Generic function to get sequence data

Description

getSequence returns the sequence either as vector of single chararacters or as a single string of multiple characters.

Usage

1
2
3
getSequence(object, as.string = FALSE, ...)
## S3 method for class 'SeqAcnucWeb'
getSequence(object, as.string = FALSE, ..., socket = autosocket())

Arguments

object

an object of the class SeqAcnucWeb or SeqFastadna, or SeqFastaAA or SeqFrag or a list of these objects, or an object of class qaw created by query

as.string

if TRUE sequences are returned as strings of multiple characters instead of a vector of single characters

socket

an object of class sockconn connecting to a remote ACNUC database (default is a socket to the last opened database).

...

further arguments passed to or from other methods

Value

For a single sequence an object of class character containing the characters of the sequence, either of length 1 when as.string is TRUE, or of the length of the sequence when as.string is FALSE. For many sequences, a list of these.

Author(s)

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

References

citation("seqinr")

See Also

SeqAcnucWeb, SeqFastadna, SeqFastaAA, SeqFrag

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#
# List all available methods for getSequence generic function:
#
   methods(getSequence)
#
# SeqAcnucWeb class example:
#
  ## Not run: # Need internet connection
  choosebank("emblTP")
  fc <- query("fc", "sp=felis catus et t=cds et o=mitochondrion")
  getSequence(fc$req[[1]])
  getSequence(fc$req[[1]], as.string = TRUE)
  closebank()
  
## End(Not run)
#
# SeqFastaAA class example:
#
  aafile <- system.file("sequences/seqAA.fasta", package = "seqinr")
  sfaa <- read.fasta(aafile, seqtype = "AA")
  getSequence(sfaa[[1]])
  getSequence(sfaa[[1]], as.string = TRUE)
#
# SeqFastadna class example:
#
  dnafile <- system.file("sequences/someORF.fsa", package = "seqinr")
  sfdna <- read.fasta(file = dnafile)
  getSequence(sfdna[[1]])
  getSequence(sfdna[[1]], as.string = TRUE)
#
# SeqFrag class example:
#
  sfrag <- getFrag(object = sfdna[[1]], begin = 1, end = 10)
  getSequence(sfrag)
  getSequence(sfrag, as.string = TRUE)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.