Skip to content

Commit e440e04

Browse files
committed
fix code error after merging
1 parent f498059 commit e440e04

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

00_libs/load_data.R

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,7 @@ load_metrics <- function(se = se_object, multiqc = multiqc_data_dir,
100100
biotype <- one
101101
} else if (length(another) == 1) {
102102
biotype <- another
103-
metrics$sample <- make.names(metrics$sample)
104-
if (!is.null(biotype)) {
105-
annotation <- as.data.frame(gtf) %>% .[, c("gene_id", biotype)]
106-
annotation$gene_id <- stringr::str_remove(annotation$gene_id, "\\..*$") # remove .1 from end of gene
107-
rRNA <- grepl("rRNA|tRNA", annotation[[biotype]])
108-
genes <- intersect(annotation[rRNA, "gene_id"], row.names(counts))
109-
ratio <- data.frame(
110-
sample = colnames(counts),
111-
r_and_t_rna_rate = colSums(counts[genes, ]) / colSums(counts)
112-
)
103+
metrics$sample <- make.names(metrics$sample)
113104
metrics <- left_join(metrics, ratio, by = "sample")
114105
} else {
115106
warning("No gene biotype founded")
@@ -119,6 +110,7 @@ load_metrics <- function(se = se_object, multiqc = multiqc_data_dir,
119110
metrics$sample <- make.names(metrics$sample)
120111
if (!is.null(biotype)) {
121112
annotation <- as.data.frame(gtf) %>% .[, c("gene_id", biotype)]
113+
annotation$gene_id <- stringr::str_remove(annotation$gene_id, "\\..*$") # remove .1 from end of gene
122114
rRNA <- grepl("rRNA|tRNA", annotation[[biotype]])
123115
genes <- intersect(annotation[rRNA, "gene_id"], row.names(counts))
124116
ratio <- data.frame(

0 commit comments

Comments
 (0)