Skip to content

Commit

Permalink
Merge pull request #8 from gregorysprenger/dev
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
gregorysprenger authored Nov 17, 2023
2 parents 4c8c47b + b34c5cb commit dcd5f13
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 12 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v2.0.2 - November 16, 2023

### `Added`

### `Fixed`

- Added collect operators to database/reference channels to allow for all inputs to be analyzed for each process
- Removed extra slashes '/' from run_assembly.uge-nextflow scripts
- Updated paths for summary email when using run_assembly.uge-nextflow scripts

### `Updated`

### `Deprecated`

## v2.0.1 - November 16, 2023

### `Added`
Expand All @@ -24,6 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- nf-core Styling
- Allow samplesheet (XLSX, CSV, TSV) OR directory as input
- Use SKESA instead of SPAdes for assembling contigs
- Downsampling of input FastQ files
- Contig taxonomic classification using GTDB-Tk
- Intra-contig gene information using BUSCO
- Ability to use a BUSCO config file
Expand Down
19 changes: 12 additions & 7 deletions _run_assembly.uge-nextflow
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ nextflow \
-profile ${HPC} \
--input ${IN} \
--outdir ${OUT} \
-ansi-log false \
-N ${USER}@cdc.gov \
-w ${OUT}/.work \
--blast_db ${LAB_HOME}/.databases/ncbi \
Expand Down Expand Up @@ -59,6 +58,12 @@ while read -r line; do
error=$(grep -A1 "java.lang" ${line}/.command.err | head -n 2 | tail -n 1)
fi

# Drop BBDuk reformatting message
if [[ ${process} =~ .*REMOVE_PHIX_BBDUK$ ]] \
&& [[ "${error}" =~ "Input is being processed as unpaired" ]]; then
continue
fi

# Check if error is from file checks
if [[ ${error} =~ .+Check[[:space:]]failed$ ]]; then
get_previous_process_workdir=$(dirname $(grep "ln -s" ${line}/.command.run | grep "work" | awk 'END {print $(NF-1)}' ))
Expand Down Expand Up @@ -101,25 +106,25 @@ if [[ -f "${OUT}/pipeline_info/errors.tsv" ]]; then
fi

# Count lines in Summary.Illumina.GenomeCoverage.tab
if [[ -f "${OUT}/qa/Summary.Illumina.GenomeCoverage.tab" ]]; then
num_assemblies=$(wc -l ${OUT}/qa/Summary.Illumina.GenomeCoverage.tab | awk '{print $1}')
if [[ -f "${OUT}/Summaries/Summary.Illumina.GenomeCoverage.tab" ]]; then
num_assemblies=$(wc -l ${OUT}/Summaries/Summary.Illumina.GenomeCoverage.tab | awk '{print $1}')
fi

# E-mail completion status
if [[ -f "${OUT}/qa/Summary.Illumina.GenomeCoverage.tab" ]] \
if [[ -f "${OUT}/Summaries/Summary.Illumina.GenomeCoverage.tab" ]] \
&& [[ -f "${OUT}/pipeline_info/errors.tsv" ]]; then
echo -e "Assembly and QA finished on $(date)\n${OUT}" | mail \
-s "${num_assemblies} assembled $(basename "${OUT}") [HPC]" \
-S smtp="smtpgw.cdc.gov" \
-a "${OUT}/qa/Summary.Illumina.GenomeCoverage.tab" \
-a "${OUT}/Summaries/Summary.Illumina.GenomeCoverage.tab" \
-a "${OUT}/pipeline_info/errors.tsv" \
"${USER}@cdc.gov"

elif [[ -f "${OUT}/qa/Summary.Illumina.GenomeCoverage.tab" ]]; then
elif [[ -f "${OUT}/Summaries/Summary.Illumina.GenomeCoverage.tab" ]]; then
echo -e "Assembly and QA finished on $(date)\n${OUT}" | mail \
-s "${num_assemblies} assembled $(basename "${OUT}") [HPC]" \
-S smtp="smtpgw.cdc.gov" \
-a "${OUT}/qa/Summary.Illumina.GenomeCoverage.tab" \
-a "${OUT}/Summaries/Summary.Illumina.GenomeCoverage.tab" \
"${USER}@cdc.gov"

elif [[ -f "${OUT}/pipeline_info/errors.tsv" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ manifest {
description = "Trim, assemble, and annotate paired end illumina reads."
mainScript = 'main.nf'
nextflowVersion = '!>=22.04.3'
version = '1.1.0'
version = '2.0.2'
}

// Load configs
Expand Down
4 changes: 2 additions & 2 deletions run_assembly.uge-nextflow
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ if [[ ${#submitted[@]} -ge 1 ]] && \
-v SINGULARITY_TMPDIR=${SINGULARITY_TMPDIR} \
-v SINGULARITY_CACHEDIR=${SINGULARITY_CACHEDIR} \
-v NXF_SINGULARITY_CACHEDIR=${SINGULARITY_CACHEDIR} \
${LAB_HOME}/workflows//wf-paired-end-illumina-assembly/_run_assembly.uge-nextflow
${LAB_HOME}/workflows/wf-paired-end-illumina-assembly/_run_assembly.uge-nextflow

elif [[ ${#submitted[@]} -ge 1 ]] && \
[[ ${HOSTNAME%%.*} == 'rosalind01' ]] || \
Expand All @@ -340,7 +340,7 @@ elif [[ ${#submitted[@]} -ge 1 ]] && \
-v SINGULARITY_TMPDIR=${SINGULARITY_TMPDIR} \
-v SINGULARITY_CACHEDIR=${SINGULARITY_CACHEDIR} \
-v NXF_SINGULARITY_CACHEDIR=${SINGULARITY_CACHEDIR} \
${LAB_HOME}/workflows//wf-paired-end-illumina-assembly/_run_assembly.uge-nextflow
${LAB_HOME}/workflows/wf-paired-end-illumina-assembly/_run_assembly.uge-nextflow

else
echo -e "${RED_TXT}Biolinux/Aspen/Rosalind HPC is not detected.\nSubmission cancelled. ${COLOR_OFF}"
Expand Down
9 changes: 7 additions & 2 deletions workflows/assembly.nf
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ if (params.phix_reference) {
error("PhiX reference file not in supported extension: .fasta, .fas, .fa, .fna")
}
}
.collect()
} else {
error("Path to PhiX reference not specified. Please supply a PhiX reference file in FastA format via `--phix_reference` parameter.")
}
Expand All @@ -131,6 +132,7 @@ if (params.adapter_reference) {
error("Adapter reference file not in supported extension: .fasta, .fas, .fa, .fna")
}
}
.collect()
} else {
error("Path to Adapter reference not specified. Please supply an adapter reference file in FastA format via `--adapter_reference` parameter.")
}
Expand Down Expand Up @@ -312,7 +314,8 @@ workflow ASSEMBLY {
} else {
error("Kraken requires 'database.{idx,kdb}' and 'taxonomy/{names,nodes}.dmp' files!")
}
}
}
.collect()
} else {
error("Unsupported object given to --kraken1_db, database must be supplied as either a directory or a .tar.gz file!")
}
Expand Down Expand Up @@ -350,6 +353,7 @@ workflow ASSEMBLY {
error("Kraken2 requires '{hash,opts,taxo}.k2d' files!")
}
}
.collect()
} else {
error("Unsupported object given to --kraken2_db, database must be supplied as either a directory or a .tar.gz file!")
}
Expand Down Expand Up @@ -588,10 +592,10 @@ workflow ASSEMBLY {
} else if ( ch_gtdbtk_db_file.isDirectory() ) {
ch_db_for_gtdbtk = Channel
.fromPath( "${ch_gtdbtk_db_file}/*", type: 'dir', maxDepth: 1 )
.collect()
.map{
[ it[0].getSimpleName(), it ]
}
.collect()
} else {
error("Unsupported object given to --gtdb_db, database must be supplied as either a directory or a .tar.gz file!")
}
Expand Down Expand Up @@ -634,6 +638,7 @@ workflow ASSEMBLY {
db
}
}
.collect()
} else {
error("Unsupported object given to --busco_db, database must be supplied as either a directory or a .tar.gz file!")
}
Expand Down

0 comments on commit dcd5f13

Please sign in to comment.