Skip to content

Commit

Permalink
change paths of python, add bin to docker containers
Browse files Browse the repository at this point in the history
  • Loading branch information
WhalleyT committed Oct 25, 2023
1 parent 60ad35f commit 97276e9
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 14 deletions.
3 changes: 3 additions & 0 deletions docker/Dockerfile.clockwork-0.9.7
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ clockwork_version=2364dec4cbf25c844575e19e8fe0a319d10721b5
ENV PACKAGES="procps curl git build-essential wget zlib1g-dev pkg-config jq r-base-core rsync autoconf libncurses-dev libbz2-dev liblzma-dev libcurl4-openssl-dev cmake tabix libvcflib-tools libssl-dev software-properties-common perl locales locales-all" \
PYTHON="python2.7 python-dev"

COPY bin/ /opt/bin/
ENV PATH=/opt/bin:$PATH

RUN apt-get update \
&& apt-get install -y $PACKAGES $PYTHON \
&& curl -fsSL https://www.python.org/ftp/python/${python_version}/Python-${python_version}.tgz | tar -xz \
Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.preprocessing-0.9.7
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ LD_LIBRARY_PATH=/usr/local/lib

RUN export DEBIAN_FRONTEND="noninteractive"

COPY bin/ /opt/bin/
ENV PATH=/opt/bin:$PATH

RUN apt-get update \
&& DEBIAN_FRONTEND="noninteractive" apt-get install -y $PACKAGES $PYTHON \
&& pip3 install --upgrade pip \
Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.vcfpredict-0.9.7
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ piezo_version=0.3 \
gnomonicus_version=1.1.2 \
tuberculosis_amr_catalogues=12d38733ad2e238729a3de9f725081e1d4872968

COPY bin/ /opt/bin/
ENV PATH=/opt/bin:$PATH

RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata \
&& apt-get install -y $PACKAGES $PYTHON \
Expand Down
4 changes: 2 additions & 2 deletions modules/clockworkModules.nf
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ process alignToRef {
samtools index ${bam} ${bai}
samtools stats ${bam} > ${stats}
python3 ${baseDir}/bin/parse_samtools_stats.py ${bam} ${stats} > ${stats_json}
python3 ${baseDir}/bin/create_final_json.py ${stats_json} ${species_json}
parse_samtools_stats.py ${bam} ${stats} > ${stats_json}
create_final_json.py ${stats_json} ${species_json}
cp ${sample_name}_report.json ${sample_name}_report_previous.json
Expand Down
2 changes: 1 addition & 1 deletion modules/getversionModules.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ process getversion {
script:

"""
python3 ${baseDir}/bin/software-json.py ${params.sing_dir} ${params.config_dir}
software-json.py ${params.sing_dir} ${params.config_dir}
"""

stub:
Expand Down
18 changes: 9 additions & 9 deletions modules/preprocessingModules.nf
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,9 @@ process kraken2 {
"""
kraken2 --threads ${task.cpus} --db . --output ${kraken2_read_classification} --report ${kraken2_report} --paired $fq1 $fq2
python3 ${baseDir}/bin/parse_kraken_report2.py ${kraken2_report} ${kraken2_json} 0.5 5000
parse_kraken_report2.py ${kraken2_report} ${kraken2_json} 0.5 5000
${baseDir}/bin/extract_kraken_reads.py -k ${kraken2_read_classification} -r ${kraken2_report} -s $fq1 -s2 $fq2 -o ${nonBac_depleted_reads_1} -o2 ${nonBac_depleted_reads_2} --taxid 2 --include-children --fastq-output >/dev/null
extract_kraken_reads.py -k ${kraken2_read_classification} -r ${kraken2_report} -s $fq1 -s2 $fq2 -o ${nonBac_depleted_reads_1} -o2 ${nonBac_depleted_reads_2} --taxid 2 --include-children --fastq-output >/dev/null
gzip -f ${nonBac_depleted_reads_1}
gzip -f ${nonBac_depleted_reads_2}
Expand Down Expand Up @@ -362,13 +362,13 @@ process afanc {
if [[ ${run_afanc} =~ /${sample_name}/ ]]
then
afanc screen ${afanc_myco_db} ${fq1} ${fq2} -p 5.0 -n 1000 -o ${sample_name} -t ${task.cpus} -v ${afanc_myco_db}/lineage_profiles/TB_variants.tsv
python3 ${baseDir}/bin/reformat_afanc_json.py ${sample_name}/${sample_name}.json
reformat_afanc_json.py ${sample_name}/${sample_name}.json
printf ${sample_name}
else
afanc screen ${afanc_myco_db} ${fq1} ${fq2} -p 2.0 -n 500 -o ${sample_name} -t ${task.cpus} -v ${afanc_myco_db}/lineage_profiles/TB_variants.tsv
python3 ${baseDir}/bin/reformat_afanc_json.py ${sample_name}/${sample_name}.json
reformat_afanc_json.py ${sample_name}/${sample_name}.json
python3 ${baseDir}/bin/identify_tophit_and_contaminants2.py ${afanc_report} ${kraken_json} ${baseDir}/resources/assembly_summary_refseq.txt ${params.species} ${params.unmix_myco} ${baseDir}/resources null
identify_tophit_and_contaminants2.py ${afanc_report} ${kraken_json} ${baseDir}/resources/assembly_summary_refseq.txt ${params.species} ${params.unmix_myco} ${baseDir}/resources null
echo '{"error":"Kraken's top family hit either wasn't Mycobacteriaceae, or there were < 100k Mycobacteriaceae reads. Sample will not proceed further than afanc."}' | jq '.' > ${error_log} && printf "no" && jq -s ".[0] * .[1] * .[2]" ${software_json} ${error_log} ${sample_name}_species_in_sample.json > ${report_json}
Expand Down Expand Up @@ -504,7 +504,7 @@ process identifyBacterialContaminants {
report_json = "${sample_name}_report.json"

"""
python3 ${baseDir}/bin/identify_tophit_and_contaminants2.py ${afanc_json} ${kraken_json} ${baseDir}/resources/assembly_summary_refseq.txt ${params.species} ${params.unmix_myco} ${baseDir}/resources null
identify_tophit_and_contaminants2.py ${afanc_json} ${kraken_json} ${baseDir}/resources/assembly_summary_refseq.txt ${params.species} ${params.unmix_myco} ${baseDir}/resources null
contam_to_remove=\$(jq -r '.summary_questions.are_there_contaminants' ${sample_name}_species_in_sample.json)
acceptable_species=\$(jq -r '.summary_questions.is_the_top_species_appropriate' ${sample_name}_species_in_sample.json)
Expand Down Expand Up @@ -663,7 +663,7 @@ process reKraken {
"""
kraken2 --threads ${task.cpus} --db . --output ${kraken2_read_classification} --report ${kraken2_report} --paired $fq1 $fq2
python3 ${baseDir}/bin/parse_kraken_report2.py ${kraken2_report} ${kraken2_json} 0.5 5000
parse_kraken_report2.py ${kraken2_report} ${kraken2_json} 0.5 5000
rm -rf ${sample_name}_read_classifications.txt
"""

Expand Down Expand Up @@ -705,7 +705,7 @@ process reAfanc {

"""
afanc screen ${afanc_myco_db} ${fq1} ${fq2} -p 5.0 -n 1000 -o ${sample_name} -t ${task.cpus} -v ${afanc_myco_db}/lineage_profiles/TB_variants.tsv
python3 ${baseDir}/bin/reformat_afanc_json.py ${sample_name}/${sample_name}.json
reformat_afanc_json.py ${sample_name}/${sample_name}.json
printf ${sample_name}
"""

Expand Down Expand Up @@ -777,7 +777,7 @@ process summarise {
report_json = "${sample_name}_report.json"

"""
python3 ${baseDir}/bin/identify_tophit_and_contaminants2.py ${afanc_json} ${kraken_json} ${baseDir}/resources/assembly_summary_refseq.txt ${params.species} ${params.unmix_myco} ${baseDir}/resources ${prev_species_json}
identify_tophit_and_contaminants2.py ${afanc_json} ${kraken_json} ${baseDir}/resources/assembly_summary_refseq.txt ${params.species} ${params.unmix_myco} ${baseDir}/resources ${prev_species_json}
contam_to_remove=\$(jq -r '.summary_questions.are_there_contaminants' ${sample_name}_species_in_sample.json)
acceptable_species=\$(jq -r '.summary_questions.is_the_top_species_appropriate' ${sample_name}_species_in_sample.json)
Expand Down
2 changes: 1 addition & 1 deletion modules/vcfpredictModules.nf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ process vcfmix {
error_log = "${sample_name}_err.json"

"""
python3 ${baseDir}/bin/run-vcfmix.py ${bcftools_vcf}
run-vcfmix.py ${bcftools_vcf}
cp ${sample_name}_report.json ${sample_name}_report_previous.json
Expand Down
3 changes: 2 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ profiles {
}

withLabel:getversion{
executor = "local"
executor = "local"

}

withName:downloadContamGenomes {
Expand Down

0 comments on commit 97276e9

Please sign in to comment.