Skip to content

Commit 6cdd5c5

Browse files
Vicentevyepez88
Vicente
authored andcommitted
boxplot added
1 parent 0878965 commit 6cdd5c5

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

drop/modules/mae-pipeline/QC/DNA_RNA_matrix_plot.R

+12-4
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,25 @@ colnames(melt_mat)[1:2] <- c('DNA_ID', 'RNA_ID')
4242
melt_mat[, RNA_ID := as.character(RNA_ID)]
4343
melt_mat[, DNA_ID := as.character(DNA_ID)]
4444

45+
# Add sample annot
46+
qc_dt <- merge(sa, melt_mat, all = T)
47+
qc_dt[is.na(ANNOTATED_MATCH), ANNOTATED_MATCH := F]
48+
qc_dt[, PREDICTED_MATCH := value > identityCutoff]
49+
qc_dt[ANNOTATED_MATCH == T, match := 'Annotated DNA-RNA']
50+
qc_dt[ANNOTATED_MATCH == F, match := 'Not annotated DNA-RNA']
51+
52+
4553
ggplot(melt_mat, aes(value)) + geom_histogram(fill = 'cadetblue4', binwidth = 0.05, center = .025) +
4654
theme_bw(base_size = 14) +
4755
labs(x = 'Proportion of matching DNA-RNA variants', y = 'DNA-RNA combinations') +
4856
scale_y_log10() + annotation_logticks(sides = "l") +
4957
expand_limits(x=c(0,1)) +
5058
geom_vline(xintercept=identityCutoff, linetype='dashed', color = 'firebrick')
5159

60+
ggplot(qc_dt, aes(match, value)) + geom_boxplot() +
61+
expand_limits(y=c(0,1)) + theme_bw(base_size = 14) +
62+
labs(x = '', y = 'Proportion of matching DNA-RNA variants')
63+
5264

5365
#' ### Heatmap of matching variants
5466

@@ -64,10 +76,6 @@ ggplot(melt_mat, aes(value)) + geom_histogram(fill = 'cadetblue4', binwidth = 0.
6476
#' Similar for the RNAs.
6577
#'
6678

67-
qc_dt <- merge(sa, melt_mat, all = T)
68-
qc_dt[is.na(ANNOTATED_MATCH), ANNOTATED_MATCH := F]
69-
qc_dt[, PREDICTED_MATCH := value > identityCutoff]
70-
7179
# function to check the matches
7280
check_matches <- function(annot_col, pred_col){
7381
if(sum(pred_col) == 0) return('no match')

0 commit comments

Comments
 (0)