File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -74,10 +74,14 @@ function renderGenotypes(ctx: DataCanvasRenderingContext2D,
7474 var width = Math . max ( 1 , Math . round ( scale ( variant . position + 1 ) - scale ( variant . position ) ) ) ;
7575 vc . calls . forEach ( call => {
7676 var y = yForRow ( callSetNames . indexOf ( call . callSetName ) ) ;
77- ctx . fillStyle = call . genotype . reduce ( ( a , b ) => a + b , 0 ) == 1 ? style . GENOTYPE_FILL_HET : style . GENOTYPE_FILL_HOM ;
78- ctx . strokeStyle = ctx . fillStyle ;
79- ctx . fillRect ( x - 0.2 , y , width , style . GENOTYPE_HEIGHT ) ;
80- ctx . strokeRect ( x - 0.2 , y , width , style . GENOTYPE_HEIGHT ) ;
77+ var callSum = call . genotype . reduce ( ( a , b ) => a + b , 0 ) ;
78+ // do not display 0,0 calls
79+ if ( callSum > 0 ) {
80+ ctx . fillStyle = callSum == 1 ? style . GENOTYPE_FILL_HET : style . GENOTYPE_FILL_HOM ;
81+ ctx . strokeStyle = ctx . fillStyle ;
82+ ctx . fillRect ( x - 0.2 , y , width , style . GENOTYPE_HEIGHT ) ;
83+ ctx . strokeRect ( x - 0.2 , y , width , style . GENOTYPE_HEIGHT ) ;
84+ }
8185 } ) ;
8286 ctx . popObject ( ) ;
8387 } ) ;
You can’t perform that action at this time.
0 commit comments