Skip to content

Commit

Permalink
feat: expanding support for drep and bin consolidation
Browse files Browse the repository at this point in the history
  • Loading branch information
rroutsong committed Jan 16, 2024
1 parent daf27e1 commit c5f56a1
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 109 deletions.
3 changes: 2 additions & 1 deletion config/cluster.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"threads": 8,
"mem": "16g",
"partition": "norm",
"time": "0-04:00:00"
"time": "0-04:00:00",
"gres": "None"
},
"metawrap_genome_assembly": {
"threads": 24,
Expand Down
6 changes: 5 additions & 1 deletion config/images.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"images": {
"metawrap": "docker://rroutsong/metamorph_metawrap:1.3.2",
"metawrap": "docker://rroutsong/metamorph_metawrap:0.0.2",
"metagenome": "docker://rroutsong/metamorph_metagenome:0.0.1"
},
"containers": {
"metawrap": "/data/OpenOmics/SIFs/metamorph_metawrap_1.3.2.sif",
"metagenome": "/data/OpenOmics/SIFs/metamorph_metagenome_0.0.1.sif"
}
}
5 changes: 2 additions & 3 deletions metamorph
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,15 @@ import argparse # potential python3 3rd party package, added in python/3.5
# Local imports
from src import version
from src.run import init, setup, bind, dryrun, runner, run_coa_pipeline
from src.shells import bash
from src.utils import (
Colors,
err,
exists,
fatal,
hashed,
permissions,
check_cache,
require)
require
)


# Pipeline Metadata
Expand Down
8 changes: 5 additions & 3 deletions src/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# Python standard library
from __future__ import print_function
from shutil import copytree
from uuid import uuid4
from datetime import datetime
import os, re, json, sys, subprocess

# Local imports
Expand Down Expand Up @@ -329,11 +331,9 @@ def bind(sub_args, config):
if value not in bindpaths:
bindpaths.append(value)

rawdata_bind_paths = [os.path.realpath(p) for p in config['project']['datapath'].split(',')]
rawdata_bind_paths = [os.path.abspath(p) for p in config['project']['datapath'].split(',')]
working_directory = os.path.realpath(config['project']['workpath'])



return bindpaths


Expand Down Expand Up @@ -393,6 +393,8 @@ def add_user_information(config):
# username
config['project']['userhome'] = home
config['project']['username'] = username
dt = datetime.now().strftime("%m/%d/%Y")
config['project']['id'] = f"{uuid4()}_{dt}_metagenome"

return config

Expand Down
41 changes: 24 additions & 17 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,42 +24,49 @@ configfile: "config.json" # Generated from user input and config/*.json
rule all:
input:
# read qc and filtering
# ~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~
expand(
join(
workpath, "metawrap_readqc", "{name}", "{name}.R1_bmtagger_report.html"
workpath, config['project']['id'], "metawrap_qc", "{name}", "{name}.R1_bmtagger_report.html"
),
name=samples,
),
expand(
join(
workpath, "metawrap_readqc", "{name}", "{name}.R2_bmtagger_report.html"
workpath, config['project']['id'], "metawrap_qc", "{name}", "{name}.R2_bmtagger_report.html"
),
name=samples,
),
expand(join(workpath, "{name}", "{name}.R1_readqc.fastq"), name=samples),
expand(join(workpath, "{name}", "{name}.R2_readqc.fastq"), name=samples),
# genome assembly
# ~~~~~~~~~~~~~~~
expand(
join(workpath, "metawrap_assembly", "{name}", "final_assembly.fasta"),
join(workpath, config['project']['id'], "metawrap_assembly", "{name}", "final_assembly.fasta"),
name=samples,
),
expand(
join(workpath, "metawrap_assembly", "{name}", "assembly_report.html"),
join(workpath, config['project']['id'], "metawrap_assembly", "{name}", "assembly_report.html"),
name=samples,
),
# taxonomic classification
# ~~~~~~~~~~~~~~~~~~~~~~~~
expand(join(workpath, "metawrap_taxonomy", "{name}", "final_assembly.krona"), name=samples),
expand(join(workpath, "metawrap_taxonomy", "{name}", "kronagram.html"), name=samples),
expand(join(workpath, "metawrap_taxonomy", "{name}", "final_assembly.krak2"), name=samples),
expand(join(workpath, "metawrap_taxonomy", "{name}", "final_assembly.kraken2"), name=samples),
# assembly binning and refinement
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
expand(join(workpath, "metawrap_binning", "{name}"), name=samples),
expand(join(workpath, "metawrap_refine_bins", "{name}"), name=samples),
# ~~~~~~~~~~~~~~~
expand(join(workpath, config['project']['id'], "metawrap_kmer", "{name}", "final_assembly.krona"), name=samples),
expand(join(workpath, config['project']['id'], "metawrap_kmer", "{name}", "kronagram.html"), name=samples),
expand(join(workpath, config['project']['id'], "metawrap_kmer", "{name}", "final_assembly.krak2"), name=samples),
expand(join(workpath, config['project']['id'], "metawrap_kmer", "{name}", "final_assembly.kraken2"), name=samples),
# assembly binning
# ~~~~~~~~~~~~~~~
expand(join(workpath, config['project']['id'], "metawrap_binning", "{name}", "maxbin2_bins.contigs"), name=samples),
expand(join(workpath, config['project']['id'], "metawrap_binning", "{name}", "maxbin2_bins.stats"), name=samples),
expand(join(workpath, config['project']['id'], "metawrap_binning", "{name}", "metabat2_bins.contigs"), name=samples),
expand(join(workpath, config['project']['id'], "metawrap_binning", "{name}", "metabat2_bins.stats"), name=samples),
expand(join(workpath, config['project']['id'], "metawrap_binning", "{name}", "metawrap_50_5_bins.contigs"), name=samples),
expand(join(workpath, config['project']['id'], "metawrap_binning", "{name}", "metawrap_50_5_bins.stats"), name=samples),
expand(join(workpath, config['project']['id'], "metawrap_binning", "{name}", "figures", "binning_results.png"), name=samples),
# bin refinement
# ~~~~~~~~~~~~~~~
expand(join(workpath, config['project']['id'], "metawrap_bin_refine", "{name}", "dereplicated_bins"), name=samples),



# Import rules
include: join("rules", "metawrap.smk")
include: join("rules", "metawrap.smk")
Loading

0 comments on commit c5f56a1

Please sign in to comment.