Skip to content

Commit

Permalink
ignoring workdirs and nproc is a Process command parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
crosenth committed Oct 7, 2024
1 parent 0d37a7a commit ec6e245
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
*-env
__pycache__
.nextflow*
work
work/
output*
.DS_Store
singularity/
dev/
.apptainer/
workdirs/
4 changes: 2 additions & 2 deletions bin/run_plate.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ def main(arguments):
launching pipleine""")
parser.add_argument('-c', '--check-inputs', action='store_true', default=False,
help='verify inputs and exit')
parser.add_argument('-p', '--profile', choices=['hutch'],
default='hutch_singularity', help="""[%(default)s]""")
parser.add_argument('-p', '--profile', choices=['hutch_batch', 'hutch_apptainer'],
default='hutch_apptainer', help="""[%(default)s]""")

args = parser.parse_args(arguments)
plate = args.plate
Expand Down
15 changes: 8 additions & 7 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ process cmsearch_orientations {

"""
python3 -c "from Bio import SeqIO;import gzip;SeqIO.write(SeqIO.parse(gzip.open('${R1}', 'rt'), 'fastq'), 'R1.fa', 'fasta')"
cmsearch -E 10.0 --cpu 4 --hmmonly --noali --tblout scores.txt ${model} R1.fa
cmsearch -E 10.0 --cpu ${params.nproc} --hmmonly --noali --tblout scores.txt ${model} R1.fa
split_reads.py --counts counts.csv --cmsearch scores.txt ${sampleid} ${R1} ${R2}
"""
}
Expand All @@ -198,7 +198,7 @@ process vsearch_orientations {

"""
python3 -c "from Bio import SeqIO;import gzip;SeqIO.write(SeqIO.parse(gzip.open('${R1}', 'rt'), 'fastq'), 'R1.fa', 'fasta')"
vsearch --usearch_global R1.fa --db ${library} --id 0.75 --query_cov 0.8 --strand both --threads 4 --top_hits_only --userfields query+qstrand --userout hits.tsv
vsearch --usearch_global R1.fa --db ${library} --id 0.75 --query_cov 0.8 --strand both --threads ${params.nproc} --top_hits_only --userfields query+qstrand --userout hits.tsv
split_reads.py --counts counts.csv --vsearch hits.tsv ${sampleid} ${R1} ${R2}
"""
}
Expand Down Expand Up @@ -291,16 +291,17 @@ process dada_dereplicate {

"""
dada2_dada.R ${R1} ${R2} \
--counts counts.csv \
--data dada.rds \
--errors ${model} \
--sampleid ${sampleid} \
--orientation ${orientation} \
--overlaps overlaps.csv \
--nthreads ${params.nproc} \
--params ${dada_params} \
--data dada.rds \
--sampleid ${sampleid} \
--seqtab seqtab.csv \
--seqtab-r1 seqtab_r1.csv \
--seqtab-r2 seqtab_r2.csv \
--counts counts.csv \
--overlaps overlaps.csv
--seqtab-r2 seqtab_r2.csv
get_unmerged.R dada.rds \
--forward-seqs unmerged_F.fasta \
--reverse-seqs unmerged_R.fasta
Expand Down
5 changes: 4 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ params {
// Docker image is hosted on github
container = "ghcr.io/nhoffman/dada2-nf:2.0.3"
min_reads = 1
// for Processes that use nproc also see queueSize and maxForks
nproc = 4
work_dir = "work"
}

Expand Down Expand Up @@ -126,7 +128,8 @@ profiles {
apptainer {
enabled = true
autoMounts = true
cacheDir = '/fh/scratch/delete90/fredricks_d/lab/nhoffman/apptainer/cache/'
// Nextflow specific, different from APPTAINER_CACHEDIR
cacheDir = '.apptainer/'
}
params {
output = 'output'
Expand Down

0 comments on commit ec6e245

Please sign in to comment.