[Seqinr-forum] Concerning the biological databases access and queries in the last version of seqinr
Simon Penel
simon.penel at univ-lyon1.fr
Mon Nov 17 11:58:53 CET 2014
Dear seqinr users/developers,
since the last version of R, it not possible to change an object
belonging the global environment from a package.
This means that an object defined in seqinr (i.e. in the seqinr
environment .seqinrEnv) is not anymore defined in the global environment.
This leads to errors in the examples. Typically :
choosebank("genbank")
query("bb", "sp=Borrelia burgdorferi")
# To get the names of the 4 first sequences:
sapply(bb$req[1:4], getName)
Error in lapply(X = X, FUN = FUN, ...) : object 'bb' not found
Instead using directly the bb object, you should now use
get("bb",env=.seqinrEnv)
For example:
apply((get("bb",env=.seqinrEnv)$req[1:4]),getName)
more generally if you want to store to the results of the request you
may type :
mybb <- (get("bb",env=.seqinrEnv)
We need to modify the examples and/or the R functions involved in the
database queries in the next version of seqinr, we will do that as soon
as possible.
We are thinking of a global solution by creating a function "seqobj" (
aliased to "so" ) :
seqobj <- function (obj) { get (obj,env=.seqinrEnv)}
And and to use so("x") instead x in the examples.
Any suggestions are of course welcome.
Sorry for the troubles,
all the best
Simon
--
Simon Penel
Laboratoire de Biometrie et Biologie Evolutive
Bat 711 - CNRS UMR 5558 - Universite Lyon 1
43 bd du 11 novembre 1918 69622 Villeurbanne Cedex
Tel: 04 72 43 29 04 Fax: 04 72 43 13 88
http://lbbe.univ-lyon1.fr/-Penel-Simon-.html?lang=fr
More information about the Seqinr-forum
mailing list