<p>The query link for all interactors would be thus : <code>https://www.uniprot.org/uniprot/?query=organism%3A9606+AND+interactor%3A*&amp;sort=score</code></p>

<hr>

<p>There is always an option of downloading the static version of the service if you find it incovnient to deal with their API for your use case <a href="ftp://ftp.uniprot.org/pub/databases/uniprot/" rel="nofollow noreferrer">from here</a> and have it all to yourself, pipe data into your dataframes locally. I find it useful to just broswe their repositories sometimes instead of reading the specifications.</p>

<p>In general, you can get a variety of datashapes  from uniprot that you cannot get from their static database-image by specifying the appropriate parameters in the request. You can browse and explore parameters by expanding their GUI's <strong>search fields</strong> as described in <a href="http://insideuniprot.blogspot.com/2015_03_01_archive.html" rel="nofollow noreferrer">this little guide</a>. Then you can request your data like so, in python for example. </p>

<pre><code>import requests
URL = "https://www.uniprot.org/uniprot/"
PARAMS = {'organism': 9606, 'format': 'tab', ....#Additional parameters#...}
response = requests.get(url=URL, params=PARAMS)
</code></pre>

CC BY-SA 4.0
2020-04-12T01:12:19.607Z
Thanks for the reply. So I was already able to download the database data, I'll explain in more detail what it is exactly that I need in the post.
An Ignorant Wanderer
CC BY-SA 4.0
2020-04-12T01:33:20.053Z
@AnIgnorantWanderer Added query for interactors. Tag on ```&format=tab``` to make your life easier once you get to python.
rtviii
CC BY-SA 4.0
2020-04-11T23:36:33.343Z
2020-04-16T02:56:54.693Z
2020-04-16T02:56:54.693Z
rtviii
<p>I am looking for guidance to load all SwissProt PPI data for Homo sapiens into a graph (from NetworkX). In particular, the part that I'm struggling with is gathering the data from SwissProt for each human protein. </p>

<hr>

<p>The data that I'm looking to extract is protein-protein interaction. This is not included in the files found <a href="ftp://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/idmapping/by_organism/" rel="nofollow noreferrer">here</a>, which @rtviii (answer below) suggested to use. Rather, when say you click on an entry in SwissProt, for each entry, there is a section devoted to "Interaction" as shown in the image attached below. I would like to extract that information for each human protein, and load it into a graph data structure using NetworkX</p>

<p><a href="https://i.sstatic.net/VKTPS.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/VKTPS.png" alt="enter image description here"></a></p>

<hr>

<p>EDIT 2:</p>

<p>How I ended up doing it:</p>

<pre><code>
    query = "reviewed:yes+AND+organism:9606"
    args = {'query': query, 'format': 'xls', 'columns':'id,entry name,interactor'}

    uniprot_url = "https://www.uniprot.org/uniprot/?{}".format(urllib.parse.urlencode(args))

    with open(&lt;DESIRED FILE PATH&gt;, "wb") as target:
          target.write(requests.get(url).content)


</code></pre>

CC BY-SA 4.0
2020-04-13T16:21:51.060Z
What are you trying to do exactly? Are you starting with a list of proteins and want to find their interactions? If so, why not go straight to Mint or Intact (but be careful with Intact, there's a lot of dirty data in there)? Why would you start from uniprot? If you want to build a high quality human PPI network, this really isn't the simplest or best approach. You might want to ask a new question, taking a step back to basics.
terdon
<python><uniprot>
Loading all PPI information from Uniprot into a graph in NetworkX
# Loading all PPI information from Uniprot into a graph in NetworkX

(Asked by: username_0 on 2020-04-11)

I am looking for guidance to load all SwissProt PPI data for Homo sapiens into a graph (from NetworkX). In particular, the part that I'm struggling with is gathering the data from SwissProt for each human protein. 

The data that I'm looking to extract is protein-protein interaction. This is not included in the files found here, which @rtviii (answer below) suggested to use. Rather, when say you click on an entry in SwissProt, for each entry, there is a section devoted to "Interaction" as shown in the image attached below. I would like to extract that information for each human protein, and load it into a graph data structure using NetworkX


EDIT 2:
How I ended up doing it:

    query = "reviewed:yes+AND+organism:9606"
    args = {'query': query, 'format': 'xls', 'columns':'id,entry name,interactor'}

    uniprot_url = "https://www.uniprot.org/uniprot/?{}".format(urllib.parse.urlencode(args))

    with open(, "wb") as target:
          target.write(requests.get(url).content)

**Tags:** python, uniprot
> **Comments:**
> **username_1**: What are you trying to do exactly? Are you starting with a list of proteins and want to find their interactions? If so, why not go straight to Mint or Intact (but be careful with Intact, there's a lot of dirty data in there)? Why would you start from uniprot? If you want to build a high quality human PPI network, this really isn't the simplest or best approach. You might want to ask a new question, taking a step back to basics.  

---

## 1 answers

### Answer by username_2 on 2020-04-11. Score: 2 | Accepted answer

The query link for all interactors would be thus : https://www.uniprot.org/uniprot/?query=organism%3A9606+AND+interactor%3A*&sort=score

There is always an option of downloading the static version of the service if you find it incovnient to deal with their API for your use case from here and have it all to yourself, pipe data into your dataframes locally. I find it useful to just broswe their repositories sometimes instead of reading the specifications.
In general, you can get a variety of datashapes  from uniprot that you cannot get from their static database-image by specifying the appropriate parameters in the request. You can browse and explore parameters by expanding their GUI's search fields as described in this little guide. Then you can request your data like so, in python for example. 
import requests
URL = "https://www.uniprot.org/uniprot/"
PARAMS = {'organism': 9606, 'format': 'tab', ....#Additional parameters#...}
response = requests.get(url=URL, params=PARAMS)

> **Comments:**
> **username_0**: Thanks for the reply. So I was already able to download the database data, I'll explain in more detail what it is exactly that I need in the post.  
> **username_2**: @AnIgnorantWanderer Added query for interactors. Tag on ```&format=tab``` to make your life easier once you get to python.  

---

