File: modifylist.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 (85 lines) | stat: -rw-r--r-- 3,388 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
\name{modifylist}
\alias{modifylist}
\title{Modification of an ACNUC list}
\description{
This function modifies a previously existing ACNUC list by selecting sequences
either by length, either by date, either for the presence of a given string in annotations. 
}
\usage{
modifylist(listname, modlistname = listname, operation, 
 type = c("length", "date", "scan"), socket = autosocket(), 
 virtual = FALSE, verbose = FALSE)
}
\arguments{
  \item{listname}{the name of the ACNUC list to modify}
  \item{modlistname}{the name of the modified ACNUC list. Default is to use the
       same list name so that previous list is lost.}
  \item{operation}{a string of character describing the operation to be done, see details.}
  \item{type}{the type of operation, could be one of \code{ "length", "date", "scan"}.
        Default is \code{"length"}}
  \item{socket}{an object of class \code{sockconn} connecting to a remote ACNUC
                        database (default is a socket to the last opened database).}
  \item{virtual}{if TRUE, no attempt is made to retrieve the information about all the elements of the list. In this case, the \code{req} component of the list is set to NA.}
  \item{verbose}{logical, if TRUE mode verbose is on}
}

\details{
Example of possible values for the argument \code{operation}: 

  \describe{
  \item{length}{as in  "> 10000"    or    "< 500"}
  \item{date}{as in   "> 1/jul/2001"   or   "< 30/AUG/98"}
  \item{scan}{specify the string to be searched for}
  }
Character < is to be understood as <= and > likewise.
}

\value{
The result is directly assigned to the object \code{modlistname} in the user workspace.
This is an objet of class \code{qaw}, a list with the following 6 components:

  \item{call}{the original call}
  \item{name}{the ACNUC list name}
  \item{nelem}{the number of elements (for instance sequences) in the ACNUC list}
  \item{typelist}{the type of the elements of the list. Could be SQ for a list of
    sequence names, KW for a list of keywords, SP for a list of species names.}
  \item{req}{a list of sequence names that fit the required criteria or \code{NA} when
    called with parameter \code{virtual} is \code{TRUE}}
  \item{socket}{the socket connection that was used}
  
}
\references{ \url{http://doua.prabi.fr/databases/acnuc.html}

\code{citation("seqinr")}
}
\author{J.R. Lobry}
\seealso{\code{\link{choosebank}}, \code{\link{query}} and
  \code{\link{prepgetannots}} to select the annotation lines for scan.}
\examples{
\dontrun{ # Need internet connection
  choosebank("emblTP")
  mylist <- query("mylist", "sp=felis catus et t=cds", virtual=TRUE)
  mylist$nelem # 603 sequences
  stopifnot(mylist$nelem == 603)

  # select sequences with at least 1000 bp:
  mylist <- modifylist("mylist", operation = ">1000", virtual = TRUE)
  mylist$nelem # now, only 132 sequences
  stopifnot(mylist$nelem == 132)

  # scan for "felis" in annotations:
  mylist <- modifylist("mylist", op = "felis", type = "scan", virtual = TRUE)
  mylist$nelem # now, only 33 sequences
  stopifnot(mylist$nelem == 33)

  # modify by date:
  mylist <-  modifylist("mylist", op = "> 1/jul/2001", type = "date", virtual = TRUE)
  mylist$nelem # now, only 15 sequences
  stopifnot(mylist$nelem == 15)

  # Summary of current ACNUC lists, one list called MYLIST on sever:
  sapply(alr()$rank, getliststate)
  closebank()
  }
}
\keyword{ utilities }