Learn R Programming

seqinr (version 3.4-5)

modifylist: 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

listname

the name of the ACNUC list to modify

modlistname

the name of the modified ACNUC list. Default is to use the same list name so that previous list is lost.

operation

a string of character describing the operation to be done, see details.

type

the type of operation, could be one of "length", "date", "scan". Default is "length"

socket

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

virtual

if TRUE, no attempt is made to retrieve the information about all the elements of the list. In this case, the req component of the list is set to NA.

verbose

logical, if TRUE mode verbose is on

Value

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

call

the original call

name

the ACNUC list name

nelem

the number of elements (for instance sequences) in the ACNUC list

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.

req

a list of sequence names that fit the required criteria or NA when called with parameter virtual is TRUE

socket

the socket connection that was used

Details

Example of possible values for the argument operation:

length

as in "> 10000" or "< 500"

date

as in "> 1/jul/2001" or "< 30/AUG/98"

scan

specify the string to be searched for

Character < is to be understood as <= and > likewise.

References

http://doua.prabi.fr/databases/acnuc.html

citation("seqinr")

See Also

choosebank, query and prepgetannots to select the annotation lines for scan.

Examples

Run this code
# NOT RUN {
 # 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()
  
# }

Run the code above in your browser using DataLab