[Seqinr-forum] Seqinr write.fasta problem with max characters per line

penel at biomserv.univ-lyon1.fr penel at biomserv.univ-lyon1.fr
Thu Feb 25 10:02:50 CET 2010


Dear Jonathan,

I suspect the way you retrieve your sequence data   may be the problem:

when using getSequence, you have to use the option as.string = FALSE 
(this is the default).

There is an example where the 2 options are tested:


in R:
=======
choosebank("embl")
query("test1","n=AB009279")


seq1<-sapply(test1$req[1:1],getSequence, as.string = TRUE)
seq2<-sapply(test1$req[1:1],getSequence)
write.fasta(sequences = seq1, names = "test string is TRUE", nbchar = 10 
, file.out = "test1.fasta")
write.fasta(sequences = seq2, names = "test string is FALSE", nbchar = 
10 , file.out = "test2.fasta")
========


you should get the following data  your files:
 head test1.fasta
 >test string is TRUE
catgaaggggccctgggccgtccgttggctgatacttacctctgttgccggatccctgttcagaggcgacagcgctcaggtcaccgatgtcagctccaaggtgttgaaattgagtaagaacgctaccgaaggggagcctggatgcaaggaaggtctgcatcgtgggagcaagttctgctgtctgccatgccctcctggcacacgaaaagctgccgactgtgaagaagatgggggtagaccatcctgtataccctgtgaagaagcgaaggactacacagacaggagccatttttctcccagatgcagaagatgtaaaatttgtgatgaagagcatggcttagaagtggaaaaaaactgtacccggacccagaataccaagtgcagatgtaaatcaaactttttttgtaacgtctctcagtgtgaccactgtaacccgtgcatgatgtgtgaacatggaatccttgagaattgcacaccaaccagcagcaccaaatgtaaacaaggatccagctccaaacttctgtggctttgtgccctgctcctgattctaccgtccgcactagtgtgttgctgtgtgttgaaaaagtacgggaatacgaagaatggccgccgggaatctacagtctcagttactgagagtatgccgatgaatttcacagacatcgacttgagtaaatacatcagtagcattgccgaacaaatgaaaataactcaagtcagagaatttgtccgcaagaatggtatcaacgaagccaaaatagacgagatcaagaacgacaacctccaagacacagctgaacagaaagtccaactgctccggaattggtaccagctccacgggaggaagggcgcgtattacgctctggtgaaaggtctcaggaaagccaatctctgcgctcttgccgagaaaattgaagatatggtccagaaggacagtgcgagctaacttgagaatggaaactgcaaacacgaaaataaaagacaaagcctggctgaatgtgaaaaacaact

 head test2.fasta
 >test string is FALSE
catgaagggg
ccctgggccg
tccgttggct
gatacttacc
tctgttgccg
gatccctgtt
cagaggcgac
agcgctcagg
tcaccgatgt


I hope this help,

all the best,

Simon







Jonathan Reichel a écrit :
> Greetings!
>
> I'm trying to write DNA sequences to a file in fasta format.  the
> seqinr library has a function called write.fasta, which works fine,
> except for one crucial point:
> there's supposed to be a maximum number of characters per line (the
> default is supposed to be 60), but when I call the function, it
> prints the entire sequence on a single line, regardless of how long it
> is (in every case, the sequence is longer than the value used for the
> nbchar argument)...
>
> Any idea why I might be experiencing this?
>
> I'm using Windows 7 64-bit, R version 2.10.1.
>
> Regards,
> Jonathan Reichel
>
>
>
>   


-- 
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