I am running the Sarek pipeline on two samples usi...
# sarek
a
I am running the Sarek pipeline on two samples using SLURM. The main Nextflow job successfully launches and completes several child processes, but after some time it enters a prolonged “Sleeping” state and only submits new jobs very slowly (one or two at a time). I’m trying to determine whether this slowdown is related to my job configuration or an issue with the SLURM queue itself.
Copy code
executor >  slurm (2095)
[3d/340923] NFC…_sapiens_assembly38.fasta) | 1 of 1, cached: 1 ✔
[-        ] NFC…EPARE_GENOME:BWAMEM2_INDEX -
[-        ] NFC…E_GENOME:DRAGMAP_HASHTABLE -
[-        ] NFC…4_CREATESEQUENCEDICTIONARY -
[-        ] NFC…E_GENOME:MSISENSORPRO_SCAN -
[-        ] NFC…PARE_GENOME:SAMTOOLS_FAIDX -
[-        ] NFC…TABIX_BCFTOOLS_ANNOTATIONS -
[-        ] NFC…PREPARE_GENOME:TABIX_DBSNP -
[-        ] NFC…ME:TABIX_GERMLINE_RESOURCE -
[-        ] NFC…RE_GENOME:TABIX_KNOWN_SNPS -
[-        ] NFC…_GENOME:TABIX_KNOWN_INDELS -
[-        ] NFC…K:PREPARE_GENOME:TABIX_PON -
[3d/5d51ae] NFC…_2576bc_8f0.interval_list) | 0 of 1
[cf/2d6505] NFC… (hglft_genome_2576bc_8f0) | 1 of 1, cached: 1 ✔
[f2/b99457] NFC… (chr10_48434802-48435073) | 3838 of 102902, cached: 1770
[1d/e7f2ae] NFC… (hglft_genome_2576bc_8f0) | 1 of 1, cached: 1 ✔
[ca/1c2ae6] NFC…KIT_ANTITARGET (intervals) | 1 of 1, cached: 1 ✔
[03/01dfd2] NFC…_sapiens_assembly38.fasta) | 1 of 1, cached: 1 ✔
[-        ] NFC…RING_DECOMPRESS_TO_FQ_PAIR -
[-        ] NFC…SPRING_DECOMPRESS_TO_R1_FQ -
[9e/798155] NFC…IEW_MAP_MAP (OV2085_P64-2) | 2 of 2, cached: 2 ✔
[35/da3b72] NFC…AP_UNMAP (OV1369_R2_P66-1) | 2 of 2, cached: 2 ✔
[ef/00168f] NFC…NMAP_MAP (OV1369_R2_P66-1) | 2 of 2, cached: 2 ✔
[c7/29d4cf] NFC…AP_UNMAP (OV1369_R2_P66-1) | 2 of 2, cached: 2 ✔
[c1/550345] NFC…GE_UNMAP (OV1369_R2_P66-1) | 2 of 2, cached: 2 ✔
[47/d85107] NFC…TQ_UNMAP (OV1369_R2_P66-1) | 2 of 2, cached: 2 ✔
[0d/9048c8] NFC…E_FASTQ_MAP (OV2085_P64-2) | 2 of 2, cached: 2 ✔
[2e/129d92] NFC…T:CAT_FASTQ (OV2085_P64-2) | 2 of 2, cached: 2 ✔
[2a/a35241] NFC…AREK:FASTQC (OV2085_P64-2) | 2 of 2, cached: 2 ✔
[17/c9f621] NFC…SAREK:FASTP (OV2085_P64-2) | 2 of 2, cached: 2 ✔
[b9/7c2436] NFC…N:BWAMEM1_MEM (OV2085_P64) | 24 of 24 ✔
[-        ] NFC…CATES:GATK4_MARKDUPLICATES | 0 of 2
Plus 82 more processes waiting for tasks…
Copy code
#!/usr/bin/env bash
#SBATCH --account=def-dcook
#SBATCH --ntasks-per-node=4      # number of MPI processes
#SBATCH --nodes=1
#SBATCH --mem-per-cpu=1G      # memory; default unit is megabytes
#SBATCH --time=11:59:00          # time (DD-HH:MM)

module load nextflow/24.10.2
module load apptainer 

export SLURM_ACCOUNT=def-dcook
export SALLOC_ACCOUNT=$SLURM_ACCOUNT
export SBATCH_ACCOUNT=$SLURM_ACCOUNT

#ensure that the temporary directory used by nf-core is the one provided by the SLURM session
export TMPDIR=$SLURM_TMPDIR
#ensure that the session information is cached in your scratch directory
NXF_SINGULARITY_CACHEDIR=/scratch/$USER/nf-core/

DATE=$(date +%Y%m%d)
#OUTDIR="wes_sarek_results_${DATE}"
OUTDIR="wes_new"
RESOURCES="/scratch/asmab/ovcan/resources"

nextflow run /scratch/asmab/nf-core/nf-core-sarek_3.5.1/3_5_1 \
        --input samplesheet_two.csv \
        --outdir ${OUTDIR} \
        -c obcf-graham.cfg \
        --wes \
        --tools mutect2,strelka,cnvkit,controlfreec,vep \
        --genome null \
        --igenomes_ignore \
        --intervals hglft_genome_2576bc_8f0.interval_list \
        -plugins nf-schema@2.3.0 \
        --fasta ${RESOURCES}/Homo_sapiens_assembly38.fasta \
        --fasta_fai ${RESOURCES}/Homo_sapiens_assembly38.fasta.fai \
        --dict ${RESOURCES}/Homo_sapiens_assembly38.dict \
        --bwa false \
        --vep_cache_version 113 \
        --vep_genome GRCh38 \
        --vep_species homo_sapiens \
        --mappability ${RESOURCES}/out100m2_hg38.gem \
        --germline_resource ${RESOURCES}/af-only-gnomad.hg38.vcf.gz \
        --germline_resource_tbi ${RESOURCES}/af-only-gnomad.hg38.vcf.gz.tbi \
        --known_snps ${RESOURCES}/1000G_omni2.5.hg38.vcf.gz \
        --known_snps_tbi ${RESOURCES}/1000G_omni2.5.hg38.vcf.gz.tbi \
        --known_indels ${RESOURCES}/Mills_and_1000G_gold_standard.indels.hg38.vcf.gz \
        --known_indels_tbi ${RESOURCES}/Mills_and_1000G_gold_standard.indels.hg38.vcf.gz.tbi \
        --known_indels ${RESOURCES}/Homo_sapiens_assembly38.known_indels.vcf.gz \
        --known_indels_tbi ${RESOURCES}/Homo_sapiens_assembly38.known_indels.vcf.gz.tbi \
        -resume
p
Unless you see nodes idling the most likely reason is because you don't get jobs through faster because of general cluster load? There can also be any set of weird priorities in place for your site, but that's not much you need to react to unless it makes sense to e.g. run with the local executor on a larger node.
r
Also markduplicates is unfortunately a bottleneck step. The samples have to squeeze through that one and then we can do a bunch of scatter gathering to speed up the analysis
a
The step that is taking long in this case is PREPARE_INTERVALS:TABIX_BGZIPTABIX_INTERVAL_SPLIT ([6b/10f83c] NFC… (chr10_49019561-49019832) | 3840 of 102930, cached: 1770). The master job is submitting these jobs slowly. The mark duplicates step has not begun according to the logs.
r
that is too many splits. You will want to play with the interval_list file to reduce the amount of splitting.
https://nf-co.re/sarek/3.5.1/docs/usage/#intervals-for-base-quality-score-recalibration-and-variantcalling if your intervallist file has a seconds column you might want to remove that
a
what is an expected number of splits that one should see? I converted the initial target BED file in hg37 coordinates to hg38 using liftOver and then converted it to interval_list file using picard's BedToIntervalList.
r
for WGS we are using 20
you can just provide the bed directly. That is probably easier as you can tune the number of splits with
--nucleotides_per_second
, the default is probably already binning the bed file well enough
a
I am running Sarek on WES data with a target file ( # regions= 242421 ). would reducing nucleotides_per_second to 100000 be sufficient or should i go lower than that?
r
it's quite tricky to configure this with the intervals list. Is there a reason you can't provide the liftovered bed?
a
yes, I have the liftOver bed file. the number of regions in them is = 242421
r
try supplying the bedfile, sarek should be default bin them into only a few buckets. Does your bed file have any special columns or just chr,start,stop,(gene)?
a
attached image of a portion of the BED file. by "sarek should be default bin them into only a few buckets", do you mean not to tune --nucleotides_per_second parameter?
r
yep give it a try and see how many bins you get, should be pretty quick to see.
also use resume, you haven't hit the parts yet were the samples are using the intervals, so you should be able to cache the alignment
a
[44/05b7f9] NFC… (chr14_20356548-20356699) | 0 of 404; yes it did generate less number of bins
r
Ok let’s see if we can go down more. I am commuting at the moment and can estimate some values when I get back or you can try increasing the nucleotides per second parameter. . Maybe try tripeling it
a
Thank you!
r
I think we should aim for about 10-20 bins or less
a
--nucleotides_per_second 600000; with this the pipeline past that stage pretty quickly;
Copy code
executor >  slurm (427)
[cd/50eea5] NFC…_sapiens_assembly38.fasta) | 0 of 1
[-        ] NFC…EPARE_GENOME:BWAMEM2_INDEX -
[-        ] NFC…E_GENOME:DRAGMAP_HASHTABLE -
[-        ] NFC…4_CREATESEQUENCEDICTIONARY -
[-        ] NFC…E_GENOME:MSISENSORPRO_SCAN -
[-        ] NFC…PARE_GENOME:SAMTOOLS_FAIDX -
[-        ] NFC…TABIX_BCFTOOLS_ANNOTATIONS -
[-        ] NFC…PREPARE_GENOME:TABIX_DBSNP -
[-        ] NFC…ME:TABIX_GERMLINE_RESOURCE -
[-        ] NFC…RE_GENOME:TABIX_KNOWN_SNPS -
[-        ] NFC…_GENOME:TABIX_KNOWN_INDELS -
[-        ] NFC…K:PREPARE_GENOME:TABIX_PON -
[07/29cfea] NFC…ome_2576bc_8f0.sorted.bed) | 1 of 1 ✔
[3b/1d79aa] NFC…T (chr9_87971119-87971360) | 404 of 404 ✔
[ab/d003ae] NFC…_genome_2576bc_8f0.sorted) | 1 of 1 ✔
[be/8e7a58] NFC…KIT_ANTITARGET (intervals) | 1 of 1 ✔
[23/66dcab] NFC…_sapiens_assembly38.fasta) | 1 of 1 ✔
[-        ] NFC…RING_DECOMPRESS_TO_FQ_PAIR -
[-        ] NFC…SPRING_DECOMPRESS_TO_R1_FQ -
[-        ] NFC…SPRING_DECOMPRESS_TO_R2_FQ -
[62/ce4b83] NFC…IEW_MAP_MAP (OV2295_P61-5) | 0 of 3
[c7/9c7007] NFC…UNMAP_UNMAP (OV2295_P61-5) | 3 of 3 ✔
[88/815067] NFC…W_UNMAP_MAP (OV2295_P61-5) | 3 of 3 ✔
[30/fb1101] NFC…W_MAP_UNMAP (OV2085_P64-7) | 3 of 3 ✔
[48/b7855e] NFC…MERGE_UNMAP (OV2085_P64-7) | 3 of 3 ✔
[6d/ee36d7] NFC…FASTQ_UNMAP (OV2085_P64-7) | 3 of 3 ✔
Plus 87 more processes waiting for tasks…
s
I've had issues on slurm in the past when submitting lots of small jobs like that, in that it gums up the scheduler, so maybe talk to your cluster admins
a
tripling the value for nucleotides_per_second helped the pipeline move forward. thank you