(make_cytoscape_file.m: last updated on January 2, 2015)
(README: last updated on February 26, 2015)

####################################################
TESTED:
Linux, MacOS X, and Windows
#####################################################


####################################################
FUNCTION:
make_cytoscape_file(r, dir, outfile, thresh, iso)


Example Usages:

make_cytoscape_file(55, 'test/Primary_Solutions/', 'cytoscape_file.txt', 0, 1)
####################################################


####################################################
PREPARATION: (DO THIS BEFORE YOU RUN THE SCRIPT)
	
The MOCASSIN-prot solution files for the proteins should already exist as .mat files and labeled as Solution1.mat, Solution2.mat, etc in a single directory. mocassin_prot.m generates this matrix files in the "Primary_Solutions" (or "Secondary_Solutions", etc. by mocassin_prot_iter) directory. The path to this directory is given in the second argument (dir).

Sample inputs and output can be found in the exampleData directory.

SPECIAL NOTES:
** The file where the output is written is an appendable file. Therefore if you run the program more than once, you need to delete the output file (cytoscape_file.txt) or change the file name between runs (otherwise it will just continually append the one file).
####################################################


####################################################
INPUTS:  r = the number of proteins in the network (i.e. how many scoring matrices
             exist)
         dir = the directory where the solution data files are stored and where output file will be saved
         outfile = name of the output file
         thresh = the edge weight threshold for including edges in the network (thresh=0 means use all edges, thresh=0.1 means keep only the 
		  edges with weight >0.1)
	 iso = indicator whether or not to print isolated nodes (1 if yes, 0 if no)
				  
####################################################
How to run make_cytoscape_file.m:

See READMEmocassin_prot.txt

####################################################
OUTPUT FILE: the file mentioned below will be written to the same directory chosen by the "dir" option with name chosen by "outfile" option

--------------------------
The output is a tab-delimited text file which can be used to import the network information into Cytoscape (http://www.cytoscape.org/) and other similar network visualization programs (i.e. Gephi). Each line in the file consists of four entries:
P1	P2	1.0	105.9189
P2	P3	0.5	75.2922
Here the first entry is the target protein, the second is the source protein, the third is the edge weight for the directed edge, and the fourth is the game value for the target protein.

SPECIAL NOTES:
If using isolated proteins option (to include proteins with no domains, no LP solution, all incoming edges below threshold, etc.) these proteins are presented as isolated nodes in the network and they appear in the file as a line with a single-column entry:
P1
P2

The indexing for the proteins is given in the file protein_index.txt (which was created in the "Matrices" directory during the use of mtxassemble.pl)
####################################################