Skip to content

Commit

Permalink
fixed the indexing bug that was assigning wrong gene_id for intergeni…
Browse files Browse the repository at this point in the history
…c features. fixes #16
  • Loading branch information
retaj committed Apr 25, 2017
1 parent 1ceaab1 commit 428be39
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
6 changes: 3 additions & 3 deletions R/annotate.R
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,10 @@ annotateHostGenes <- function(se, genes.gr) {
start(circ.ends.gr) <- end(circ.ends.gr)

olap.start <- findOverlaps(circ.starts.gr, genes.gr, type = "within")
olap.end <- findOverlaps(circ.ends.gr, genes.gr, type = "within")
olap.end <- findOverlaps(circ.ends.gr, genes.gr, type = "within")

This comment has been minimized.

Copy link
@mschilli87

mschilli87 Apr 25, 2017

Collaborator

in case the linter complains, this might be the cause 😉


circs <- data.table(start.hit = names(circs.gr) %in% queryHits(olap.start),
end.hit = names(circs.gr) %in% queryHits(olap.end),
circs <- data.table(start.hit = 1:length(circs.gr) %in% queryHits(olap.start),
end.hit = 1:length(circs.gr) %in% queryHits(olap.end),
id = circs.gr$id,
ord = 1:length(circs.gr))

Expand Down
29 changes: 27 additions & 2 deletions inst/scripts/test_load_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,19 @@ circs.se <- summarizeCircs(colData = cdata, keep.linear = FALSE, wobble = 1,
circs.se <- annotateCircs(se = circs.se, annot.list = annot.list,
assembly = "hg19")

# issue16
tmp <- resTable(circs.se)
tmp[feature == "intergenic:intergenic" & gene_id != "intergenic"]
tmp.gr <- GRanges(seqnames = tmp[feature == "intergenic:intergenic" & gene_id != "intergenic"][3:7,]$chr,
ranges = IRanges(start=tmp[feature == "intergenic:intergenic" & gene_id != "intergenic"][3:7]$start,
end=tmp[feature == "intergenic:intergenic" & gene_id != "intergenic"][3:7]$end),
strand = "-")

tmp.gr <- range(tmp.gr)


# find_circ2
annot.list <- loadAnnotation("data/test.sqlite")
annot.list <- loadAnnotation("inst/extdata/db/test.sqlite")

cdata <- data.frame(sample = c("D0", "D2", "D4"),
filename = c("inst/extdata/Sy5y_D0_sites.bed",
Expand All @@ -32,12 +43,26 @@ circs.se <- summarizeCircs(colData = cdata, wobble = 1, keepCols = 1:19)
circs.se <- annotateCircs(se = circs.se, annot.list = annot.list,
assembly = "hg19", fixCoordIndexing = T)


# issue #16

histogram(circs.se, 0.5)
annotPie(circs.se, 0.02)
uniqReadsQC(circs.se, "all")

## issue #16 #
tmp <- resTable(circs.se)
tmp[feature=="intergenic:intergenic" & gene_id == "no_single_host"]
rowRanges(circs.se)[start(rowRanges(circs.se))==119107780]
rowRanges(circs.se)[start(rowRanges(circs.se))==180669210]

rowRanges(circs.se)[start(rowRanges(circs.se)) %in% c(119107780, 180669210)]

sub.se <- circs.se[c(which(start(rowRanges(circs.se)) %in% c(119107779, 180669209)), 200:300),]





# development
#library(data.table)
#library(GenomicRanges)
Expand Down

3 comments on commit 428be39

@mschilli87
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole thing was now pushed to dev, but all pull-request target dev2.
Should I rebase dev2 on dev?
I'd suggest to send future fixes to dev2 until we merge dev2 to master, delete dev, branch a new dev from master, bump the version, re-target remaining PRs from dev2 to (new) dev & finally get rid of dev2 again (see #43 (comment)).

@mschilli87
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this commit to dev2 without creating a merge commit.
So now dev2 is again the same as dev but withot the merge of #43 pulling in the failing Windows tests.

@mschilli87
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to force-push another change to dev2 to get a working build for each commit as Travis is still using Ubuntu 12.04 (until July when they'll switch to 14.04) and the CRAN guys seem to have dropped support for that (see travis-ci/travis-ci#7654 (comment)). So we are now testing on 14.04 'already'. 🎉

Please sign in to comment.