Exemplo n.º 1
0
boolean build_alignment(void)
{
  GeneParameter21 * gpara;
  GeneModel * gm;

  if( pal_file != NULL ) {
    pal = read_simple_PackAln_file(pal_file);
  }


  if( use_new_stats == 0 ) {
    gpara = GeneParameter21_wrap(gf,subs_error,indel_error,rmd,model_codon,model_splice,use_tied_model,ct,rnd_loop,cds_loop,rnd_to_model,link_loop,link_to_model);
  } else {
    gm = GeneModel_from_GeneStats(gs,gmp);
    
    gpara= GeneParameter21_from_GeneModel(gm,ct,rnd_loop,cds_loop,rnd_to_model,link_loop,link_to_model,subs_error,indel_error);
  }
  

  if( gpara == NULL ) {
    warn("Sorry - could not build gene parameters. Must be a bug of some sort");
    return FALSE;
  }

  
  /* phased based proteins use a different source */

  if( alg == GWWRAP_623P ) {
    alb = AlnBlock_from_phased_protein_wrap(pro,tsm,gen,gpara->cm,rm,mat,ppp,gpara,dpri,&pal);
  } else {
    if( use_tsm == FALSE) {
      alb =  AlnBlock_from_protein_genewise_wrap(pro,gen,mat,-gap,-ext,gpara,rmd,rmd,alg,use_syn,rm,allN,startend,dpri,&pal,gwrp);
    } else {
      alb =  AlnBlock_from_TSM_genewise_wrap(tsm,gen,gpara,rmd,rmd,use_syn,alg,allN,flat_insert,dpri,&pal,NULL);
    }
  }

  free_GeneParameter21(gpara);



  if( alb == NULL )
    return FALSE;


  gr = new_GenomicRegion(gen);


  add_Genes_to_GenomicRegion_GeneWise(gr,gen->baseseq->offset,gen->baseseq->end,alb,use_tsm == TRUE ? tsm->name : pro->baseseq->name,pseudo,NULL);

  if( use_tsm == TRUE) 
    mss = MatchSummarySet_from_AlnBlock_genewise(alb,tsm->name,1,gen->baseseq);
  else
    mss = MatchSummarySet_from_AlnBlock_genewise(alb,pro->baseseq->name,pro->baseseq->offset,gen->baseseq);

  return TRUE;
}
Exemplo n.º 2
0
GeneModel * GeneModel_from_GeneModelParam(GeneModelParam * p)
{
  GeneStats * st;
  GeneModel * out;

  assert(p);

  st = GeneStats_from_GeneModelParam(p);

  out = GeneModel_from_GeneStats(st,p);

  free_GeneStats(st);

  return out;
}
Exemplo n.º 3
0
int main(int argc,char ** argv)
{
  Sequence * seq;

  ComplexSequence * cs;
  ComplexSequenceEvalSet * cset;


  GeneStats * st;
  GeneModel * gm;
  GeneModelParam * gp;
  FILE * ifp;

  gp = std_GeneModelParam();


  seq = read_fasta_file_Sequence("../../test_data/human.genomic");
  
  ifp = openfile("gene.stat","r");
  
  st = read_GeneStats(ifp); 
  
  /*  dump_GeneStats(st,stdout); */

  fflush(stdout);

  gm = GeneModel_from_GeneStats(st,gp);

  show_GeneModel(gm,stdout);

  fflush(stdout);

  cset = new_ComplexSequenceEvalSet_from_GeneModel(gm);

  cs = new_ComplexSequence(seq,cset);

  show_ComplexSequence(cs,stdout);

}