Output files¶
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.
Directory layout¶
Everything below is relative to --out (default out/). Every publishDir copies rather than
links, so the tree stands on its own once work/ is deleted.
out/
├── 1_SV_search/
│ ├── SVs.vcf ← truvari_merge
│ ├── svim-asm_individual_VCFs/<sample>.vcf.gz ← svim_asm
│ ├── sniffles2_individual_VCFs/*.vcf.gz ← sniffles_population_call
│ └── pav_individual_VCFs/sv_<sample>.vcf.gz ← pav_asm
├── 2_Repeat_Filtering/
│ └── <N>/ ← repeatmask_VCF, one dir per contig
│ ├── genotypes_repmasked_filtered.vcf
│ ├── genotypes_repmasked.vcf.gz
│ ├── repeatmasker_dir/
│ ├── ultra_out.bed ultra_out.span ultra_out.stats
│ ├── total_repeat_span.tsv union.bp combined.stats
│ └── vcf_annotation.bak.txt
├── 3_TSD_search/ ← concat_repeatmask, then hervk_annotate
│ ├── pangenome.vcf
│ ├── pangenome.presence-absence.tsv
│ ├── pangenome.trusted.vcf (default; not written with --human)
│ ├── pangenome.presence-absence_trusted.tsv (default; not written with --human)
│ ├── pangenome.human.vcf (--human only)
│ ├── pangenome.presence-absence_human.tsv (--human only)
│ ├── pangenome.human.consolidated.vcf (--human only)
│ ├── human_filter_summary.txt (--human only)
│ ├── hervk_polymorphism_summary.md (--human only)
│ ├── hervk_loci.tsv hervk_calls.tsv (--human only)
│ ├── hervk_arch.tsv hervk_refstate.tsv (--human only)
│ ├── hervk_candidates.vcf (--human only)
│ ├── hervk_discovery_consolidation_report.md (--human only)
│ ├── TSD_summary.txt
│ └── TSD_full_log.txt
├── 4_Genotyping/
│ ├── pangenie_graph_variants.tsv ← pangenie_index, pangenie method only
│ ├── <sample>_genotyping.vcf.gz(.tbi) ← pangenie, pangenie method only
│ ├── genotyping_record_audit.tsv ← genotyping_audit
│ ├── GraffiTE.merged.genotypes.vcf.gz ← merge_VCFs
│ ├── GraffiTE.merged.genotypes.trusted.vcf.gz(.tbi) (not with --human) ← trusted_genotypes
│ ├── GraffiTE.merged.genotypes.presence-absence_trusted.tsv (not with --human)
│ ├── GraffiTE.merged.genotypes.human.vcf.gz(.tbi) (--human only) ← hervk_reconcile
│ ├── hervk_unconsolidated_records.vcf (--human only)
│ └── hervk_reconciliation_report.md (--human only)
├── GraffiTE_graph/index/ ← make_graph, giraffe/graphaligner only
└── GraffiTE_alignments/ ← graph_align_reads, giraffe/graphaligner only
Which subset appears depends on the entry point and the graph method:
flowchart LR
A["Stage 1"] --> D1["1_SV_search/"]
B["Stage 2"] --> D2["2_Repeat_Filtering/"]
B --> D3["3_TSD_search/"]
C["Stage 3"] --> D4["4_Genotyping/"]
C -.->|"giraffe · graphaligner"| D5["GraffiTE_graph/"]
C -.->|"giraffe · graphaligner"| D6["GraffiTE_alignments/"]
classDef s1 fill:#f5851f2e,stroke:#f5851f;
classDef s2 fill:#f2523f2e,stroke:#f2523f;
classDef s3 fill:#3d63c92e,stroke:#3d63c9;
classDef always fill:#8888881a,stroke:#888888;
classDef maybe fill:none,stroke:#888888,stroke-dasharray:4 3;
class A s1;
class B s2;
class C s3;
class D1,D2,D3,D4 always;
class D5,D6 maybe;
Main output files
For most users the file that matters is 3_TSD_search/pangenome.vcf (all annotated
polymorphisms) or its filtered companion: pangenome.trusted.vcf by default, or
pangenome.human.vcf with --human. If you genotyped, it is
4_Genotyping/GraffiTE.merged.genotypes.vcf.gz, which carries the same annotations plus
per-sample genotypes.
Reading HERV-K with --human
GraffiTE can emit several VCF records for one HERV-K locus: two breakpoints for one
insertion, or a deletion and an insertion describing opposite directions of the same event.
The .consolidated. and .human. VCFs hold each locus as one multi-allelic record. Read
those for HERV-K. The files they are built from stay as they are, because the discovery VCF
induces the graph and the merged genotypes VCF is the native record of what vg call did.
| want | read |
|---|---|
| HERV-K loci before genotyping | 3_TSD_search/pangenome.human.consolidated.vcf |
| HERV-K loci with genotypes | 4_Genotyping/GraffiTE.merged.genotypes.human.vcf.gz |
| every other TE family | pangenome.human.vcf or GraffiTE.merged.genotypes.vcf.gz |
INFO/HERVK_MEI marks the loci where a null allele segregates. Those are the ones
comparable to an Alu, L1 or SVA insertion. See VCF fields.
1_SV_search¶
Stage 1 output. Present whenever discovery ran, and with --vcf, where the directory holds
only SVs.vcf. Absent with --RM_dir and --graffite_vcf, which skip the merge.
| File | Contents | Source |
|---|---|---|
SVs.vcf |
The merged, non-redundant set of SVs from every caller and sample, sorted, with SVLEN recomputed from the alleles and IDs shortened to <caller id>_<n>. Missing genotypes are set to 0. This is the file Stage 2 annotates. With --vcf or a single input VCF, it is a copy of the input. |
module/main.nf:193,201,278-280 |
svim-asm_individual_VCFs/<sample>.vcf.gz |
One file per assembly: svim-asm calls of at least 100 bp, insertions and deletions only, sorted. | module/main.nf:175,187-188 |
sniffles2_individual_VCFs/<sample>.vcf.gz |
One file per read set, split from the Sniffles2 population call of at least 100 bp, insertions and deletions only, symbolic alleles dropped. | module/main.nf:118,131-135 |
pav_individual_VCFs/sv_<sample>.vcf.gz |
One file per sample: PAV calls with abs(SVLEN) above 50 bp. PAV's own filters (TRIM, COMPOUND) stay in FILTER. |
module/main.nf:141,171 |
The --svs input is passed straight to the merge and is not copied here.
2_Repeat_Filtering¶
One directory per contig of SVs.vcf, numbered by task index, so 1/ is not necessarily
chromosome 1. Each holds the RepeatMasker and ULTRA run on that contig's variants and the
intermediate tables the span filter was computed from. The whole directory is what --RM_dir
reads back in to skip Stage 2's masking step.
module/main.nf:638-652, main.nf:133-142
| File | Contents | Source |
|---|---|---|
genotypes_repmasked_filtered.vcf |
The contig's records that passed total_repeat_span > --repeat_span_cutoff, with the repeat annotation fields. The TSD search reads this file. |
module/main.nf:661 |
genotypes_repmasked.vcf.gz |
The same records before the span filter, so you can inspect a dropped variant. | module/main.nf:660 |
repeatmasker_dir/ |
RepeatMasker's own output on indels.fa, the FASTA of every variant's inserted or deleted sequence: indels.fa.out is the table annotate_vcf.R parses, and the RM_hit_IDs field points into its last column. |
bin/repmask_vcf.sh:37-39,47-48,75,77,108 |
ultra_out.bed |
ULTRA's tandem repeat intervals, one BED line per repeat, the variant ID as the sequence name. | bin/repmask_vcf.sh:92-98 |
ultra_out.span |
Non-redundant tandem-repeat bases per variant. | bin/repmask_vcf.sh:102-104 |
ultra_out.stats |
Variant ID, ULTRA_TR, ULTRA_TR_span. |
bin/repmask_vcf.sh:135-137 |
union.bp |
Bases covered by the union of TE hits and ULTRA intervals, per variant. | bin/repmask_vcf.sh:142-144 |
total_repeat_span.tsv |
Variant ID and total_repeat_span. |
bin/repmask_vcf.sh:145-147 |
combined.stats |
Variant ID, ULTRA_TR, ULTRA_TR_span, total_repeat_span, one row per variant with a hit in either tool. |
bin/repmask_vcf.sh:151-152 |
vcf_annotation.bak.txt |
The annotation table handed to bcftools annotate, one row per variant, before compression. |
bin/repmask_vcf.sh:156-162 |
3_TSD_search¶
Stage 2's deliverables. concat_repeatmask writes everything except the hervk_* files and the consolidated VCF, then,
under --human, hervk_annotate writes its own files into the same directory and overwrites
pangenome.human.vcf and pangenome.presence-absence_human.tsv with annotated versions.
module/main.nf:511-527, module/main.nf:301-321
| File | Contents | Source |
|---|---|---|
pangenome.vcf |
Every variant from every contig that passed the span filter, with REF and ALT re-read from the reference, TSD and polyA added, and the caller's FILTER kept. This file induces the pangenome graph, so nothing downstream modifies it. |
module/main.nf:577-592 |
pangenome.trusted.vcf |
The records of pangenome.vcf that pass the trusted-subset expression in Stage 2. Not written under --human. |
module/main.nf:16-25,597-601 |
pangenome.human.vcf |
--human only. The records that pass the MEI filter in Human MEIs, with the HERV-K classifier fields and locus flags added by hervk_annotate. make_graph and pangenie_index take pangenome.vcf, not this file, so the graph is the same under --human. hervk_reconcile reads this file to consolidate HERV-K loci in the genotyped VCF. |
module/main.nf:607, module/main.nf:312,384-388, main.nf:167,201,213,288 |
pangenome.human.consolidated.vcf |
--human only. pangenome.human.vcf with each HERV-K locus collapsed onto one multi-allelic record, genotypes taken from the assemblies. |
module/main.nf:401-407 |
pangenome.presence-absence.tsv, ..._trusted.tsv, ..._human.tsv |
Flat tables of the matching VCF; see Presence-absence TSVs. | module/main.nf:595,601,608 |
human_filter_summary.txt |
--human only. The exact bcftools view -i expression that was applied, record counts before and after, and the kept and dropped (matching_classes, repeat_ids) combinations with their counts. |
module/main.nf:610-625 |
TSD_summary.txt |
One row per variant searched, the best duplication found and whether it passed. Columns are in Target site duplications. | module/main.nf:575, bin/TSD_Match_v2.sh:146 |
TSD_full_log.txt |
The full search log: both fragments with a ruler, every candidate duplication and the chosen one, per variant. | module/main.nf:576, bin/TSD_Match_v2.sh:156 |
hervk_candidates.vcf |
--human only. The HERV-K candidates among the LTR/ERVK records of pangenome.vcf up to --hervk_max_svlen, classified, with their discovery genotypes. Wider than the human subset: this file has every member of a locus the --human filter split. |
module/main.nf:349-377 |
hervk_calls.tsv |
--human only. The per-candidate call table: id, position, SVLEN, class, allele states, evidence, k, j, reference units and period, reference state, lambda, nu, coverage, pmap, architecture, notes. |
bin/hervk_classify.py:478-480 |
hervk_loci.tsv |
--human only. One row per locus: id, interval, member records, how many are in the human subset and which are not, reference state, allele set, locus type, the three flags, per-record class, evidence and k, architecture, and flags such as LOCUS_SPLIT_BY_HUMAN_FILTER. |
bin/hervk_reconcile.py:127-131 |
hervk_arch.tsv |
--human only. The architecture read from the RepeatMasker fragments of each candidate: signature, permutation points, LTR family, termini, fragment count, LTR, internal and other bp, strand, internal gaps, architecture string. |
bin/hervk_arch.py:399-401 |
hervk_refstate.tsv |
--human only. What the masked reference window holds at each candidate: state, unit count and period, LTR and internal bp, distance, the reference element's interval, flags, architecture. |
bin/hervk_ref_state.py:382-384 |
hervk_polymorphism_summary.md |
--human only. Counts per class and per evidence type, the permutation points seen, and the unresolved candidates. |
bin/hervk_classify.py:649 |
hervk_discovery_consolidation_report.md |
--human only. Per locus, the alleles and counts after consolidating the assembly genotypes, and the loci that were skipped and why. |
bin/hervk_reconcile.py:1249 |
4_Genotyping¶
Stage 3's deliverables, present when --genotype is true (the default).
| File | Contents | Source |
|---|---|---|
pangenie_graph_variants.tsv |
PanGenie method only. One row per ALT allele of pangenome.vcf: record, CHROM, POS, pangenome_ID, allele, graph_ID, in_graph, note. graph_ID is what PanGenie writes to INFO/ID of the genotyped VCFs; in_graph=no marks alleles merge_vcfs.py left out of the graph. |
module/main.nf:715,724,727-730, bin/pangenie_graph_vcf.py:25 |
<sample>_genotyping.vcf.gz, .tbi |
PanGenie method only. Each read set's genotypes, split to one ALT per record so they match pangenome.vcf one for one. |
module/main.nf:737,744,748,766-769 |
GraffiTE.merged.genotypes.vcf.gz |
All read sets merged into one VCF, one column per sample, with every INFO field of pangenome.vcf copied onto the matching record by position and alleles. The headline genotyped file. No .tbi is published for it; run tabix -p vcf on it before random access. |
module/main.nf:882-904 |
GraffiTE.merged.genotypes.trusted.vcf.gz, .tbi |
Not written under --human. The records of the merged genotypes whose pangenome.vcf counterpart passes the trusted-subset expression, so every record has one repeat class. Subset by ID, because the expression tests FILTER and merge_VCFs does not transfer it. |
module/main.nf:931-961 |
GraffiTE.merged.genotypes.presence-absence_trusted.tsv |
Not written under --human. Flat table of the file above, same schema as the discovery TSVs; see Presence-absence TSVs. |
module/main.nf:931-961 |
genotyping_record_audit.tsv |
One row per ALT allele of pangenome.vcf, saying whether the graph genotyped it, whether the annotation reached it, and which stage dropped it (lost_at). Counts summarized in # lines at the top. |
module/main.nf:909-929 |
GraffiTE.merged.genotypes.human.vcf.gz, .tbi |
--human only. The human subset of the merged genotypes, HERV-K annotation carried over from pangenome.human.vcf, and each HERV-K locus consolidated onto one record. Graph genotypes at copy-number loci are withheld unless --hervk_mask_graph_gt_at_cnv false. |
module/main.nf:423,434-435,449-491 |
hervk_unconsolidated_records.vcf |
--human only. The member records each consolidated record was built from, as they were before consolidation. |
module/main.nf:436,487 |
hervk_reconciliation_report.md |
--human only. Per locus, alleles, AC, AN against 2N, resolved and partial samples; then the loci with ploidy exceeded, with AN below 2N, and skipped. |
bin/hervk_reconcile.py:1249 |
The per-sample vg call VCFs of the giraffe and graphaligner methods are not published; you can
pass them back with --vcfs only if you keep them from work/.
GraffiTE_graph¶
Giraffe and graphaligner methods only, unless --graph pointed at an existing directory. The
index/ directory is what --graph takes.
module/main.nf:773-806, main.nf:210-212
| File | Method | Contents | Source |
|---|---|---|---|
index/index.giraffe.gbz |
giraffe | The GBZ graph and indexes from vg autoindex. |
module/main.nf:790-792 |
index/index.gfa |
both | The graph in GFA. vg call reads it on the graphaligner path, and the methylation module indexes it. |
module/main.nf:791,799 |
index/index.pb |
both | The snarl decomposition vg call needs. |
module/main.nf:792,800 |
index/index.vg |
graphaligner | The vg construct graph the GFA was converted from. |
module/main.nf:798 |
GraffiTE_alignments¶
Giraffe and graphaligner methods only, unless you supplied them with --graph_alignments. One pair per
read set, which --graph_alignments takes back.
module/main.nf:827-835, main.nf:223-225
| File | Contents | Source |
|---|---|---|
<sample>.gaf.gz |
The alignments in GAF, reduced to the twelve standard columns plus the cs or cg tag, sorted by read name. |
module/main.nf:846,854, bin/subset_gaf.py |
<sample>.pack |
The vg pack coverage over the graph, alignments below --min_mapq excluded, which vg call genotypes from. |
module/main.nf:845,853 |
Presence-absence TSVs¶
pangenome.vcf, pangenome.trusted.vcf and pangenome.human.vcf each have a flat companion written by vcf_to_pa_tsv.py.
The first 21 columns are fixed, then one column per sample:
CHROM POS END ID SVTYPE SVLEN n_hits match_lengths repeat_ids matching_classes fragmts
RM_hit_strands RM_hit_IDs total_match_length total_match_span L1_5PINV ULTRA_TR
ULTRA_TR_span total_repeat_span TSD polyA <sample1> <sample2> ...
A missing INFO field is written as NA. The sample columns say whether the element is
present, whichever way the VCF record points:
SVTYPE |
genotype carries an ALT allele | all REF | missing |
|---|---|---|---|
INS |
1 |
0 |
NA |
DEL |
0 |
1 |
NA |
A 1 therefore always means the TE is in that sample. Under --human, the _human.tsv is
rewritten by hervk_annotate with the classifier's columns appended.
bin/vcf_to_pa_tsv.py:4-15,42-75, module/main.nf:379-381
What is not published¶
These stay in work/ and vanish with it:
- The alignments of Stage 1:
map_asmandmap_longreadsBAMs, and the.snffiles ofsniffles_sample_call. truvari_merge's intermediates: the stripped and merged inputs, the shards, the collapsed shards.- The per-contig split of
SVs.vcfand the TSD working files (indels.fa, the flank and end FASTAs, per-batch summaries). - The PanGenie index (
pangenie_index/) and the multi-allelic graph VCF it was built from. - The per-sample
vg callVCFs, the.gamalignments (deleted inside the task), and the FASTQ converted from a BAM in--genotype_with. merge_VCFs' sorted copy ofpangenome.vcfand its uncompressed merge.
nextflow run -with-report and -with-trace are the way to see resource use per task; nothing
in out/ records it.