@@ -42,13 +42,25 @@ colnames(melt_mat)[1:2] <- c('DNA_ID', 'RNA_ID')
42
42
melt_mat [, RNA_ID : = as.character(RNA_ID )]
43
43
melt_mat [, DNA_ID : = as.character(DNA_ID )]
44
44
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
+
45
53
ggplot(melt_mat , aes(value )) + geom_histogram(fill = ' cadetblue4' , binwidth = 0.05 , center = .025 ) +
46
54
theme_bw(base_size = 14 ) +
47
55
labs(x = ' Proportion of matching DNA-RNA variants' , y = ' DNA-RNA combinations' ) +
48
56
scale_y_log10() + annotation_logticks(sides = " l" ) +
49
57
expand_limits(x = c(0 ,1 )) +
50
58
geom_vline(xintercept = identityCutoff , linetype = ' dashed' , color = ' firebrick' )
51
59
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
+
52
64
53
65
# ' ### Heatmap of matching variants
54
66
@@ -64,10 +76,6 @@ ggplot(melt_mat, aes(value)) + geom_histogram(fill = 'cadetblue4', binwidth = 0.
64
76
# ' Similar for the RNAs.
65
77
# '
66
78
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
-
71
79
# function to check the matches
72
80
check_matches <- function (annot_col , pred_col ){
73
81
if (sum(pred_col ) == 0 ) return (' no match' )
0 commit comments