Skip to content

Commit

Permalink
Merge pull request #4 from hpages/devel
Browse files Browse the repository at this point in the history
The makeTxDb*() functions have moved from GenomicFeatures to txdbmaker
  • Loading branch information
almeidasilvaf authored Mar 19, 2024
2 parents 8fab8b9 + c0c7e5d commit f1b436e
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 26 deletions.
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: doubletrouble
Title: Identification and classification of duplicated genes
Version: 1.3.5
Date: 2022-05-29
Version: 1.3.6
Date: 2024-03-19
Authors@R:
c(
person(given = "Fabrício",
Expand Down Expand Up @@ -47,7 +47,7 @@ biocViews:
Encoding: UTF-8
LazyData: false
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.0
RoxygenNote: 7.3.1
Imports:
syntenet,
GenomicRanges,
Expand All @@ -64,6 +64,7 @@ Imports:
Depends:
R (>= 4.2.0)
Suggests:
txdbmaker,
testthat (>= 3.0.0),
knitr,
feature,
Expand Down
3 changes: 2 additions & 1 deletion R/duplicate_classification.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
#' annotation <- syntenet::process_input(yeast_seq, yeast_annot)$annotation
#'
#' # Get list of intron counts
#' txdb_list <- lapply(yeast_annot, GenomicFeatures::makeTxDbFromGRanges)
#' library(txdbmaker)
#' txdb_list <- lapply(yeast_annot, txdbmaker::makeTxDbFromGRanges)
#' intron_counts <- lapply(txdb_list, get_intron_counts)
#'
#' # Classify duplicates - full scheme
Expand Down
13 changes: 7 additions & 6 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ collinearity2blocks <- function(collinearity_paths = NULL) {

#' Get a data frame of intron counts per gene
#'
#' @param txdb A `txdb` object with transcript annotations. See details below
#' for examples on how to create `txdb` objects from different kinds of input.
#' @param txdb A `TxDb` object with transcript annotations. See details below
#' for examples on how to create `TxDb` objects from different kinds of input.
#'
#'
#' @return A data frame with intron counts per gene, with variables:
Expand All @@ -129,8 +129,8 @@ collinearity2blocks <- function(collinearity_paths = NULL) {
#'
#' @details
#' The family of functions \code{makeTxDbFrom*} from
#' the \strong{GenomicFeatures} package can be used to create `txdb` objects
#' from a variety of input data types. You can create `txdb` objects
#' the \strong{txdbmaker} package can be used to create `TxDb` objects
#' from a variety of input data types. You can create `TxDb` objects
#' from e.g., `GRanges` objects (\code{makeTxDbFromGRanges()}),
#' GFF files (\code{makeTxDbFromGFF()}),
#' an Ensembl database (\code{makeTxDbFromEnsembl}), and
Expand All @@ -144,8 +144,9 @@ collinearity2blocks <- function(collinearity_paths = NULL) {
#' @examples
#' data(yeast_annot)
#'
#' # Create txdb object from GRanges
#' txdb <- GenomicFeatures::makeTxDbFromGRanges(yeast_annot[[1]])
#' # Create TxDb object from GRanges
#' library(txdbmaker)
#' txdb <- txdbmaker::makeTxDbFromGRanges(yeast_annot[[1]])
#'
#' # Get intron counts
#' intron_counts <- get_intron_counts(txdb)
Expand Down
5 changes: 3 additions & 2 deletions R/utils_duplicate_classification.R
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,9 @@ get_transposed <- function(
#' # Classify pairs
#' trd <- get_transposed(pairs, diamond_inter, annotation)
#'
#' # Create txdb object from GRanges
#' txdb <- GenomicFeatures::makeTxDbFromGRanges(yeast_annot[[1]])
#' # Create TxDb object from GRanges
#' library(txdbmaker)
#' txdb <- txdbmaker::makeTxDbFromGRanges(yeast_annot[[1]])
#'
#' # Get intron counts
#' intron_counts <- get_intron_counts(txdb)
Expand Down
3 changes: 2 additions & 1 deletion man/classify_gene_pairs.Rd

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

13 changes: 7 additions & 6 deletions man/get_intron_counts.Rd

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

5 changes: 3 additions & 2 deletions man/get_transposed_classes.Rd

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

3 changes: 2 additions & 1 deletion tests/testthat/test-duplicate_classification.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
library(txdbmaker) # for makeTxDbFromGRanges()

#----Load data------------------------------------------------------------------
data(diamond_intra)
Expand Down Expand Up @@ -25,7 +26,7 @@ ssd <- all[all$type != "SD", 1:2]
duplicates <- diamond_intra[[1]][, 1:2]


txdb <- GenomicFeatures::makeTxDbFromGRanges(yeast_annot[[1]])
txdb <- txdbmaker::makeTxDbFromGRanges(yeast_annot[[1]])
intron_counts <- get_intron_counts(txdb)

ic_list <- list(Scerevisiae = intron_counts)
Expand Down
9 changes: 5 additions & 4 deletions vignettes/doubletrouble_vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -347,21 +347,22 @@ of data frames with the number of introns per gene for each species. This
can be done with the function `get_intron_counts()`, which takes a `TxDb`
object as input. `TxDb` objects store transcript annotations, and they
can be created with a family of functions
named `makeTxDbFrom*` from the `r BiocStyle::Biocpkg("GenomicFeatures")`
named `makeTxDbFrom*` from the `r BiocStyle::Biocpkg("txdbmaker")`
package (see `?get_intron_counts()` for a summary of all functions).


Here, we will create a list of `TxDb` objects from a list of `GRanges` objects
using the function `MakeTxDbFromGRanges`
from `r BiocStyle::Biocpkg("GenomicFeatures")`. Importantly, to create
using the function `makeTxDbFromGRanges`
from `r BiocStyle::Biocpkg("txdbmaker")`. Importantly, to create
a `TxDb` from a `GRanges`, the `GRanges` object must contain genomic coordinates
for all features, including transcripts, exons, etc. Because of that, we
will use annotation from the example data set `yeast_annot`,
which was not processed with `syntenet::process_input()`.

```{r}
library(txdbmaker)
# Create a list of `TxDb` objects from a list of `GRanges` objects
txdb_list <- lapply(yeast_annot, GenomicFeatures::makeTxDbFromGRanges)
txdb_list <- lapply(yeast_annot, txdbmaker::makeTxDbFromGRanges)
txdb_list
```

Expand Down

0 comments on commit f1b436e

Please sign in to comment.