pav3 3.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. pav3-3.0.0/CHANGELOG.md +410 -0
  2. pav3-3.0.0/CODE_OF_CONDUCT.md +109 -0
  3. pav3-3.0.0/CONTRIBUTING.md +146 -0
  4. pav3-3.0.0/LICENSE +21 -0
  5. pav3-3.0.0/MANIFEST.in +26 -0
  6. pav3-3.0.0/PKG-INFO +279 -0
  7. pav3-3.0.0/README.md +238 -0
  8. pav3-3.0.0/pyproject.toml +133 -0
  9. pav3-3.0.0/setup.cfg +4 -0
  10. pav3-3.0.0/src/pav3/__init__.py +70 -0
  11. pav3-3.0.0/src/pav3/__main__.py +6 -0
  12. pav3-3.0.0/src/pav3/align/__init__.py +17 -0
  13. pav3-3.0.0/src/pav3/align/features.py +571 -0
  14. pav3-3.0.0/src/pav3/align/lcmodel/__init__.py +30 -0
  15. pav3-3.0.0/src/pav3/align/lcmodel/_lcmodel.py +278 -0
  16. pav3-3.0.0/src/pav3/align/lcmodel/_lcmodel_logistic.py +105 -0
  17. pav3-3.0.0/src/pav3/align/lcmodel/_lcmodel_null.py +55 -0
  18. pav3-3.0.0/src/pav3/align/lcmodel/_util.py +247 -0
  19. pav3-3.0.0/src/pav3/align/lift.py +887 -0
  20. pav3-3.0.0/src/pav3/align/op.py +363 -0
  21. pav3-3.0.0/src/pav3/align/records.py +338 -0
  22. pav3-3.0.0/src/pav3/align/score.py +552 -0
  23. pav3-3.0.0/src/pav3/align/tables.py +1079 -0
  24. pav3-3.0.0/src/pav3/align/trim.py +1151 -0
  25. pav3-3.0.0/src/pav3/anno.py +82 -0
  26. pav3-3.0.0/src/pav3/call/__init__.py +18 -0
  27. pav3-3.0.0/src/pav3/call/expr.py +91 -0
  28. pav3-3.0.0/src/pav3/call/integrate.py +699 -0
  29. pav3-3.0.0/src/pav3/call/intra.py +551 -0
  30. pav3-3.0.0/src/pav3/call/util.py +70 -0
  31. pav3-3.0.0/src/pav3/cli/__init__.py +29 -0
  32. pav3-3.0.0/src/pav3/cli/_cli.py +137 -0
  33. pav3-3.0.0/src/pav3/cli/_common_opt.py +161 -0
  34. pav3-3.0.0/src/pav3/cli/_lift_cli.py +139 -0
  35. pav3-3.0.0/src/pav3/cli/_returncode.py +82 -0
  36. pav3-3.0.0/src/pav3/cli/_subcommand_batch.py +188 -0
  37. pav3-3.0.0/src/pav3/cli/_subcommand_call.py +197 -0
  38. pav3-3.0.0/src/pav3/cli/_subcommand_license.py +56 -0
  39. pav3-3.0.0/src/pav3/cli/_subcommand_lift.py +100 -0
  40. pav3-3.0.0/src/pav3/cli/_subcommand_maketable.py +106 -0
  41. pav3-3.0.0/src/pav3/cli/_subcommand_subseq.py +117 -0
  42. pav3-3.0.0/src/pav3/const.py +198 -0
  43. pav3-3.0.0/src/pav3/data/lcmodel/default/model.json +4 -0
  44. pav3-3.0.0/src/pav3/data/lcmodel/human_95_80/model.json +15 -0
  45. pav3-3.0.0/src/pav3/data/lcmodel/human_95_80/model_info.tar.gz +0 -0
  46. pav3-3.0.0/src/pav3/data/lcmodel/human_95_80/weights.npz +0 -0
  47. pav3-3.0.0/src/pav3/data/lcmodel/human_98_80/model.json +15 -0
  48. pav3-3.0.0/src/pav3/data/lcmodel/human_98_80/model_info.tar.gz +0 -0
  49. pav3-3.0.0/src/pav3/data/lcmodel/human_98_80/weights.npz +0 -0
  50. pav3-3.0.0/src/pav3/data/lcmodel/prim_90_50/model.json +15 -0
  51. pav3-3.0.0/src/pav3/data/lcmodel/prim_90_50/model_info.tar.gz +0 -0
  52. pav3-3.0.0/src/pav3/data/lcmodel/prim_90_50/weights.npz +0 -0
  53. pav3-3.0.0/src/pav3/data/lcmodel/primdiv_85_50/model.json +15 -0
  54. pav3-3.0.0/src/pav3/data/lcmodel/primdiv_85_50/model_info.tar.gz +0 -0
  55. pav3-3.0.0/src/pav3/data/lcmodel/primdiv_85_50/weights.npz +0 -0
  56. pav3-3.0.0/src/pav3/data/tracks/alignment_track_fields.tsv +27 -0
  57. pav3-3.0.0/src/pav3/data/tracks/variant_track_fields.tsv +41 -0
  58. pav3-3.0.0/src/pav3/data/workflow/Snakefile +82 -0
  59. pav3-3.0.0/src/pav3/data/workflow/profiles/pav_default/config.yaml +80 -0
  60. pav3-3.0.0/src/pav3/data/workflow/rules/align.smk +366 -0
  61. pav3-3.0.0/src/pav3/data/workflow/rules/call.smk +749 -0
  62. pav3-3.0.0/src/pav3/data/workflow/rules/data.smk +133 -0
  63. pav3-3.0.0/src/pav3/data/workflow/rules/pipeline.smk +26 -0
  64. pav3-3.0.0/src/pav3/data/workflow/rules/tracks.smk +215 -0
  65. pav3-3.0.0/src/pav3/dev/__init__.py +19 -0
  66. pav3-3.0.0/src/pav3/dev/imports.py +440 -0
  67. pav3-3.0.0/src/pav3/dev/inter.py +24 -0
  68. pav3-3.0.0/src/pav3/dev/path.py +48 -0
  69. pav3-3.0.0/src/pav3/dev/sm.py +95 -0
  70. pav3-3.0.0/src/pav3/dev/tables.py +37 -0
  71. pav3-3.0.0/src/pav3/errors.py +33 -0
  72. pav3-3.0.0/src/pav3/fig/__init__.py +13 -0
  73. pav3-3.0.0/src/pav3/fig/const.py +39 -0
  74. pav3-3.0.0/src/pav3/fig/density.py +154 -0
  75. pav3-3.0.0/src/pav3/fig/tracks.py +1116 -0
  76. pav3-3.0.0/src/pav3/fig/util.py +110 -0
  77. pav3-3.0.0/src/pav3/format.py +122 -0
  78. pav3-3.0.0/src/pav3/inv.py +1163 -0
  79. pav3-3.0.0/src/pav3/io.py +720 -0
  80. pav3-3.0.0/src/pav3/kde.py +220 -0
  81. pav3-3.0.0/src/pav3/lgsv/__init__.py +21 -0
  82. pav3-3.0.0/src/pav3/lgsv/call.py +360 -0
  83. pav3-3.0.0/src/pav3/lgsv/chain.py +244 -0
  84. pav3-3.0.0/src/pav3/lgsv/interval.py +697 -0
  85. pav3-3.0.0/src/pav3/lgsv/io.py +273 -0
  86. pav3-3.0.0/src/pav3/lgsv/region_kde.py +199 -0
  87. pav3-3.0.0/src/pav3/lgsv/resources.py +152 -0
  88. pav3-3.0.0/src/pav3/lgsv/struct.py +483 -0
  89. pav3-3.0.0/src/pav3/lgsv/variant.py +1276 -0
  90. pav3-3.0.0/src/pav3/lift/__init__.py +75 -0
  91. pav3-3.0.0/src/pav3/lift/errors.py +35 -0
  92. pav3-3.0.0/src/pav3/lift/output.py +516 -0
  93. pav3-3.0.0/src/pav3/lift/run.py +332 -0
  94. pav3-3.0.0/src/pav3/lift/source.py +422 -0
  95. pav3-3.0.0/src/pav3/lift/source_table.py +278 -0
  96. pav3-3.0.0/src/pav3/maketable.py +450 -0
  97. pav3-3.0.0/src/pav3/params.py +768 -0
  98. pav3-3.0.0/src/pav3/pipeline.py +1214 -0
  99. pav3-3.0.0/src/pav3/region.py +416 -0
  100. pav3-3.0.0/src/pav3/schema.py +301 -0
  101. pav3-3.0.0/src/pav3/seq.py +609 -0
  102. pav3-3.0.0/src/pav3/util.py +178 -0
  103. pav3-3.0.0/src/pav3/vcf.py +1850 -0
  104. pav3-3.0.0/src/pav3/workflow/__init__.py +11 -0
  105. pav3-3.0.0/src/pav3/workflow/call.py +649 -0
  106. pav3-3.0.0/src/pav3/workflow/perf.py +1017 -0
  107. pav3-3.0.0/src/pav3/workflow/resource.py +523 -0
  108. pav3-3.0.0/src/pav3.egg-info/PKG-INFO +279 -0
  109. pav3-3.0.0/src/pav3.egg-info/SOURCES.txt +136 -0
  110. pav3-3.0.0/src/pav3.egg-info/dependency_links.txt +1 -0
  111. pav3-3.0.0/src/pav3.egg-info/entry_points.txt +2 -0
  112. pav3-3.0.0/src/pav3.egg-info/requires.txt +17 -0
  113. pav3-3.0.0/src/pav3.egg-info/top_level.txt +1 -0
  114. pav3-3.0.0/tests/TESTING_TODO.md +1 -0
  115. pav3-3.0.0/tests/align/.gitkeep +0 -0
  116. pav3-3.0.0/tests/align/test_score.py +55 -0
  117. pav3-3.0.0/tests/align/test_tables.py +118 -0
  118. pav3-3.0.0/tests/align/test_trim.py +167 -0
  119. pav3-3.0.0/tests/call/.gitkeep +0 -0
  120. pav3-3.0.0/tests/call/test_derived_seq.py +174 -0
  121. pav3-3.0.0/tests/call/test_ins_derived.py +133 -0
  122. pav3-3.0.0/tests/cli/.gitkeep +0 -0
  123. pav3-3.0.0/tests/cli/test_maketable.py +502 -0
  124. pav3-3.0.0/tests/conftest.py +76 -0
  125. pav3-3.0.0/tests/lgsv/.gitkeep +0 -0
  126. pav3-3.0.0/tests/lgsv/test_off_target.py +175 -0
  127. pav3-3.0.0/tests/lgsv/test_query_region.py +292 -0
  128. pav3-3.0.0/tests/lift/conftest.py +53 -0
  129. pav3-3.0.0/tests/lift/test_lift.py +197 -0
  130. pav3-3.0.0/tests/lift/test_subseq.py +201 -0
  131. pav3-3.0.0/tests/test_anno.py +60 -0
  132. pav3-3.0.0/tests/test_params.py +72 -0
  133. pav3-3.0.0/tests/test_pipeline_config.py +137 -0
  134. pav3-3.0.0/tests/test_vcf_cpx.py +206 -0
  135. pav3-3.0.0/tests/test_vcf_fields.py +254 -0
  136. pav3-3.0.0/tests/test_vcf_multiallelic.py +232 -0
  137. pav3-3.0.0/tests/workflow/test_perf.py +173 -0
  138. pav3-3.0.0/tox.toml +54 -0
@@ -0,0 +1,410 @@
1
+ # Changelog
2
+
3
+ <!--
4
+ Style guide:
5
+ https://common-changelog.org/
6
+ -->
7
+
8
+ <!-- TEMPLATE
9
+ ## [x.y.z] - YYYY-MM-DD
10
+
11
+ ### Changed
12
+ -
13
+
14
+ ### Added
15
+ -
16
+
17
+ ### Removed
18
+ -
19
+
20
+ ### Fixed
21
+ -
22
+
23
+ -->
24
+
25
+ ## 3.0.0 - 2026-10-28
26
+
27
+ _First stable release of PAV 3, listing changes since the last prerelease (3.0.0.dev26)._
28
+
29
+ ### Changed
30
+ - **Breaking:** Low-confidence alignment filtering (`LCALIGN`) is off by default (config parameter `lc_model`
31
+ defaults to `none`). It removed correct calls in highly diverged regions such as HLA class II. Set `lc_model` to
32
+ `default` for the previous behavior.
33
+ - **Breaking:** Alignment records with MAPQ below 20 are filtered by default (new config parameter `min_mapq`).
34
+ Their variants are filtered with `MAPQ`, and their regions are not callable. Low-MAPQ fragments in satellites and
35
+ repeats produced false calls that broke haplotype reconstruction from the VCF.
36
+ - **Breaking:** Haplotype merge defaults (`pav3.const.DEFAULT_MERGE_PARAMS`) for `insdel` and `cpx` merge only
37
+ matching alleles: same position and end, size and sequence identity of at least 0.998 for insertions and
38
+ deletions, and 0.98 for complex variants (with segment overlap 0.8). The previous population-style tolerances
39
+ merged different alleles from the two haplotypes into one homozygous record and moved variants up to 200 bp to the
40
+ other haplotype's position. Override with the new `merge_params` config parameter.
41
+ - **Breaking:** VCF records at the same position are combined into multi-allelic records when they have the same
42
+ filter and no haplotype carries more than one of them, so different alleles on two haplotypes are written as one
43
+ record (e.g. `1|2`) instead of two overlapping records (`1|0` and `0|1`).
44
+ - **Breaking:** Complex variants are written as sequence-resolved REF and ALT alleles by default. The record
45
+ replaces the reference bases skipped by the variant with the variant sequence, so applying it to the reference
46
+ (e.g. `bcftools consensus`) reconstructs the haplotype. Set `vcf_cpx_symbolic` to write `<CPX>` alleles.
47
+ - **Breaking:** VCF `INFO/SVLEN` is always positive. Deletions are no longer negated.
48
+ - **Breaking:** VCF `INFO/SVLEN` is written only for symbolic ALT alleles. VCF defines it for symbolic structural
49
+ variant alleles and directs writers to use the missing value for all others, where REF and ALT give the length.
50
+ Multi-allelic records combining an SNV with an indel carried `SVLEN=.,N`, which crashed Truvari, and htslib 1.22
51
+ sized sequence-resolved records by SVLEN.
52
+ - **Breaking:** VCF `INFO/END` and `INFO/SEQ` are written only for symbolic ALT alleles, where REF and ALT do not
53
+ carry the span or the sequence. `SEQ` is upper-cased to match REF and ALT, and is not written for derived
54
+ variants, where it does not describe the alternate allele.
55
+ - **Breaking:** VCF INFO values no longer contain literal commas, which VCF reserves as the value delimiter. `DUP`
56
+ separates regions with `/`, and `CPX_REF_TRACE` and `CPX_QRY_TRACE` drop thousands separators. The `trace_ref`
57
+ and `trace_qry` variant table columns are unchanged.
58
+ - **Breaking:** Tandem and inverted duplications are written as `<DUP:TANDEM>` and `<DUP:INVDUP>` rather than
59
+ `INFO/SUBTYPE`.
60
+ - **Breaking:** Replaced VCF `INFO/HOMREF` and `INFO/HOMQRY` with the reserved `INFO/HOMLEN`, summing upstream and
61
+ downstream homology from reference breakpoints for `DEL` and `DUP` and query breakpoints for `INS` and `CPX`.
62
+ - **Breaking:** Workflow targets are renamed for the output they build: `pav_all` to `vcf` (still the default),
63
+ `align_all` to `align`, `call_tables_all` to `call_tables`, `call_tables_hap_all` to `call_tables_hap`,
64
+ `tracks_all` to `tracks`, and `tracks_align_all` to `tracks_align`. The rules previously named `call_tables`,
65
+ `call_tables_callable`, and `tracks_align` are renamed `call_merge_haps`, `call_callable`, and
66
+ `tracks_align_trim`, so Snakemake profiles setting resources for them need the new names.
67
+ - **Breaking:** The assembly table is the first of `assemblies.csv`, `assemblies.xlsx`, and `assemblies.tsv` found
68
+ in the run directory (previously `assemblies.tsv`, then `assemblies.xlsx`). A run directory with more than one of
69
+ these files may read a different table.
70
+ - Tighter compliance with VCF 4.5.
71
+ - Complex variant tables have new columns `seq_ref_pos` and `seq_ref_end`, the reference region the variant
72
+ sequence replaces.
73
+ - VCF INFO headers declare an accurate `Number`. `END` is `Number=1` and `SVLEN` is `Number=A`, matching the
74
+ reserved keys; all others are `Number=A`. All were previously `Number=.`.
75
+ - Contig names embedded in VCF INFO values (`QUERY`, `DUP`, and the complex variant traces) are percent-encoded
76
+ where they contain `;`, `=`, `,`, `%`, a tab, or a line break, as VCF requires.
77
+ - VCF records are sorted in reference order, the order of the `##contig` header lines, rather than by chromosome
78
+ name (`chr1`, `chr10`, `chr2`). Tools validating records against the sequence dictionary (e.g. Picard) reject
79
+ other orders.
80
+ - VCF REF and ALT reduce IUPAC ambiguity codes to the base that is first alphabetically (e.g. `R` to `A`), as VCF
81
+ requires.
82
+ - The VCF header writes `##fileDate` instead of `##filedate`, and `##reference` as the reference file name instead
83
+ of a `file://` URI, which read the file name as a host name.
84
+ - Variant tracks report `.` for strand. The strand column was never set, and a variant carries no orientation of
85
+ the reference feature it is drawn on.
86
+ - The multi-allelic record summary is printed only with `verbose`, and its statistics are not computed otherwise.
87
+ - `pav3 --help` directs users to `batch` and lists `call` as deprecated.
88
+ - The README cites the PAV 3 preprint (https://doi.org/10.1101/2024.12.19.629504), is reorganized into install,
89
+ configuration, run, and output sections, and documents the workflow targets and the other `pav3` subcommands.
90
+
91
+ ### Added
92
+ - YAML configuration file `pav.yaml` (or `pav.yml`), accepting the same parameters as `pav.json`. PAV reads
93
+ `pav.json` only if no YAML configuration is found, and warns and uses the YAML configuration if both are present.
94
+ - Config parameters `min_mapq`, `merge_params`, and `vcf_cpx_symbolic`.
95
+ - VCF `INFO/SVCLAIM` is written as `J` for symbolic `DEL` and `DUP` alleles, which VCF requires. PAV calls these
96
+ from non-reference adjacencies rather than from a measure of DNA abundance.
97
+ - Duplications derived from insertions placing a copy of a reference region. A tandem-duplication insertion
98
+ derives a tandem duplication.
99
+ - Insertions over deleted reference bases and deletions with inserted bases now emit both variants instead of the
100
+ larger one alone. The smaller component was previously discarded, leaving an allele that reported no inserted
101
+ sequence.
102
+ - Documentation page describing the VCF output.
103
+ - Config parameter `perf_log` logs the CPU and memory usage of each rule from input assemblies to the VCF to
104
+ `log/perf/{asm_name}/{rule}_{wildcards}.parquet` (e.g. `log/perf/HG00171/call_intra_snv_insdel_h1.parquet`).
105
+ `true` takes a snapshot every 30 seconds, a positive integer sets the seconds between snapshots, and `false` or `0`
106
+ (default) disables it. The table is rewritten after every snapshot, so a job killed for exceeding its memory keeps
107
+ its samples. Adjunct rules (tracks, alignment depth) are not logged.
108
+ - Runtime dependencies PyYAML, for `pav.yaml`, and psutil, for `perf_log`.
109
+ - Workflow targets `callable`, the callable regions of each haplotype, and `tracks_var`, the variant tracks of each
110
+ haplotype.
111
+
112
+ ### Removed
113
+ - **Breaking:** Snakemake `benchmark` directives (`log/benchmark/`), replaced by `perf_log`.
114
+ - **Breaking:** VCF `INFO/SVTYPE`. VCF 4.5 deprecates it as redundant with ALT, which carries the type in the
115
+ symbolic allele or in the REF and ALT lengths.
116
+ - The `##FILTER=<ID=PASS>` header. VCF defines PASS implicitly.
117
+ - Workflow target `align_export_all`. It always failed in PAV 3, which does not yet implement the alignment export
118
+ rule it requires.
119
+
120
+ ### Fixed
121
+ - Alignment trimming truncated the passing alignment instead of the filtered one where a passing and a filtered
122
+ alignment overlapped (the filtered flag was inverted).
123
+ - Alignment trimming applied the left-aligning tie-break to alignments in opposite orientations instead of
124
+ alignments in the same orientation.
125
+ - Alignment trimming removed a passing alignment contained in a higher-scoring filtered alignment. The filtered
126
+ alignment is now removed.
127
+ - The haplotype merge dropped one of two variants with the same position, end, and length on one haplotype (e.g. a
128
+ 1 bp insertion and deletion at one site). Duplicates are now identified with the variant type and sequence.
129
+ - Symbolic VCF records (INV, DUP) had the first base of the variant as `REF` instead of the base at `POS`.
130
+ - VCF FORMAT keys and sample values were separated by `;` instead of `:`.
131
+ - An unknown `lc_model` name is an error instead of silently disabling LC filtering (path-like names) or raising an
132
+ unrelated import error (plain names).
133
+ - Variant IDs were duplicated when a variant merged into both the passing and non-passing haplotype merges. IDs
134
+ are now versioned across both merges rather than within each.
135
+ - Deletions derived from complex variants were written with an empty VCF `REF`.
136
+ - Insertions at a tandem duplication were written with `REF` matching `ALT`, encoding no variant.
137
+ - Writing a VCF now fails, naming the variants, if a record has an empty `REF`, an empty `ALT`, or a `REF`
138
+ matching its `ALT`.
139
+ - Query homology was read from the reference homology field.
140
+ - VCF `INFO/DUP` was dropped for variants duplicating an even number of regions.
141
+ - `DUP` and `CPX` records carried no `INFO/END`, so they indexed as 1 bp and could be missed by region queries.
142
+ - Large deletions reported an empty query region, which wrote `INFO/QUERY` as an inverted range. Deletions now
143
+ report a 1 bp query region at the breakpoint, matching intra-alignment deletions. Query homology is still
144
+ measured over the query region between the anchors.
145
+ - Complex variants reported the query region between the untrimmed anchors, which excludes bases duplicated at
146
+ the variant site, leaving `INFO/QUERY` shorter than `INFO/SVLEN`. They now report the region from the
147
+ query-reference-trimmed alignments, as insertions do, when that region spans the duplicated bases.
148
+ - Insertions and complex variants took the duplicated bases at the variant site from the query region of the
149
+ query-reference-trimmed alignments without checking that reference trimming resolved the overlap between the
150
+ anchors. Where it did not, a tandem duplication was written with no sequence at all. The duplicated bases are
151
+ again read from the reference in that case, and the variant reports a 1 bp query region rather than an empty
152
+ one.
153
+ - Perfect homology was reported as zero when it ran to the end of the compared flank, understating `INFO/HOMLEN`
154
+ for short variants in low-complexity sequence.
155
+ - The assertion comparing the query-trimmed and query-reference-trimmed reference regions of an alignment
156
+ interval joined its conditions with `or`, so it passed whenever any one of them held.
157
+ - INV/DUP/CPX tracks failed to build with `Trailing characters parsing integer in field 7` once the duplication
158
+ callset carried duplications derived from insertions. Duplications are the only records without their own
159
+ thick-line coordinates, and the missing values were filled with the literal text `pos` and `end` instead of the
160
+ variant position, which `bedToBigBed` rejected.
161
+ - Track columns typed as numbers in the AutoSQL table are now checked before the BED is written, naming the
162
+ column rather than failing inside `bedToBigBed`. UCSC itemRgb columns, which are declared `uint` but hold
163
+ `R,G,B` strings, are exempt.
164
+ - Duplication filters were assigned to the wrong records. The duplication table sorted its filter column on its
165
+ own rather than the codes within each record, moving filters such as `LCALIGN` and `MAPQ` between duplications.
166
+ - Duplication IDs were not unique. Derived duplications of the same reference region (e.g. a region copied twice by
167
+ one complex variant) shared one ID, because the duplication table was written without the ID versioning applied
168
+ to the other tables. Repeated IDs now take a version suffix (`.1`, `.2`), and passing variants keep the
169
+ unversioned ID.
170
+ - Variant IDs changed after other records were linked to them. IDs were versioned as each call source was
171
+ integrated, when the `derived`, `discord`, and `inner` columns and the complex variant segment and reference trace
172
+ tables link to them, then versioned again when the table was written, which reassigned versions among variants
173
+ sharing an ID. IDs are now versioned once. Variants derived from other variants are versioned last, so they never
174
+ take an ID another record links to. A passing variant takes a versioned ID when a variant integrated before it has
175
+ the same ID (e.g. an alignment-truncating deletion filtered by `LCALIGN` keeps its ID over a passing deletion at
176
+ the same site).
177
+ - Complex variants whose sequence matches the reference bases they replace were written with REF equal to ALT when
178
+ the reference was soft-masked, because the check compared case. They are left out of the VCF with a warning.
179
+ - VCF `INFO/SUBTYPE`, `INFO/CPX_REF_TRACE`, and `INFO/CPX_QRY_TRACE` were written with an empty value for complex
180
+ variants with an empty reference or query trace.
181
+ - VCF records were written with CSV quoting: an empty INFO column was written as `""`, and a value containing a
182
+ quote was wrapped in quotes. An empty INFO column is now `.`.
183
+ - With `vcf_haplotypes`, variants carried only by haplotypes left out of the VCF were written with no haplotype
184
+ carrying the ALT allele (e.g. `0|0`).
185
+ - `pav3 license` without a format argument failed instead of printing the brief license.
186
+
187
+ ## 3.0.0.dev26 - 2026-08-28
188
+
189
+ ### Changed
190
+ - Version bump to mitigate version conflicts with built containers with a stale version number.
191
+
192
+ ## 3.0.0.dev25 - 2026-08-28
193
+
194
+ ### Added
195
+ - `lift`, `subseq`, and `maketable` subcommands.
196
+
197
+ ### Changed
198
+ - Repository moved to BeckLaboratory/pav3 and images deployed to GHCR.
199
+ - Updated Agglovar version and merge fields.
200
+ - Documentation fixes for Read the Docs and a callout about container permissions.
201
+
202
+ ### Fixed
203
+ - `pav3.workflow.link_fasta()` returned an empty list for uncompressed FASTA files.
204
+
205
+ ## 3.0.0.dev23 - 2026-06-18
206
+
207
+ ### Added
208
+ - Docker and Apptainer build processes.
209
+
210
+ ### Changed
211
+ - Routines locating PAV resources accept a path other than the working directory.
212
+ - Updated Polars and other dependency versions.
213
+
214
+ ### Fixed
215
+ - Workaround for a Polars 1.41 streaming bug.
216
+
217
+ ## 3.0.0.dev22 - 2026-05-06
218
+
219
+ ### Added
220
+ - Functions converting alignment operations to sequence operations (`M` to `=`/`X`).
221
+
222
+ ### Changed
223
+ - VCF writing supports multiple samples.
224
+ - Schema harmonized with Agglovar.
225
+
226
+ ### Fixed
227
+ - Reading `M` alignment operations from SAM files.
228
+ - Intra-alignment variant performance.
229
+ - `from_definition` typo.
230
+
231
+ ## 3.0.0.dev21 - 2026-03-30
232
+
233
+ ### Fixed
234
+ - Off-by-one error lifting regions.
235
+ - Float32/Float64 mismatch with Polars 1.38 and newer.
236
+ - Snakemake `namedlist` import location varies by version.
237
+
238
+ ## 3.0.0.dev20 - 2026-03-23
239
+
240
+ ### Changed
241
+ - Genotype procedure supports multi-sample merges.
242
+ - Removed Snakemake from `rules/align.smk`.
243
+
244
+ ### Fixed
245
+ - VCF irregularities.
246
+
247
+ ## 3.0.0.dev19 - 2026-03-19
248
+
249
+ ### Changed
250
+ - Tuned inter-alignment variant models for robustness.
251
+ - Score model accepts n template switches.
252
+ - `integrate_sources` moved from Snakemake into a library routine.
253
+
254
+ ### Fixed
255
+ - Inter-alignment variant discovery and scoring model bugs.
256
+ - Interval reported the absolute value for `ref_len`, which is negative for a tandem duplication at a breakpoint.
257
+ - Float32/Float64 type mismatch between NumPy and Polars.
258
+
259
+ ## 3.0.0.dev18 - 2026-02-18
260
+
261
+ ### Fixed
262
+ - Complex variant structures, including duplications at a breakpoint.
263
+ - VCF failures with empty variant tables.
264
+ - Dependabot vulnerability alert.
265
+
266
+ ## 3.0.0.dev17 - 2026-02-10
267
+
268
+ ### Fixed
269
+ - Missing inversion schema for intra-alignment inversions with no variants.
270
+
271
+ ## 3.0.0.dev16 - 2026-02-09
272
+
273
+ ### Changed
274
+ - Schema cast sorts columns by schema order.
275
+
276
+ ### Fixed
277
+ - Intra-alignment inversion discovery.
278
+ - Dependabot alerts (urllib3, filelock, virtualenv).
279
+
280
+ ## 3.0.0.dev15 - 2026-02-08
281
+
282
+ ### Added
283
+ - Variant and alignment tracks.
284
+ - Tools for interactive development and troubleshooting.
285
+ - Configuration file flexibility.
286
+
287
+ ### Changed
288
+ - Reworked the workflow framework.
289
+ - Alignment lift framework rewritten for efficiency.
290
+
291
+ ### Fixed
292
+ - Inversion detection, including false negatives around alignment breaks with no aligned inverted segment.
293
+ - Intra-alignment variant calling and coordinate lifts.
294
+ - Variant sort order at intermediate stages.
295
+ - Variant table schema mismatches.
296
+
297
+ ## 3.0.0.dev14 - 2025-12-08
298
+
299
+ ### Changed
300
+ - Semicolons are converted when writing VCFs.
301
+
302
+ ## 3.0.0.dev13 - 2025-12-05
303
+
304
+ ### Added
305
+ - VCF writer.
306
+
307
+ ### Changed
308
+ - `call` subcommand renamed to `batch`.
309
+ - Configuration file renamed from `config.json` to `pav.json`, with a warning for the old name.
310
+
311
+ ## 3.0.0.dev12 - 2025-11-27
312
+
313
+ ### Fixed
314
+ - Inversion flag bugs.
315
+ - Errors from PAV and Agglovar versions getting out of sync.
316
+
317
+ ## 3.0.0.dev11 - 2025-11-26
318
+
319
+ ### Changed
320
+ - Updated Agglovar version.
321
+
322
+ ## 3.0.0.dev10 - 2025-11-26
323
+
324
+ ### Added
325
+ - Complex variants in the haplotype merge (`results/{asm_name}/call/call_cpx.parquet`).
326
+
327
+ ### Changed
328
+ - Replaced the `polars-u64-idx` dependency with `polars` 1.35.2 or newer.
329
+
330
+ ## 3.0.0.dev9 - 2025-11-20
331
+
332
+ ### Added
333
+ - Haplotype merge combining the per-haplotype call tables of an assembly into
334
+ `results/{asm_name}/call/call_{vartype}.parquet` for INS/DEL, INV, and SNV, merging passing and filtered variants
335
+ separately. Merge parameters are in `pav3.const.DEFAULT_MERGE_PARAMS`.
336
+
337
+ ### Changed
338
+ - Large insertion and tandem duplication tables replace the `ref_templ` column with `dup`, the duplicated reference
339
+ loci. Complex variant tables add `seg`, the aligned segments between the anchors, and `dup`.
340
+ - Large variants are sorted by reference position before they are resolved, speeding sequence and homology lookups.
341
+ - Updated Agglovar version.
342
+
343
+ ## 3.0.0.dev8 - 2025-11-06
344
+
345
+ ### Changed
346
+ - Variant ID expressions moved to Agglovar.
347
+
348
+ ### Fixed
349
+ - QC routines causing inversion loss.
350
+ - Build not finding PAV files.
351
+
352
+ ## 3.0.0.dev6, 3.0.0.dev7 - 2025-10-21
353
+
354
+ ### Fixed
355
+ - Removed a line raising `NotImplementedError`.
356
+
357
+ ## 3.0.0.dev5 - 2025-10-21
358
+
359
+ ### Changed
360
+ - Haplotype variant tables relocated.
361
+
362
+ ### Fixed
363
+ - Variant table handling.
364
+
365
+ ## 3.0.0.dev4 - 2025-10-08
366
+
367
+ ### Added
368
+ - Command-line interface.
369
+ - `CONTRIBUTING.md`.
370
+
371
+ ### Changed
372
+ - Package data relocated and packaging updated for upload.
373
+
374
+ ## 3.0.0.dev3 - 2025-10-06
375
+
376
+ ### Added
377
+ - PAV 3 complete through haplotype call tables (rule `call_tables_hap`).
378
+
379
+ ## 3.0.0.dev2 - 2025-06-23
380
+
381
+ ### Added
382
+ - Low-confidence alignment prediction model for filtering alignment records.
383
+ - QC for large SV calling and tracks.
384
+
385
+ ### Changed
386
+ - Alignment trimming performance for deep overlapping alignment records.
387
+ - Reworked feature handling and alignment operation handling.
388
+ - CIGAR and non-large inversion calls integrated with PAV 3.
389
+ - I/O avoids pysam, which breaks on large operation lengths.
390
+ - Renamed `.snakemake` files to `.smk`.
391
+
392
+ ### Removed
393
+ - `keep-going` from the default Snakemake profiles.
394
+
395
+ ### Fixed
396
+ - Large variant calls and alignment filter aliases.
397
+
398
+ ## 3.0.0.dev1 - 2024-12-22
399
+
400
+ ### Changed
401
+ - Altered PAV project structure including library.
402
+ - Replaced Pandas with Polars.
403
+ - Increased performance with Polars and vectorization.
404
+ - Repository transitioned to the Beck laboratory.
405
+
406
+ ### Added
407
+ - Variant intersects are handled by agglovar.
408
+
409
+ ### Removed
410
+ - SVPop was replaced by agglovar and some functions were moved into PAV.
@@ -0,0 +1,109 @@
1
+
2
+ # Contributor Covenant 3.0 Code of Conduct
3
+
4
+ ## Our Pledge
5
+
6
+ We pledge to make our community welcoming, safe, and equitable for all.
7
+
8
+ We are committed to fostering an environment that respects and promotes the dignity, rights, and contributions of all
9
+ individuals, regardless of characteristics including race, ethnicity, caste, color, age, physical characteristics,
10
+ neurodiversity, disability, sex or gender, gender identity or expression, sexual orientation, language, philosophy or
11
+ religion, national or social origin, socio-economic position, level of education, or other status. The same privileges
12
+ of participation are extended to everyone who participates in good faith and in accordance with this Covenant.
13
+
14
+ ## Encouraged Behaviors
15
+
16
+ While acknowledging differences in social norms, we all strive to meet our community's expectations for positive
17
+ behavior. We also understand that our words and actions may be interpreted differently than we intend based on culture,
18
+ background, or native language.
19
+
20
+ With these considerations in mind, we agree to behave mindfully toward each other and act in ways that center our shared
21
+ values, including:
22
+
23
+ 1. Respecting the **purpose of our community**, our activities, and our ways of gathering.
24
+ 2. Engaging **kindly and honestly** with others.
25
+ 3. Respecting **different viewpoints** and experiences.
26
+ 4. **Taking responsibility** for our actions and contributions.
27
+ 5. Gracefully giving and accepting **constructive feedback**.
28
+ 6. Committing to **repairing harm** when it occurs.
29
+ 7. Behaving in other ways that promote and sustain the **well-being of our community**.
30
+
31
+
32
+ ## Restricted Behaviors
33
+
34
+ We agree to restrict the following behaviors in our community. Instances, threats, and promotion of these behaviors are
35
+ violations of this Code of Conduct.
36
+
37
+ 1. **Harassment.** Violating explicitly expressed boundaries or engaging in unnecessary personal attention after any
38
+ clear request to stop.
39
+ 2. **Character attacks.** Making insulting, demeaning, or pejorative comments directed at a community member or group of
40
+ people.
41
+ 3. **Stereotyping or discrimination.** Characterizing anyone’s personality or behavior on the basis of immutable
42
+ identities or traits.
43
+ 4. **Sexualization.** Behaving in a way that would generally be considered inappropriately intimate in the context or
44
+ purpose of the community.
45
+ 5. **Violating confidentiality**. Sharing or acting on someone's personal or private information without their
46
+ permission.
47
+ 6. **Endangerment.** Causing, encouraging, or threatening violence or other harm toward any person or group.
48
+ 7. Behaving in other ways that **threaten the well-being** of our community.
49
+
50
+ ### Other Restrictions
51
+
52
+ 1. **Misleading identity.** Impersonating someone else for any reason, or pretending to be someone else to evade
53
+ enforcement actions.
54
+ 2. **Failing to credit sources.** Not properly crediting the sources of content you contribute.
55
+ 3. **Promotional materials**. Sharing marketing or other commercial content in a way that is outside the norms of the
56
+ community.
57
+ 4. **Irresponsible communication.** Failing to responsibly present content which includes, links or describes any other
58
+ restricted behaviors.
59
+
60
+
61
+ ## Reporting an Issue
62
+
63
+ Tensions can occur between community members even when they are trying their best to collaborate. Not every conflict
64
+ represents a code of conduct violation, and this Code of Conduct reinforces encouraged behaviors and norms that can help
65
+ avoid conflicts and minimize harm.
66
+
67
+ When an incident does occur, it is important to report it promptly. **Please report violations to
68
+ Peter Audano (peter.audano@jax.org)**. Alternatively, you may consult with Christine Beck (christine.beck@jax.org) or
69
+ The Jackson Laboratory HR department (hrhelp@jax.org) for guidance.
70
+
71
+ Community Moderators take reports of violations seriously and will make every effort to respond in a timely manner. They
72
+ will investigate all reports of code of conduct violations, reviewing messages, logs, and recordings, or interviewing
73
+ witnesses and other participants. Community Moderators will keep investigation and enforcement actions as transparent as
74
+ possible while prioritizing safety and confidentiality. In order to honor these values, enforcement actions are carried
75
+ out in private with the involved parties, but communicating to the whole community may be part of a mutually agreed upon
76
+ resolution.
77
+
78
+
79
+ ## Addressing Violations
80
+
81
+ ****
82
+
83
+ Complaints will be reviewed confidentially and appropriate responses will be taken including suspension and
84
+ permanent bans from the project as necessary. We reserve the right to remove any content contributed by a violator
85
+ including code and discussions.
86
+
87
+ ## Scope
88
+
89
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing
90
+ the community in public or other spaces. Examples of representing our community include using an official email address,
91
+ posting via an official social media account, or acting as an appointed representative at an online or offline event.
92
+
93
+
94
+ ## Attribution
95
+
96
+ This Code of Conduct is adapted from the Contributor Covenant, version 3.0, permanently available at
97
+ [https://www.contributor-covenant.org/version/3/0/](https://www.contributor-covenant.org/version/3/0/).
98
+
99
+ Contributor Covenant is stewarded by the Organization for Ethical Source and licensed under CC BY-SA 4.0. To view a copy
100
+ of this license, visit [https://creativecommons.org/licenses/by-sa/4.0/](https://creativecommons.org/licenses/by-sa/4.0/)
101
+
102
+ For answers to common questions about Contributor Covenant, see the FAQ at
103
+ [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are provided at
104
+ [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations). Additional enforcement and community guideline resources can
105
+ be found at [https://www.contributor-covenant.org/resources](https://www.contributor-covenant.org/resources). The enforcement ladder was inspired by the work of
106
+ [Mozilla’s code of conduct team](https://github.com/mozilla/inclusion).
107
+
108
+ Some modifications to the original code of conduct were made using the
109
+ [Atom project Code of Conduct](https://github.com/atom/atom/blob/master/CODE_OF_CONDUCT.md) as a guide.
@@ -0,0 +1,146 @@
1
+ # Contributing
2
+
3
+ Thank you for your interest in contributing! We appreciate your help including bugs reports and implementing new
4
+ features.
5
+
6
+ ## Bugs, questions, and feature requests
7
+
8
+ The project's [GitHub issues page](https://github.com/BeckLaboratory/pav3/issues) may be used to ask questions,
9
+ report bugs, and request features.
10
+
11
+ Please search for related issues before opening a new one. If you find a relevant open issue, you may monitor it for
12
+ updates (look for the "Subscribe" button on the issue's page). Add comments to existing issues as needed. Reference
13
+ related issues in your new issue or comments. Comments on closed issues may be missed.
14
+
15
+ Please make sure you understand the [Code of Conduct](CODE_OF_CONDUCT.md) before opening or commenting on issues.
16
+
17
+ ### Reporting bugs
18
+
19
+ When reporting a bug, please provide the following information:
20
+ * A clear and concise description of the bug.
21
+ * The version of the project you are using.
22
+ * The steps to reproduce the bug.
23
+ * Any error messages you receive.
24
+ * Platform information (e.g. OS, Python version, etc).
25
+
26
+ Please include as many details as possible in your report, it helps us resolve the issue faster. Please also take a
27
+ moment to re-read your report to ensure it is clear and concise. When in doubt, more detail is generally better.
28
+
29
+ ### Feature requests
30
+
31
+ We welcome ideas for improving on the project. Please provide a clear description of the feature you would like and
32
+ examples about why it is useful. Please help us understand the full context of your feature request so that we can
33
+ make an informed decision and properly prioritize the request.
34
+
35
+ ## Contributing
36
+
37
+ Bugs are often fixed by the maintainers, but please feel free to look for issues and submit pull requests. Pick any
38
+ issue that is accepted and not assigned to another contributor. You may comment on the issue to express your interest
39
+ in working on it.
40
+
41
+ If you are a first time contributor, we will do our best to mark issues as a "good first issue".
42
+
43
+ If you would like to take on an issue, please comment on the issue to let others know. You may use the issue to discuss
44
+ possible solutions.
45
+
46
+ Please make sure you understand the [Code of Conduct](CODE_OF_CONDUCT.md) before becoming a contributor.
47
+
48
+ ### Setting up your environment
49
+
50
+ Pull the codebase from GitHub:
51
+ ```bash
52
+ git clone https://github.com/BeckLaboratory/pav3.git
53
+ cd pav
54
+ ```
55
+
56
+ A virtual environment is already setup with [uv](https://docs.astral.sh/uv/). See the
57
+ [uv installation guide](https://docs.astral.sh/uv/getting-started/installation/) to install uv if you do not have it.
58
+
59
+ Initialize your virtual environment:
60
+ ```bash
61
+ uv sync
62
+ ```
63
+
64
+ This will create a virtual environment in the `.venv` directory including all project dependencies and development tools
65
+ used directly by this project. Your IDE can use the virtual environment to provide features such as code completion.
66
+
67
+ Commands in the virtual environment can be run by prefixing them with `uv`.
68
+
69
+ Open an interactive session:
70
+ ```bash
71
+ uv run ipython
72
+ ```
73
+
74
+ ### Setting up your IDE
75
+
76
+ This project was developed with [PyCharm](https://www.jetbrains.com/pycharm/), but no specific IDE is compulsory. When
77
+ opening the projcet in PyCharm, it should detect the uv virtual environment and use it. If not, you may need to
78
+ configure the IDE to use the environment in `.venv`.
79
+
80
+ ### Linting and unit tests
81
+
82
+ Linting and unit tests are setup through tox environments [tox](https://tox.wiki/) already configured for this project.
83
+ A list of environments can be viewed in [tox.toml]. Environments starting with "py" are for unit testing various
84
+ Python versions, and a "flake8" environment is for linting. By default, running a tox environment will run all unit
85
+ tests or perform linting for the whole project.
86
+
87
+ Important environments are:
88
+ * flake8: Linting.
89
+ * sphinx: Build documentation.
90
+
91
+
92
+ To run a tox environment, use:
93
+ ```bash
94
+ uv run tox -e <environment_name>
95
+ ```
96
+
97
+ For example, to run the linting environment:
98
+ ```bash
99
+ uv run tox -e flake8
100
+ ```
101
+
102
+ The same tools are also available in the virtual environment and can be run with the `uv` prefix.
103
+
104
+ For example, lint a single file:
105
+ ```bash
106
+ uv run flake8 <file_path>
107
+ ```
108
+
109
+ Please ensure your contributions pass linting and do not break unit tests before submitting a pull request. When adding
110
+ a new feature, please consider adding unit tests for it.
111
+
112
+
113
+ ### Pull requests
114
+
115
+ When your contribution is ready, open a pull request.
116
+
117
+ Before submitting a pull request:
118
+ * Make sure your changes are rebased against the main branch.
119
+ * Ensure your code is free of linting errors (See [Linting and unit tests])
120
+ * Ensure your code does not break any existing unit tests (See [Linting and unit tests]).
121
+ * Ensure your code follows the conventions outlined in the [Conventions](#conventions) section.
122
+
123
+ While submitting a pull request:
124
+ * Use a clear and concise title.
125
+ * Provide a clear and concise description.
126
+ * Reference the issue(s) you are working on.
127
+
128
+ A maintainer will review your request and may ask for changes or leave comments. Once all issues are resolved, the
129
+ pull request will be merged into the main branch, and your contribution will be included in the next release!
130
+
131
+ If you are stuck or unsure about your solution, feel free to open a draft pull request and ask for help.
132
+
133
+ ## Conventions
134
+
135
+ * Use [reStructuredText docstrings](https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html)
136
+ * Omit ":type:" and ":rtype:", allow type hints to fill it in.
137
+ * Use type hints.
138
+ * Use snake_case for variable names and function names.
139
+ * Use CamelCase for class names.
140
+ * Line length limit 120 characters
141
+ * Use 4 spaces for indentation.
142
+ * Place operators at the start of multi-line expressions rather than the end.
143
+ * Avoid backslashes, enclose in parethesis instead.
144
+ * All non-public members should be prefixed with an underscore.
145
+ * All public package members must appear in __all__.
146
+ * Use relative imports except for a few submodules with no dependencies on other submodules.