Esempio n. 1
0
void analyse(t_atoms *atoms,t_blocka *gb,char ***gn,bool bASK,bool bVerb)
{
  t_aa_names *aan;
  eRestp  *restp;
  char    *resnm;
  atom_id *aid;
  int     nra;
  int     i;
  size_t  j;

  if (bVerb)
    printf("Analysing residue names:\n");
  snew(restp,atoms->nres);
  aid=mk_aid(atoms,restp,etOther,&nra,TRUE);
  add_grp(gb,gn,nra,aid,"System"); 
  sfree(aid);

  aan = get_aa_names();
  for(i=0; (i<atoms->nres); i++) {
    resnm = *atoms->resinfo[i].name;
    if ((restp[i] == etOther) && is_protein(aan,resnm))
      restp[i] = etProt;
    if (restp[i] == etOther)
      for(j=0; (j<NDNA);  j++) {
	if (strcasecmp(Sugars[j],resnm) == 0)
	  restp[i] = etDNA;
      }
  }
  p_status(atoms->nres,restp,bVerb);
  done_aa_names(&aan);
  
  /* Protein */
  aid=mk_aid(atoms,restp,etProt,&nra,TRUE);
  if (nra > 0) 
    analyse_prot(restp,atoms,gb,gn,bASK,bVerb);
  
  sfree(aid);

  /* Non-Protein */
  aid=mk_aid(atoms,restp,etProt,&nra,FALSE);
  if ((nra > 0) && (nra < atoms->nr))
    add_grp(gb,gn,nra,aid,"Non-Protein"); 
  sfree(aid);

  /* DNA */
  aid=mk_aid(atoms,restp,etDNA,&nra,TRUE);
  if (nra > 0) {
    add_grp(gb,gn,nra,aid,"DNA"); 
    analyse_dna(restp,atoms,gb,gn,bASK,bVerb);
  }
  sfree(aid);

  /* Other */
  analyse_other(restp,atoms,gb,gn,bASK,bVerb);
  aid=mk_aid(atoms,restp,etOther,&nra,TRUE);
  if ((nra > 0) && (nra < atoms->nr))
    add_grp(gb,gn,nra,aid,"Other"); 
  sfree(aid);
  sfree(restp);
}
Esempio n. 2
0
char *seq_guess_type( char *seq )
{
    /* Martin A. Hansen, May 2008 */

    /* Guess the type of a given sequnce, */
    /* which is returned as a pointer to a string. */

    char *type;

    type = mem_get( 8 );

    if ( is_dna( seq ) ) {
        type = "DNA";
    } else if ( is_rna( seq ) ) {
        type = "RNA";
    } else if ( is_protein( seq ) ) {
        type = "PROTEIN";
    } else {
        abort();
    }

    return type;
}