Skip to content

Commit

Permalink
Add AvgHapLen tag to VCF output
Browse files Browse the repository at this point in the history
  • Loading branch information
jts committed Aug 26, 2014
1 parent 80e2e84 commit cde3ca6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/GraphDiff/DindelUtil.cpp
Expand Up @@ -280,6 +280,16 @@ DindelReturnCode DindelUtil::runDindelPairMatePair(const std::string& id,
pPreviousResult = pThisResult;
}

// Add additional tags to each VCF record
double average_hap_length = 0.0f;
for(size_t i = 0; i < variant_haplotypes.size(); ++i)
average_hap_length += variant_haplotypes[i].size();
average_hap_length /= variant_haplotypes.size();

for(size_t i = 0; i <= 1; ++i)
for(size_t j = 0; j < vcfCollections[i].records.size(); ++j)
vcfCollections[i].records[j].addComment("AvgHapLen", average_hap_length);

// Copy raw VCFRecords to output
for(size_t i = 0; i <= 1; ++i)
{
Expand Down

0 comments on commit cde3ca6

Please sign in to comment.