Learn R Programming

bio3d (version 2.1-2)

get.seq: Download FASTA Sequence Files

Description

Downloads FASTA sequence files from the NR, or SWISSPROT/UNIPROT databases.

Usage

get.seq(ids, outfile = "seqs.fasta", db = "nr")

Arguments

ids
A character vector of one or more appropriate database codes/identifiers of the files to be downloaded.
outfile
A single element character vector specifying the name of the local file to which sequences will be written.
db
A single element character vector specifying the database from which sequences are to be obtained.

Value

  • If all files are successfully downloaded a list object with two components is returned:
  • alian alignment character matrix with a row per sequence and a column per equivalent aminoacid/nucleotide.
  • idssequence names as identifiers.
  • This is similar to that returned by read.fasta. However, if some files were not successfully downloaded then a vector detailing which ids were not found is returned.

Details

This is a basic function to automate sequence file download from the NR and SWISSPROT/UNIPROT databases.

References

Grant, B.J. et al. (2006) Bioinformatics 22, 2695--2696.

See Also

blast.pdb, read.fasta, read.fasta.pdb, get.pdb

Examples

Run this code
pdb <- read.pdb( get.pdb("5p21", URLonly=TRUE) )
blast <- blast.pdb( pdbseq(pdb), database = "swissprot" )
ids <- plot.blast( blast )
seq <- get.seq(ids$gi.id, outfile=tempfile())
seq$id[1:10]
seq$ali[1:10,]

Run the code above in your browser using DataLab