@@ -163,20 +163,18 @@ rm -f small_cluster.gfa small_cluster_0.vcf small_cluster_3.vcf
163163# 2. Run vg deconstruct with -a to use the pre-computed augref paths
164164
165165# Test: SNP inside deletion
166- vg convert -g nesting/nested_snp_in_del.gfa -p > nested_snp_in_del.pg
167- vg paths --compute-augref --min-augref-len 0 -x nested_snp_in_del.pg -Q x > nested_snp_in_del.augref.pg
166+ vg paths --compute-augref --min-augref-len 0 -x nesting/nested_snp_in_del.gfa -Q x > nested_snp_in_del.augref.pg
168167vg deconstruct nested_snp_in_del.augref.pg -p x -a > nested_snp_in_del.vcf
169168grep -v ^# nested_snp_in_del.vcf | awk '{print $4 "\t" $5 "\t" $10}' > nested_snp_in_del.tsv
170169printf " CATG\tCAAG,C\t1|2\n" > nested_snp_in_del_truth.tsv
171170printf " T\tA\t1|.\n" >> nested_snp_in_del_truth.tsv
172171diff nested_snp_in_del.tsv nested_snp_in_del_truth.tsv
173172is " $? " 0 " nested deconstruction gets correct allele for snp inside deletion"
174173
175- rm -f nested_snp_in_del.pg nested_snp_in_del. augref.pg nested_snp_in_del.vcf nested_snp_in_del.tsv nested_snp_in_del_truth.tsv
174+ rm -f nested_snp_in_del.augref.pg nested_snp_in_del.vcf nested_snp_in_del.tsv nested_snp_in_del_truth.tsv
176175
177176# Test: SNP inside insertion with LV field checks
178- vg convert -g nesting/nested_snp_in_ins.gfa -p > nested_snp_in_ins.pg
179- vg paths --compute-augref --min-augref-len 0 -x nested_snp_in_ins.pg -Q x > nested_snp_in_ins.augref.pg
177+ vg paths --compute-augref --min-augref-len 0 -x nesting/nested_snp_in_ins.gfa -Q x > nested_snp_in_ins.augref.pg
180178vg deconstruct nested_snp_in_ins.augref.pg -P x -a > nested_snp_in_ins.vcf
181179grep -v ^# nested_snp_in_ins.vcf | awk '{print $4 "\t" $5 "\t" $10}' > nested_snp_in_ins.tsv
182180# With -P x, nested variants are on augref contigs (x_1_alt), parent on x
@@ -192,74 +190,66 @@ is $(grep LV=1 nested_snp_in_ins.vcf | wc -l) 1 "LV=1 set for nested allele of n
192190# With -P x, we get multiple contigs (x, x_1_alt, x_2_alt)
193191is $( grep -c " ^##contig" nested_snp_in_ins.vcf) 3 " nested deconstruction gets all reference contigs in vcf header"
194192
195- rm -f nested_snp_in_ins.pg nested_snp_in_ins. augref.pg nested_snp_in_ins.vcf nested_snp_in_ins.tsv nested_snp_in_ins_truth.tsv nested_snp_in_ins_contigs.tsv
193+ rm -f nested_snp_in_ins.augref.pg nested_snp_in_ins.vcf nested_snp_in_ins.tsv nested_snp_in_ins_truth.tsv nested_snp_in_ins_contigs.tsv
196194
197195# Test: Double-nested SNP
198- vg convert -g nesting/nested_snp_in_nested_ins.gfa -p > nested_snp_in_nested_ins.pg
199- vg paths --compute-augref --min-augref-len 0 -x nested_snp_in_nested_ins.pg -Q x > nested_snp_in_nested_ins.augref.pg
196+ vg paths --compute-augref --min-augref-len 0 -x nesting/nested_snp_in_nested_ins.gfa -Q x > nested_snp_in_nested_ins.augref.pg
200197vg deconstruct nested_snp_in_nested_ins.augref.pg -P x -a > nested_snp_in_nested_ins.vcf
201198is $( grep -v ^# nested_snp_in_nested_ins.vcf | grep LV=0 | wc -l) 1 "level 0 site found in double-nested SNP"
202199is $( grep -v ^# nested_snp_in_nested_ins.vcf | grep "LV=" | wc -l) 3 "all nested sites found in double-nested SNP"
203200is $( grep -v ^# nested_snp_in_nested_ins.vcf | grep LV=2 | wc -l) 1 "level 2 site found in double-nested SNP"
204201
205- rm -f nested_snp_in_nested_ins.pg nested_snp_in_nested_ins. augref.pg nested_snp_in_nested_ins.vcf
202+ rm -f nested_snp_in_nested_ins.augref.pg nested_snp_in_nested_ins.vcf
206203
207204# Test: Nested site with cycle
208- vg convert -g nesting/nested_snp_in_ins_cycle.gfa -p > nested_snp_in_ins_cycle.pg
209- vg paths --compute-augref --min-augref-len 0 -x nested_snp_in_ins_cycle.pg -Q x > nested_snp_in_ins_cycle.augref.pg
205+ vg paths --compute-augref --min-augref-len 0 -x nesting/nested_snp_in_ins_cycle.gfa -Q x > nested_snp_in_ins_cycle.augref.pg
210206vg deconstruct nested_snp_in_ins_cycle.augref.pg -P x -a > nested_snp_in_ins_cycle.vcf
211207is $( grep -v ^# nested_snp_in_ins_cycle.vcf | grep LV=0 | wc -l) 1 "level 0 found in nested cycle"
212208is $( grep -v ^# nested_snp_in_ins_cycle.vcf | grep LV=1 | wc -l) 1 "level 1 found in nested cycle"
213- rm -f nested_snp_in_ins_cycle.pg nested_snp_in_ins_cycle. augref.pg nested_snp_in_ins_cycle.vcf
209+ rm -f nested_snp_in_ins_cycle.augref.pg nested_snp_in_ins_cycle.vcf
214210
215211# Test: MNP handling
216- vg convert -g nesting/mnp.gfa -p > mnp.pg
217- vg paths --compute-augref --min-augref-len 0 -x mnp.pg -Q x > mnp.augref.pg
212+ vg paths --compute-augref --min-augref-len 0 -x nesting/mnp.gfa -Q x > mnp.augref.pg
218213vg deconstruct mnp.augref.pg -p x -a > mnp.vcf
219214printf " x\t3\t>2>7\tTCAT\tATTT\n" > mnp_truth.tsv
220215grep -v ^# mnp.vcf | awk '{print $1 "\t" $2 "\t" $3 "\t" $4 "\t" $5}' > mnp.tsv
221216diff mnp_truth.tsv mnp.tsv
222217is " $? " 0 " nested deconstruction handles mnp"
223218
224- rm -f mnp.pg mnp. augref.pg mnp.vcf mnp_truth.tsv mnp.tsv
219+ rm -f mnp.augref.pg mnp.vcf mnp_truth.tsv mnp.tsv
225220
226221# Test 1: Deep nesting (3+ levels) - triple nested SNP
227- vg convert -g nesting/triple_nested.gfa -p > triple_nested.pg
228- vg paths --compute-augref --min-augref-len 0 -x triple_nested.pg -Q x > triple_nested.augref.pg
222+ vg paths --compute-augref --min-augref-len 0 -x nesting/triple_nested.gfa -Q x > triple_nested.augref.pg
229223vg deconstruct triple_nested.augref.pg -P x -a > triple_nested.vcf
230224is $( grep -v ^# triple_nested.vcf | grep LV=0 | wc -l) 1 "level 0 site found in triple nested"
231225is $( grep -v ^# triple_nested.vcf | grep "LV=" | wc -l) 5 "all nested sites found in triple nested"
232226is $( grep -v ^# triple_nested.vcf | grep LV=2 | wc -l) 1 "level 2 site found in triple nested"
233227is $( grep -v ^# triple_nested.vcf | grep LV=3 | wc -l) 1 "level 3 site found in triple nested"
234228is $( grep -v ^# triple_nested.vcf | grep LV=4 | wc -l) 1 "level 4 site found in triple nested"
235- rm -f triple_nested.pg triple_nested. augref.pg triple_nested.vcf
229+ rm -f triple_nested.augref.pg triple_nested.vcf
236230
237231# Test 2: Multiple children at same level - insertion with 2 nested SNPs
238- vg convert -g nesting/insertion_with_three_snps.gfa -p > insertion_with_three_snps.pg
239- vg paths --compute-augref --min-augref-len 0 -x insertion_with_three_snps.pg -Q x > insertion_with_three_snps.augref.pg
232+ vg paths --compute-augref --min-augref-len 0 -x nesting/insertion_with_three_snps.gfa -Q x > insertion_with_three_snps.augref.pg
240233vg deconstruct insertion_with_three_snps.augref.pg -P x -a > multi_child.vcf
241234is $( grep -v ^# multi_child.vcf | grep "LV=" | wc -l) 3 "expected number of sites with LV field"
242235is $( grep -v ^# multi_child.vcf | grep LV=1 | wc -l) 2 "two child SNPs found at level 1"
243- rm -f insertion_with_three_snps.pg insertion_with_three_snps. augref.pg multi_child.vcf
236+ rm -f insertion_with_three_snps.augref.pg multi_child.vcf
244237
245238# Test 3: NestingInfo field propagation - verify LV field
246- vg convert -g nesting/nested_snp_in_ins.gfa -p > field_check.pg
247- vg paths --compute-augref --min-augref-len 0 -x field_check.pg -Q x > field_check.augref.pg
239+ vg paths --compute-augref --min-augref-len 0 -x nesting/nested_snp_in_ins.gfa -Q x > field_check.augref.pg
248240vg deconstruct field_check.augref.pg -P x -a > field_check.vcf
249241is $( grep " LV=0" field_check.vcf | wc -l) 1 " LV=0 field present for top-level site"
250- rm -f field_check.pg field_check. augref.pg field_check.vcf
242+ rm -f field_check.augref.pg field_check.vcf
251243
252244# Test 4: Multiple reference traversals with nesting (should reduce to one)
253- vg convert -g nesting/cyclic_ref_nested.gfa -p > cyclic_ref_nested.pg
254- vg paths --compute-augref --min-augref-len 0 -x cyclic_ref_nested.pg -Q x > cyclic_ref_nested.augref.pg
245+ vg paths --compute-augref --min-augref-len 0 -x nesting/cyclic_ref_nested.gfa -Q x > cyclic_ref_nested.augref.pg
255246vg deconstruct cyclic_ref_nested.augref.pg -p x -a > cyclic_ref_nested.vcf
256247is $( grep -v ^# cyclic_ref_nested.vcf | wc -l) 1 "cyclic reference with nesting produces single variant"
257- rm -f cyclic_ref_nested.pg cyclic_ref_nested. augref.pg cyclic_ref_nested.vcf
248+ rm -f cyclic_ref_nested.augref.pg cyclic_ref_nested.vcf
258249
259250# Test 5: Cyclic reference outputs multiple variants (one per reference traversal)
260251# Reference x visits the snarl twice (via node 2 then 3), alt a visits twice (via node 3 then 4)
261252# With -c 0 to disable context-jaccard (which doesn't work well on tiny graphs), we should get 2 variants
262- vg convert -g nesting/cyclic_ref_multiple_variants.gfa -p > cyclic_ref_multi.pg
263- vg deconstruct cyclic_ref_multi.pg -p x -a -c 0 > cyclic_ref_multi.vcf
253+ vg deconstruct nesting/cyclic_ref_multiple_variants.gfa -p x -a -c 0 > cyclic_ref_multi.vcf
264254is $( grep -v ^# cyclic_ref_multi.vcf | wc -l) 2 "cyclic reference with -a outputs variant for each reference traversal"
265- rm -f cyclic_ref_multi.pg cyclic_ref_multi. vcf
255+ rm -f cyclic_ref_multi.vcf
0 commit comments