Skip to content

Commit

Permalink
Ignore strand in calcPercentOverlap
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffbhasin committed Sep 4, 2017
1 parent 320bbd4 commit da4370b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion R/annotate.r
Expand Up @@ -506,7 +506,13 @@ calcOverlapForReportExons <- function(query.gr, subject.gr, sum.all=TRUE, report
# expands the output to include 0%s - should match row number of query.gr
calcPercentOverlap <- function(query.gr, subject.gr, sum.all=TRUE, report.bp=FALSE)
{
#subject.gr <- reduce(subject.gr)
# this function gives a percent without respect to strand (run twice on each strand separate for stranded results)
# ignore strand if it was given in input GRanges
strand(query.gr) <- "*"
strand(subject.gr) <- "*"
# need to set reduce the subject so overlapping ranges on different strand are now one range
subject.gr <- reduce(subject.gr)

overlaps.fo <- findOverlaps(query.gr, subject.gr)

# compute width of each overlap row
Expand Down

0 comments on commit da4370b

Please sign in to comment.