getAnnot | R Documentation |
Annotations are taken from the Annot
attribute for sequences
imported from a FASTA file and retrieved from an ACNUC server for
objects of the SeqAcnucWeb
class.
getAnnot(object, ...)
## S3 method for class 'SeqAcnucWeb'
getAnnot(object, ..., nbl = 100, socket = autosocket())
object |
an object of the class |
nbl |
the maximum number of line of annotation to read. Reading of lines stops when nbl lines have been transmitted or at the last annotation line of the sequence (SQ or ORIGIN line). |
socket |
an object of class |
... |
further arguments passed to or from other methods |
getAnnot
returns a vector of string of characters containing the
annotations for the sequences.
D. Charif, J.R. Lobry, L. Palmeira
citation("seqinr")
query
, SeqAcnucWeb
, c2s
, translate
and prepgetannots
to select the annotation lines.
#
# List all available methods for getAnnot generic function:
#
methods(getAnnot)
#
# SeqAcnucWeb class example:
#
## Not run:
# 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()
## End(Not run)
#
# 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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.