Commit 85b8053f authored by Raquel Bromberg's avatar Raquel Bromberg

Code cleanup, mostly commented code deleted

parent 1cadca46
...@@ -234,7 +234,7 @@ int main(int argc, char* argv[]) ...@@ -234,7 +234,7 @@ int main(int argc, char* argv[])
exit(1); exit(1);
} }
ofstream outstream3; /* ofstream outstream3;
string outfile3 = path+"/"+bfn+"/bin_corrections_unlikelies.txt"; string outfile3 = path+"/"+bfn+"/bin_corrections_unlikelies.txt";
outstream3.open(outfile3.c_str(), ios::out | ios::app); outstream3.open(outfile3.c_str(), ios::out | ios::app);
if(outstream3.fail()) if(outstream3.fail())
...@@ -242,6 +242,7 @@ int main(int argc, char* argv[]) ...@@ -242,6 +242,7 @@ int main(int argc, char* argv[])
cout<<"Failed to open outstream3 to "<<outfile3<<endl; cout<<"Failed to open outstream3 to "<<outfile3<<endl;
exit(1); exit(1);
} }
*/
outstream<<num_bins<<endl<<endl; outstream<<num_bins<<endl<<endl;
...@@ -330,8 +331,8 @@ int main(int argc, char* argv[]) ...@@ -330,8 +331,8 @@ int main(int argc, char* argv[])
} }
outstream<<endl; outstream<<endl;
outstream3<<i<<" to "<<j<<endl; // outstream3<<i<<" to "<<j<<endl;
outstream3<<uscore<<endl<<most_unlikely<<endl<<endl; // outstream3<<uscore<<endl<<most_unlikely<<endl<<endl;
} }
} }
} }
......
This diff is collapsed.
...@@ -26,7 +26,7 @@ class org ...@@ -26,7 +26,7 @@ class org
int total_num_aa; //total number of amino acids in the proteome int total_num_aa; //total number of amino acids in the proteome
int total_num_proteins; //total number of proteins in the proteome int total_num_proteins; //total number of proteins in the proteome
int tag_length; int tag_length;
bool conserved; //what the hell is this? bool conserved;
int filtering_steps; int filtering_steps;
vector<string> files; //e.g. NC_021726.faa vector<string> files; //e.g. NC_021726.faa
...@@ -93,14 +93,12 @@ class org ...@@ -93,14 +93,12 @@ 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 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,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);
...@@ -115,14 +113,6 @@ class org ...@@ -115,14 +113,6 @@ class org
void write_filtered_set(ofstream& outstream, int filt_option); void write_filtered_set(ofstream& outstream, int filt_option);
//GETTERS AND SETTERS //GETTERS AND SETTERS
//void add_file(string f);
//void set_uid(string u);
//vector<string> get_files();
//string get_uid();
//string get_path();
//string get_bfn();
int get_ordinal(); int get_ordinal();
}; };
...@@ -161,11 +151,6 @@ void org::generate_tags(bool do_scrambled, bool partial_run) ...@@ -161,11 +151,6 @@ 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()
{
p.generate_scrambled_tags(ordinal);
}
*/
void org::set_ordinal(int i) void org::set_ordinal(int i)
{ {
ordinal=i; ordinal=i;
...@@ -173,7 +158,6 @@ void org::set_ordinal(int i) ...@@ -173,7 +158,6 @@ void org::set_ordinal(int i)
void org::setp_set_keeper(int index,int i) void org::setp_set_keeper(int index,int i)
{ {
// cout<<"In setp_set_keeper(int,int): "<<index<<" "<<i<<endl;
p.set_keeper(index,i); p.set_keeper(index,i);
} }
...@@ -202,12 +186,6 @@ void org::setp_size_real_tags(int i) ...@@ -202,12 +186,6 @@ 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)
{
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)
{ {
p.set_pvv_gnums_val(index,vals); p.set_pvv_gnums_val(index,vals);
...@@ -232,11 +210,6 @@ void org::setp_chosen_column(int i) ...@@ -232,11 +210,6 @@ 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)
{
p.set_pv_size(i);
}*/
void org::setp_set_pvv_size(int i) void org::setp_set_pvv_size(int i)
{ {
p.set_pvv_size(i); p.set_pvv_size(i);
...@@ -339,11 +312,7 @@ int org::read_faa_file(int i,int& total_aa) ...@@ -339,11 +312,7 @@ int org::read_faa_file(int i,int& total_aa)
instream>>eater; instream>>eater;
} }
//we now have both the info_line and the protein sequence. //we now have both the info_line and the protein sequence.
//cout<<"Adding a protein"<<endl;
//cout<<info_line<<endl;
p.add_protein(info_line,aaseq); p.add_protein(info_line,aaseq);
//cout<<"info_line = "<<info_line<<endl;
//cout<<"aaseq = "<<aaseq<<endl;
add_aa_counts(aaseq); add_aa_counts(aaseq);
result+=aaseq.length(); result+=aaseq.length();
aaseq=""; aaseq="";
...@@ -376,19 +345,6 @@ int org::get_tags_size() ...@@ -376,19 +345,6 @@ int org::get_tags_size()
return p.get_tags_size(); return p.get_tags_size();
} }
/*
//GETTERS AND SETTERS
void org::add_file(string f)
{
files.push_back(f);
}
vector<string> org::get_files()
{
return files;
}
*/
string org::get_file(int i) string org::get_file(int i)
{ {
if(i>=0 && i<files.size()) if(i>=0 && i<files.size())
...@@ -421,18 +377,7 @@ string org::get_directory() ...@@ -421,18 +377,7 @@ string org::get_directory()
{ {
return directory; return directory;
} }
/*
void org::set_uid(string u)
{
uid = u;
}
string org::get_uid()
{
return uid;
}
*/
void org::set_path(string p) void org::set_path(string p)
{ {
path = p; path = p;
...@@ -448,15 +393,6 @@ void org::set_dir(string s) ...@@ -448,15 +393,6 @@ void org::set_dir(string s)
dir=s; dir=s;
} }
/*
string org::get_path()
{
return path;
}
*/
void org::add_aa_counts(string s) void org::add_aa_counts(string s)
{ {
for(int i=0; i<s.length(); i++) for(int i=0; i<s.length(); i++)
...@@ -489,13 +425,6 @@ void org::write_out_aa_array(ofstream& outstream) ...@@ -489,13 +425,6 @@ void org::write_out_aa_array(ofstream& outstream)
} }
} }
/*
string org::get_bfn()
{
return bfn;
}
*/
string org::get_dir() string org::get_dir()
{ {
return dir; return dir;
...@@ -520,7 +449,7 @@ void org::mark_gene_internal_repeats(int index) ...@@ -520,7 +449,7 @@ void org::mark_gene_internal_repeats(int index)
void org::write_out_gene(int index) void org::write_out_gene(int index)
{ {
p.print_protein_info(index); // p.print_protein_info(index);
} }
void org::clear_proteins() void org::clear_proteins()
...@@ -528,11 +457,6 @@ void org::clear_proteins() ...@@ -528,11 +457,6 @@ void org::clear_proteins()
p.clear_proteins(); p.clear_proteins();
} }
/*void org::increment_ggs(int gene_id,int gnums_size,int 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)
{ {
p.increment_ggs(gene_id,gnums_size,vector_size,d); p.increment_ggs(gene_id,gnums_size,vector_size,d);
...@@ -546,24 +470,14 @@ void org::write_out_new_proteome(int index) ...@@ -546,24 +470,14 @@ void org::write_out_new_proteome(int index)
cout<<"dir = "<<dir<<endl; cout<<"dir = "<<dir<<endl;
cout<<"directory = "<<directory<<endl; cout<<"directory = "<<directory<<endl;
/*
string outcommand = "rm -r "+path+"/FAA_new/"+directory;
int system_return = system(outcommand.c_str());
outcommand = "mkdir "+path+"/FAA_new/"+directory;
system_return = system(outcommand.c_str());
*/
stringstream ss; stringstream ss;
ss<<index; ss<<index;
string col; string col;
ss>>col; ss>>col;
//string s = path+bfn+"/FAA_new_col"+col+"/"+directory;
//cout<<"s = "<<s<<endl;
vector<pair<int,int> > mscv; vector<pair<int,int> > mscv;
populate_mscv(mscv); populate_mscv(mscv);
p.write_out_new_proteome_v2(path,directory,files,ordinal,mscv,index); p.write_out_new_proteome_v2(path,directory,files,ordinal,mscv,index);
//instream.open( (path+"/"+dir+"/"+directory+"/"+files.at(i)).c_str() );
} }
void org::add_file(string s) void org::add_file(string s)
...@@ -636,7 +550,6 @@ void org::populate_mscv(vector<pair<int,int> >& mscv) ...@@ -636,7 +550,6 @@ void org::populate_mscv(vector<pair<int,int> >& mscv)
instream.open(infile.c_str()); instream.open(infile.c_str());
if(instream.fail()) if(instream.fail())
{ {
//Just leave it alone. File doesn't exist. Leave mscv empty.
} }
else else
{ {
...@@ -654,7 +567,6 @@ void org::populate_mscv(vector<pair<int,int> >& mscv) ...@@ -654,7 +567,6 @@ void org::populate_mscv(vector<pair<int,int> >& mscv)
foo.first=gene_id; foo.first=gene_id;
foo.second=count; foo.second=count;
mscv.push_back(foo); mscv.push_back(foo);
//mscv[gene_id]=count;
instream>>gnum>>gene_id>>count; instream>>gnum>>gene_id>>count;
} }
} }
......
This diff is collapsed.
...@@ -17,13 +17,10 @@ class protein ...@@ -17,13 +17,10 @@ class protein
int gene_ids; int gene_ids;
bool deleter; bool deleter;
bool manually_include; //beats deleter. bool manually_include; //beats deleter.
//set<int> genome_hits;
public: public:
protein(); protein();
void mark_keeper(); void mark_keeper();
//void add_hit(int i);
//void write_genome_hits(ofstream& outstream);
void add_gnums(int i); void add_gnums(int i);
void add_gis(int i); void add_gis(int i);
void mark_for_deletion(); void mark_for_deletion();
...@@ -40,7 +37,6 @@ class protein ...@@ -40,7 +37,6 @@ class protein
//getters //getters
string get_sequence(); string get_sequence();
string get_info_line(); string get_info_line();
//int get_genome_hits_size();
int get_gnums(); int get_gnums();
int get_geneids(); int get_geneids();
bool get_deleter(); bool get_deleter();
...@@ -77,41 +73,16 @@ void protein::set_id(int i) ...@@ -77,41 +73,16 @@ void protein::set_id(int i)
id = i; id = i;
} }
/*void protein::add_hit(int i)
{
genome_hits.insert(i);
}
*/
string protein::get_sequence() string protein::get_sequence()
{ {
return sequence; return sequence;
} }
/*void protein::write_genome_hits(ofstream& outstream)
{
set<int>::iterator it;
for(it=genome_hits.begin(); it!=genome_hits.end(); ++it)
{
outstream<<*it<<" ";
}
outstream<<endl;
}
*/
string protein::get_info_line() string protein::get_info_line()
{ {
return info_line; return info_line;
} }
/*
int protein::get_genome_hits_size()
{
return genome_hits.size();
}
*/
void protein::add_gnums(int i) void protein::add_gnums(int i)
{ {
gnums+=i; gnums+=i;
...@@ -151,12 +122,8 @@ void protein::reset_deleters() ...@@ -151,12 +122,8 @@ void protein::reset_deleters()
{ {
if(deleter) if(deleter)
{ {
cout<<"reset_deleters for: "<<endl;
print_protein_info(); print_protein_info();
gnums=0; gnums=0;
//int staller;
//cout<<"Stalling: ";
//cin>>staller;
} }
} }
......
This diff is collapsed.
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