コード例 #1
0
ファイル: HomologyAdaptor.c プロジェクト: Ensembl/ensc-core
HomologyAdaptor *HomologyAdaptor_new(ComparaDBAdaptor *dba) {
  HomologyAdaptor *ha = NULL;

  if ((ha = (HomologyAdaptor *)calloc(1,sizeof(HomologyAdaptor))) == NULL) {
    fprintf(stderr,"Error: Failed allocating ha\n");
  } else {
    BaseComparaAdaptor_init((BaseComparaAdaptor *)ha, dba, HOMOLOGY_ADAPTOR);
  }

  return ha;
}
コード例 #2
0
SyntenyRegionAdaptor *SyntenyRegionAdaptor_new(ComparaDBAdaptor *dba) {
  SyntenyRegionAdaptor *sra = NULL;

  if ((sra = (SyntenyRegionAdaptor *)calloc(1,sizeof(SyntenyRegionAdaptor))) == NULL) {
    fprintf(stderr,"Error: Failed allocating sra\n");
  } else {
    BaseComparaAdaptor_init((BaseComparaAdaptor *)sra, dba, SYNTENYREGION_ADAPTOR);
  }


  return sra;
}
コード例 #3
0
GenomicAlignAdaptor *GenomicAlignAdaptor_new(ComparaDBAdaptor *dba) {
  GenomicAlignAdaptor *gaa;
  int maxAlLen;
  MetaContainer *mc;

  if ((gaa = (GenomicAlignAdaptor *)calloc(1,sizeof(GenomicAlignAdaptor))) == NULL) {
    fprintf(stderr, "ERROR: Failed allocating space for GenomicAlignAdaptor\n");
    return NULL;
  }
  BaseComparaAdaptor_init((BaseComparaAdaptor *)gaa, dba, GENOMICALIGN_ADAPTOR);


  mc = ComparaDBAdaptor_getMetaContainer(gaa->dba);

  if (MetaContainer_getIntValueByKey(mc, "max_alignment_length", &maxAlLen)) {
    gaa->maxAlignmentLength = maxAlLen;
  } else {
    fprintf(stderr, "Warning: Meta table key 'max_alignment_length' not defined\n" 
	       "using default value [%d]", DEFAULT_MAX_ALIGNMENT);
    gaa->maxAlignmentLength = DEFAULT_MAX_ALIGNMENT;
  }

  return gaa;
}