forked from gkarthik/ivar
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test for amino acid translation taking strand into account
- Loading branch information
Showing
4 changed files
with
71 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
test 1 G 20 GGGGGGGGGGGGGGGGGGGG ???????????????????? | ||
test 2 A 20 AAAAAAAAAAAAAAAAAAAA ???????????????????? | ||
test 3 G 20 GGGGGGGGGGGGGGGGGGGG ???????????????????? | ||
test 4 G 20 GGGGGGGGGGGGGGGGGGGG ???????????????????? | ||
test 5 C 20 CCCCCCCCCCTTTTTTTTTT ???????????????????? | ||
test 6 T 20 TTTTTTTTTTTTTTTTTTTT ???????????????????? | ||
test 7 G 20 GGGGGGGGGGGGGGGGGGGG ???????????????????? | ||
test 8 C 20 CCCCCCCCCCCCCCCCCCCC ???????????????????? | ||
test 9 C 20 CCCCCCCCCCCCCCCCCCCC ???????????????????? | ||
test 10 A 20 AAAAAAAAAAAAAAAAAAAA ???????????????????? | ||
test 11 G 20 GGGGGGGGGGGGGGGGGGGG ???????????????????? | ||
test 12 C 20 CCCCCCCCCCCCCCCCCCCC ???????????????????? | ||
test 13 C 20 CCCCCCCCCCCCCCCCCCCC ???????????????????? | ||
test 14 G 20 GGGGGGGGGGGGGGGGGGGG ???????????????????? | ||
test 15 G 20 GGGGGGGGGGCCCCCCCCCC ???????????????????? | ||
test 16 A 20 AAAAAAAAAAAAAAAAAAAA ???????????????????? | ||
test 17 C 20 CCCCCCCCCCCCCCCCCCCC ???????????????????? | ||
test 18 T 20 TTTTTTTTTTTTTTTTTTTT ???????????????????? | ||
test 19 T 20 TTTTTTTTTTTTTTTTTTTT ???????????????????? | ||
test 20 C 20 CCCCCCCCCCCCCCCCCCCC ???????????????????? |
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,3 @@ | ||
## GFF3 file format | ||
test Genbank CDS 1 9 . + . ID=test1;Note=positiveStrand;gene=A; | ||
test Genbank CDS 11 20 . - . ID=test2;Note=negativeStrand;gene=B; |
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,45 @@ | ||
#include <fstream> | ||
#include <iostream> | ||
#include <string> | ||
|
||
#include "../src/allele_functions.h" | ||
#include "../src/call_variants.h" | ||
|
||
int call_var_check_outfile(std::string prefix, uint8_t min_qual, | ||
uint8_t min_depth, double min_threshold, | ||
std::string out[], int len) { | ||
std::string path = "../data/test.strand.pileup"; | ||
std::ifstream mplp(path); | ||
call_variants_from_plup(mplp, prefix, min_qual, min_threshold, min_depth, | ||
"../data/db/test_ref.fa", "../data/test_strand.gff"); | ||
std::ifstream outFile(prefix + ".tsv"); | ||
std::string l; | ||
getline(outFile, l); // Ignore first line | ||
int comp = 0, ctr = 0; | ||
|
||
while (ctr < len) { | ||
getline(outFile, l); | ||
std::cout << l << std::endl; | ||
std::cout << out[ctr] << " -> CORRECT" << std::endl; | ||
comp += l.compare(out[ctr]); | ||
std::cout << l.compare(out[ctr]) << "\n"; | ||
ctr++; | ||
} | ||
return comp; | ||
} | ||
|
||
int main() { | ||
int num_success = 0; | ||
// Quality threshold 20. Frequency threshold: 0.03. Total_DP = 3. Indel passes | ||
// filters with total_depth 4. Has two lines. | ||
std::string expected_out[2] = { | ||
"test\t5\tC\tT\t10\t0\t30\t10\t0\t30\t0.5\t20\t0.000290613\tTRUE\tA:test1\tGCT\tA\tGTT\tV\t2", | ||
"test\t15\tG\tC\t10\t0\t30\t10\t0\t30\t0.5\t20\t0.000290613\tTRUE\tB:test2\tGTC\tV\tGTG\tV\t2" | ||
}; | ||
num_success = | ||
call_var_check_outfile("../data/test_strand", 20, 0, 0.03, expected_out, 2); | ||
std::cout << num_success << std::endl; | ||
|
||
if (num_success == 0) return 0; | ||
return -1; | ||
} |