Skip to content

Commit

Permalink
Merge pull request #343 from sunbeam-labs/332-kraken-biom-rule-fails-…
Browse files Browse the repository at this point in the history
…when-run-on-a-cluster

Kraken-biom rule fails on cluster
  • Loading branch information
Ulthran committed Oct 14, 2022
2 parents 0b45db7 + b81df83 commit 3ef434a
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 27 deletions.
Empty file modified docs/requirements.txt
100644 → 100755
Empty file.
9 changes: 8 additions & 1 deletion envs/classify.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
name: classify
channels:
- bioconda
- anaconda
- conda-forge
dependencies:
- biom-format
- biom-format
- kraken-biom
- libgfortran-ng=7.2.0 # kraken-biom https://github.com/gammapy/gammapy/issues/1417
# - conda-forge::libgfortran # kraken-biom
# - anaconda::pathlib # kraken-biom
- python>=3 # biom-format
5 changes: 2 additions & 3 deletions rules/classify/kraken.smk
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@ rule kraken2_biom:
input:
expand(CLASSIFY_FP/'kraken'/'{sample}-taxa.tsv',
sample=Samples.keys())
conda:
"../../envs/classify.yml"
output:
CLASSIFY_FP/'kraken'/'all_samples.biom'
shell:
# Using pip to install because conda version is way outdated
"""
pip install kraken-biom && \
pip install --upgrade numpy && \
kraken-biom --max D -o {output} {input}
"""

Expand Down
14 changes: 0 additions & 14 deletions rules/reports/reports.smk
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,3 @@ rule fastqc_report:
script:
"../../scripts/reports/fastqc_report.py"


rule multiqc_report:
"""Build multiqc report on qc step."""
input:
TARGET_FASTQC
output:
MULTIQC_REPORT
params:
title = Cfg['qc'].get('report_title', 'QC report'),
outdir = QC_FP/'reports'
conda:
"../../envs/reports.yml"
script:
"../../scripts/reports/multiqc_report.py"
10 changes: 3 additions & 7 deletions rules/targets/targets.smk
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,10 @@ TARGET_ANNOTATE = expand(


# ---- Reports
# MultiQC report
MULTIQC_REPORT = QC_FP/'reports'/'multiqc_report.html'

TARGET_REPORT = [
QC_FP/'reports'/'preprocess_summary.tsv',
QC_FP/'reports'/'fastqc_quality.tsv',
ASSEMBLY_FP/'contigs_coverage.txt',
MULTIQC_REPORT
str(QC_FP/'reports'/'preprocess_summary.tsv'),
str(QC_FP/'reports'/'fastqc_quality.tsv'),
str(ASSEMBLY_FP/'contigs_coverage.txt'),
]

# ---- All targets
Expand Down
2 changes: 2 additions & 0 deletions scripts/reports/multiqc_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@

report_name = snakemake.output[0].split('/')[-1] # Get unique name from targets.rules file

os.system("conda list")
os.system("multiqc -f -i \"{a}\" -n {b} -o {c} {c}".format(
a=snakemake.params.title, b=report_name, c=snakemake.params.outdir))
# -f overwrites any previous reports instead of iterating the next one's name
print(os.listdir(snakemake.params.outdir))

# Different versions of multiqc seem to be inconsistent with naming conventions
if report_name in os.listdir(snakemake.params.outdir):
Expand Down
2 changes: 0 additions & 2 deletions tests/targets.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,5 @@ qc/cleaned/dummyecoli_2.fastq.gz
qc/cleaned/random_1.fastq.gz
qc/cleaned/random_2.fastq.gz

qc/reports/multiqc_report.html

mapping/human/coverage.csv
mapping/phix174/coverage.csv

0 comments on commit 3ef434a

Please sign in to comment.