Skip to content

Commit

Permalink
Merge pull request #63 from ComparativeGenomicsToolkit/path-sense
Browse files Browse the repository at this point in the history
always set haplotype for refsense -- vg 1.50.0 requires it
  • Loading branch information
glennhickey authored Aug 2, 2023
2 parents 01b5a94 + 4d177ac commit cd2e668
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion hal2vg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ void pinch_to_handle(const Genome* genome,
subrange_t subpath = resolve_subpath_naming(parsed_name);
string parsed_genome_name = genome->getName();
size_t haplotype = resolve_haplotype_naming(parsed_genome_name);
if (sense == PathSense::HAPLOTYPE && haplotype == PathMetadata::NO_HAPLOTYPE) {
if (haplotype == PathMetadata::NO_HAPLOTYPE) {
haplotype = 0;
}
// create the path
Expand Down
6 changes: 3 additions & 3 deletions tests/small/truth.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
"rank": "6"
}
],
"name": "cat#3"
"name": "cat#0#3"
},
{
"mapping": [
Expand Down Expand Up @@ -264,7 +264,7 @@
"rank": "7"
}
],
"name": "chimp#2"
"name": "chimp#0#2"
},
{
"mapping": [
Expand Down Expand Up @@ -368,7 +368,7 @@
"rank": "8"
}
],
"name": "human#1"
"name": "human#0#1"
}
]
}
3 changes: 1 addition & 2 deletions tests/t/chop.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ PATH=../deps/hal:$PATH

plan tests 18

#vg convert -g chop/tiny-flat.gfa -p > tiny-flat.vg
vg convert -g chop/tiny-flat.gfa -o > tiny-flat.vg
vg convert -g chop/tiny-flat.gfa -p > tiny-flat.vg
printf "x\t0\t100\n" > all.bed
clip-vg tiny-flat.vg -b all.bed | vg view - | grep -v ^H > chopped-all.gfa
is "$(cat chopped-all.gfa | wc -l)" 0 "chopping everything clears out the graph"
Expand Down
8 changes: 4 additions & 4 deletions tests/t/merge.t
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ hal2vg small2.hal | vg mod -O - | vg ids -s - > small2.vg
hal2vg merged1.hal | vg mod -O - | vg ids -s - > merged1.vg
vg view small.vg | sort > small.gfa
vg view small2.vg | sort > small2.gfa
vg find -x merged1.vg -p cat#3:1 -c 1000 | vg ids -s - | vg view - | sort | sed -e 's/_0//g' | sed -e 's/_1//g' | sed -e "s/cat human chimp/human chimp cat/g" > merged1.comp1.gfa
vg find -x merged1.vg -p cow#3:1 -c 1000 | vg ids -s - | vg view - | sort | sed -e 's/_0//g' | sed -e 's/_1//g' | sed -e "s/human chimp cow/cow human chimp/g" > merged1.comp2.gfa
vg find -x merged1.vg -p cat#0#3:1 -c 1000 | vg ids -s - | vg view - | sort | sed -e 's/_0//g' | sed -e 's/_1//g' | sed -e "s/human chimp cat/chimp human cat/g" > merged1.comp1.gfa
vg find -x merged1.vg -p cow#0#3:1 -c 1000 | vg ids -s - | vg view - | sort | sed -e 's/_0//g' | sed -e 's/_1//g' | sed -e "s/human cow chimp/chimp human cow/g" > merged1.comp2.gfa
diff small.gfa merged1.comp1.gfa
is $? 0 "First component of merged graph identical to first input graph"
diff small2.gfa merged1.comp2.gfa
Expand Down Expand Up @@ -60,8 +60,8 @@ hal2vg small2.hal | vg mod -O - | vg ids -s - > small2.vg
hal2vg merged1.hal | vg mod -O - | vg ids -s - > merged1.vg
vg view small.vg | sort > small.gfa
vg view small2.vg | sort > small2.gfa
vg find -x merged1.vg -p cat#3:1 -c 1000 | vg ids -s - | vg view - | sort | sed -e 's/_0//g' | sed -e 's/_1//g' | sed -e "s/cat human chimp/human chimp cat/g" > merged1.comp1.gfa
vg find -x merged1.vg -p cow#3:1 -c 1000 | vg ids -s - | vg view - | sort | sed -e 's/_0//g' | sed -e 's/_1//g' | sed -e "s/human chimp cow/cow human chimp/g" > merged1.comp2.gfa
vg find -x merged1.vg -p cat#0#3:1 -c 1000 | vg ids -s - | vg view - | sort | sed -e 's/_0//g' | sed -e 's/_1//g' | sed -e "s/human chimp cat/chimp human cat/g" > merged1.comp1.gfa
vg find -x merged1.vg -p cow#0#3:1 -c 1000 | vg ids -s - | vg view - | sort | sed -e 's/_0//g' | sed -e 's/_1//g' | sed -e "s/human cow chimp/chimp human cow/g" > merged1.comp2.gfa
diff small.gfa merged1.comp1.gfa
is $? 0 "First component of merged graph identical to first input graph"
diff small2.gfa merged1.comp2.gfa
Expand Down

0 comments on commit cd2e668

Please sign in to comment.