File: seerBasicFilter.cpp

package info (click to toggle)
seer 1.1.4-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,692 kB
  • sloc: cpp: 2,945; perl: 596; python: 122; makefile: 92; sh: 43
file content (33 lines) | stat: -rw-r--r-- 761 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
 * File: seerFilter.cpp
 *
 * Can be filtered in kmds or seer
 * Filters kmers that won't be meaningfully associated.
 * Saves time over performing regressions on all, and reduces false positives
 *
 */

#include "seercommon.hpp"

// k-mer length and frequency
int passBasicFilters(const cmdOptions& filterOptions, const Kmer& k)
{
   int passed = 1;

   // Don't test long kmers
   if (k.length() > filterOptions.max_length)
   {
      passed = 0;
   }

   // Impose min words
   // TODO may want to make this more sophisticated, make sure there are at
   // least ten words in each category
   if (passed && (k.num_occurrences() < filterOptions.min_words || k.num_occurrences() > filterOptions.max_words))
   {
      passed = 0;
   }

   return passed;
}