Extract data from Blast XML files
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
R
inst/extdata
man
DESCRIPTION
LICENSE
NAMESPACE
README.md

README.md

blastxml: Extract data from Blast XML files

R requirements

R (>= 3.2)

xml2

magrittr

tibble

Installation

library(devtools)
install_github("BigelowLab/blastxml")

### or into the the system-wide library
with_lib(.Library, install_github("BigelowLab/blastxml"))

Example

Retrieve basic info about the file contents.


xmlfile <- system.file("extdata", "blastn.xml.gz", package = "blastxml")
info <- blastxml_info(xmlfile)

A straight dump of data into a character matrix or a tibble.


x <- blastxml_dump(xmlfile)

You can save to a delimited text file.


x <- blastxml_dump(xmlfile, out_file = 'dump.csv', sep = ",", row.names = FALSE)

You can reduce the number of fields to extract.

# get a copy of the default listing of fields
bxd <- BXD(app = 'blastn')
fields <- get_BXD_names()

# trim off the last 3 fields
len <- length(fields)
fields <- fields[-c((len-3):len)]

# update your listing
bxd <- set_BXD_names(fields, bxd = bxd)

# read and compare to the first example above
x_trimmed<- blastxml_dump(xmlfile, bxd = bxd)