Mentions légales du service

Skip to content
Snippets Groups Projects
Commit ae37630d authored by Vincent Liard's avatar Vincent Liard
Browse files

remove ae_genetic_unit::get_protein_list() calls

parent 75372db7
No related branches found
No related tags found
No related merge requests found
......@@ -129,9 +129,9 @@ void ae_individual_X11::display_cdss( ae_X11_window* win )
char display_string[40];
sprintf( display_string, "Main chromosome size : %" PRId32 "bp", genome_length );
win->draw_string( 15, 25, display_string );
sprintf( display_string, "Leading : %" PRId32 " CDSs", gen_unit->get_protein_list()[LEADING]->get_nb_elts() );
sprintf( display_string, "Leading : %" PRId32 " CDSs", static_cast<int32_t>(gen_unit->get_protein_list_std()[LEADING].size()));
win->draw_string( 15, 40, display_string );
sprintf( display_string, "Lagging : %" PRId32 " CDSs", gen_unit->get_protein_list()[LAGGING]->get_nb_elts() );
sprintf( display_string, "Lagging : %" PRId32 " CDSs", static_cast<int32_t>(gen_unit->get_protein_list_std()[LAGGING].size()));
win->draw_string( 15, 55, display_string );
// Compute display diameter according to genome length and window size
......
......@@ -459,14 +459,8 @@ void draw_triangles( ae_individual* indiv, Environment* env, char * directoryNam
double h;
for (auto& gu: indiv->get_genetic_unit_list_std()) {
ae_list_node<ae_protein*>* prot_node = NULL;
ae_protein* prot = NULL;
prot_node = (gu.get_protein_list())[LEADING]->get_first();
while ( prot_node != NULL )
{
prot = (ae_protein*) prot_node->get_obj();
for (const auto& gu: indiv->get_genetic_unit_list_std()) {
for (const auto& prot: gu.get_protein_list_std()[LEADING]) {
h = prot->get_height() * prot->get_concentration();
fprintf( drawingfile, "%lf %lf moveto\n", margin, 0.5);
fprintf( drawingfile, "%lf %lf lineto\n", margin + scalex*(prot->get_mean() - prot->get_width()), 0.5);
......@@ -474,14 +468,9 @@ void draw_triangles( ae_individual* indiv, Environment* env, char * directoryNam
fprintf( drawingfile, "%lf %lf lineto\n", margin + scalex*(prot->get_mean() + prot->get_width()), 0.5);
fprintf( drawingfile, "%lf %lf moveto\n", margin + scalex*(1), 0.5);
fprintf( drawingfile, "stroke\n" );
prot_node = prot_node->get_next();
}
prot_node = (gu.get_protein_list())[LAGGING]->get_first();
while ( prot_node != NULL )
{
prot = (ae_protein*) prot_node->get_obj();
for (const auto& prot: gu.get_protein_list_std()[LAGGING]) {
h = prot->get_height() * prot->get_concentration();
fprintf( drawingfile, "%lf %lf moveto\n", margin, 0.5);
fprintf( drawingfile, "%lf %lf lineto\n", margin + scalex*(prot->get_mean() - prot->get_width()), 0.5);
......@@ -489,8 +478,6 @@ void draw_triangles( ae_individual* indiv, Environment* env, char * directoryNam
fprintf( drawingfile, "%lf %lf lineto\n", margin + scalex*(prot->get_mean() + prot->get_width()), 0.5);
fprintf( drawingfile, "%lf %lf moveto\n", margin + scalex*(1), 0.5);
fprintf( drawingfile, "stroke\n" );
prot_node = prot_node->get_next();
}
}
......@@ -777,9 +764,6 @@ void draw_genetic_unit_with_CDS( ae_genetic_unit* gen_unit, char * directoryName
// genes
// -----------
ae_list_node<ae_protein*>* node = NULL;
ae_protein* prot = NULL;
int32_t first;
int32_t last;
int8_t layer = 0;
......@@ -811,10 +795,7 @@ void draw_genetic_unit_with_CDS( ae_genetic_unit* gen_unit, char * directoryName
// printf("LEADING\n" );
node = (gen_unit->get_protein_list())[LEADING]->get_first();
while (node != NULL)
{
prot = (ae_protein *) node->get_obj();
for (const auto& prot: gen_unit->get_protein_list_std()[LEADING]) {
first = prot->get_first_translated_pos();
last = prot->get_last_translated_pos();
// h = prot->get_height() * prot->get_concentration();
......@@ -906,16 +887,11 @@ void draw_genetic_unit_with_CDS( ae_genetic_unit* gen_unit, char * directoryName
fprintf( drawingfile, "%lf %lf %lf %d %d arc\n", 0.5, 0.5, r + layer*0.02, theta_last, theta_first);
fprintf( drawingfile, "stroke\n" );
}
node = node->get_next();
}
// printf("LAGGING\n" );
node = (gen_unit->get_protein_list())[LAGGING]->get_first();
while (node != NULL)
{
prot = (ae_protein *) node->get_obj();
for (const auto& prot: gen_unit->get_protein_list_std()[LAGGING]) {
first = prot->get_first_translated_pos();
last = prot->get_last_translated_pos();
// h = prot->get_height() * prot->get_concentration();
......@@ -1007,8 +983,6 @@ void draw_genetic_unit_with_CDS( ae_genetic_unit* gen_unit, char * directoryName
fprintf( drawingfile, "%lf %lf %lf %d %d arc\n", 0.5, 0.5, r - layer*0.02, theta_first, theta_last);
fprintf( drawingfile, "stroke\n" );
}
node = node->get_next();
}
......
......@@ -265,22 +265,12 @@ int main(int argc, char** argv)
// where the paralogs (gene copies created by duplication) will be monitored
ae_list<ae_gene_tree*> * gene_trees = new ae_list<ae_gene_tree*>();
ae_list_node<ae_protein*> *prot_node = NULL;
ae_protein *prot = NULL;
for (const auto& unit: indiv->get_genetic_unit_list_std()) {
prot_node = (unit.get_protein_list()[LEADING])->get_first();
while(prot_node != NULL) {
prot = prot_node->get_obj();
for (const auto& prot: unit.get_protein_list_std()[LEADING])
gene_trees->add(new ae_gene_tree(begin_gener, prot));
prot_node = prot_node->get_next();
}
prot_node = (unit.get_protein_list()[LAGGING])->get_first();
while(prot_node != NULL) {
prot = prot_node->get_obj();
for (const auto& prot: unit.get_protein_list_std()[LAGGING])
gene_trees->add(new ae_gene_tree(begin_gener, prot));
prot_node = prot_node->get_next();
}
}
// ===============================================================================
......@@ -426,28 +416,16 @@ int main(int argc, char** argv)
register_actual_mutation_effect_on_genes_in_trees(gene_trees, &mut, &*unit, num_gener, impact_on_metabolic_error);
/* New genes that have been created "from scratch", i.e. not by duplication => new gene tree */
prot_node = (unit->get_protein_list()[LEADING])->get_first();
while (prot_node != NULL)
{
prot = prot_node->get_obj();
search_protein_in_gene_trees(gene_trees, prot, &genetree, &genetreenode);
if (genetreenode == NULL)
{
gene_trees->add(new ae_gene_tree(num_gener, prot, &mut));
}
prot_node = prot_node->get_next();
}
prot_node = (unit->get_protein_list()[LAGGING])->get_first();
while (prot_node != NULL)
{
prot = prot_node->get_obj();
search_protein_in_gene_trees(gene_trees, prot, &genetree, &genetreenode);
if (genetreenode == NULL)
{
gene_trees->add(new ae_gene_tree(num_gener, prot, &mut));
}
prot_node = prot_node->get_next();
}
for (const auto& prot: unit->get_protein_list_std()[LEADING]) {
search_protein_in_gene_trees(gene_trees, prot, &genetree, &genetreenode);
if (genetreenode == nullptr)
gene_trees->add(new ae_gene_tree(num_gener, prot, &mut));
}
for (const auto& prot: unit->get_protein_list_std()[LAGGING]) {
search_protein_in_gene_trees(gene_trees, prot, &genetree, &genetreenode);
if (genetreenode == nullptr)
gene_trees->add(new ae_gene_tree(num_gener, prot, &mut));
}
// print_gene_trees_to_screen(gene_trees);// DEBUG
// indiv->print_protein_list(); // DEBUG
}
......@@ -470,28 +448,16 @@ int main(int argc, char** argv)
register_actual_mutation_effect_on_genes_in_trees(gene_trees, &mut, &*unit, num_gener, impact_on_metabolic_error);
/* New genes that have been created "from scratch", i.e. not by duplication => new gene tree */
prot_node = (unit->get_protein_list()[LEADING])->get_first();
while (prot_node != NULL)
{
prot = prot_node->get_obj();
search_protein_in_gene_trees(gene_trees, prot, &genetree, &genetreenode);
if (genetreenode == NULL)
{
gene_trees->add(new ae_gene_tree(num_gener, prot, &mut));
}
prot_node = prot_node->get_next();
}
prot_node = (unit->get_protein_list()[LAGGING])->get_first();
while (prot_node != NULL)
{
prot = prot_node->get_obj();
search_protein_in_gene_trees(gene_trees, prot, &genetree, &genetreenode);
if (genetreenode == NULL)
{
gene_trees->add(new ae_gene_tree(num_gener, prot, &mut));
}
prot_node = prot_node->get_next();
}
for (const auto& prot: unit->get_protein_list_std()[LEADING]) {
search_protein_in_gene_trees(gene_trees, prot, &genetree, &genetreenode);
if (genetreenode == nullptr)
gene_trees->add(new ae_gene_tree(num_gener, prot, &mut));
}
for (const auto& prot: unit->get_protein_list_std()[LAGGING]) {
search_protein_in_gene_trees(gene_trees, prot, &genetree, &genetreenode);
if (genetreenode == nullptr)
gene_trees->add(new ae_gene_tree(num_gener, prot, &mut));
}
}
if ( check_now && ae_utils::mod(num_gener, backup_step) == 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment