Commit d3428e35 authored by Raquel Bromberg's avatar Raquel Bromberg

Bug fixed in code for generating scrambled proteomes

parent a51aac66
...@@ -60,9 +60,9 @@ class org ...@@ -60,9 +60,9 @@ class org
void setp_discrepancy(double d); void setp_discrepancy(double d);
void setp_conserved(int i); void setp_conserved(int i);
void setp_chosen_column(int i); void setp_chosen_column(int i);
void setp_set_pv_size(int i); // void setp_set_pv_size(int i);
void setp_set_pvv_size(int i); void setp_set_pvv_size(int i);
void setp_set_pv_val(int index, int i1, int i2, int i3, int i4, int i5); // void setp_set_pv_val(int index, int i1, int i2, int i3, int i4, int i5);
void setp_set_pvv_gnums_val(int index, vector<int> vals); void setp_set_pvv_gnums_val(int index, vector<int> vals);
void setp_set_pvv_gis_val(int index, vector<int> vals); void setp_set_pvv_gis_val(int index, vector<int> vals);
void setp_set_keeper(int index,int i); void setp_set_keeper(int index,int i);
...@@ -93,20 +93,20 @@ class org ...@@ -93,20 +93,20 @@ class org
void fill_fields(string dir_par); void fill_fields(string dir_par);
void generate_tags(bool do_scrambled, bool partial_run); void generate_tags(bool do_scrambled, bool partial_run);
void generate_scrambled_tags(); // void generate_scrambled_tags();
void clear_tags(); void clear_tags();
void clear_scr_tags(); void clear_scr_tags();
void write_out_aa_array(ofstream& outstream); void write_out_aa_array(ofstream& outstream);
int mark_keepers(vector<string> keepers); int mark_keepers(vector<string> keepers);
void write_out_gene(int index); void write_out_gene(int index);
void clear_proteins(); void clear_proteins();
void increment_ggs(int gene_id,int gnums_size,int vector_size); // void increment_ggs(int gene_id,int gnums_size,int vector_size);
void increment_ggs(int gene_id,int gnums_size,int vector_size,double d); void increment_ggs(int gene_id,int gnums_size,int vector_size,double d);
void write_out_new_proteome(int index); void write_out_new_proteome(int index);
void add_file(string s); void add_file(string s);
void add_discr(int instances, double avg_rep); void add_discr(int instances, double avg_rep);
double get_discr(); double get_discr();
void count_conserved(); void increment_conserved();
void count_filtered_proteomes(vector<int>& v); void count_filtered_proteomes(vector<int>& v);
void push_back_file_size(int fs); void push_back_file_size(int fs);
void add_aa_count(int index, int count); void add_aa_count(int index, int count);
...@@ -161,11 +161,11 @@ void org::generate_tags(bool do_scrambled, bool partial_run) ...@@ -161,11 +161,11 @@ void org::generate_tags(bool do_scrambled, bool partial_run)
p.generate_tags(ordinal,do_scrambled,partial_run); p.generate_tags(ordinal,do_scrambled,partial_run);
} }
void org::generate_scrambled_tags() /*void org::generate_scrambled_tags()
{ {
p.generate_scrambled_tags(ordinal); p.generate_scrambled_tags(ordinal);
} }
*/
void org::set_ordinal(int i) void org::set_ordinal(int i)
{ {
ordinal=i; ordinal=i;
...@@ -202,10 +202,11 @@ void org::setp_size_real_tags(int i) ...@@ -202,10 +202,11 @@ void org::setp_size_real_tags(int i)
p.set_size_real_tags(i); p.set_size_real_tags(i);
} }
void org::setp_set_pv_val(int index,int i1, int i2, int i3, int i4, int i5) /*void org::setp_set_pv_val(int index,int i1, int i2, int i3, int i4, int i5)
{ {
p.set_pv_val(index,i1,i2,i3,i4,i5); p.set_pv_val(index,i1,i2,i3,i4,i5);
} }
*/
void org::setp_set_pvv_gnums_val(int index, vector<int> vals) void org::setp_set_pvv_gnums_val(int index, vector<int> vals)
{ {
...@@ -231,10 +232,10 @@ void org::setp_chosen_column(int i) ...@@ -231,10 +232,10 @@ void org::setp_chosen_column(int i)
p.set_chosen_column(i); p.set_chosen_column(i);
} }
void org::setp_set_pv_size(int i) /*void org::setp_set_pv_size(int i)
{ {
p.set_pv_size(i); p.set_pv_size(i);
} }*/
void org::setp_set_pvv_size(int i) void org::setp_set_pvv_size(int i)
{ {
...@@ -478,6 +479,7 @@ void org::write_out_aa_array(ofstream& outstream) ...@@ -478,6 +479,7 @@ void org::write_out_aa_array(ofstream& outstream)
if(total_num_aa<=0) if(total_num_aa<=0)
{ {
cout<<"In org::write_out_aa_array(ofstream&). total_num_aa="<<total_num_aa<<endl; cout<<"In org::write_out_aa_array(ofstream&). total_num_aa="<<total_num_aa<<endl;
cout<<"ordinal="<<ordinal<<endl;
exit(1); exit(1);
} }
...@@ -526,10 +528,10 @@ void org::clear_proteins() ...@@ -526,10 +528,10 @@ void org::clear_proteins()
p.clear_proteins(); p.clear_proteins();
} }
void org::increment_ggs(int gene_id,int gnums_size,int vector_size) /*void org::increment_ggs(int gene_id,int gnums_size,int vector_size)
{ {
p.increment_ggs(gene_id,gnums_size,vector_size); p.increment_ggs(gene_id,gnums_size,vector_size);
} }*/
void org::increment_ggs(int gene_id,int gnums_size,int vector_size,double d) void org::increment_ggs(int gene_id,int gnums_size,int vector_size,double d)
{ {
...@@ -585,9 +587,9 @@ double org::get_discr() ...@@ -585,9 +587,9 @@ double org::get_discr()
return p.get_discr(); return p.get_discr();
} }
void org::count_conserved() void org::increment_conserved()
{ {
p.count_conserved(); p.increment_conserved();
} }
int org::get_conserved() int org::get_conserved()
......
This diff is collapsed.
...@@ -63,7 +63,8 @@ int main(int argc, char* argv[]) ...@@ -63,7 +63,8 @@ int main(int argc, char* argv[])
u.rm_mkdir(path+"/"+bfn,"TAGSscr"); u.rm_mkdir(path+"/"+bfn,"TAGSscr");
u.rm_mkdir(path+"/"+bfn,"HIST"); u.rm_mkdir(path+"/"+bfn,"HIST");
u.rm_mkdir(path+"/"+bfn,"SAVEDORGS"); u.rm_mkdir(path+"/"+bfn,"SAVEDORGS");
srand(time(NULL));
#pragma omp parallel for #pragma omp parallel for
for(int i=0; i<to; i++) for(int i=0; i<to; i++)
{ {
......
...@@ -35,7 +35,7 @@ const bool DO_SCRAMBLING = true; //DO_SCRAMBLING: Can be set to false when user ...@@ -35,7 +35,7 @@ const bool DO_SCRAMBLING = true; //DO_SCRAMBLING: Can be set to false when user
//generating very slightly different results; keeping this random background //generating very slightly different results; keeping this random background
//constant can be useful for testing/debugging, etc. //constant can be useful for testing/debugging, etc.
const int NUM_FILES_CUTOFF = 5; //NUM_FILES_CUTOFF: For each directory of .faa files, checks how many there are in total. const int NUM_FILES_CUTOFF = 10; //NUM_FILES_CUTOFF: For each directory of .faa files, checks how many there are in total.
//If there are more .faa files than this cutoff, the organism is flagged in //If there are more .faa files than this cutoff, the organism is flagged in
//problematic_inputs.txt. This is to facilitate identifying downloads //problematic_inputs.txt. This is to facilitate identifying downloads
//which consist of hundreds of .faa files for a single organism. //which consist of hundreds of .faa files for a single organism.
...@@ -634,6 +634,7 @@ void sttagger::write_out_tags_v2() ...@@ -634,6 +634,7 @@ void sttagger::write_out_tags_v2()
organisms.at(0).clear_tags(); organisms.at(0).clear_tags();
outstream.close(); outstream.close();
/*
ofstream histstream; ofstream histstream;
histstream.open( (path+"/"+bfn+"/"+bfn+"_hist.txt").c_str()); histstream.open( (path+"/"+bfn+"/"+bfn+"_hist.txt").c_str());
if(histstream.fail()) if(histstream.fail())
...@@ -645,7 +646,7 @@ void sttagger::write_out_tags_v2() ...@@ -645,7 +646,7 @@ void sttagger::write_out_tags_v2()
histstream<<ordinal<<endl<<organisms.at(0).get_total_num_aa()<<endl; histstream<<ordinal<<endl<<organisms.at(0).get_total_num_aa()<<endl;
organisms.at(0).write_out_aa_array(outstream); organisms.at(0).write_out_aa_array(outstream);
histstream<<endl; histstream<<endl;
histstream.close(); histstream.close();*/
} }
void sttagger::write_out_scr_tags(int organism) void sttagger::write_out_scr_tags(int organism)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment