Resuming and skipping work¶
Applies to GraffiTE v1.1
Verified against v1.1.0.0 at commit bf51777. The
2024 paper describes v1.0, which
differs in places; see v1.0 vs v1.1.
Two mechanisms avoid recomputing. Nextflow's -resume reuses cached tasks from the same launch
directory when nothing upstream changed. GraffiTE's own entry-point flags go further: they take
a file an earlier run published, or that you produced elsewhere, and skip the processes that
would have produced it. The flags form a ladder, from the earliest stage to the latest.
Nextflow -resume¶
Nextflow keys each task on its inputs and script, so a task reruns only when one of those
changed. This works only from the directory holding the work/ tree and .nextflow/ of the
earlier run, and only as long as work/ has not been deleted. It is the right tool for a run
that stopped part-way. The flags below are for reusing results across directories, across
machines, or with different downstream parameters.
Entry points¶
| Flag | What you supply | Skips | Source |
|---|---|---|---|
--svs |
per-sample SV VCFs | the callers, not the merge | main.nf:120-125 |
--vcf |
one merged SV VCF | all of Stage 1 | main.nf:148-149 |
--RM_dir |
the 2_Repeat_Filtering/ directory of an earlier run |
RepeatMasker and ULTRA | main.nf:133-142 |
--graffite_vcf |
a pangenome.vcf |
all of Stages 1 and 2 | main.nf:129,183-186 |
--graph |
a GraffiTE_graph/index/ directory |
make_graph |
main.nf:210-214 |
--graph_alignments |
per-sample GAF and pack files | graph_align_reads |
main.nf:223-229 |
--vcfs |
per-sample vg call VCFs |
alignment and vg_call |
main.nf:218-220 |
--hervk_reconcile_vcf |
a genotyped VCF | genotyping, with --genotype false |
main.nf:296-314 |
--genotype false |
nothing | all of Stage 3 | main.nf:188 |
--svs: your own per-sample calls¶
On disk: a samplesheet with sample and path columns, one VCF per row; see
Samplesheets.
Runs: the merge (truvari_merge) and everything after it. Combines with --assemblies,
--longreads, --bams and --pav; the VCFs are mixed into the same merge. GraffiTE does not
filter what you supply by size or type, so restrict to INS and DEL yourself
main.nf:120-125.
--vcf: one merged VCF¶
On disk: one VCF or .vcf.gz of insertions and deletions, with sequence-resolved alleles.
Split multi-allelic records first (bcftools norm -m-).
Runs: truvari_merge in pass-through mode (decompress only, IDs preserved), then all of
Stages 2 and 3 module/main.nf:205-212.
Cannot be combined with any discovery flag; the run stops with a message naming the
discovery flags you passed main.nf:46-49. Use --svs when you want your VCF merged with
GraffiTE's own calls.
--RM_dir: RepeatMasker output of an earlier run¶
On disk: a directory holding one subdirectory per Stage 2 batch, each with
genotypes_repmasked_filtered.vcf and a repeatmasker_dir/. That is the layout of
out/2_Repeat_Filtering/, where the subdirectories are numbered by task
main.nf:134-136, module/main.nf:638-644.
out/2_Repeat_Filtering/
├── 1/
│ ├── genotypes_repmasked_filtered.vcf
│ └── repeatmasker_dir/
├── 2/
│ ...
Runs: the TSD search, polyA annotation, the repeat-span filter, the trusted or human
subset, and, with --human, the HERV-K classifier, which reads the raw RepeatMasker tables from
repeatmasker_dir/. --TE_library is still required under --human, because the classifier
masks reference windows with it main.nf:172-175.
This is the entry point for changing anything downstream of RepeatMasker: --tsd_win,
a higher --repeat_span_cutoff, the --trusted_* and --human* parameters, or the HERV-K parameters.
--graffite_vcf: a finished pangenome.vcf¶
On disk: a pangenome.vcf from 3_TSD_search/, or any VCF carrying the GraffiTE INFO
fields.
Runs: Stage 3 only, which builds the graph from the VCF as-is
main.nf:183-186.
Cannot be combined with --human unless --hervk_reconcile false is also given: the HERV-K
consolidation after genotyping needs tables that only the skipped stage writes
main.nf:58-63. To re-run the HERV-K steps, enter with --RM_dir
instead.
--graph: a built graph¶
On disk: the GraffiTE_graph/index/ directory of an earlier run, or any directory holding
what make_graph writes: index.gfa and index.pb, plus index.giraffe.gbz and its
companions for the giraffe method module/main.nf:788-801.
Runs: alignment and calling for every sample in --genotype_with. Requires
--graph_method giraffe, graphaligner or precomputed; the PanGenie path has its own index
and ignores --graph main.nf:206-214.
--graph_alignments: aligned reads¶
On disk: a samplesheet with sample, gaf and pack columns pointing at the
<sample>.gaf.gz and <sample>.pack files from GraffiTE_alignments/
main.nf:223-225.
Runs: vg_call for each row, against the graph from --graph or a fresh make_graph.
Only the samples listed here are called; --genotype_with is still read, and every path in it
must exist, but its samples are not aligned.
--vcfs: called samples¶
On disk: a samplesheet with sample and path columns pointing at per-sample vg call
VCFs (.vcf.gz with index), as vg_call writes them main.nf:218-220.
Runs: merge_VCFs, then genotyping_audit main.nf:271-273, and
trusted_genotypes unless --human main.nf:279-280; hervk_reconcile
under --human. No sample is aligned or called, but --genotype_with is still read, its paths
must exist, and any BAM row in it still goes through bam_to_fastq
main.nf:197. Pass --graph alongside --vcfs: the make_graph call
sits outside the --vcfs test main.nf:209-214, so without it the run
still builds an index at 40G for up to 6h nextflow.config:137-139, and
unless --epigenomes is on nothing consumes it. precomputed requires --graph in any case
main.nf:53-56.
--hervk_reconcile_vcf with --genotype false¶
On disk: a GraffiTE.merged.genotypes.vcf.gz from an earlier run, and the inputs for
--RM_dir and --human.
Runs: Stage 2 from the RepeatMasker output, hervk_annotate, then hervk_reconcile
against the supplied VCF, whose back end is read from its header
main.nf:302-314. See Human MEIs for the command
line.
--genotype false¶
Stops after Stage 2. --genotype_with is not read and need not exist
main.nf:188.
Combining rungs¶
Rungs at different stages combine: --RM_dir with --graph, or --graffite_vcf with
--graph_alignments. The rule is that each flag replaces the processes that would have produced
its input and leaves the rest running, so any combination that leaves a connected pipeline works.
The one refusal is --vcf beside a discovery flag.
Rungs that replace the same process do not stack: --graph_alignments and --vcfs together means --vcfs
wins, because the alignment branch is inside the else of the --vcfs test
main.nf:218-232.