Skip to content

Commit

Permalink
minor bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ischeller committed Dec 20, 2019
1 parent f0bf2d5 commit 12e6eb0
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 8 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Suggests:
covr,
TxDb.Hsapiens.UCSC.hg19.knownGene,
org.Hs.eg.db,
AnnotationDbi,
LinkingTo:
Rcpp,
RcppArmadillo
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ exportMethods(strandSpecific)
exportMethods(workingDir)
import(BiocParallel)
import(data.table)
importFrom(AnnotationDbi,select)
importFrom(BBmisc,"%nin%")
importFrom(BBmisc,chunk)
importFrom(BBmisc,is.error)
Expand Down
1 change: 1 addition & 0 deletions R/FRASER-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
### Annotation
#'
#' @importFrom biomaRt useEnsembl getBM
#' @importFrom AnnotationDbi select
#'
#'
### Plotting
Expand Down
25 changes: 21 additions & 4 deletions R/annotationOfRanges.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
#' @param GRCh GRCh version to connect to. If this is NULL, then the current
#' GRCh38 is used. Otherwise, this can only be 37 (default) at the moment
#' (see \code{\link{useEnsebml}}).
#' @param txdb A TxDb object (default: TxDb.Hsapiens.UCSC.hg19.knownGene).
#' @param orgDb An orgDb object (default: org.Hs.eg.db).
#' @param txdb A TxDb object. If this is NULL, then the default one is used,
#' currently this is TxDb.Hsapiens.UCSC.hg19.knownGene
#' @param orgDb An orgDb object If this is NULL, then the default one is used,
#' currently this is org.Hs.eg.db
#'
#' @return FraseRDataSet
#'
Expand Down Expand Up @@ -87,13 +89,28 @@ annotateRanges <- function(fds, feature="hgnc_symbol", featureName=feature,
#' @export
annotateRangesWithTxDb <- function(fds, feature="SYMBOL",
featureName="hgnc_symbol",
txdb=TxDb.Hsapiens.UCSC.hg19.knownGene,
orgDb=org.Hs.eg.db){
txdb=NULL, orgDb=NULL){

# check input
stopifnot(is(fds, "FraseRDataSet"))
if(length(fds) == 0) return(fds)

if(is.null(txdb)){
if(requireNamespace("TxDb.Hsapiens.UCSC.hg19.knownGene")){
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene
} else{
stop("Please provide a TxDb object as input.")
}

}
if(is.null(orgDb)){
if(requireNamespace("org.Hs.eg.db")){
orgDb <- org.Hs.eg.db
} else{
stop("Please provide an OrgDb object to extract gene symbols")
}
}

for(i in c("psi3", "psiSite")){
# get GRanges object with the split reads which should be annotated
gr <- rowRanges(fds, type=i)
Expand Down
5 changes: 5 additions & 0 deletions R/methods-makeExampleObj.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
#' \code{makeFittedExampleFraseRDataSet} additionally runs the FRASER
#' pipeline.
#'
#' @param workingDir directory where to store HDF5 and RDS files. Defaults to
#' the current tempory R session folder.
#' @param rerun Defaults to \code{FALSE}. If set to \code{TRUE} it reruns the
#' full fit of the model.
#'
#' @return FraseRDataSet
#'
#' @examples
Expand Down
10 changes: 6 additions & 4 deletions man/annotateRanges.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions man/makeExampleFraseRDataSet.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 12e6eb0

Please sign in to comment.