bool CSnpBitfield2::IsTrue( CSnpBitfield::EFunctionClass prop ) const { bool ret = false; if ( prop == CSnpBitfield::eMultipleFxn || prop == CSnpBitfield::eUnknownFxn ) { ret = ( GetFunctionClass() == prop ); } else { // looking for a specific function class unsigned char byte3 = m_listBytes[3]; unsigned char byte4 = m_listBytes[4]; // the 'Has reference' bit may be set. So turn it off for test. byte4 &= 0xfd; // 1111 1101 <- mask to set the 2nd bit to zero switch (prop) { case CSnpBitfield::eInGene: ret = (byte3 & fBit0); break; case CSnpBitfield::eInGene5: ret = (byte3 & fBit1); break; case CSnpBitfield::eInGene3: ret = (byte3 & fBit2); break; case CSnpBitfield::eIntron: ret = (byte3 & fBit3); break; case CSnpBitfield::eDonor: ret = (byte3 & fBit4); break; case CSnpBitfield::eAcceptor: ret = (byte3 & fBit5); break; case CSnpBitfield::eInUTR5: ret = (byte3 & fBit6); break; case CSnpBitfield::eInUTR3: ret = (byte3 & fBit7); break; // using byte4 case CSnpBitfield::eSynonymous: ret = (byte4 & fBit0); break; case CSnpBitfield::eNonsense: ret = (byte4 & fBit2); break; case CSnpBitfield::eMissense: ret = (byte4 & fBit3); break; case CSnpBitfield::eFrameshift: ret = (byte4 & fBit4); break; // eUTR case CSnpBitfield::eUTR: ret = (byte3 & fBit6) || (byte3 & fBit7); break; default: ret = false; } } return ret; }
bool CSnpBitfield1_2::IsTrue( CSnpBitfield::EFunctionClass prop ) const { return (prop == GetFunctionClass()); }