write2FASTA: Write sequences to a file in fasta format

Description Usage Arguments Value Author(s) Examples

View source: R/write2FASTA.R

Description

Write the sequences obtained from getAllPeakSequence to a file in fasta format leveraging writeFASTA in Biostrings package. FASTA is a simple file format for biological sequence data. A FASTA format file contains one or more sequences and there is a header line which begins with a > proceeding each sequence.

Usage

1
write2FASTA(mySeq, file = "", width = 80)

Arguments

mySeq

GRanges with varibles name and sequence ,e.g., results obtained from getAllPeakSequence

file

Either a character string naming a file or a connection open for reading or writing. If "" (the default for write2FASTA), then the function writes to the standard output connection (the console) unless redirected by sink

width

The maximum number of letters per line of sequence

Value

Output as FASTA file format to the naming file or the console.

Author(s)

Lihua Julie Zhu

Examples

1
2
3
4
5
6
7
peaksWithSequences = GRanges(seqnames=c("1", "2"),
IRanges(start=c(1000, 2000), 
end=c(1010, 2010), 
names=c("id1", "id2")), 
sequence= c("CCCCCCCCGGGGG", "TTTTTTTAAAAAA"))

write2FASTA(peaksWithSequences, file="testseq.fasta", width=50)

ChIPpeakAnno documentation built on April 1, 2021, 6:01 p.m.