-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tests to check generated data correctness #61
Comments
I numbered items of this issue. Seems (1)(2)(3)(4)(5) can be assigned to current Shall I create PR to compare contorolled test result for test (1)(2)(3)(4)(5) ? |
… Remove unused old test files
Issue #61 (2) Examine result files of `cljam pileup` in test
Issue #61 (6) Examine result file of `dedupe` in test
Issue #61 (5) Examine result file of `create-dict` in test
…n test/cljam/util/t_chromosome.clj
Supplied tests for (1)(2)(4)(5)(6). I have not good idea for (3). I commit ayamada@f2ed61b for (7), work well, but it cause very long time in |
Issue #61 (1) Examine result file of `cljam normalize` in test
Issue #61 (4) Examine result file of `create-mpileup` based on (2)
About (3) For small BAM files, it might be easier to check levels manually with IGV, For more complex BAM files, we need some programatic approach. One option is to fork samtools. https://github.com/samtools/htslib/blob/95b1034/htslib/sam.h#L527
It may be possible to output SAM records or pairs of QNAME and level from that struct. |
@alumi Thanks for your explanation. |
I checked ayamada/cljam@a134664 and the levels seem to be correct. Thanks! just FYI I wrote rough patch, and tested the bam file with commands like I got following SAM and it's equal to levels in ayamada/cljam@a134664.
diff --git bam_tview.c bam_tview.c
index 206ac8b..7b16d93 100644
--- bam_tview.c
+++ bam_tview.c
@@ -62,7 +62,7 @@ int base_tv_init(tview_t* tv, const char *fn, const char *fn_fa,
{
assert(tv!=NULL);
assert(fn!=NULL);
- tv->mrow = 24; tv->mcol = 80;
+ tv->mrow = 8000; tv->mcol = 80;
tv->color_for = TV_COLOR_MAPQ;
tv->is_dot = 1;
@@ -113,6 +113,7 @@ void base_tv_destroy(tview_t* tv)
sam_close(tv->fp);
}
+samFile* gOUT;
int tv_pl_func(uint32_t tid, uint32_t pos, int n, const bam_pileup1_t *pl, void *data)
{
@@ -166,6 +167,10 @@ int tv_pl_func(uint32_t tid, uint32_t pos, int n, const bam_pileup1_t *pl, void
for (j = 0; j <= max_ins; ++j) {
for (i = 0; i < n; ++i) {
const bam_pileup1_t *p = pl + i;
+ bam1_t* d = bam_dup1(p->b);
+ uint32_t lv = p->level - 1;
+ bam_aux_append(d, "LV", 'i', 4, (uint8_t*)&lv);
+ sam_write1(gOUT, tv->header, d);
int row = TV_MIN_ALNROW + p->level - tv->row_shift;
if (j == 0) {
if (!p->is_del) {
@@ -409,7 +414,7 @@ int bam_tview_main(int argc, char *argv[])
error("cannot create view");
return EXIT_FAILURE;
}
-
+ gOUT = sam_open_format("-", "w", 0);
if ( position )
{
int tid, beg, end;
@@ -417,7 +422,7 @@ int bam_tview_main(int argc, char *argv[])
if (name_lim) *name_lim = '\0';
else beg = 0; // region parsing failed, but possibly a seq named "foo:a"
tid = bam_name2id(tv->header, position);
- if (tid >= 0) { tv->curr_tid = tid; tv->left_pos = beg; }
+ if (tid >= 0) { tv->curr_tid = tid; tv->left_pos = beg; tv->mcol = end;}
}
else if ( tv->fai )
{
@@ -437,6 +442,6 @@ int bam_tview_main(int argc, char *argv[])
tv->my_drawaln(tv, tv->curr_tid, tv->left_pos);
tv->my_loop(tv);
tv->my_destroy(tv);
-
+ sam_close(gOUT);
return EXIT_SUCCESS;
}
diff --git bam_tview_html.c bam_tview_html.c
index e3aecda..a7927b5 100644
--- bam_tview_html.c
+++ bam_tview_html.c
@@ -327,7 +327,7 @@ tview_t* html_tv_init(const char *fn, const char *fn_fa, const char *samples,
}
tv->row_count=0;
tv->screen=NULL;
- tv->out=stdout;
+ tv->out=stderr;
tv->attributes=0;
base_tv_init(base,fn,fn_fa,samples,fmt);
/* initialize callbacks */ |
Issue #61 (3) Examine result file of `cljam level` test
(Came from #60 (review) )
Add many tests by #60, but some tests doesn't check generated(converted) result data.
Should check these data (but may need correct result data).
cljam/test/cljam/t_cli.clj
Line 53 in ff91c66
cljam normalize
in test #66cljam/test/cljam/t_cli.clj
Line 96 in ff91c66
cljam pileup
in test #65NB: "pileup" output format may change in future (maybe)
.cljam/test/cljam/t_cli.clj
Line 142 in ff91c66
cljam level
test #70cljam/test/cljam/t_pileup.clj
Line 218 in ff91c66
create-mpileup
based on (2) #67cljam/test/cljam/t_dict.clj
Line 17 in ff91c66
create-dict
in test #64cljam/test/cljam/t_dedupe.clj
Line 11 in ff91c66
dedupe
in test #63cljam/test/cljam/t_sorter.clj
Line 110 in ff91c66
lein cloverage
, may not merge it.The text was updated successfully, but these errors were encountered: