Skip to content
/ metapi Public
forked from ohmeta/metapi

A pipeline to construct a genome catalogue from metagenomics data

License

Notifications You must be signed in to change notification settings

zhunshi/metapi

 
 

Repository files navigation

metapi

Install

# install dependencies
conda install \
    pandas ruamel_yaml \
    snakemake pigz sra-tools \
    insilicoseq ncbi-genome-download \
    sickle-trim fastp \
    bwa bowtie2 samtools \
    spades idba megahit quast \
    metabat maxbin2 checkm-genome \
    prodigal prokka gtdbtk metaphlan2 humann2

conda install -c alienzj seqtk

# install metapi
git clone -b dev https://github.com/ohmeta/metapi

# configure PYTHONPATH
echo 'export PYTHONPATH="/path/to/metapi:$PYTHONPATH"' >> ~/.bashrc

Run

Help

python /path/to/metapi/metapi/core.py --help

Input requirements

Please supply samples.tsv format like below:

idfq1fq2
s1s1.1.fq.gzs1.2.fq.gz
s2s2.1.fq.gzs2.2.fq.gz
s2s21.1.fq.gzs21.2.fq.g
s3hello.1.fq.gzhello.2.fq.gz

The header must be: id fq1 fq2. If id is same, the fq1 and fq2 belong to one sample, and will be merged to process.

Init

# Assume you in a directory named hello_meta, all operation will do in this directory
cd hello_meta
python /path/to/metapi/metapi/core.py init -d ./ -s samples.tsv -b raw -a metaspades
# -d ./ : work in hello_meta directory
# -s samples.tsv: input data
# -b raw : begin from raw data
# -a metaspades : use MetaSPAdes assembler

After that, after hello_meta directory, you will see: assay results scripts sources study config.yaml cluster.yaml

List

See what metapi can do:

snakemake --snakefile /path/to/metapi/metapi/Snakefile \
    --configfile ./config.yaml --list

Debug

Debug a specific rule, eg checkm_lineage_wf:

snakemake --snakefile /path/to/metapi/metapi/Snakefile \
    --configfile ./config.yaml \
    -p -r -n --debug-dag \
    --until checkm_lineage_wf

Run on local computer

snakemake --snakefile /path/to/metapi/metapi/Snakefile \
          --configfile ./config.yaml \
          --until checkm_lineage_wf

Submit to cluster using qsub

snakemake --snakefile /path/to/metapi/metapi/Snakefile \
    --configfile ./config.yaml \
    --cluster-config ./cluster.yaml \
    --jobs 80 \
    --cluster "qsub -S /bin/bash -cwd \
               -q {cluster.queue} \
               -P {cluster.project} \
               -l vf={cluster.mem},p={cluster.cores} \
               -binding linear:{cluster.cores} \
               -o {cluster.output} \
               -e {cluster.error}" \
    --latency-wait 360 \
    -k \
    --until checkm_lineage_wf

License

Omics for all, Open Source for all. GPLv3+.

About

A pipeline to construct a genome catalogue from metagenomics data

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 89.8%
  • Perl 6.8%
  • R 2.8%
  • Shell 0.6%