Skip to content

Commit

Permalink
Fix the code for ENSEMBL and GENCODE annotation
Browse files Browse the repository at this point in the history
Co-authored-by: Nick Eagles <[email protected]>
  • Loading branch information
HediaTnani and Nick-Eagles committed Jan 11, 2024
1 parent a8a2fd0 commit 5fef6c3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions R/DEqual.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@ DEqual <- function(DE) {
}

## Locate common transcripts
if (all(grepl("^ENST.*?\\.", rownames(DE)))) {
is_gencode = all(grepl("^ENST.*?\\.", rownames(DE)))
is_ensembl = all(grepl("^ENST", rownames(DE)) & !grepl("\\.", rownames(DE)))
if (is_gencode) {
common <- intersect(rownames(qsvaR::degradation_tstats), rownames(DE))
} else if (all(grepl("^ENST", rownames(DE)))) {
} else if (is_ensembl) {
common <- intersect(gsub('\\..*', '', rownames(qsvaR::degradation_tstats)), rownames(DE))
} else {
stop("The rownames of the DE output and the rownames of the degradation t-statistic do not match")
stop("The rownames of the input dataframe should be either GENCODE or ENSEMBL transcript IDs.")
}

#stopifnot(length(common) > 0)
Expand Down

0 comments on commit 5fef6c3

Please sign in to comment.