User:Timothee Flutre/Notebook/Postdoc/2011/11/08

From OpenWetWare
< User:Timothee Flutre‎ | Notebook‎ | Postdoc‎ | 2011‎ | 11
Revision as of 08:06, 12 June 2012 by Timothee Flutre (talk | contribs) (Entry title)
Jump to: navigation, search
Owwnotebook icon.png Project name <html><img src="/images/9/94/Report.png" border="0" /></html> Main project page
<html><img src="/images/c/c3/Resultset_previous.png" border="0" /></html>Previous entry<html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</html>Next entry<html><img src="/images/5/5c/Resultset_next.png" border="0" /></html>

Fasta format in R with Bioconductor

  • save pairs "header+sequence" into a file in the fasta format:
library(Biostrings)  # from Bioconductor
dset <- DNAStringSet( c("ATGACG", "TTGAC") )
names(dset) <- c("seq1", "seq2")
write.XStringSet(dset, file="myreads.fa", format="fasta", width=80)
  • retrieve a given sequence
dset[ grep("^seq13$", names(dset)) ]
toString( dset[ grep("^seq13$", names(dset)) ] )