|
| 1 | +/* |
| 2 | +
|
| 3 | +Pollux |
| 4 | +Copyright (C) 2014 Eric Marinier |
| 5 | +
|
| 6 | +This program is free software: you can redistribute it and/or modify |
| 7 | +it under the terms of the GNU General Public License as published by |
| 8 | +the Free Software Foundation, either version 3 of the License, or |
| 9 | +(at your option) any later version. |
| 10 | +
|
| 11 | +This program is distributed in the hope that it will be useful, |
| 12 | +but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | +GNU General Public License for more details. |
| 15 | +
|
| 16 | +You should have received a copy of the GNU General Public License |
| 17 | +along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | +
|
| 19 | +*/ |
| 20 | + |
| 21 | +#include <stdlib.h> |
| 22 | +#include "Correction.h" |
| 23 | + |
| 24 | +Correction* createCorrection(Reads** reads, unsigned int numReadSets, |
| 25 | + KMerHashTable* kmers, unsigned int kmerSize, unsigned int lowKMerThreshold, |
| 26 | + char* outputDirectory, CorrectionFunction correctionFunction) |
| 27 | +{ |
| 28 | + Correction* correction = (Correction*)malloc(sizeof(Correction)); |
| 29 | + |
| 30 | + correction->reads = reads; |
| 31 | + correction->numReadSets = numReadSets; |
| 32 | + |
| 33 | + correction->kmers = kmers; |
| 34 | + correction->kmerSize = kmerSize; |
| 35 | + correction->lowKMerThreshold = lowKMerThreshold; |
| 36 | + |
| 37 | + correction->substitutions = true; |
| 38 | + correction->insertions = true; |
| 39 | + correction->deletions = true; |
| 40 | + correction->homopolymers = true; |
| 41 | + |
| 42 | + correction->outputDirectory = outputDirectory; |
| 43 | + |
| 44 | + correction->correctionFunction = correctionFunction; |
| 45 | + |
| 46 | + return correction; |
| 47 | +} |
| 48 | + |
| 49 | +Reads** correctionGetReads(Correction* correction) |
| 50 | +{ |
| 51 | + return correction->reads; |
| 52 | +} |
| 53 | + |
| 54 | +unsigned int correctionGetNumReadSets(Correction* correction) |
| 55 | +{ |
| 56 | + return correction->numReadSets; |
| 57 | +} |
| 58 | + |
| 59 | +KMerHashTable* correctionGetKMers(Correction* correction) |
| 60 | +{ |
| 61 | + return correction->kmers; |
| 62 | +} |
| 63 | + |
| 64 | +unsigned int correctionGetKMerSize(Correction* correction) |
| 65 | +{ |
| 66 | + return correction->kmerSize; |
| 67 | +} |
| 68 | + |
| 69 | +unsigned int correctionGetLowThreshold(Correction* correction) |
| 70 | +{ |
| 71 | + return correction->lowKMerThreshold; |
| 72 | +} |
| 73 | + |
| 74 | +CorrectionFunction correctionGetFunction(Correction* correction) |
| 75 | +{ |
| 76 | + return correction->correctionFunction; |
| 77 | +} |
| 78 | + |
| 79 | +char* correctionGetOutputDirectory(Correction* correction) |
| 80 | +{ |
| 81 | + return correction->outputDirectory; |
| 82 | +} |
0 commit comments