예제 #1
0
bool CPacked_seqpnt::x_IsMinusStrand(void) const
{
    ENa_strand strand = eNa_strand_unknown;
    if ( IsSetStrand() ) {
        strand = GetStrand();
    }
    return (strand == eNa_strand_minus)  ||  (strand == eNa_strand_both_rev);
}
예제 #2
0
bool CLocation_constraint :: x_DoesStrandMatchConstraint(const CSeq_loc& loc) const
{
  if (loc.Which() == CSeq_loc::e_not_set) {
     return false;
  }
  if (GetStrand() == eStrand_constraint_any) {
     return true;
  }

  if (loc.GetStrand() == eNa_strand_minus) {
      if (GetStrand() == eStrand_constraint_minus) {
         return true;
      }
      else return false;
  }
  else {
     if (GetStrand() == eStrand_constraint_plus) {
       return true;
     }
     else return false;
  }
};
예제 #3
0
bool CLocation_constraint :: x_IsLocationConstraintEmpty() const
{
  if (GetStrand() != eStrand_constraint_any
          || GetSeq_type() != eSeqtype_constraint_any
          || GetPartial5() != ePartial_constraint_either
          || GetPartial3() != ePartial_constraint_either
          || GetLocation_type() != eLocation_type_constraint_any
          || (CanGetEnd5()
                && GetEnd5().Which() != CLocation_pos_constraint::e_not_set)
          || (CanGetEnd3()
                && GetEnd3().Which() != CLocation_pos_constraint::e_not_set)) {
    return false;
  }
  return true;
};
예제 #4
0
bool CLocation_constraint :: Match(const CSeq_feat& feat, CConstRef <CSeq_feat> feat_to, CConstRef <CBioseq> feat_bioseq) const
{
  if (x_IsLocationConstraintEmpty()) {
     return true;
  }
 
  const CSeq_loc& feat_loc = feat.GetLocation();
  if (GetStrand() != eStrand_constraint_any) {
    if (feat_bioseq.Empty()) {
       return false;
    }
    else if (feat_bioseq->IsAa()) {
      if (feat_to.Empty()) {  // when feat is product, feat_to points to cds
         return false;
      }
      else if (!x_DoesStrandMatchConstraint (feat_to->GetLocation())) {
        return false;
      }
    }
    else if (!x_DoesStrandMatchConstraint (feat_loc)) {
        return false;
    }
  }

  if (!x_DoesBioseqMatchSequenceType(feat_bioseq, GetSeq_type())) {
     return false;
  }

  if (!x_DoesLocationMatchPartialnessConstraint (feat_loc)) {
     return false;
  }

  if (!x_DoesLocationMatchTypeConstraint (feat_loc)) {
     return false;
  }

  if (!x_DoesLocationMatchDistanceConstraint(feat_bioseq, feat_loc)) {
     return false;
  }

  return true;
};
예제 #5
0
void CPacked_seqpnt::FlipStrand(void)
{
    if (IsSetStrand()) {
        SetStrand(Reverse(GetStrand()));
    }
}
예제 #6
0
bool CSeq_interval::x_IsMinusStrand(void) const
{
    return IsSetStrand() && IsReverse(GetStrand());
}
예제 #7
0
void CSeq_interval::FlipStrand(void)
{
    if (IsSetStrand()) {
        SetStrand(Reverse(GetStrand()));
    }
}