Question: Clutering Using Mcl Algorithm
0
gravatar for pixie@bioinfo
5.6 years ago by
pixie@bioinfo1.4k
pixie@bioinfo1.4k wrote:

I have a network of around 1000 nodes and 3 million edges. I have used the mcl software to break it up into clusters. MCL :loading a file

I have used the following command:

mcl blue_v1.txt -I 1.8 --abc -o blue_v2.mcl

This gives a file in ".mcl" format. I am not able to figure out the clusters in this file. How do I get in a tab delimited file or something that can be read into Cytoscape.

Thanks

network clustering • 3.6k views
ADD COMMENTlink modified 5.6 years ago by Arnaud Ceol840 • written 5.6 years ago by pixie@bioinfo1.4k

Can you open this file in notepad++?

ADD REPLYlink written 5.6 years ago by Smandape60
2
gravatar for Arnaud Ceol
5.6 years ago by
Arnaud Ceol840
Milan, Italy
Arnaud Ceol840 wrote:

As far as I remember, the mcl output reports on each line all the proteins present in a cluster. There is no interaction here, so if you want to load it in Cytoscape to have to build back the network. Here is an example of python script I used time ago in order to do that, it takes in input the mcl output file and the original network file and create one network file for each cluster:

import sys 
import string

cluster_filename=sys.argv[1]
network_filename=sys.argv[2]


interactions=[]

# read interactions 
num_interactions=0
with open(network_filename) as in_handle:
    for line in in_handle:
        parts=line.strip().split("\t")
        ac1=parts[0]
        ac2=parts[1]
        interactions.append(ac1+"#"+ac2)
        interactions.append(ac2+"#"+ac1)
        num_interactions=num_interactions+1

print "%s interactions" % (num_interactions)

cluster=0

with open(cluster_filename) as in_handle:
    for line in in_handle:
        cluster = cluster+1
        acs=line.strip().split("\t")
        print "number of proteins: %s" % (len(acs))
        if len(acs) > 2:
            output=open(cluster_filename+ "." + str(cluster) + ".network.txt" ,  "w")

            i = 0
            while i < len(acs) :
                j=i
                while j < len(acs):
                    if acs[i] + "#" + acs[j] in interactions:
                        output.write(acs[i] + "\t" + acs[j] + "\n")
                    j=j+1
                i=i+1

            output.close()
ADD COMMENTlink written 5.6 years ago by Arnaud Ceol840
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1273 users visited in the last hour