Skip to content

Commit

Permalink
Check if any gene in sig_transcripts is in rownames(rse_tx)
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 9, 2024
1 parent 10f5a58 commit eab90c4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions R/getDegTx.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ getDegTx <- function(rse_tx, type = c("cell_component", "standard", "top1500"),
stop("Error: rse_tx must be a RangedSummarizedExperiment object.")
}

# Check if any gene in sig_transcripts is in rownames(rse_tx)
if (!any(sig_transcripts %in% rownames(rse_tx))) {
stop("sig_transcripts and rownames(rse_tx) do not match")
}

# Check if all rownames start with "ENST"
if (!all(grepl("^ENST", rownames(rse_tx)))) {
stop("Error: Some rownames do not start with 'ENST'.")
Expand All @@ -59,10 +64,6 @@ getDegTx <- function(rse_tx, type = c("cell_component", "standard", "top1500"),
stop("Error: Row names do not match the expected patterns.")
}

# Check if any gene in sig_transcripts is in rownames(rse_tx)
# if (!any(sig_transcripts %in% rownames(rse_tx))) {
# stop("sig_transcripts and rownames(rse_tx) do not match")
# }

# Check if the row means is greater than 1
if (mean(rowMeans(assays(rse_tx)[[assayname]])) < 1) {
Expand Down

0 comments on commit eab90c4

Please sign in to comment.