File: getAnnot.Rd

package info (click to toggle)
r-cran-seqinr 3.4-5-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,876 kB
  • sloc: ansic: 1,987; makefile: 14
file content (88 lines) | stat: -rw-r--r-- 2,860 bytes parent folder | download | duplicates (4)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
\name{getAnnot}
\alias{getAnnot}
\alias{getAnnot.default}
\alias{getAnnot.list}
\alias{getAnnot.SeqAcnucWeb}
\alias{getAnnot.SeqFastadna}
\alias{getAnnot.SeqFastaAA}
\alias{getAnnot.qaw}
\alias{getAnnot.logical}
\alias{readAnnots.socket}

\title{Generic Function to get sequence annotations}
\description{
Annotations are taken from the \code{Annot} attribute for sequences
imported from a FASTA file and retrieved from an ACNUC server for
objects of the \code{SeqAcnucWeb} class.
}
\usage{
getAnnot(object, ...)
\method{getAnnot}{SeqAcnucWeb}(object, ..., nbl = 100, socket = autosocket())
}
\arguments{
  \item{object}{ an object of the class \code{SeqAcnucWeb}
    or \code{SeqFastadna}, or \code{SeqFastaAA} or a list of these objects }
  \item{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). }
  \item{socket}{an object of class \code{sockconn} connecting to a remote ACNUC
                        database (default is a socket to the last opened database).}
  \item{...}{further arguments passed to or from other methods}
}
\value{
  \code{getAnnot} returns a vector of string of characters containing the
  annotations for the sequences.
}
\references{
  \code{citation("seqinr")}
}
\author{D. Charif, J.R. Lobry, L. Palmeira} 
\seealso{
  \code{\link{query}}, \code{\link{SeqAcnucWeb}}, \code{\link{c2s}}, \code{\link{translate}} and \code{\link{prepgetannots}} to select the annotation lines.
}
\examples{
#
# List all available methods for getAnnot generic function:
#
   methods(getAnnot)
#
# SeqAcnucWeb class example:
#
  \dontrun{
  # 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"))
}
\keyword{ utilities }