Skip to content

How to restart a otb run

David Molik edited this page Dec 2, 2022 · 1 revision

If otb has errored and an otb run needs to be restarted it is recommended that by taking the nextflow call from the reports file, and adding it to the relevant otb slurm template (or SGE template) with the "-resume" option, commenting out the otb.sh call in the slurm script:

relevant file: /reports/.nextflow.command.txt

cat this file to grab the nextflow command, say something like:

nextflow run run.nf -c config/slurm_usda.cfg --scaffold --hapscaffold --polishtype="dv" --polish --mode="phasing" --hclustlinkage="average" --l="1" --kmer="kmc" --outfasta="prosapia_bivincta.genome.out" --threads="32" --hicreadf="/project/ag100pest/Prosapia_bivincta_otb_test/RawHiCData/Pbis-GTCCGC_HiC_S2_L001_R1_001.fastq.gz" --hicreadr="/project/ag100pest/Prosapia_bivincta_otb_test/RawHiCData/Pbis-GTCCGC_HiC_S2_L001_R2_001.fastq.gz" --yahs --busco --linreage="/project/ag100pest/Prosapia_bivincta_otb_test/otb/insecta_odb10" --readin="/project/ag100pest/Prosapia_bivincta_otb_test/RawHiFiData/*.hifi_reads.fastq.gz" --assembly="prosapia_bivincta"

and add the -resume to it:

nextflow run run.nf -c config/slurm_usda.cfg --scaffold --hapscaffold --polishtype="dv" --polish --mode="phasing" --hclustlinkage="average" --l="1" --kmer="kmc" --outfasta="prosapia_bivincta.genome.out" --threads="32" --hicreadf="/project/ag100pest/Prosapia_bivincta_otb_test/RawHiCData/Pbis-GTCCGC_HiC_S2_L001_R1_001.fastq.gz" --hicreadr="/project/ag100pest/Prosapia_bivincta_otb_test/RawHiCData/Pbis-GTCCGC_HiC_S2_L001_R2_001.fastq.gz" --yahs --busco --linreage="/project/ag100pest/Prosapia_bivincta_otb_test/otb/insecta_odb10" --readin="/project/ag100pest/Prosapia_bivincta_otb_test/RawHiFiData/*.hifi_reads.fastq.gz" --assembly="prosapia_bivincta" -resume

then add this to the slurm template, making sure to comment out the relevant otb.sh line:

#if [[ -z "$BUSCO" ]]; then
#  ./otb.sh -n ${Assembly_Name} -f "$( echo ${Forward})" -r "$(echo ${Reverse})" -in "$(echo ${CCS})" -m ${HiFi_Type} -t ${Threads} ${Yahs} ${Busco} --polish_type ${Polish_Type} --runner ${Runner} -c -s
#else
#  ./otb.sh -n ${Assembly_Name} -f "$( echo ${Forward})" -r "$(echo ${Reverse})" -in "$(echo ${CCS})" -m ${HiFi_Type} -t ${Threads} ${Yahs} #${Busco} ${Busco_Location} ${Busco_DB} --polish_type ${Polish_Type} --runner ${Runner} -c -s
#fi

<nextflow call goes here>

the slrum script can now be run again, restarted from the failed job.