Skip to content

Commit

Permalink
Create --add-identity option
Browse files Browse the repository at this point in the history
  • Loading branch information
faithokamoto authored Jan 16, 2025
1 parent d6b219b commit d1a5a0c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/subcommand/inject_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ void help_inject(char** argv) {
<< endl
<< "options:" << endl
<< " -x, --xg-name FILE use this graph or xg index (required, non-XG formats also accepted)" << endl
<< " -i, --add-identity add the 'identity' statistic (\% of matching base pairs) to output GAM" << endl
<< " -r, --rescore re-score alignments" << endl
<< " -o, --output-format NAME output the alignments in NAME format (gam / gaf / json) [gam]" << endl
<< " -t, --threads N number of threads to use" << endl;
Expand All @@ -41,6 +42,7 @@ int main_inject(int argc, char** argv) {
}

string xg_name;
bool add_identity = false;
bool rescore = false;
string output_format = "GAM";
std::set<std::string> output_formats = { "GAM", "GAF", "JSON" };
Expand All @@ -53,6 +55,7 @@ int main_inject(int argc, char** argv) {
{
{"help", no_argument, 0, 'h'},
{"xg-name", required_argument, 0, 'x'},
{"add-identity", no_argument, 0, 'i'},
{"rescore", no_argument, 0, 'r'},
{"output-format", required_argument, 0, 'o'},
{"threads", required_argument, 0, 't'},
Expand Down Expand Up @@ -86,6 +89,10 @@ int main_inject(int argc, char** argv) {
}
break;

case 'i':
add_identity = true;
break;

case 'r':
rescore = true;
break;
Expand Down Expand Up @@ -126,6 +133,10 @@ int main_inject(int argc, char** argv) {

function<void(Alignment&)> lambda = [&](Alignment& aln) {
set_crash_context(aln.name());
if (add_identity) {
// Calculate & save identity statistic
aln.set_identity(identity(aln.path()));
}
if (rescore) {
// Rescore the alignment
aln.set_score(aligner.score_contiguous_alignment(aln));
Expand Down

1 comment on commit d1a5a0c

@adamnovak
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vg CI tests complete for branch vg-inject-identity. View the full report here.

16 tests passed, 0 tests failed and 0 tests skipped in 17449 seconds

Please sign in to comment.