Code Monkey home page Code Monkey logo

pysarg's Introduction

pysarg

Python implementation of ARGs_OAP

Installation

  • build from source (cmake, zlib and libpthread are required for building diamond and minimap2):
git clone https://github.com/xinehc/pysarg
cd pysarg
## use python3 if needed
python setup.py install
  • the source code is also uploaded to pypi, try:
## make take a while for building the wheel, as 2 different versions of diamond need to be compiled
## use pip3 if needed
pip install pysarg
  • pre-compiled conda packages (osx-64 or linux-64, python 3.6)
conda install -c xinehc pysarg
  • only python=3.6 package has been uploaded, if python!=3.6, create a new conda environment
conda create -n pysarg -c xinehc pysarg python=3.6
source activate pysarg

Example

Two toy examples (100k paired-end reads, 100bp each) are provided in example/inputdir:

# git clone https://github.com/xinehc/pysarg
# mkdir -p pysarg/example/outputdir
pysarg stage_one -i pysarg/example/inputdir -o pysarg/example/outputdir
pysarg stage_two -i pysarg/example/outputdir/extracted.fasta -m pysarg/example/outputdir/metadata.txt -o pysarg/example/outputdir 

## LINUX only: add flag --original to get Ublastx_stageone's results (required to use the pre-compiled binaries in Ublastx_stageone)
pysarg stage_one -i pysarg/example/inputdir -o pysarg/example/outputdir --original
pysarg stage_two -i pysarg/example/outputdir/extracted.fasta -m pysarg/example/outputdir/metadata.txt -o pysarg/example/outputdir --original

If everything is ok, there should be four output files in example/outputdir

  • metadata.txt
sample read_length read_number 16s_number cell_number
STAS 100 200000 9.776536312849162 3.05292019025543
SWHAS104 100 200000 9.35754189944134 3.3635174193105737
  • output.txt
sample sequence gene gene_length gene_type gene_subtype covered_length
STAS STAS_30 gi|671541568|ref|WP_031525212.1| 648 macrolide-lincosamide-streptogramin macrolide-lincosamide-streptogramin__macB 31
STAS STAS_61 NP_840140 273 bacitracin bacitracin__bacA 32
STAS STAS_70 gi|764440891|ref|WP_044366757.1| 439 multidrug
... ... ... ... ... ... ...
  • the above two tables can be merged on column sample and then used for normalizing the ARG counts and drawing PCA plots. One example is provided in notebook/normalize_sarg.ipynb
  • extracted.fasta is the pre-filtered ARG-like sequences in stage-one, extracted.blast is the blastx result of extracted.fasta in stage-two.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.