Open selinaLa opened 2 years ago
note: how to create network plot from differential object
Differential analysis of CD4+/CD8+, plotting heatmap After function compare I want to display results in heatmap of CD4+ and CD8+. Then I get this result. with the rules in the list
| TF1 | TF2 | CD4+_cosine | CD8+_cosine | CD4+/CD8+_cosine_log2fc | CD4+/CD8+_cosine_log2fc_pvalue | CD4+/CD8+_cosine_log2fc_pvalue_adj -- | -- | -- | -- | -- | -- | -- | -- AHR | ATF6 | 0.033026 | 0.139711 | -1.304316 | 1.287173e-11 | 0.000002 ATF6 | AHR | 0.033026 | 0.139711 | -1.304316 | 1.287173e-11 | 0.000002 RFX3 | RXRB | 0.029594 | 0.089801 | -0.903453 | 7.935660e-07 | 0.127266 RXRB | RFX3 | 0.029594 | 0.089801 | -0.903453 | 7.935660e-07 | 0.127266 NR3C1 | TFEB | 0.015293 | 0.058167 | -0.833117 | 6.507370e-06 | 1.000000 ... | ... | ... | ... | ... | ... | ... FOS | FOSL2 | 0.361287 | 0.144311 | 1.124337 | 7.012899e-06 | 1.000000 JUN | JUNB | 0.382696 | 0.153419 | 1.129647 | 2.713180e-06 | 0.435118 JUNB | JUN | 0.382696 | 0.153419 | 1.129647 | 2.713180e-06 | 0.435118 JUN | FOS | 0.376444 | 0.149213 | 1.139924 | 5.391554e-06 | 0.864654 FOS | JUN | 0.376444 | 0.149213 | 1.139924 | 5.391554e-06 | 0.864654When I use the function simplify the rules, so I dont get the duplicates, I get this list and this heatmap
TF1 | TF2 | CD4+_cosine | CD8+_cosine | CD4+/CD8+_cosine_log2fc | CD4+/CD8+_cosine_log2fc_pvalue | CD4+/CD8+_cosine_log2fc_pvalue_adj -- | -- | -- | -- | -- | -- | -- AHR | ATF6 | 0.033026 | 0.139711 | -1.304316 | 1.287173e-11 | 0.000002 RFX3 | RXRB | 0.029594 | 0.089801 | -0.903453 | 7.935660e-07 | 0.127266 NR3C1 | TFEB | 0.015293 | 0.058167 | -0.833117 | 6.507370e-06 | 1.000000 CTCFL | AHR | 0.050248 | 0.119755 | -0.826933 | 1.070661e-05 | 1.000000 RFX3 | THRB | 0.024469 | 0.073211 | -0.816538 | 1.866323e-06 | 0.299306 ... | ... | ... | ... | ... | ... | ... JUN | FOSL2 | 0.374479 | 0.151570 | 1.115187 | 4.585157e-06 | 0.735331 FOS | JUNB | 0.370528 | 0.148826 | 1.122216 | 6.176374e-06 | 0.990517 FOSL2 | FOS | 0.361287 | 0.144311 | 1.124337 | 7.012899e-06 | 1.000000 JUN | JUNB | 0.382696 | 0.153419 | 1.129647 | 2.713180e-06 | 0.435118 JUN | FOS | 0.376444 | 0.149213 | 1.139924 | 5.391554e-06 | 0.864654Does it matter which I use? Because in both theoretically there is the same input. Only in the unsimplified heatmap the imfomation is mirrored and therefore doubled
Differential analysis of CD4+/CD8+, vulcano plot in the documentation the selection line of the foldchange is a little over 1 or -1.
In my vulcano plot the selection line of the fold change is at 0,25 or -0,25.
Because of that I get a lot of rules and I get a pretty complex network. Is there a way to change the selection line border or is it generated of the rules?
For the first question: Yes it contains the same information, only not mirrored. One may find the symmetrical plot easier to read, but the information content should stay the same. You could also check if the cluster remains the same (I can not check here, because the picture background is black and I can not see the clusters properly).
For the second question: The thresholds are calculated automatically based on the distributions and pvalues (that's why the boundaries differ between the example and your data). For the pvalues a threshold of 0.05 is set as default, you can change this directly in the function (see attached picture). [y-axis] However, although the functionality to change the distribution percentage (as default also 0.05) used as threshold is given by the utility method (utils.get_threshold() ), there is no way to change the input as a user (DiffCombObj.select_rules() provides no parameter for this). [x-axis]
I need to check with Mette whether this is intended, otherwise we could add this.
Hi Selina, please have a look at the newest changes mentioned here: https://github.com/loosolab/TF-COMB/issues/31#issuecomment-989735407.
So if you give measure_threshold_percent=0.01
, you will get less rules and hopefully you are able to better visualize that in the network :+1:
tasks: