Skip to content

Commit

Permalink
Merge pull request #146 from GoekeLab/bambu-devel
Browse files Browse the repository at this point in the history
update annotationFunction to test txdb object first 

Former-commit-id: 7e3cdae
  • Loading branch information
cying111 authored Jul 28, 2020
2 parents baa55d6 + 87b4a0e commit 0458b3b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions R/annotationFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
#' package = "bambu")
#' gr <- prepareAnnotationsFrom(x = gtf.file)
prepareAnnotations <- function(x) {
if(grepl(".gtf",x)){
return(prepareAnnotationsFromGTF(x))
}
if(class(x) == "TxDb"){
exonsByTx = exonsBy(txdb,by='tx', use.names=TRUE)
if(any(duplicated(names(exonsByTx)))) {
Expand All @@ -37,8 +34,14 @@ prepareAnnotations <- function(x) {
minEqClasses <- getMinimumEqClassByTx(exonsByTx)
mcols(exonsByTx)$eqClass <- minEqClasses$eqClass[match(names(exonsByTx),minEqClasses$queryTxId)]
return(exonsByTx)
}else{
if(grepl(".gtf",x)){
return(prepareAnnotationsFromGTF(x))
}

}


}


Expand Down

0 comments on commit 0458b3b

Please sign in to comment.