Example #1
0
def create_test_model(test_network_file = humannet_filename):
    """Returns a nampy model for testing.  

    test_network_file: a two-column network file to be read
    
    """
    # from os import name as __name
    from nampy.networkio import networkio
    
    the_nampy_model = networkio.create_network_model_from_textfile('humannet', test_network_file, verbose = False)
    
    return the_nampy_model
Example #2
0
# protein complexes that facilitate viral infection. PLOS ONE, 9(5), e96687.

import nampy
from nampy.networkio import networkio
from nampy.annotation import idmapping
from nampy.manipulation import manipulation
from nampy.monopartiteanalysis import prince

# Let's work with a version of HumanNet
# Lee, I., Blom, U. M., Wang, P. I., Shim, J. E., & Marcotte, E. M. (2011). 
# Prioritizing candidate disease genes by network-based boosting of genome-wide association data. 
# Genome research, 21(7), 1109–21. doi:10.1101/gr.118992.110
data_dir = nampy.__path__[0] + '/data/'

network_file = data_dir + "HumanNet_v1_join_networkonly.txt"
humannet = networkio.create_network_model_from_textfile('humannet', network_file, verbose = True)

# Add ids courtesy of bioservices
# note you may need to "easy_install bioservices" first
# also, you may want to add email = '*****@*****.**'
# so ncbi can contact you if there are issues with the query
# Note there may some errors returned while querying but 
# each query is generally successful within the three tries.
humannet = idmapping.get_more_node_ids(humannet, node_id_type = "Entrez Gene (GeneID)", mapping_types = ['Entrez Gene (GeneID)', "UniProtKB ACC", 'UniProtKB ID', 'Symbol'], verbose = True)

# APMS host targets from
# Jäger, S., Cimermancic, P., Gulbahce, N., Johnson, J. R., McGovern, K. E., Clarke, S. C.,
#  … Krogan, N. J. (2012). Global landscape of HIV-human protein complexes. 
# Nature, 481(7381), 365–70. doi:10.1038/nature10719
hiv_apms_file = data_dir + "published_hiv_apms_factors.txt"
apms_source = networkio.create_source_dict_from_textfile(hiv_apms_file)