readFasta-methods {pairseqsim} | R Documentation |
Reads file in FASTA format. An sequence entry in the fasta dabase
consists of a header line starting with the ">" sign which contains
the id of the sequence. It is followed by several lines of the protein
sequence. Because the header line may vary the user can specify a
function which will extract (grep) the id.
infogrep <- function(x)
{
return(sub("^>([a-zA-Z0-9]+) .+","\1",x,perl=TRUE))
}
object |
either AASequence or AASequenceList |
file |
Path to the file |
grepinfo |
Function which extracts the id from the fasta description line. |
grepseq |
Function to pre-process the sequence. |
Returns an object of class AASequenceList
.
Witold E. Wolski
mySequlist <- new("AASequenceList",info="my sequence list") #mySequlist<-readFasta(mySequlist,"ex.fasta",grepinfo=infogrep,grepseq=seqgrep)