-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
filtering the example rse_tx for the vignette
- Loading branch information
Showing
8 changed files
with
60 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,8 @@ | |
^\.github$ | ||
^data-raw$ | ||
^codecov\.yml$ | ||
^\.Rhistory$ | ||
^\.Rdata$ | ||
^\.httr-oauth$ | ||
^\.DS_Store$ | ||
^dcs04_data$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: qsvaR | ||
Title: Generate Quality Surrogate Variable Analysis for Degradation Correction | ||
Version: 1.9.0 | ||
Date: 2024-05-03 | ||
Version: 1.9.1 | ||
Date: 2024-09-16 | ||
Authors@R: | ||
c( | ||
person("Joshua", "Stolz", email = "[email protected]", | ||
|
@@ -25,7 +25,7 @@ biocViews: Software, WorkflowStep, Normalization, BiologicalQuestion, | |
DifferentialExpression, Sequencing, Coverage | ||
Encoding: UTF-8 | ||
Roxygen: list(markdown = TRUE) | ||
RoxygenNote: 7.3.0 | ||
RoxygenNote: 7.3.2 | ||
Suggests: | ||
BiocFileCache, | ||
BiocStyle, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,53 @@ | ||
#' Check validity of transcript vectors | ||
|
||
|
||
|
||
#' Remove version number from Gencode/Ensembl transcript names | ||
#' | ||
#' This function is used to check if the tx1 and tx2 are GENCODE or ENSEMBL and print an error message if it's not and return a character vector of transcripts in tx2 that are in tx1. | ||
#' This function removes the Gencode/ENSEMBL version from the transcript ID, while protecting _PAR_Y suffixes if present | ||
#' | ||
#' @param tx1 A `character()` vector of GENCODE or ENSEMBL transcripts. | ||
#' @param tx2 A `character()` vector of GENCODE or ENSEMBL transcripts. | ||
#' @param txnames A `character()` vector of GENCODE or ENSEMBL transcript IDs | ||
#' | ||
#' @param arg_name1 A `character(1)` vector of description of tx1 | ||
#' @param arg_name2 A `character(1)` vector of description of tx2 | ||
#' | ||
#' @return A | ||
#' `character()` vector of transcripts in `tx2` that are in `tx1`. | ||
#' `character()` vector of transcript names without versioning | ||
#' | ||
#' @export | ||
#' | ||
#' @examples | ||
#' ensIDs <- normalize_tx_names(rownames(rse_tx)) | ||
|
||
normalize_tx_names <- function(txnames) { | ||
sub('(ENST\\d+)\\.\\d+(.*)$','\\1\\2', txnames, perl=TRUE) | ||
} | ||
|
||
|
||
#' Check validity of transcript vectors and return a vector matching indexes in tx1 | ||
#' | ||
#' This function is used to check if tx1 and tx2 are GENCODE or ENSEMBL transcript IDs | ||
#' and return an integer vector of tx1 transcript indexes that are in tx2. | ||
#' | ||
#' @param tx1 A `character()` vector of GENCODE or ENSEMBL transcript IDs. | ||
#' @param tx2 A `character()` vector of GENCODE or ENSEMBL transcript IDs. | ||
#' | ||
#' | ||
#' @return A | ||
#' `integer()` vector of `tx1` transcript indexes in `tx2`. | ||
#' | ||
#' @export | ||
#' | ||
#' @examples | ||
#' sig_tx <- select_transcripts("cell_component") | ||
#' whichTx <- check_tx_names(rownames(rse_tx), sig_tx) | ||
#' whichTx <- which_tx_names(rownames(rse_tx), sig_tx) | ||
|
||
check_tx_names = function(txnames, sig_transcripts) { | ||
# Functions for checking whether a vector of transcripts all match GENCODE | ||
# or ENSEMBL naming conventions | ||
which_tx_names = function(txnames, sig_transcripts) { | ||
## Between releases 25 and 43, PAR genes and transcripts had the "_PAR_Y" suffix appended to their identifiers. | ||
## Since release 44, these have their own IDs | ||
if (!all(grepl("^ENST\\d+", txnames))) { | ||
stop("The transcript names must be ENSEMBL or Gencode IDs (ENST...)" ) | ||
} | ||
## normalize the transcript names | ||
sig_tx <- sub('(ENST\\d+)\\.\\d+(.*)$','\\1\\2', sig_transcripts, perl=TRUE) | ||
r_tx <- sub('(ENST\\d+)\\.\\d+(.*)$','\\1\\2', txnames, perl=TRUE) | ||
r_tx <- normalize_tx_names(txnames) | ||
sig_tx <- normalize_tx_names(sig_transcripts) | ||
which(r_tx %in% sig_tx) | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.