-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from tfwillems/master
New Alignment Filter
- Loading branch information
Showing
24 changed files
with
719 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
Copyright (C) 2014 Thomas Willems <[email protected]> | ||
This file is part of lobSTR. | ||
lobSTR is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
lobSTR is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with lobSTR. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "src/common.h" | ||
#include "src/FilterCounter.h" | ||
|
||
FilterCounter::FilterCounter(){ | ||
counts = new uint64_t[NUM_FILTERS]; | ||
for (int i = 0; i < NUM_FILTERS; i++) | ||
counts[i] = 0; | ||
} | ||
|
||
void FilterCounter::increment(const int type){ | ||
if (type > NUM_FILTERS || type < 0) | ||
PrintMessageDieOnError("Invalid filter type", ERROR); | ||
counts[type]++; | ||
} | ||
|
||
std::string FilterCounter::GetFilterType(const int type){ | ||
switch(type){ | ||
case NOT_UNIT: | ||
return "NOT_UNIT"; | ||
case DIFF_FROM_REF: | ||
return "DIFF_FROM_REF"; | ||
case MAPPING_QUALITY: | ||
return "MAPPING_QUALITY"; | ||
case MATE_DIST: | ||
return "MATE_DIST"; | ||
case ALLELE_SIZE: | ||
return "ALLELE_SIZE"; | ||
case SPANNING_AMOUNT: | ||
return "SPANNING_AMOUNT"; | ||
case NUM_END_MATCHES: | ||
return "NUM_END_MATCHES"; | ||
case NOT_MAXIMAL_END: | ||
return "NOT_MAXIMAL_END"; | ||
case BP_BEFORE_INDEL: | ||
return "BP_BEFORE_INDEL"; | ||
case UNFILTERED: | ||
return "UNFILTERED"; | ||
default: | ||
PrintMessageDieOnError("Invalid filter type", ERROR); | ||
} | ||
} | ||
|
||
uint64_t FilterCounter::GetFilterCount(const int type){ | ||
if (type > NUM_FILTERS || type < 0) | ||
PrintMessageDieOnError("Invalid filter type", ERROR); | ||
return counts[type]; | ||
} | ||
|
||
|
||
FilterCounter::~FilterCounter(){ | ||
delete [] counts; | ||
} | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
Copyright (C) 2014 Thomas Willems <[email protected]> | ||
This file is part of lobSTR. | ||
lobSTR is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
lobSTR is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with lobSTR. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
|
||
#ifndef SRC_FILTER_COUNTER_H_ | ||
#define SRC_FILTER_COUNTER_H_ | ||
|
||
#include <stdint.h> | ||
|
||
#include <string> | ||
|
||
class FilterCounter { | ||
private: | ||
uint64_t* counts; | ||
|
||
public: | ||
const static int NUM_FILTERS = 10; | ||
|
||
// Various filter types | ||
const static int NOT_UNIT = 0; | ||
const static int DIFF_FROM_REF = 1; | ||
const static int MAPPING_QUALITY = 2; | ||
const static int MATE_DIST = 3; | ||
const static int ALLELE_SIZE = 4; | ||
const static int SPANNING_AMOUNT = 5; | ||
const static int NUM_END_MATCHES = 6; | ||
const static int NOT_MAXIMAL_END = 7; | ||
const static int BP_BEFORE_INDEL = 8; | ||
const static int UNFILTERED = 9; | ||
|
||
FilterCounter(); | ||
|
||
/* Increment the count for the provided filter type */ | ||
void increment(const int type); | ||
|
||
/* Returns the name of the filter associated with the provided filter type */ | ||
std::string GetFilterType(const int type); | ||
|
||
/* Returns the count associated with the provided filter type */ | ||
uint64_t GetFilterCount(const int type); | ||
|
||
~FilterCounter(); | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.