[BioC] Sequence output formatting
Richard Pearson
richard.pearson at postgrad.manchester.ac.uk
Mon Jul 9 17:21:57 CEST 2007
You might also want to look at ?cat, e.g.
cat(paste(">",acc[i],sep=""),"\n")
might do what you want (you need the "\n" to get a newline character).
Richard.
J.delasHeras at ed.ac.uk wrote:
> 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
>
>
>
>
More information about the Bioconductor
mailing list