Beispiel #1
0
   void
loadannots()
{
   ifstream annots;
   annots.open(scangen_args.phenotype_arg);
   if (annots.fail()){
      cerr << "Cannot open phenotype file: " << strerror(errno) << endl;
      exit(EXIT_FAILURE);
   }

   back_insert_iterator<vstring> dest(phenos);
   copy(iisstring(annots),iisstring(),dest);

   annots.close();

   ifstream glist;
   if (species=="droso"){
      cout << "Reading droso genes list..." << endl;
      glist.open( (scangen_datapath+"/droso/annot/genelist.dat").c_str() );
   } else if (species=="eutherian"){
      cout << "Reading eutherian genes list..." << endl;
      glist.open( (scangen_datapath+"/eutherian/annot/genelist.dat").c_str() );
   }
   if (glist.fail()){
      cerr << "Cannot open gene list file: " << strerror(errno) << endl;
      exit(EXIT_FAILURE);
   }

   back_insert_iterator<vstring> destg(gbacks);
   copy(iisstring(glist),iisstring(),destg);

   glist.close();

   for (ivstring ivs=phenos.begin();ivs!=phenos.end();ivs++){
      for (ivstring ivs2=gbacks.begin();ivs2!=gbacks.end();ivs2++){
         if (*ivs2==*ivs){
            gbacks.erase(ivs2);
            break;
         }
      }
   }

   //   for (ivstring ivs=phenos.begin();ivs!=phenos.end();ivs++){
   //      cout << *ivs << endl;
   //   }
}
Beispiel #2
0
   void 
comppheno()
{
   // attribute phenotype to CRMs
   for (unsigned int i=0;i<nbchrom;i++){
      for (ivginst ivg=groupedinst[i].begin();ivg!=groupedinst[i].end();ivg++){
         (*ivg).isdiscarded();
         if (!(*ivg).discarded){
            for (ivstring ivs=phenos.begin();ivs!=phenos.end();ivs++){
               if ((*ivg).besttss.gene==*ivs){
                  (*ivg).goodpheno=1;
                  break;
               } else {
                  (*ivg).goodpheno=0;
               }
            }
         } else {
            (*ivg).goodpheno=0;
         }
      }
   }
   return;
}
 /*!
  * @if jp
  * @brief 与えられた文字列リストから重複を削除
  * @else
  * @brief Eliminate duplication from the given string list
  * @endif
  */
 vstring unique_sv(vstring sv)
 {
   return std::for_each(sv.begin(), sv.end(), unique_strvec()).str;
 }