/BlastLCA.jl

Primary LanguageJuliaMIT LicenseMIT

BlastLCA

Stable Dev Build Status

This is a julia package to identify lowest common ancestor (LCA) from blast results.

It requires

  • Blast result (include qseqid, bitscore, pidents and staxids)
  • NCBI Taxonomy database (see Taxonomy.jl)

This tool is referred to Carradec et al., 2018. See Methods section (Taxonomic assignment).

Example

using BlastLCA
using Taxonomy

db = Taxonomy.DB("/db/taxonomy/nodes.dmp", "/db/taxonomy/names.dmp")

blastout_path = "your_blast_result.txt"

minimal = 0.90
cutoff = 0.67
precision = Dict{Symbol, Float64}(
    :class => 0.50,
    :order => 0.65,
    :family => 0.80,
    :genus => 0.95,
    :species => 1.0)

ranks = [:superkingdom, :phylum, :class, :order, :family, :genus, :species]

f = x-> weightedLCA(x, minimal, cutoff, ranks, precision)

blastLCA(diamond_path, "lca_output_path.txt";
               taxonomy=db,
               method=f,
               header=false,
               qseqid_pos=1,
               staxids_pos=13,
               pident_pos=3,
               bitscore_pos=12
               );

CLI

This package also supports CLI.

Install

julia -e "import Pkg; Pkg.add(url=\"https://github.com/banhbio/BlastLCA.jl\")"

export PATH="~/.julia/bin:$PATH"
#or
ln -s ~/.julia/bin/blastlca /where/in/PATH

Usage

blastlca -h
blastlca weighted -h

Run weighted LCA

balstlca wighted /your/blastresult.tsv -o output.tsv --nodes-path /db/nodes.dmp --names-path /db/names.dmp