Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
retaj committed Dec 4, 2018
2 parents eb5fc37 + f745735 commit 15ca013
Show file tree
Hide file tree
Showing 21 changed files with 515 additions and 55 deletions.
2 changes: 0 additions & 2 deletions .lintr
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Note: There is are two copies of this file (.lintr & inst/.lint) that need to
# be kept in sync (see https://github.com/jimhester/covr/issues/253)
# see https://github.com/jimhester/lintr#project-configuration
linters: with_defaults(
camel_case_linter = NULL, # 133
Expand Down
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ r_github_packages:

# See https://docs.travis-ci.com/user/languages/r/#R-Versions
r:
# - oldrel
- oldrel
- release
- devel

# See https://github.com/travis-ci/travis-ci/issues/7654#issuecomment-297051230
# TODO: check for 'latest', 'previous', etc. mappings
dist: trusty

sudo: required
bioc_required: true

Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
ciRcus 0.1.6
------------
NEW FEATURES

* new bedTracks()/writeBedTracks() functions generating BED6-style
GRangesList/writing BED files for circRNA browser tracks
* added D. melanogaster (dm6) and R. norvegicus (rn6) support

IMPROVEMENTS AND BUG FIXES

* using "coarse" pruning.mode in keepStandardChromosomes when building annotation
* introduced a number of bugfixes (and probably new bugs)

ciRcus 0.1.5
------------
NEW FEATURES
Expand Down
5 changes: 4 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,23 @@ Imports:
AnnotationDbi,
AnnotationHub,
biomaRt,
BiocGenerics,
data.table,
DBI,
GenomeInfoDb,
GenomicFeatures,
GenomicRanges,
ggplot2,
hash,
IRanges,
RColorBrewer,
RMySQL,
rtracklayer,
S4Vectors,
stringr,
SummarizedExperiment
Suggests:
testthat,
knitr,
lintr
RoxygenNote: 6.0.1
RoxygenNote: 6.1.0
9 changes: 9 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export(annotateCircs)
export(annotateFlanks)
export(annotateHostGenes)
export(annotateJunctions)
export(bedTracks)
export(circLinRatio)
export(getStudiesList)
export(gtf2sqlite)
Expand All @@ -18,6 +19,7 @@ export(resTable)
export(summarizeCircs)
export(testCoordinateIndexing)
export(uniqReadsQC)
export(writeBedTracks)
import(AnnotationHub)
import(DBI)
import(RMySQL)
Expand All @@ -28,7 +30,12 @@ import(methods)
import(stringr)
importFrom(AnnotationDbi,loadDb)
importFrom(AnnotationDbi,saveDb)
importFrom(BiocGenerics,sort)
importFrom(GenomeInfoDb,"seqlevels<-")
importFrom(GenomeInfoDb,"seqlevelsStyle<-")
importFrom(GenomeInfoDb,seqlevelsStyle)
importFrom(GenomicFeatures,makeTxDbFromGRanges)
importFrom(GenomicRanges,GRangesList)
importFrom(GenomicRanges,makeGRangesFromDataFrame)
importFrom(GenomicRanges,reduce)
importFrom(GenomicRanges,resize)
Expand All @@ -45,3 +52,5 @@ importFrom(data.table,set)
importFrom(data.table,setnames)
importFrom(hash,hash)
importFrom(hash,keys)
importFrom(rtracklayer,export)
importFrom(rtracklayer,score)
25 changes: 14 additions & 11 deletions R/annotate.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
#'
#' @export
gtf2sqlite <-
function(assembly = c("hg19", "hg38", "mm10", "rn5", "dm6", "WBcel235"),
function(assembly = c("hg19", "hg38", "mm10", "rn5", "rn6", "dm6",
"WBcel235"),
db.file) {

ah <- AnnotationHub()
Expand Down Expand Up @@ -105,7 +106,7 @@ setMethod("loadAnnotation", signature("character"),
setGeneric("annotateCircs",
function(se,
annot.list,
assembly = c("hg19", "hg38", "mm10", "rn5", "dm6",
assembly = c("hg19", "hg38", "mm10", "rn5", "rn6", "dm6",
"WBcel235"),
fixCoordIndexing = TRUE,
...)
Expand All @@ -115,7 +116,7 @@ setGeneric("annotateCircs",
#' @rdname annotateCircs-methods
setMethod("annotateCircs", signature("RangedSummarizedExperiment"),
function(se, annot.list,
assembly = c("hg19", "hg38", "mm10", "rn5", "dm6",
assembly = c("hg19", "hg38", "mm10", "rn5", "rn6", "dm6",
"WBcel235"),
fixCoordIndexing = TRUE, ...) {

Expand Down Expand Up @@ -149,11 +150,13 @@ setMethod("annotateCircs", signature("RangedSummarizedExperiment"),
}

# check seqlevel style, match input
if (!any(seqlevelsStyle(annot.list$genes) %in%
seqlevelsStyle(se))) {
warning("nonmatching seqlevel styles, will fix automatically")
for (i in 1:length(annot.list)) {
seqlevelsStyle(annot.list[[i]]) <- seqlevelsStyle(se)
if (class(try(seqlevelsStyle(se), TRUE)) != "try-error") {
if (!any(seqlevelsStyle(annot.list$genes) %in%
seqlevelsStyle(se))) {
warning("nonmatching seqlevel styles, will fix automatically")
for (i in 1:length(annot.list)) {
seqlevelsStyle(annot.list[[i]]) <- seqlevelsStyle(se)
}
}
}

Expand Down Expand Up @@ -200,10 +203,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")

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
10 changes: 8 additions & 2 deletions R/circus.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,19 @@
#' @importFrom AnnotationDbi saveDb loadDb
#' @import AnnotationHub
#' @importFrom biomaRt useMart useDataset getBM
#' @importFrom BiocGenerics sort
#' @importFrom data.table data.table rbindlist dcast.data.table set setnames fread
#' @import DBI
#' @importFrom GenomicRanges makeGRangesFromDataFrame resize reduce
#' @importFrom GenomeInfoDb seqlevelsStyle seqlevelsStyle<- seqlevels<-
#' @importFrom GenomicRanges makeGRangesFromDataFrame resize reduce GRangesList
#' @importFrom GenomicFeatures makeTxDbFromGRanges
#' @import ggplot2
#' @importFrom hash hash keys
#' @importFrom IRanges findOverlaps
#' @import methods
#' @importFrom RColorBrewer brewer.pal
#' @import RMySQL
#' @importFrom rtracklayer export score
#' @import S4Vectors
#' @import stringr
#' @import SummarizedExperiment
Expand Down Expand Up @@ -55,6 +58,7 @@ NULL
"79" = "mar2015.archive.ensembl.org",
"80" = "may2015.archive.ensembl.org",
"81" = "jul2015.archive.ensembl.org",
"91" = "dec2017.archive.ensembl.org",
"current" = "ensembl.org"
),

Expand All @@ -68,8 +72,9 @@ NULL
assembly2annhub = list("hg19" = "AH10684",
"hg38" = "AH47963",
"mm10" = "AH47973",
"dm6" = "AH47953",
"dm6" = "AH60052",
"rn5" = "AH28841",
"rn6" = "AH60238",
"WBcel235" = "AH47942"
),

Expand All @@ -78,6 +83,7 @@ NULL
"mm10" = "current",
"dm6" = "current",
"rn5" = "79",
"rn6" = "91",
"WBcel235" = "81"
),

Expand Down
Loading

0 comments on commit 15ca013

Please sign in to comment.