[Seqinr-forum] write.fasta() example

Darren Obbard darren.obbard at ed.ac.uk
Thu Dec 16 14:22:20 CET 2010


Hi!

data<-read.alignment("file.fas",format="fasta")
write.fasta(as.list(data$seq), data$nam, file.out="out_file.fas", open = 
"a", nbchar = 100)
test<-scan("out_file.fas",what="character")
nchar(test[3])==100

The problem may be that the file already contains the \r's, and that 
this casues write.fasta to fail in its wrapping?

linux is Ubuntu (lucid lynx)

R version 2.12.0 (2010-10-15)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
  [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C
  [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8
  [5] LC_MONETARY=C              LC_MESSAGES=en_GB.UTF-8
  [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C
  [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
[1] seqinr_2.0-9    ape_2.5-3       multicore_0.1-3

loaded via a namespace (and not attached):
[1] gee_4.13-14     grid_2.12.0     lattice_0.19-13 nlme_3.1-97



-- 

Darren Obbard
Institute of Evolutionary Biology
Room 123, Ash 2, Ashworth Labs
Kings Buildings
University of Edinburgh, UK
darren.obbard at ed.ac.uk
Lab: 0131 651 3614   --  Office: 0131 650 5476
Mobile: 07968 838 635   --  Home: 0131 466 0341
http://www.biology.ed.ac.uk/research/groups/obbard/

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: file.fas
URL: <http://lists.r-forge.r-project.org/pipermail/seqinr-forum/attachments/20101216/ba7fb816/attachment.asc>


More information about the Seqinr-forum mailing list