#!/usr/bin/env python# Dénes Türei Uniklinik RWTH Aachen & EMBL Heidelberg 2018# turei.denes@gmail.com# how to load non-human interaction data directly in pypath# note: for mammalians the recommended method is to# translate from human network by orthology# as most of the data is available for humanimportpypath# first we need to set the `ncbi_tax_id` parameter# of the PyPath instance to 10090pa=pypath.PyPath(ncbi_tax_id=10090)# all network inputs in pypath are defined by# `ReadSettings` objects# many predefined input settings reside in various# dicts in `data_formats`# to load mouse data from Signor we need to set the# parameter below; this will result the reader to# check column #13 in original Signor data and load# only those with values `10090` or `10090;10090` in# this column, and also to consider these having a# taxon ID `10090` (values in the dict; this determines# ID translation later)# these settings are specific for individual resources# one need to check the output of the corresponding# `pypath.dataio` method to find out the values;# find the methods under the `inFile` attribute of the# `ReadSettings` object, e.g.# `pypath.data_formats.pathway['signor'].inFile`# ok, this is misleading because it's not a file but# a function, but in theory it could be also a file name# or URLpypath.data_formats.pathway['signor'].ncbiTaxId={'col':12,'dict':{'10090':10090,'10090;10090':10090}}# these `reference lists` are used to make sure all entities# have their type and taxon correctly identified# for example this is simply a list of all mouse UniProts# if you want only SwissProts add `swissprot = True`pa.reflists[('uniprot','protein',10090)]=(pypath.reflists.ReferenceList('uniprot','protein',10090,'all_uniprots'))pa.reflists[('uniprot','protein',10090)].load()# in order to get any mouse interaction from Signor# we need to pass `organism = 10090` to# `dataio.signor_interactions()`# this is redundant and undocumented, sorry about that# will improve laterpypath.data_formats.pathway['signor'].inputArgs['organism']=10090# after setting all these it is possible to load mouse interactions# as they are defined in Signorpa.init_network({'singor':pypath.data_formats.pathway['signor']})# output:# > 355 interactions between 373 nodes# from 1 resources have been loaded## this network is much smaller than human# in my opinion is better to have more complete data# translated from human
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 133 135 137 139 141 143 145 147 149 151 153 155 157 159 161 163 165 167 169 171 173 175 177 179 181 183 185 187 189 191 193 195 197 199 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 133 135 137 139 141 143 145 147 149 151 153 155 157 159 161 163 165 167 169 171 173 175 177 179 181 183 185 187 189 191 193 195 197 199 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 133 135 137 139 141 143 145 147 149 151 153 155 157 159 161 163 165 167 169 171 173 175 177 179 181 183 185 187 189 191 193 195 197 199