Skip to content

Commit

Permalink
Merge pull request #65 from ComparativeGenomicsToolkit/path-sense
Browse files Browse the repository at this point in the history
Flip-flop on mandatory reference haplotype
  • Loading branch information
glennhickey authored Aug 8, 2023
2 parents 70e3710 + d8aeb7d commit 4fbfe1e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 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 (haplotype == PathMetadata::NO_HAPLOTYPE) {
if (sense == PathSense::HAPLOTYPE && 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#0#3"
"name": "cat#3"
},
{
"mapping": [
Expand Down Expand Up @@ -264,7 +264,7 @@
"rank": "7"
}
],
"name": "chimp#0#2"
"name": "chimp#2"
},
{
"mapping": [
Expand Down Expand Up @@ -368,7 +368,7 @@
"rank": "8"
}
],
"name": "human#0#1"
"name": "human#1"
}
]
}
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#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
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/human chimp cat/human cat chimp/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 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#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
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/human chimp cat/human cat chimp/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 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 4fbfe1e

Please sign in to comment.