Changeset 3920


Ignore:
Timestamp:
May 31, 2020, 8:21:44 AM (3 years ago)
Author:
Peter
Message:

to handle ALT being <ID> string access to VCFHeader is needed and cannot be handled here. Instead we ignore those ALTs and documents the behaviour.

Location:
trunk/yat/omic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/omic/VCF.cc

    r3919 r3920  
    341341  {
    342342    for (size_t i=0; i<vcf.alts().size(); ++i)
    343       if (vcf.alts()[i].size() != vcf.ref().size())
     343      if (vcf.alts()[i].size() != vcf.ref().size() &&
     344          vcf.alts()[i][0]!='<')
    344345        return true;
    345346    return false;
     
    349350  bool is_snv(const VCF& vcf)
    350351  {
    351     // FIXME we should handle the case when allele has format "<ID>"
    352352    if (vcf.ref().size()!=1)
    353353      return false;
     
    363363  bool is_dnv(const VCF& vcf)
    364364  {
    365     // FIXME we should handle the case when allele has format "<ID>"
    366365    if (vcf.ref().size()!=2)
    367366      return false;
     
    377376  bool is_mnv(const VCF& vcf)
    378377  {
    379     // FIXME we should handle the case when allele has format "<ID>"
    380378    if (vcf.ref().size()<=2)
    381379      return false;
    382380
    383381    for (size_t i=0; i<vcf.alts().size(); ++i)
    384       if (vcf.alts()[i].size()==vcf.ref().size())
     382      if (vcf.alts()[i].size()==vcf.ref().size() &&
     383          vcf.alts()[i][0]!='<')
    385384        return true;
    386385
  • trunk/yat/omic/VCF.h

    r3823 r3920  
    431431     \return true if at least one variant is an indel, i.e., if at
    432432     least one alt allele is not the same size as ref.
     433
     434     \note ALT being an angle-bracketed ID string is ignored
    433435   */
    434436  bool is_indel(const VCF&);
     
    437439     \return true if at least one variant is a single-nucleotide
    438440     variant (SNV), i.e., ref is 1bp and at least one alt allele is
    439      1bp.
     441     1bp (but not '*').
     442
     443     \note ALT being an angle-bracketed ID string is ignored
    440444   */
    441445  bool is_snv(const VCF&);
     
    445449     variant (DNV), i.e., ref is 2bp and at least one alt allele is
    446450     2bp.
     451
     452     \note ALT being an angle-bracketed ID string is ignored
    447453   */
    448454  bool is_dnv(const VCF&);
     
    452458     variant (MNV), i.e., ref is >2bp and at least one alt allele is
    453459     same length as ref.
     460
     461     \note ALT being an angle-bracketed ID string is ignored
    454462   */
    455463  bool is_mnv(const VCF&);
Note: See TracChangeset for help on using the changeset viewer.