I have a question, I have obtained scores ranging from (0 to 10) resulting from 2 different methods but they are based ran on the same process. Now, I am interested to correlate these scores or find concordance. I am seeking help to how to best represent these scores or correlate scores. I tried using correlation analysis (code below) using corrplot but this wasn't very helpful because I could not correlate which row (feature) belong to which column (process). I am interested to correlate each feature to each process or column, and find concordance. Probably, I am not sure, a heatmap coupled with boxplot or violin plot would help in this case?
The scores are in the form of 2 dataframes in R as templates given below:
If I understand you correctly, you want to correlate the values obtained for each combination of Feature and Process for the two methods. For example (Feature_1, A_Process,Method_1) = 9 vs (Feature_1, A_Process,Method_2) = 1.
Here is how I would do that. The idea is to reshape the data so there are three column, Feature, Process, and Value, and then line up the values from the two methods. I did not use all of your columns, just A - G, but I think the code conveys the idea.
@FJCC thank you for the inputs, but I was interested to see the individual feature to process level comparisons instead. I tried the below, but, the issue is there "Inf" values in the dataframe, and plot uses this.
log_ratios <- log(Method_1 / Method_2)
# Heatmap visualization
library(ggplot2)
library(reshape2)
# Assuming 'log_ratios' is a dataframe where the rownames are features
log_ratios$Feature <- rownames(log_ratios)
log_ratios_melted <- melt(log_ratios, id.vars = "Feature")
# Now plotting
ggplot(log_ratios_melted, aes(variable, Feature, fill = value)) +
geom_tile() +
scale_fill_gradient2(low = "blue", high = "red", mid = "white", midpoint = 0) +
theme_minimal() +
xlab("Process") +
ylab("Feature") +
ggtitle("Heatmap of Concordance")
Yes, log(Method_1 / Method_2) will return Inf if Method_2 has a value of zero, it will return -Inf if Method_1 is zero, and it will return NaN if both values are zero. I don't know enough about your data to suggest what to do about that.