#
# List all available methods for getAnnot generic function:
#
methods(getAnnot)
#
# SeqAcnucWeb class example:
#
if (FALSE) {
# Need internet connection
choosebank("emblTP")
fc<-query("fc", "sp=felis catus et t=cds et O=mitochondrion et Y>2001 et no k=partial")
# get the first 5 lines annotating the first sequence:
annots <- getAnnot(fc$req[[1]], nbl = 5)
cat(annots, sep = "\n")
# or use the list method to get them all at once:
annots <- getAnnot(fc$req, nbl = 5)
cat(annots, sep = "\n")
closebank()
}
#
# SeqFastaAA class example:
#
aafile <- system.file("sequences/seqAA.fasta", package = "seqinr")
sfaa <- read.fasta(aafile, seqtype = "AA")
getAnnot(sfaa[[1]])
#
# SeqFastadna class example:
#
dnafile <- system.file("sequences/malM.fasta", package = "seqinr")
sfdna <- read.fasta(file = dnafile)
getAnnot(sfdna[[1]])
#
# Example with a FASTA file with multiple entries:
#
ff <- system.file("sequences/someORF.fsa", package = "seqinr")
fs <- read.fasta(ff)
getAnnot(fs) # the list method is used here to get them all at once
#
# Default getAnnot method example. An error is produced because
# there are no annotations by default:
#
result <- try(getAnnot(letters))
stopifnot(!inherits("result", "try-error"))
Run the code above in your browser using DataLab