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;
   //   }
}