[BioC] Sequence output formatting

J.delasHeras at ed.ac.uk J.delasHeras at ed.ac.uk
Mon Jul 9 17:06:39 CEST 2007


Quoting Daniel Brewer <daniel.brewer at icr.ac.uk>:

> Just a quick question.  Is there any way to stop the "[1]" outputting
> when printing to a file?
>
> I am trying to create a fasta format file using the following:
> sink(file = "fastaseq.txt")
> for (i in 1:length(acc))
> {
> print(paste(">",acc[i],sep=""))
> print(getSEQ(acc[i]))
> }
> sink(file = NULL)
>
> Thanks
>
> Dan

Not sure if this is the best way, but you can create a character  
variable for your text, and use write.table to save it into a text  
file. That's the method I use in a couple of functions I made to do  
stuff with DNA sequences and it works.

Jose



-- 
Dr. Jose I. de las Heras                      Email: J.delasHeras at ed.ac.uk
The Wellcome Trust Centre for Cell Biology    Phone: +44 (0)131 6513374
Institute for Cell & Molecular Biology        Fax:   +44 (0)131 6507360
Swann Building, Mayfield Road
University of Edinburgh
Edinburgh EH9 3JR
UK



More information about the Bioconductor mailing list