To run TARA, please see nd.edu/~cone/TARA

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Instructions for running TARA-TS
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Run from the TARA++code-data folder.

All python scripts were run on version 2.7.8, numpy 1.9.0, sklearn 0.15.2

main.py and Evaluation.py are code from the protein function prediction framework in https://www3.nd.edu/~cone/LNA_GNA/. Their usage is directly incorporated already.

Download SNAP from https://github.com/snap-stanford/snap. We will use the ./node2vec executable from examples/node2vec

Run the following command to embed the integrated network:
	./node2vec -i:networks/integrated-yeast-human-numbered.edgelist -o:embeddings/integrated.emb
Note that the -numbered network must be used, as node2vec only accepts integer node IDs.

After obtaining the integrated.emb file, convert the node number IDs (first column) to protein IDs and split into two files for yeast and human using the following script. The embeddings we obtained in our study are provided; keep in mind yours may differ due to the inherent randomness.

	python ./scripts/split-and-map-node2vec.py data/networks/integrated-prot2num.map data/embeddings/integrated-yeast-human.emb data/embeddings/yeast.emb data/embeddings/human.emb

To get the feature of a node pair, run the following:

	./scripts/get-nodepair-feats.py [shared list] [human emb] [yeast emb] [k] [out] [go frequency file] [thresh]

[shared list]: In this file, each line should contain a human protein, a yeast protein, and any experimental biological process GO terms they share, tab delimited (if no GO terms of any kind are shared, the line should still contain the human (first) and yeast (second) protein). For example, here is what a few lines may look like:

	RNF14   SYP1
	RNF14   SHE10
	RNF14   STP1    GO:0045893 

GO data describing a GO term can be found here: http://geneontology.org/page/download-ontology
GO annotation data can be found here: http://current.geneontology.org/products/pages/downloads.html
As these files are very large, we are unable to provide them.

[human emb] and [yeast emb]: These files should contain the node2vec of human and yeast PPI networks. A given line should contain the name of the protein and its feature vector. An example line is as follows:
	hSNAP29 0.0231804 -0.0248205 0.134498 -0.0766571 0.0778835 0.310577 0.0267511 -0.0969636 0.371695 -0.0684733 0.0602712 0.00760342 0.159658 -0.340018 0.138729 0.0654418 0.300636 0.108987 -0.0451643 -0.0346984 0.0985243 -0.266418 -0.15699 0.195828 -0.000820191 0.00574705 0.00411297 -0.081439 -0.0207464 -0.0972906 -0.403819 -0.0958427 0.0427945 -0.0856657 -0.276071 -0.178333 -0.0310734 0.165903 0.126526 0.17301 0.182757 0.0249045 0.212248 -0.283873 0.0361664 -0.110001 -0.0815712 0.0952588 -0.375999 0.343978 -0.327334 0.313711 0.0972081 0.0933288 0.212568 0.208411 0.262102 0.16135 0.576909 -0.291262 0.53036 0.210027 0.0854624 -0.407796 -0.0691612 -0.0570491 -0.0690748 -0.389671 -0.207251 -0.294247 0.284425 0.232767 -0.427771 -0.500986 0.333256 0.308619 0.0712296 -0.218293 0.0694216 0.0253613 -0.466024 0.142523 -0.113694 -0.114519 -0.369332 -0.548238 -0.263167 -0.11972 -0.244055 -0.542552 0.367892 -0.0614108 0.0989442 0.265697 0.254946 0.157637 -0.454933 -0.519081 -0.932633 0.157605 -1.2152 0.146863 -0.0128518 0.206498 0.437999 0.0755198 0.483282 -0.4874 -1.0268 1.19368 -0.245128 0.349471 -0.514312 -0.00288858 -0.425632 2.19216 -1.20124 -0.570238 -0.107269 -0.122706 0.122244 0.225653 0.145327 -0.102173 -0.743149 0.932833 -0.139479 0.26425
The node ID should contain an initial 'h' for human on 's' for yeast; the script automatically accounts for these.

[k]: This is the ground truth parameter for how many GO terms need to be shared for a node pair to be counted as functionally related. 

[out]: This is the output file. Note that because we take 10 random samples for the negative class, the numbers 0-9 will be appended.

[go frequency file]: This is a file containing every experimentally inferred biological process GO term and how many proteins they annotate. An example line looks like:
		GO:0002949	4
meaning the GO term GO:0002949 annotates 4 proteins.

[thresh]: This is the GO term rarity threshold. Options are '800' (for all GO terms), '50', or '25'.

Here is an example run:
	python ./scripts/get-nodepair-feats.py ../data/human-yeast-shared-terms-EXP.txt ../data/embeddings/human.emb ../data/embeddings/yeast.emb 3 ../data/features/atleast3-EXP.csv ../data/go-freq.txt 800

Then, use prediction.py. 
	
	python ./scripts/prediction.py [data] [outf] [seed] [perc] [thresh]

[data]: The input to this should be the output file of get-nodepair-feats.py without any numbers appended. The script deals with that. 

[outf]: This is the stem of the output file. It should match the ground truth dataset.

[seed]: This is the random seed. 0-9 should be used, which correspond to the 0-9 of the random samples.

[perc]: This is the percent of data that should be used as training, which should be in the format '0.x'.

[thresh]: This is the GO term rarity threshold. Options are '800', '50', or '25'.

	python ./scripts/prediction.py ./data/features/atleast3-EXP.csv ./data/alns/atleast3-EXP 0 0.9 800

This will result in several output files. 

	atleast3-EXP-90.0.txt0 contains the alignment.
	.config0 files contain configuration for the protein function prediction framework.
	atleast3-EXP-90.0.txt.out0 contains the output of the protein function prediction framework, which are the precision, recall, and F-score.
	atleast3-EXP-90.0.txt.out0predlist.txt contains the predicted list of protein-GO term pairs.

Then, after repeating the same for the corresponding TARA version on the same ground truth-rarity dataset, you can take the intersection of the two predicted lists to get the predictions for TARA++. 

