Guest User

Untitled

a guest
Oct 10th, 2012
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 1.58 KB | None | 0 0
  1.  
  2. //for every hypothetical kmer
  3.     foreach(ref h_kmer; taskPool.parallel(h_kmer2fid.keys))
  4.     {
  5.     //look and see if it appears in the known kmers
  6.         auto k_fid_bool = k_kmer2fid.get(h_kmer, null);
  7.         float average;
  8.         int count;
  9.         int count2;
  10.         string toPrint;
  11.     //if it does appear
  12.         if(k_fid_bool != null)
  13.         {
  14.         //pull out the hypothetical fid's associated with a kmer
  15.             foreach(ref h_fid; h_kmer2fid[h_kmer].keys)
  16.             {
  17.                 count = 0;
  18.                 toPrint ~= h_fid; toPrint ~= "\n";
  19.  
  20.         //FIGURE OUT COUNT HERE
  21.                 //foreach(ref k_fid; k_fid_bool.keys)
  22.                 //{
  23.                 //    count += k_fid_bool.length;//fid_kmer_count[h_fid][k_fid][h_kmer] = 1;
  24.                 //}
  25.         //for each known fid, that has the hypo kmer
  26.         count2 = 0;
  27.                 foreach(ref k_fid; k_fid_bool.keys)
  28.                 {
  29.                     average = to!float(count)/k_fid2kmer[k_fid].length;
  30.                     //writeln(count);
  31.                     if(average >= .7)
  32.                     {
  33.                         count2 += 1; //increment number of fids above 70%
  34.                         if(verbose)
  35.                         {
  36.                             toPrint ~= "\t"; toPrint ~= k_fid;
  37.                             toPrint ~=" ";  toPrint ~= to!string(average);
  38.                             toPrint ~= "\n";
  39.                         }
  40.                     }
  41.                     //toPrint ~= to!string(count2);
  42.                 }
  43.             }
  44. //            writeln(toPrint);
  45.         }
  46.     }
Advertisement
Add Comment
Please, Sign In to add comment