Skip to content

Commit

Permalink
Comment the added part of the script to check for patterns because gi…
Browse files Browse the repository at this point in the history
…ving errors
  • Loading branch information
HediaTnani committed Jan 5, 2024
1 parent e3455a2 commit 1b3236b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions R/getDegTx.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ getDegTx <- function(rse_tx, type = c("cell_component", "standard", "top1500"),
}

# Check patterns and perform operations based on the patterns
if (all(grepl("^ENST[0-9]{11}\\.[0-9]+$", rownames(rse_tx)))) {
# If all row names have the format 'ENST00000442987.3'
rse_tx <- rse_tx[rownames(rse_tx) %in% sig_transcripts, , drop = FALSE]
} else if (all(grepl("^ENST[0-9]{11}$", rownames(rse_tx)))) {
# If all row names have the format 'ENST00000442987'
new_transcripts <- gsub("\\..*", "", sig_transcripts)
rse_tx <- rse_tx[rownames(rse_tx) %in% new_transcripts, , drop = FALSE]
} else {
stop("Error: Row names do not match the expected patterns.")
}
# if (all(grepl("^ENST[0-9]{11}\\.[0-9]+$", rownames(rse_tx)))) {
# # If all row names have the format 'ENST00000442987.3'
# rse_tx <- rse_tx[rownames(rse_tx) %in% sig_transcripts, , drop = FALSE]
# } else if (all(grepl("^ENST[0-9]{11}$", rownames(rse_tx)))) {
# # If all row names have the format 'ENST00000442987'
# new_transcripts <- gsub("\\..*", "", sig_transcripts)
# rse_tx <- rse_tx[rownames(rse_tx) %in% new_transcripts, , drop = FALSE]
# } else {
# stop("Error: Row names do not match the expected patterns.")
# }

if (mean(rowMeans(assays(rse_tx)[[assayname]])) < 1) {
warning("The transcripts selected are lowly expressed in your dataset. This can impact downstream analysis.")
Expand Down

0 comments on commit 1b3236b

Please sign in to comment.