コード例 #1
0
ファイル: RawContig.c プロジェクト: Ensembl/ensc-core
Vector *RawContig_getAllProteinAlignFeatures(RawContig *rc, char *logicName, double *scoreP) {
  RawContigAdaptor *rca = (RawContigAdaptor *)RawContig_getAdaptor(rc);
  ProteinAlignFeatureAdaptor *pafa;

  if (!rca) {
    fprintf(stderr, "Warning: Contig has no adaptor - cannot retrieve pep align features\n");
    return emptyVector;
  }
  pafa = DBAdaptor_getProteinAlignFeatureAdaptor(rca->dba);
  return ProteinAlignFeatureAdaptor_fetchAllByRawContigAndScore(pafa,rc,scoreP,logicName);
}
コード例 #2
0
int main(int argc, char *argv[]) {
  DBAdaptor *dba;
  DBAdaptor *writeDba;
  ProteinAlignFeatureAdaptor *pafa;
  Slice *slice;
  Vector *features;
  int i;
  int failed;
  
  initEnsC(argc, argv);

  dba = Test_initROEnsDB();

  writeDba = Test_initRWEnsDB();

  slice = Test_getStandardSlice(dba);

  ok(1, slice!=NULL);

  pafa = DBAdaptor_getProteinAlignFeatureAdaptor(writeDba);
  SliceAdaptor *sa = DBAdaptor_getSliceAdaptor(dba);

  ok(2, pafa!=NULL);

  //features =  Slice_getAllDNAPepAlignFeatures(slice,NULL,NULL, NULL,NULL);

  //Slice *slice3 = SliceAdaptor_fetchByRegion(sa,"chromosome","1",2,260000000,1,NULL,0);
  Slice *slice2 = SliceAdaptor_fetchByRegion(sa,"chromosome","1",1000000,4000000,1,NULL,0);
  features =  Slice_getAllProteinAlignFeatures(slice2,NULL,NULL, NULL,NULL);

  ok(3, features!=NULL);
  ok(4, Vector_getNumElement(features)!=0);

  ProteinAlignFeatureAdaptor_store((BaseFeatureAdaptor*)pafa, features);

  return 0;
}