Ejemplo n.º 1
0
Hscore * Hscore_from_ProteinABC(ProteinDB* querydb,ProteinDB* targetdb,CompMat* comp,int a,int b,int c,double bits_cutoff,int report_level,boolean die_on_error,DBSearchImpl* dbsi)
{

   Hscore * out = NULL;
 
   Search_Return_Type ret;

   ret = SEARCH_ERROR;

   out = std_score_Hscore(bits_cutoff,report_level);

   if( dbsi == NULL ) {
      warn("Passed a NULL dbsi search implementaion object. Exiting without searching");
      goto exit;
   }

   if( querydb == NULL ) {
      warn("Passed a NULL querydb. Exiting without searching");
      goto exit;
   }

   if( targetdb == NULL ) {
      warn("Passed a NULL targetdb. Exiting without searching");
      goto exit;
   }

   if( comp == NULL ) {
      warn("Passed a NULL comparison matrix. Exiting without searching");
      goto exit;
   }

   ret = search_abc(dbsi,out,querydb,targetdb,comp,a,b,c);

   exit:

   return out;
}
Ejemplo n.º 2
0
Hscore * Hscore_from_ProteinBA(ProteinDB* querydb,ProteinDB* targetdb,CompMat* comp,Score bentry,Score bexit,Score bfor_trans,Score b_self_trans,Score b3exit,double bits_cutoff,int report_level,DBSearchImpl* dbsi)
{

   Hscore * out = NULL;

   Search_Return_Type ret;

   ret = SEARCH_ERROR;

   out = std_score_Hscore(bits_cutoff,report_level);

   if( dbsi == NULL ) {
      warn("Passed a NULL dbsi search implementaion object. Exiting without searching");
      goto exit;
   }

   if( querydb == NULL ) {
      warn("Passed a NULL querydb. Exiting without searching");
      goto exit;
   }

   if( targetdb == NULL ) {
      warn("Passed a NULL targetdb. Exiting without searching");
      goto exit;
   }

   if( comp == NULL ) {
      warn("Passed a NULL comparison matrix. Exiting without searching");
      goto exit;
   }

   ret = search_ProteinBlockAligner(dbsi,out,querydb,targetdb,comp,bentry,bexit,bfor_trans,b_self_trans,b3exit);

   exit:

   return out;
}
Ejemplo n.º 3
0
int main(int argc,char **argv)
{
  FiveStateFrameSet * frame;
  
  FiveStateModel * fsm;
  FiveStateScore * fss;

  RandomModel * rm;

  ProteinDB * proteindb;
  DBSearchImpl * dbsi;
  Hscore * hs;

  double gathering_cutoff = 0.0;
  double bits;
  int i;

  dbsi = new_DBSearchImpl_from_argv(&argc,argv);

  strip_out_float_argument(&argc,argv,"ga",&gathering_cutoff);

  strip_out_standard_options(&argc,argv,show_help,show_version);
  if( argc != 3 ) {
    show_help(stdout);
    exit(12);
  }

  rm = default_RandomModel();

  frame = read_FiveStateFrameSet_file(argv[1],"block.str");
  if( frame == NULL ) 
    fatal("Unable to make FiveStateModel from context %s, block.str file",argv[1]);
  fsm   = FiveStateModel_from_FiveStateFrameSet(frame);
  /*    dump_FiveStateModel(fsm,stdout); */
  fsm->name = stringalloc(argv[1]);
  
  fold_RandomModel_into_FiveStateModel(fsm,rm);  

  /* converts probabilities to integers for calculation */
  fss = FiveStateScore_from_FiveStateModel(fsm);
  

  proteindb = single_fasta_ProteinDB(argv[2]);

  if( proteindb== NULL )
    fatal("Unable to make proteindb from %s",argv[2]);


  hs = std_score_Hscore(Probability2Score(gathering_cutoff)-10,-1);


  search_FiveStateProtein(dbsi,hs,fss,proteindb);



  fprintf(stdout,"\n\n#High Score list\n");
  fprintf(stdout,"#Protein ID                 DNA Str  ID                        Bits Evalue\n");  
  fprintf(stdout,"--------------------------------------------------------------------------\n");

  for(i=0;i<hs->len;i++) {
    bits = Score2Bits(hs->ds[i]->score);
    if( bits < gathering_cutoff ) {
      break;
    }


    fprintf(stdout,"Protein %-20sDNA [%c] %-24s %.2f\n",hs->ds[i]->query->name,hs->ds[i]->target->is_reversed == TRUE ? '-' : '+',hs->ds[i]->target->name,bits);
  }


}