Question: Best way to find connections between clusters
We would like to find the relations between the clusters produced with the default parameters. Basically some kind of clustering of the clusters (or hierarchical clustering). Is there a way to do that using mmseqs? (Other than running clustering again with higher sensitivity or taking the representative of each cluster and clustering aligning them.)
Thanks
We don't have a good way to produce a tree from a cascaded clustering currently.
The default cascaded clustering workflow produces exactly that however, if you look into the tmp folder you will find the clustering results of previous steps, there you can find whatever representatives from the previous iterations and reconstruct a tree based on these.
Can you elaborate a little bit more? do I look at the files: aln_step1...? what should I look for?
MMseqs2 uses internally a cascaded workflow. This means it will first cluster with a low sensitivity and get step by step higher ( see https://github.com/soedinglab/MMseqs2/wiki#cascaded-clustering). But there is also a way to recluster clustered databases again to create a hierarchy. Please check out the guide at https://github.com/soedinglab/MMseqs2/wiki#how-to-manually-cascade-cluster
The structure of the clustering (clust_stepN files) would look like this
Seq.DB. Clustering Result 1 Clustering Result 2
ID1 ID3 -> ID2, ID7. ID3 -> ID5
ID2 ID5 -> ID1 ID9
ID3 ID9 -> ID8, ID6 ID4
ID4 ID4
ID5
ID6
ID7
ID8
ID9
All entries on the left side of -> are the keys in the .index file. While the right side is in the data file. I do now know how you want to use the hierarchy. If you give us more information, maybe we can help you how to use the tools to achieve it.
You could also use profiles to cluster more senstive. See issue https://github.com/soedinglab/MMseqs2/issues/66.
I have clustering results and I would like to see if any of the clusters are related, so I guess adding another step using the manual cascade clustering is what I need.
So 2 questions about this process:
- Do I need to add a result2repseq step before createsubdb? (I think it is missing in the wiki link that you attached)
- If the first step was done using mmseqs cluster with default parameters, do I need to change the sensitivity for the manual step? (should I increase or reduce it?)
Alternatively, is it possible to create a profile for each cluster and then cluster the profiles (like in issue #66)?
1.) createsubdb is enough. No need to use result2repseq
2.) I would search all sequence all-against-all to find the relatedness.
# first clustering run
mmseqs cluster sequenceDB clu1 tmp1
# create a subset of the sequenceDB only with representative sequences
mmseqs createsubdb clu1 sequenceDB cluSequenceDB
# search representative all against all
mmseqs search cluSequenceDB cluSequenceDB cluSequenceDB_aln tmp
3.) You can turn a clustering result into a profile and search with them profile-again-consensus
# first clustering run
mmseqs cluster sequenceDB clu1 tmp1
# create a subset of the sequenceDB only with representative sequences
mmseqs result2profile sequenceDB sequenceDB profileDB
mmseqs createsubdb clu1 profileDB cluProfileDB
mmseqs createsubdb clu1 profileDB_consensus cluProfileDB_consensus
# search representative all against all
mmseqs search cluProfileDB cluProfileDB_consensus cluProfileDB_aln tmp --add-self-matches
Thanks Martin. Few issues regarding the profile option:
- The
result2profilecommand requires 4 DBs, I'm assuming clu1 is the missing one?mmseqs result2profile sequenceDB sequenceDB clu1 profileDB - If I'm correct about the first issue - then the
createsubdbsteps are unnecessary? - A possible bug: the
results2profilecommand resulted in 2 files:profileDB_tmp_0.dbtypeandprofileDB_tmp_0_consensus.dbtypewhich I had to rename manually in order to move forward (remove the _tmp_0)
MMseqs2 Version: 9f344f3d6765a1131f22794d9a6fd9fcd8ca2cdf
The _tmp_0 indicates that something went wrong (the merge was unsuccessful). Could you post the log?
Hi Milot, This is the log:
MPI Init...
Rank: 0 Size: 1
Program call:
all_genomes.genes.db all_genomes.genes.db all_genomes.genes.clu4.db all_genomes.genes.clu4.profile.db
MMseqs Version: 9f344f3d6765a1131f22794d9a6fd9fcd8ca2cdf
Sub Matrix blosum62.out
Profile e-value threshold 0.001
Compositional bias 1
Use global sequence weighting false
Filter MSA 1
Maximum sequence identity threshold 0.9
Minimum seq. id. 0
Minimum score per column -20
Minimum coverage 0
Select n most diverse seqs 1000
Pseudo count a 0
Pseudo count b 1.5
Omit Consensus false
No preload false
Early exit false
Threads 56
Verbosity 3
Compute split from 0 to 6159847
Start computing profiles.
Query database type: Aminoacid
Target database type: Aminoacid
.............................................................................................................................................................. 2 Mio. sequences processed
... 1 Mio. sequences processed
............................ 4 Mio. sequences processed
............................................................ 3 Mio. sequences processed
..................................................................... 5 Mio. sequences processed
............................. 6 Mio. sequences processed
......................................................................................................................................................................................................................................................................Time for merging files: 0 h 0 m 21 s Time for merging files: 0 h 13 m 43 s
Done.
Time for merging files: 0 h 0 m 1 s
Time for merging files: 0 h 0 m 1 s
Time for processing: 2 h 53 m 18s
@adimil do you run mmseqs using MPI? If not, please compile MMseqs without MPI. This might resolve the issue.
Is this issue resolved?
Hi Martin, I didn't try to run it again, but the results were fine.
Hey Adimil, thanks for the answer. I will close it. Please let me know if the issues occurs again.
I had this same issue when trying to use mmseqs2. Are you sure it's safe to simply rename these files?