src/c++/include/common/BCFHelpers.hh
/**
 * Check if variant is a single-allelic MNP ie. can be trivially decomposed
 */
Check if variant is a single-allelic MNP ie. can be trivially decomposed
Check if variant is a single - allelic MNP ie . can be trivially decomposed
inline bool isMNP(bcf_hdr_t* hdr, bcf1_t* rec)
{
    bcf_unpack(rec, BCF_UN_SHR);
    if (rec->n_allele == 1)
    {
        return (false);
    }
    size_t reflen = strlen(rec->d.allele[0]);
    if (reflen == 1)
    {
        return (false);
    }
    for (int i = 1; i < rec->n_allele; i++)
    {
        if (reflen != strlen(rec->d.allele[i]))
        {
            return (false);
        }
    }
    return (true);
}
inline bool isMNP ( bcf_hdr_t * hdr , bcf1_t * rec ) { bcf_unpack ( rec , BCF_UN_SHR ) ; if ( rec -> n_allele == 1 ) { return ( false ) ; } size_t reflen = strlen ( rec -> d . allele [ 0 ] ) ; if ( reflen == 1 ) { return ( false ) ; } for ( int i = 1 ; i < rec -> n_allele ; i ++ ) { if ( reflen != strlen ( rec -> d . allele [ i ] ) ) { return ( false ) ; } } return ( true ) ; }
Check if variant is a single-allelic MNP ie.
Check if variant is a single - allelic MNP ie .