<jupyter_start><jupyter_text>---  Extracting Interactions from BIOGRID**2015 November 30**Using BIOGRID v3.4.130<jupyter_code>readPath = os.path.join('..', '..','DataDownload', 'BIOGRID', 'BIOGRID-ORGANISM-3.4.130.tab2', 
                        'BIOGRID-ORGANISM-Homo_sapiens-3.4.130.tab2.txt')
writePath = os.path.join('..', 'data', 'BIOGRID-3.4.130-human.txt')
colNum = open(readPath).readline().strip().split('\t').index('Experimental System Type')
with open(writePath, 'w') as fid:
    fid.writelines([line for line in open(readPath) if line.split('\t')[colNum] == 'genetic'])<jupyter_output><empty_output><jupyter_text>Breakdown of experimental evidence codes**2015 November 30**Using BIOGRID v3.4.130<jupyter_code>typeCounts = dict()
genes = set()
colNum = 1  # using Entrez
for line in open(os.path.join('..', 'data', 'BIOGRID-3.4.130-human.txt')):
    tokens = line.split('\t')
    genes.update(tokens[colNum:colNum+2])
    typeCounts[tokens[11]] = typeCounts.get(tokens[11], 0) + 1
len(genes)
typeCounts<jupyter_output><empty_output><jupyter_text>---  Predictability in BIOGRID Interaction Types**2015 August 11**Using BIOGRID v3.4.127<jupyter_code>os.chdir('/work/jyoung/genetic_interact/src')
%run func_net_pred 'Dosage Lethality'
%run func_net_pred 'Dosage Rescue'
%run func_net_pred 'Phenotypic Enhancement'
%run func_net_pred 'Phenotypic Suppression'
%run func_net_pred 'Synthetic Growth Defect'
%run func_net_pred 'Synthetic Rescue'<jupyter_output>Number of genes in functional network: 18031
Number of genes in interactions: 138
Number of seed sets: 16<jupyter_text>---  Output Gene Names in Predictive Seed Sets**2015 August 11**Entrez IDs have been used for both the BIOGRID genetic interactions and HumanNet; conversion to gene symbols will be needed. Following the approach in the IPython notebook *Fly Genetic Interactions.ipynb*, use the R Bioconductor library *org.Hs.eg.db* (specifically *org.Hs.egSYMBOL*) to output a conversion table to text, which can be read and stored in Python.     > library("org.Hs.eg.db")    > entrezIDs <- ls(org.Hs.egSYMBOL)    > length(entrezIDs)    [1] 56340    > entrezIDs[1:10]    [1] "1" "2" "3" "9" "10" "11" "12" "13" "14" "15"    > head(toTable(org.Hs.egSYMBOL[entrezIDs]))      gene_id symbol    1       1   A1BG    2       2    A2M    3       3  A2MP1    4       9   NAT1    5      10   NAT2    6      11   NATP    > conversTab <- toTable(org.Hs.egSYMBOL[entrezIDs])    > write.table(conversTab, file="/work/jyoung/DataProcessed/org.Hs.egSYMBOL.txt",                  quote=FALSE, sep="\t", row.names=FALSE)Next, verify that the table has unique gene IDs and read this conversion table into a Python dictionary.<jupyter_code>%%bash
head -5 /work/jyoung/DataProcessed/org.Hs.egSYMBOL.txt
%%bash
cut -f1 /work/jyoung/DataProcessed/org.Hs.egSYMBOL.txt | sort | uniq | wc -l
entrez2name = dict()
fid = open('/work/jyoung/DataProcessed/org.Hs.egSYMBOL.txt')
header = fid.readline()
for line in fid:
    tokens = line.strip().split('\t')
    entrez2name[tokens[0]] = tokens[1]
fid.close()<jupyter_output><empty_output><jupyter_text>Now check whether all of the Entrez IDs in FlyNet are included in the conversion dictionary.<jupyter_code>allNetEntrez = set()
for line in open('/work/jyoung/DataDownload/FunctionalNet/H6Net_CC.net'):
    allNetEntrez.update(line.split('\t')[:2])
len(allNetEntrez)
len(allNetEntrez - set(entrez2name.keys()))
pickle.dump(entrez2name, open('/work/jyoung/PyPickle/humanEntrez2names.p', 'wb'))<jupyter_output><empty_output><jupyter_text>**2015 August 12**Finally, write out the predictive seed sets.<jupyter_code>%run func_net_pred 'Dosage Rescue'
%run func_net_pred 'Phenotypic Enhancement'
%run func_net_pred 'Phenotypic Suppression'
%run func_net_pred 'Synthetic Growth Defect'
%run func_net_pred 'Synthetic Rescue'<jupyter_output>Number of genes in functional network: 18031
Number of genes in interactions: 138
Number of seed sets: 16<jupyter_text>**2015 September 22, 24, 28**Compare using HumanNet version 2 vs version 1 by plotting the seed set AUCs of version 2 against version 1 for each genetic interaction type. Create a script named *compare_func_net_versions.py* for this purpose.NOTE: *func_net_pred.py* now accepts 2 command line arguments, the BIOGRID interaction type and the organism. The modified code reduces hard-coded filenames inside individual functions. **2015 September 24, 28**The function *process_func_net( )* assumes that the genes are in columns 1 & 2 and the LLS is in column 3, as it seems must functional networks are in this format. However, HumanNet v1 has the LLS in column 24, so write a new HumanNet v1 file that only has 3 columns with the LLS in column 3:    cd /work/jyoung/DataDownload/FunctionalNet    awk '{print $1 "\t" $2 "\t" $24}' HumanNet.v1.join.txt > humannet1.entrez.txt<jupyter_code>%run compare_func_net_versions.py 'Phenotypic Enhancement' 1 2
%run compare_func_net_versions.py 'Phenotypic Suppression' 1 2<jupyter_output>Number of genes in interactions: 249
{'fraction_non_alphanumeric': 0.11817636472705459, 'fraction_numerical': 0.03939212157568486, 'mean_word_length': 4.816279069767442, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '627346', 'license': 'MIT', 'n_tokens_mistral': 1873, 'n_tokens_neox': 1683, 'n_words': 483, 'path': 'doc/Human Genetic Interactions.ipynb', 'repo_name': 'jon-young/genetic_interact', 'size': '5001'}