Skip to content

Commit

Permalink
v0.99.16 -- switch to importing functions in txdbmaker that used to b…
Browse files Browse the repository at this point in the history
…e in GenomicFeatures
  • Loading branch information
lcolladotor committed Dec 12, 2024
1 parent 0addce2 commit 9682b17
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
9 changes: 5 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: GenomicState
Title: Build and access GenomicState objects for use with derfinder tools from
sources like Gencode
Version: 0.99.15
Date: 2021-08-09
Version: 0.99.16
Date: 2024-12-12
Authors@R:
person("Leonardo", "Collado-Torres", role = c("aut", "cre"),
email = "[email protected]", comment = c(ORCID = "0000-0003-2140-308X"))
Expand All @@ -22,9 +22,10 @@ Imports:
IRanges,
org.Hs.eg.db,
utils,
methods
methods,
txdbmaker
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
Suggests:
knitr,
rmarkdown,
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ export(gencode_txdb)
export(local_metadata)
import(AnnotationHub)
importFrom(methods,is)
importFrom(txdbmaker,makeTxDbFromGFF)
9 changes: 5 additions & 4 deletions R/gencode_txdb.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#'
#' @return A [GenomicFeatures::TxDb-class] object.
#' @export
#' @importFrom txdbmaker makeTxDbFromGFF
#' @author Leonardo Collado-Torres
#' @references Based on code for the `brainflowprobes` package at:
#' <https://github.com/LieberInstitute/brainflowprobes/blob/devel/data-raw/create_sysdata.R>
Expand Down Expand Up @@ -52,7 +53,7 @@ gencode_txdb <- function(
# gencode_txdb("31", "hg19", chrs = "chr21")
## though it works with
# gencode_txdb("31", "hg18")
# txdb <- GenomicFeatures::makeTxDbFromGFF(
# txdb <- txdbmaker::makeTxDbFromGFF(
# gtf_file,
# organism = 'Homo sapiens',
# chrominfo = GenomeInfoDb::Seqinfo(genome = genome)
Expand All @@ -71,21 +72,21 @@ gencode_txdb <- function(
)

# message(paste(Sys.time(), "preparing metadata"))
metadata <- GenomicFeatures:::.prepareGFFMetadata(
metadata <- txdbmaker:::.prepareGFFMetadata(
file = gtf_file,
dataSource = NA, organism = "Homo sapiens",
taxonomyId = NA, miRBaseBuild = NA, metadata = NULL
)

message(paste(Sys.time(), "building the txdb object"))
gr <- GenomicFeatures:::.tidy_seqinfo(
gr <- txdbmaker:::.tidy_seqinfo(
gr = gencode_gtf,
chrominfo = GenomeInfoDb::Seqinfo(genome = genome)
)

## Prune again since GenomeInfoDb::Seqinfo() will return many seqlevels
gr <- GenomeInfoDb::keepSeqlevels(gr, chrs, pruning.mode = "coarse")
txdb <- GenomicFeatures::makeTxDbFromGRanges(gr, metadata = metadata)
txdb <- txdbmaker::makeTxDbFromGRanges(gr, metadata = metadata)
return(txdb)
}

Expand Down
4 changes: 3 additions & 1 deletion vignettes/GenomicState.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ bib <- c(
glue = citation("glue")[1],
AnnotationHub = citation("AnnotationHub")[1],
AnnotationHubData = citation("AnnotationHubData")[1],
GenomicRanges = citation("GenomicRanges")[1]
GenomicRanges = citation("GenomicRanges")[1],
txdbmaker = citation("txdbmaker")[1]
)
```

Expand Down Expand Up @@ -332,6 +333,7 @@ The `r Biocpkg('GenomicState')` package `r Citep(bib[['GenomicState']])` was mad
* `r Biocpkg('AnnotationHub')` `r Citep(bib[['AnnotationHub']])`
* `r Biocpkg('AnnotationHubData')` `r Citep(bib[['AnnotationHubData']])`
* `r Biocpkg('GenomicRanges')` `r Citep(bib[['GenomicRanges']])`
* `r Biocpkg('txdbmaker')` `r Citep(bib[['txdbmaker']])`

Code for creating the vignette

Expand Down

0 comments on commit 9682b17

Please sign in to comment.