Skip to content

Commit

Permalink
Fixed findInterval error reported by Andrew Jaffe.
Browse files Browse the repository at this point in the history
The error was caused by overlapping genes of different length.
  • Loading branch information
andreyshabalin committed Jan 26, 2018
1 parent 0de2ffa commit 454aacd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions R/Matrix_eQTL_engine.R
Original file line number Diff line number Diff line change
Expand Up @@ -1732,8 +1732,13 @@ Matrix_eQTL_main = function(
# ge.r = sapply(geneloc, function(x)x[nrow(x) , 2] );
sn.l = sapply(snpsloc, "[", 1 );
sn.r = sapply(snpsloc, tail, 1 );
ge.l = sapply(geneloc, "[", 1, 1 );
ge.r = sapply( lapply(geneloc, tail.matrix, 1 ), "[", 2);
ge.l = sapply(geneloc, min);
ge.r = sapply(geneloc, max);

# For find interval
ge.l = rev(cummin(rev(ge.l)));
ge.r = cummax(ge.r);

gg.1 = findInterval( sn.l, ge.r + cisDist + 1) + 1;
gg.2 = findInterval( sn.r, ge.l - cisDist );
rm(sn.l, sn.r, ge.l, ge.r);
Expand Down

0 comments on commit 454aacd

Please sign in to comment.