getLength: Generic function to get the length of sequences

View source: R/getLength.R

getLengthR Documentation

Generic function to get the length of sequences

Description

getLength returns the total number of bases or amino-acids in a sequence.

Usage

getLength(object, ...)

Arguments

object

an object of the class SeqAcnucWeb or SeqFastadna, or SeqFastaAA or SeqFrag or a list of these objects

...

further arguments passed to or from other methods

Value

getLength returns a numeric vector giving the length of the sequences.

Author(s)

D. Charif, J.R. Lobry, L. Palmeira

References

citation("seqinr")

See Also

SeqAcnucWeb, SeqFastadna, SeqFastaAA, SeqFrag

Examples

#
# List all available methods for getLength generic function:
#
   methods(getLength)
#
# Example with seven DNA sequences from a FASTA file:
#
  ff <- system.file("sequences/someORF.fsa", package = "seqinr")
  fs <- read.fasta(file = ff)
  stopifnot(all(getLength(fs) == c(5573, 5825, 2987, 3929, 2648, 2597, 2780)))
#
# Example with 49 sequences from an ACNUC server:
#
  ## Not run: 
  # Need internet connection
  choosebank("emblTP")
  fc <- query("fc", "sp=felis catus et t=cds et o=mitochondrion")
  getLength(fc)
  closebank()  

## End(Not run)

seqinr documentation built on March 31, 2023, 3:05 p.m.