medema-group / BiG-SCAPE

Similarity networks of biosynthetic gene clusters
GNU Affero General Public License v3.0
61 stars 26 forks source link

The inconsistent results in "mix_clustering_c0.30" and "mix_c0.30.network" #19

Closed durubing-jn closed 1 year ago

durubing-jn commented 2 years ago

Hi, BiG-SCAPE is a very useful tool! However, I found inconsistent results in output files ("mix_clustering_c0.30" and "mix_c0.30.network"). For eaxmple, BGC1, BGC2 and BGC3 belong to same GCF in the "mix_clustering_c0.30", but I cannot find the relationship between BGC1 and BGC3, or between BGC2 and BGC3 in the "mix_c0.30.network". Only find the relationship btween BGC1 and BGC2. This is necessary for visualization of the network. Errors occurred in identifying GCF?

Thanks, Rubing

jorgecnavarrom commented 1 year ago

Hi Rubing

The difference could be related to the different weights used to combine the distance indices. The weights are currently:

bgc_class_weight["PKSI"] = (0.22, 0.76, 0.02, 1.0)
bgc_class_weight["PKSother"] = (0.0, 0.32, 0.68, 4.0)
bgc_class_weight["NRPS"] = (0.0, 1.0, 0.0, 4.0)
bgc_class_weight["RiPPs"] = (0.28, 0.71, 0.01, 1.0)
bgc_class_weight["Saccharides"] = (0.0, 0.0, 1.0, 1.0)
bgc_class_weight["Terpene"] = (0.2, 0.75, 0.05, 2.0)
bgc_class_weight["PKS-NRP_Hybrids"] = (0.0, 0.78, 0.22, 1.0)
bgc_class_weight["Others"] = (0.01, 0.97, 0.02, 4.0)
bgc_class_weight["mix"] = (0.2, 0.75, 0.05, 2.0)

which correspond to Jaccard, Domain sequence identity, adjacency index and anchor boost (you could try taking the individual index values from the 'mix' class and recombining them with the weights of the class they belong to. Perhaps they don't make the cutoff value in that biosynthetic class?)

I think another factor could be the affinity propagation clustering algorithm, which might give different groupings.

Let me know if something else seems to have gone wrong, though!

durubing-jn commented 1 year ago

Thanks for your reply! As describe above, this means the GCFs in "mix_clustering_c0.30" may not be right?

jorgecnavarrom commented 1 year ago

Oh wait, I've just re-read your first comment. Do you mean that e.g. BGC2 and BGC3 don't have a connection in mix_c0.30.network and yet they are together in mix_clustering_c0.30? That is weird indeed... Would you be able to send me those two files? (jorge DOT navarromunoz AT wur.nl)

durubing-jn commented 1 year ago

ok, I have sent to your E-mail.

jorgecnavarrom commented 1 year ago

Ahh, I see what you mean image I think I saw something similar to this a while ago... This is an artifact of the affinity propagation clustering, I'm afraid.

I'm working (slowly) on making BiG-SCAPE use a newer version of scikit-learn (from which we use affinity propagation). Hopefully this is something that has been addressed recently. But not much else that I can do now, unfortunately.

The only recommendation I can make now would be to use the connected components as GCFs

durubing-jn commented 1 year ago

ok, thanks. There are a series of indices between two BGCs. For example, Raw distance, Squared similarity, Jaccard index, DSS index, Adjacency index, raw DSS non-anchor, raw DSS anchor, Non-anchor domains and Anchor domains. Which one can be used as the criterion for identifying GCFs?

jorgecnavarrom commented 1 year ago

Raw distance. The others are sub-components that lead to this value