Skip to content

Commit

Permalink
Add Java QC step
Browse files Browse the repository at this point in the history
  • Loading branch information
seppinho committed Dec 13, 2023
1 parent 977d484 commit feffe85
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ RUN \

RUN mkdir /opt/mutserve
WORKDIR "/opt/mutserve"
RUN wget https://github.com/seppinho/mutserve/releases/download/v2.0.0-rc12/mutserve.zip
#RUN wget https://github.com/seppinho/mutserve/releases/download/v2.0.0-rc12/mutserve.zip
COPY files/mutserve.zip .
RUN unzip mutserve.zip && \
rm mutserve.zip
ENV PATH="/opt/mutserve:${PATH}"
Expand Down
Binary file added files/mutserve.zip
Binary file not shown.
5 changes: 4 additions & 1 deletion modules/local/calculate_statistics.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ process CALCULATE_STATISTICS {
path bam_file

output:
path("*summary.txt"), emit: stats_ch
path("*summary.tab.txt"), emit: stats_ch


script:
def output_name = "${bam_file.baseName}.summary.txt"
def output_name_tab = "${bam_file.baseName}.summary.tab.txt"

"""
## calculate summary statistics
Expand All @@ -30,5 +31,7 @@ process CALCULATE_STATISTICS {
echo ${bam_file.baseName}\tMeanDepth\t\${mean_depth} >> $output_name
echo ${bam_file.baseName}\tMeanBaseQuality\t\${mean_base_quality} >> $output_name
echo ${bam_file.baseName}\tMeanMapQuality\t\${mean_map_quality} >> $output_name
csvtk space2tab $output_name -o $output_name_tab
"""
}
3 changes: 2 additions & 1 deletion modules/local/mutserve.nf
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ process MUTSERVE {
input:
path bam_files_ch
path reference
path excluded_samples

output:
path("variants.vcf.gz"), emit: vcf_ch
path("variants.txt"), emit: txt_ch

"""
java -jar /opt/mutserve/mutserve.jar call --level ${params.detection_limit} --reference ${reference} --mapQ $params.mutserve.mapQ --baseQ $params.mutserve.baseQ --deletions --output variants.vcf.gz --no-ansi ${bam_files_ch} --threads 1 --write-raw
java -jar /opt/mutserve/mutserve.jar call --level ${params.detection_limit} --reference ${reference} --mapQ $params.mutserve.mapQ --baseQ $params.mutserve.baseQ --deletions --output variants.vcf.gz --no-ansi ${bam_files_ch} --excluded-samples ${excluded_samples} --threads 1 --write-raw
"""
}
7 changes: 5 additions & 2 deletions modules/local/summarize_statistics.nf
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ process SUMMARIZE_STATISTICS {
path statistics

output:
path("sample_statistics.txt"), emit: stats_summarized_ch
path("sample_statistics.txt"), emit: summarized_ch
path("excluded_samples.txt"), emit: excluded_ch


"""
csvtk concat ${statistics} -T -o sample_statistics.txt
csvtk concat -t ${statistics} -T -o sample_statistics.txt
java -jar /opt/mutserve/mutserve.jar stats --input sample_statistics.txt --baseQ $params.mutserve.baseQ --mapQ $params.mutserve.mapQ --output excluded_samples.txt
echo HG00096.mapped.ILLUMINA.bwa.GBR.low_coverage.20101123_copy > excluded_samples.txt
"""
}
3 changes: 2 additions & 1 deletion workflows/mitocalling.nf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ workflow MITOCALLING {

MUTSERVE(
bams_ch.collect(),
ref_file
ref_file,
SUMMARIZE_STATISTICS.out.excluded_ch
)

ANNOTATE(
Expand Down

0 comments on commit feffe85

Please sign in to comment.