Skip to content

Commit

Permalink
moved the check condition for gtf one level down to test for txdb obj…
Browse files Browse the repository at this point in the history
…ect first

Former-commit-id: 6a1019c
  • Loading branch information
cying111 committed Jul 28, 2020
1 parent 5738053 commit 87b4a0e
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 87b4a0e

Please sign in to comment.