[Seqinr-forum] FASTA output splits into all headers then all sequences

Jean lobry lobry at biomserv.univ-lyon1.fr
Mon Feb 22 19:45:52 CET 2010


At 8:34 +0100 22/02/10, Lionel Guy wrote:
>Hi Jean,
>On 20 Feb 2010, at 10:29 , Jean lobry wrote:
>
>>  Where did you get this version of getSequence.list() from? Because
>>  this *** is *** the fix!!! The trouble comes from that in the
>>  current version (2.0-7) sapply() is used instead of lapply():
>
>It's actually a fix I tried (not from the source), but it dosen't 
>work. It returns a list with an entry for each nucleotide, and 
>thus... is not usable as is.
>
>Best,
>
>Lionel

Hi Lionel,

That's strange because it works for me:

sueoka:~ lobry$ R --vanilla --silent
>  library(seqinr)
>  sessionInfo()
R version 2.10.0 (2009-10-26)
i386-apple-darwin8.11.1

locale:
[1] C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] seqinr_2.0-7
>  getSequence.list <- function(object, as.string = FALSE, ...)
+    lapply(seq_len(length(object)), function(i) getSequence(object[[i]],
+    as.string = as.string, ...))
>  library(seqinr)
>  choosebank("genbank")
>  query("mydat", "AU=Matute")
>  modifylist("mydat",operation=">614")
>  modifylist("mydat",operation="<615")
>
>  myseqs <- getSequence(mydat)
>  length(myseqs) # get one entry per sequece here
[1] 65
>  mynames <- getName(mydat)
>  write.fasta(myseqs,mynames, file = "myseqs.fasta") # Fasta file seems OK

Anyway, I have commited the change yesterday on R-forge, you can give
it a try by installing this devel version (revision >= 1723) by entering:

install.packages("seqinr", repos="http://R-Forge.R-project.org")

at your R prompt.

If nobody complains I'd like to release it as seqinr 2.0-8 on CRAN
by the end of the week.

Best,

Z.


-- 
Jean R. Lobry            (lobry at biomserv.univ-lyon1.fr)
Laboratoire BBE-CNRS-UMR-5558, Univ. C. Bernard - LYON I,
43 Bd 11/11/1918, F-69622 VILLEURBANNE CEDEX, FRANCE
allo  : +33 472 43 27 56     fax    : +33 472 43 13 88
http://pbil.univ-lyon1.fr/members/lobry/




More information about the Seqinr-forum mailing list