Skip to content

Commit

Permalink
just use underscore for names
Browse files Browse the repository at this point in the history
  • Loading branch information
glennhickey committed Mar 30, 2021
1 parent 057565a commit 8a3a99c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 2 additions & 6 deletions halMergeChroms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,9 @@ static void initParser(CLParser* optionsParser) {
}

// we expect to see the same ancestor sequence names in multiple input files. we uniqify them by adding
// .i to them where i is the file's position in the input.
// _i to them where i is the file's position in the input.
static string anc_seq_name(const string& seq_name, size_t idx) {
return seq_name + ".hmc" + to_string(idx);
}
// undo the above
static string orig_seq_name(const string& seq_name) {
return seq_name.substr(0, seq_name.rfind(".hmc"));
return seq_name + "_" + to_string(idx);
}

// get the dimensions from all genomes in all input files
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/.hmc0//g' | sed -e 's/.hmc1//g' > merged1.comp1.gfa
vg find -x merged1.vg -p cow.3:1 -c 1000 | vg ids -s - | vg view - | sort | sed -e 's/.hmc0//g' | sed -e 's/.hmc1//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' > 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' > 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/.hmc0//g' | sed -e 's/.hmc1//g' > merged1.comp1.gfa
vg find -x merged1.vg -p cow.3:1 -c 1000 | vg ids -s - | vg view - | sort | sed -e 's/.hmc0//g' | sed -e 's/.hmc1//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' > 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' > 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 8a3a99c

Please sign in to comment.