Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //for every hypothetical kmer
- foreach(ref h_kmer; taskPool.parallel(h_kmer2fid.keys))
- {
- //look and see if it appears in the known kmers
- auto k_fid_bool = k_kmer2fid.get(h_kmer, null);
- float average;
- int count;
- int count2;
- string toPrint;
- //if it does appear
- if(k_fid_bool != null)
- {
- //pull out the hypothetical fid's associated with a kmer
- foreach(ref h_fid; h_kmer2fid[h_kmer].keys)
- {
- count = 0;
- toPrint ~= h_fid; toPrint ~= "\n";
- //FIGURE OUT COUNT HERE
- //foreach(ref k_fid; k_fid_bool.keys)
- //{
- // count += k_fid_bool.length;//fid_kmer_count[h_fid][k_fid][h_kmer] = 1;
- //}
- //for each known fid, that has the hypo kmer
- count2 = 0;
- foreach(ref k_fid; k_fid_bool.keys)
- {
- average = to!float(count)/k_fid2kmer[k_fid].length;
- //writeln(count);
- if(average >= .7)
- {
- count2 += 1; //increment number of fids above 70%
- if(verbose)
- {
- toPrint ~= "\t"; toPrint ~= k_fid;
- toPrint ~=" "; toPrint ~= to!string(average);
- toPrint ~= "\n";
- }
- }
- //toPrint ~= to!string(count2);
- }
- }
- // writeln(toPrint);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment