Commits

Mathieu Lajoie  committed f17645a Merge

Merged in bugfix (pull request #1)

  • Participants
  • Parent commits 6d03c56, 637c242

Comments (0)

Files changed (6)

 syntax: glob
-OUT/*.png
-OUT/*.html
-OUT/*.txt
-OUT/*positions
-OUT/*heatmap
+OUT/*
+RES/*
+DATA/*
 SOFT/obj/*
 red2
 *~
+6d03c56b0d8813c8fbddc93f71e62900d4326214 v1.0_release

File SOFT/src/data_loader.h

       ss>>name;
 
       while(ss>>value){
+	value = max(value,-1e+200);
+	value = min(value,+1e+200);
 	v_vec.push_back(value);
       }
 

File SOFT/src/experiment.h

 
   cout<<nb_genes<<" genes in intersection"<<endl;
   cout<<nb_excluded_genes<<" excluded genes (no sequence match)"<<endl;
-
-  if(nb_genes==0){
+  
+  if(ERROR.str()!=""){
     return 0;
   }
 
     cout<<"Shuffling profiles!!!"<<ENDL;
     p_dl->shuffle_profiles();
   }
-
-  //MOTIF EXTRACT
-  //p_me = new Motif_extract(p_dl->get_seq(),p_dl->get_names(),param);  
-
+ 
   p_me = new Motif_extract(p_dl->get_seq(),
 			   p_dl->get_names(),
 			   param.W_SIZE, 
   //NEXPRESSION
   int max_k = min(nb_genes,param.K_GLOB);
   p_ne = new Expression(p_dl->get_profiles(),p_dl->get_profile_labels(),p_dl->get_names(),param);
-  //p_ne->shuffle_uniform();
+ 
   p_ne->define_neighbourhood(max_k);
 
   p_se = new Scan_expression(p_ne->get_profiles(),p_ne->get_sorted_genes(),
 
   p_se->get_density_sd(m.positive_vec, m.density_vec);  
 
-  m.coverage = p_me->get_coverage(m.occ_vec);//WATCH OUT safe
+  m.coverage = p_me->get_coverage(m.occ_vec);
 
   m.score = p_se->get_score(m.positive_vec);
-  //m.z_score = p_se->get_z_score(m.positive_vec,100);
+
   m.size = m.regex_vec[0].size();
-  //m.motif_str.size();
 
   p_ne->get_mean_profile(m.positive_vec,m.mean_profile);
 
   p_me->get_strand_bias(m.regex_vec, m.f_occ, m.r_occ, m.strand_bias);
-
-  /*
-  Int1D pos_vec; 
-  p_me->get_positive_genes_forward(m.regex_vec,pos_vec);
-  m.forward_score = p_se->get_score(pos_vec);
-
-  p_me->get_positive_genes_reverse(m.regex_vec,pos_vec);
-  m.reverse_score = p_se->get_score(pos_vec);
-
-  p_me->get_positive_genes_both(m.regex_vec,pos_vec);
-  m.both_strand_score = p_se->get_score(pos_vec);
-
-  m.strand_ratio = ((m.forward_score+0.00000000001)/(m.reverse_score+0.00000000001));
-  */
-
-  //update seed-corr
-  //Int1D seed_pos_vec;p_me->get_positive_genes(m.seed.seed_str,seed_pos_vec);
-  //Double1D seed_density_vec;p_se->get_density_sd(seed_pos_vec,seed_density_vec);
-  //m.motif_seed_corr = pearsonCorr(m.density_vec,seed_density_vec);
 }
 
 #endif

File SOFT/src/scan_expression.h

     cout<<"Setting K = "<<k_glob<<" in Scan_expression"<<ENDL;
     K_GLOB = k_glob;
     if(k_glob>=nb_genes){
-      cerr<<"K_GLOB > nb genes in Scan_expression::set_kglob(int k_glob) : "<<k_glob<<ENDL;
+      cout<<"K_GLOB > nb genes in Scan_expression::set_kglob(int k_glob) : "<<k_glob<<ENDL;
     }   
     if(k_glob==0){
-      cerr<<"K_GLOB = 0 in Scan_expression::set_kglob(int k_glob) : "<<k_glob<<ENDL;
+      cout<<"K_GLOB = 0 in Scan_expression::set_kglob(int k_glob) : "<<k_glob<<ENDL;
     } 
   };
 

File SOFT/src/stats.h

 /*based on histogram estimation*/
 inline void get_heat_map(const Double2D& all, const Int1D& subset_vec, Double2D& res, int nb_bins){
   
-  /*
-  if(subset_vec.size()!=all.size()){
-    cerr<<" Error in get_heat_map(const Double2D& al..."<<ENDL;
-    exit(0);
-  }
-  */
-
   double min=0;
   double max=0;  
   get_min_max(all, min, max);
-
   Int2D all_hist_table; //ALL PROFILES
   Int2D sub_hist_table; //SUBSET
   int vec_size = all.size();
   Int1D all_vec(vec_size,1);
   get_hist_table(all,all_vec, all_hist_table, min,max,nb_bins); 
   get_hist_table(all,subset_vec, sub_hist_table, min,max,nb_bins);
-
    
   int sub_size = get_nb_pos(subset_vec);
   int all_size = all_vec.size();