Esempio n. 1
0
static Int4  FillCSANWithStru(PCSAN pcsanThis, PMMD pmmdThis, Int4 iLen)
{
     Int4 iCount = 0;
     CharPtr pcA;
     PDNMG pdnmgThis = NULL;
     PMGD pmgdThis = NULL;


     if (!pcsanThis) return 0;
     if (!pmmdThis) return 0;
     if (!IsProtein(pmmdThis)) return 0;
     if (!iLen) return 0;

     pcsanThis->pcSeqAln = (CharPtr)MemNew((size_t) (1+ sizeof(char) * iLen));
     pcA = pcsanThis->pcSeqAln;
     pdnmgThis = pmmdThis->pdnmgHead;
     iCount = 0;
     while ((pdnmgThis != NULL)  && (iCount < iLen))
      {
            iCount++;
            pmgdThis = (PMGD) pdnmgThis->data.ptrvalue;
            *pcA = (char) pmgdThis->pcIUPAC[0] ;
            pcA++;
            pdnmgThis = pdnmgThis->next;
      }
     while (iCount < iLen)
       {
            *pcA = '-';
            pcA++;
            iCount++;
       }
    pcsanThis->pcSeqAln[iLen] = '\0';
    return iCount;
}
Esempio n. 2
0
static Int4 FillCSANWithMask(PCSAN pcsanThis, PMMD pmmdThis, Int4 iLen)
{
     Int4 iCount = 0;
     CharPtr pcA;
     PDNMG pdnmgThis = NULL;
     PMGD pmgdThis = NULL;
     Char cCode = ' ';


     if (!pcsanThis) return 0;
     if (!pmmdThis) return 0;
     if (!IsProtein(pmmdThis)) return 0;
     if (!iLen) return 0;


     /* printf("Mask len=[%ld]{",(long) iLen);*/
     pcsanThis->pcSeqAln = (CharPtr)MemNew((size_t) (1+ sizeof(char) * iLen));
     pcA = pcsanThis->pcSeqAln;
     pdnmgThis = pmmdThis->pdnmgHead;
     iCount = 0;
     while ((pdnmgThis != NULL)  && (iCount < iLen))
      {
           iCount++;
           pmgdThis = (PMGD) pdnmgThis->data.ptrvalue;
           cCode = '.';  /* default loop character */
           if (pmgdThis->bPDBSecStru & (Byte) SS_HELIX)  /*author described */
              cCode = 'a';
           if (pmgdThis->bNCBISecStru & (Byte) SS_HELIX)  /* VAST ss definition */
              cCode = 'a';
           if ((pmgdThis->bPDBSecStru & (Byte) SS_HELIX) && (pmgdThis->bNCBISecStru & (Byte) SS_HELIX))
              cCode = 'A';  /* consensus !*/
           if (pmgdThis->bPDBSecStru & (Byte) SS_STRAND)  /* author described */
              cCode = 'b';
           if  (pmgdThis->bNCBISecStru & (Byte) SS_STRAND)  /* VAST ss definition */
              cCode = 'b';
           if ((pmgdThis->bPDBSecStru & (Byte) SS_STRAND) && (pmgdThis->bNCBISecStru & (Byte) SS_STRAND))
              cCode = 'B';  /* consensus */
           /* printf("%c",  cCode); */
            *pcA = cCode ;
            pcA++;
            pdnmgThis = pdnmgThis->next;
      }
     while (iCount < iLen)  /* pad to the end if this is short */
       {
            *pcA = '-';
          /* printf("%c",  '-');*/
            pcA++;
            iCount++;
       }
    pcsanThis->pcSeqAln[iLen] = '\0';
    /* printf("}\n"); */
    return iCount;
}
Esempio n. 3
0
bool CBioseq_Handle::IsAa(void) const
{
    return IsProtein();
}