Skip to content

Commit

Permalink
Add bookmarks in variant calling result
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaoyun Liu committed Mar 5, 2024
2 parents d86481b + 7246607 commit 8dcd9b9
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 71 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ Changelog
.. that users understand how the changes affect the new version.
**********
v2.0.5-dev
v2.0.6-dev
**********
* Update FastQC to 0.12.1
* Modified PDF formatting
-Add bookmarks under chapter variant
-Sort the genes of interest alphabetically
-Lock snakefmt version
* Sort the genes of interest alphabetically

**********
v2.0.5
**********
Expand Down
47 changes: 9 additions & 38 deletions includes/qc-seq/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ rule fastqc_raw:
output:
folder=directory("{sample}/qc-seq/{read_group}/fastqc-{pair}-raw"),
params:
xms="4096M",
xmx="4096M",
fastqc_dir="usr/local/opt/fastqc-0.11.9",
memory=4096,
log:
"log/fastqc_raw.{sample}.{read_group}.{pair}.txt",
threads: 4
Expand All @@ -57,16 +55,13 @@ rule fastqc_raw:
"""
mkdir -p {output.folder}
FASTQC_DIR=/{params.fastqc_dir}
export CLASSPATH="$FASTQC_DIR:$FASTQC_DIR/sam-1.103.jar:$FASTQC_DIR/jbzip2-0.9.jar:$FASTQC_DIR/cisd-jhdf5.jar"
java -Djava.awt.headless=true -Xms{params.xms} -Xmx{params.xmx} \
-Dfastqc.output_dir={output.folder} \
-Dfastqc.io.tmpdir={input.tmp} \
-Dfastqc.unzip=true \
-Dfastqc.nogroup=true \
-Dfastqc.threads={threads} \
uk.ac.babraham.FastQC.FastQCApplication \
fastqc \
--outdir {output.folder} \
--dir {input.tmp} \
--extract \
--nogroup \
--threads {threads} \
--memory {params.memory} \
{input.fq1:q} {input.fq2:q} 2> {log}
"""

Expand Down Expand Up @@ -102,39 +97,15 @@ rule cutadapt:
"""


rule fastqc_processed:
"""Runs FastQC for each pair of QC-ed inputs."""
use rule fastqc_raw as fastqc_processed with:
input:
fq1="{sample}/qc-seq/{read_group}/{sample}-{read_group}-R1.fq.gz",
fq2="{sample}/qc-seq/{read_group}/{sample}-{read_group}-R2.fq.gz",
tmp="tmp",
output:
folder=directory("{sample}/qc-seq/{read_group}/fastqc-{pair}-processed"),
params:
xms="4096M",
xmx="4096M",
fastqc_dir="usr/local/opt/fastqc-0.11.9",
log:
"log/fastqc_processed.{sample}.{read_group}.{pair}.txt",
threads: 4
container:
containers["fastqc"]
shell:
"""
mkdir -p {output.folder}
FASTQC_DIR=/{params.fastqc_dir}
export CLASSPATH="$FASTQC_DIR:$FASTQC_DIR/sam-1.103.jar:$FASTQC_DIR/jbzip2-0.9.jar:$FASTQC_DIR/cisd-jhdf5.jar"
java -Djava.awt.headless=true -Xms{params.xms} -Xmx{params.xmx} \
-Dfastqc.output_dir={output.folder} \
-Dfastqc.io.tmpdir={input.tmp} \
-Dfastqc.unzip=true \
-Dfastqc.nogroup=true \
-Dfastqc.threads={threads} \
uk.ac.babraham.FastQC.FastQCApplication \
{input.fq1:q} {input.fq2:q} 2> {log}
"""


rule rg_stats:
Expand Down
2 changes: 1 addition & 1 deletion includes/qc-seq/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ from types import SimpleNamespace
containers = {
"crimson": "docker://quay.io/biocontainers/crimson:1.1.0--pyh5e36f6f_0",
"cutadapt": "docker://quay.io/biocontainers/cutadapt:4.1--py310h1425a21_1",
"fastqc": "docker://quay.io/biocontainers/fastqc:0.11.9--hdfd78af_1",
"fastqc": "docker://quay.io/biocontainers/fastqc:0.12.1--hdfd78af_0",
}


Expand Down
1 change: 0 additions & 1 deletion report/templates/contents_var.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

<h1>Variant Calling Results</h1>


{% set vars = {'figure_idx': 1, 'table_idx': 10} %}
{% for gene in stats.cov %}
{% for tid, exons in stats.cov[gene].items() %}
Expand Down
20 changes: 20 additions & 0 deletions test/helper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

set -euxo pipefail

ref=test/data/reference/hamlet-ref.fa
star=test/data/reference/hamlet-star/Genome

function setup {
unxz -k ${ref}.xz
unxz -k ${star}.xz
}

function cleanup {
rm -f ${ref}
rm -f ${star}
}

trap cleanup EXIT

setup
4 changes: 1 addition & 3 deletions test/test_fusion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
- fusion
command: >
bash -c "
unxz -k test/data/reference/hamlet-ref.fa.xz;
source test/helper.sh
snakemake -rp
--snakefile includes/fusion/Snakefile
Expand All @@ -60,8 +60,6 @@
--use-singularity
--singularity-args '--cleanenv --bind /tmp'
--singularity-prefix '~/.singularity/cache/snakemake'
rm test/data/reference/hamlet-ref.fa;
"
files:
# Should create the arriba output files
Expand Down
18 changes: 3 additions & 15 deletions test/test_hamlet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@
- hamlet
command: >
bash -c "
set -e
unxz -k test/data/reference/hamlet-ref.fa.xz;
unxz -k test/data/reference/hamlet-star/Genome.xz;
source test/helper.sh
snakemake -rp \
--snakefile Snakefile \
Expand All @@ -72,9 +69,6 @@
--use-singularity \
--singularity-args '--cleanenv --bind /tmp' \
--singularity-prefix '~/.singularity/cache/snakemake'
rm test/data/reference/hamlet-ref.fa;
rm test/data/reference/hamlet-star/Genome;
"
- path: MO1-RNAseq-1-16714/hamlet_report.SRR8615409.pdf
- path: "log/generate_report.MO1-RNAseq-1-16714.txt"
Expand All @@ -86,26 +80,20 @@
- hamlet
command: >
bash -c "
set -e
unxz -k test/data/reference/hamlet-ref.fa.xz;
unxz -k test/data/reference/hamlet-star/Genome.xz;
source test/helper.sh
snakemake \
--snakefile Snakefile \
--configfile test/data/config/hamlet.json \
--config pepfile=test/pep/chrM_itd.csv \
--cores \
--cores 1 \
--verbose \
--use-singularity \
--singularity-args '--cleanenv --bind /tmp' \
--singularity-prefix '~/.singularity/cache/snakemake' \
SRR8615409/hamlet_report.SRR8615409.html \
SRR8615409/hamlet_report.SRR8615409.pdf
rm test/data/reference/hamlet-ref.fa;
rm test/data/reference/hamlet-star/Genome;
# Test if the table scripts can still parse the summary.json file
python3 utilities/hamlet_table.py variant SRR8615409/SRR8615409.summary.json > variant.tsv;
Expand Down
6 changes: 3 additions & 3 deletions test/test_qc_seq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@

contains_regex:
# The forward/reverse fastq files from the PEP should be handled correctly
- '-Dfastqc.output_dir=TestSample1.* test/data/fastq/R1.fq.gz test/data/fastq/R2.fq.gz'
- '-Dfastqc.output_dir=TestSample2.* test/data/fastq/R1.fq.gz test/data/fastq/R2.fq.gz'
- "-Dfastqc.output_dir=TestSample2.* 'test/data/fastq/SRR8615409 chrM_1.fastq.gz' 'test/data/fastq/SRR8615409 chrM_2.fastq.gz'"
- 'fastqc .* --outdir TestSample1.* test/data/fastq/R1.fq.gz test/data/fastq/R2.fq.gz'
- 'fastqc .* --outdir TestSample2.* test/data/fastq/R1.fq.gz test/data/fastq/R2.fq.gz'
- "fastqc .* --outdir TestSample2.* 'test/data/fastq/SRR8615409 chrM_1.fastq.gz' 'test/data/fastq/SRR8615409 chrM_2.fastq.gz'"

# Singularity should be available
- name: test-qc-sanity-singularity
Expand Down
4 changes: 0 additions & 4 deletions test/test_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ def parse_table(table):
# Get the rows
for row in table.find("tbody").find_all("tr"):
d = {k: v.get_text() for k, v in zip(headers, row.find_all("td"))}
# Convert the price field to float
# for k, v in d.items():
# if "€" in v:
# d[k] = price_to_float(v)
data.append(d)
return data

Expand Down
6 changes: 1 addition & 5 deletions test/test_snv_indels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@
- snv-indels
command: >
bash -c "
unxz -k test/data/reference/hamlet-ref.fa.xz;
unxz -k test/data/reference/hamlet-star/Genome.xz;
source test/helper.sh
snakemake -rp \
--snakefile includes/snv-indels/Snakefile \
Expand All @@ -59,9 +58,6 @@
--use-singularity \
--singularity-args '--cleanenv --bind /tmp' \
--singularity-prefix '~/.singularity/cache/snakemake'
rm test/data/reference/hamlet-ref.fa;
rm test/data/reference/hamlet-star/Genome;
"
stderr:
# snv-indel should not use a local VEP database, but query ensembl
Expand Down

0 comments on commit 8dcd9b9

Please sign in to comment.