<p>There are multiple ways to do this, and multiple protein interaction databases besides the ones you mentioned, such as <a href="https://thebiogrid.org/" rel="noreferrer">BioGRID</a> or <a href="http://www.ebi.ac.uk/intact/" rel="noreferrer">IntAct</a>. Interaction databases are different in how interactions are defined, sometimes it can be experimental evidence of interaction, sometimes coexpression, orthology-based predictions, etc. </p>

<p>There is no single solution to your problem. For String-DB you can use their R package <a href="http://bioconductor.org/packages/release/bioc/html/STRINGdb.html" rel="noreferrer">STRINGdb</a>.</p>



<pre><code># string-db
library(STRINGdb)

# retrieve full graph for H. sapiens
string_db &lt;- STRINGdb$new(version="10", species=9606,
                          score_threshold=400, input_directory="" )

# define genes of interest
genes.of.interest &lt;- ...

# get their neighbors
neighbors &lt;- string_db$get_neighbors(genes.of.interest)

# get the subgraph of interest (your genes + their neighbors)
my.subgraph &lt;- string_db$get_subnetwork(c(genes.of.interest, neighbors))

# look how many genes and interactions you have
my.subgraph
</code></pre>

<p>If you prefer GUI, you might consider using <a href="http://www.cytoscape.org/" rel="noreferrer">Cytoscape</a>. They have <a href="http://apps.cytoscape.org/apps/with_tag/interactiondatabase" rel="noreferrer">multiple addons for interaction databases</a>, e.g. <a href="http://apps.cytoscape.org/apps/stringapp" rel="noreferrer">for STRINGdb</a>. There you can just provide your gene list and get a network in a few clicks.</p>

CC BY-SA 3.0
2017-06-08T10:33:51.530Z
Note that STRING is *very* dirty. if you want to use it toi build a network it is essential to filter the results by detection method (it has many, many inferred interactions).
terdon
CC BY-SA 3.0
2017-06-08T08:24:57.997Z
2017-06-08T08:49:31.847Z
2017-06-08T08:49:31.847Z
Iakov Davydov
<p>Many interaction databases now work with <a href="http://psidev.sourceforge.net/molecular_interactions/xml/doc/user/" rel="nofollow noreferrer">PSI format</a> files. Most of the main databases can do this and the EBI has set up <a href="http://www.ebi.ac.uk/Tools/webservices/psicquic/view/main.xhtml" rel="nofollow noreferrer">PSICQUIC View</a>, a very useful page where you can query multiple databases at once. </p>

<p>Note that it is very important to limit the results according to the detection method. There is a lot of noise in protein interaction databases. Depending on what you want to do you could limit to only experimentally verified interactions or to only direct, binary interactions 
(so exclude the results of, for example, ChIP analyses which can also find complexes) etc.</p>

<p>That said, here's a simple example script that will query the APID database using its PSICQUIC service:</p>

<pre class="lang-perl prettyprint-override"><code>#!/usr/bin/perl
use strict;
use warnings;
use LWP::Simple;

my @proteins;
## Read a list of target proteins, one per line (this expects UniProt names)
open(my $fh, "$ARGV[0]") or die "Need a list of proteins as the 1st argument: $!\n";
while (&lt;$fh&gt;) {
    chomp;
    push @proteins, $_;
}
close($fh);
## Get human interactions only
my $species="9606";

## Get the interactions for each target protein
foreach my $protein (@proteins) {
    my $queryUrl= "http://cicblade.dep.usal.es/psicquic-ws/webservices/current/search/query/$protein";
    $queryUrl  .= "?taxidA:$species%20ANDtaxidB:$species";

    my $tries=1;
    my $content = get $queryUrl;
    while ($tries&lt;=10) {
        if (defined($content)) {
            $tries=11;
        } else {
            print STDERR "Could not retrieve $queryUrl, retrying($tries)...\n";
            $content = get $queryUrl;
        }
        $tries++;
    }

    # Now list all interactions
    my @lines = split(/\n/, $content);
    my $LINES= @lines;
    my $count = 0;
    for my $line (@lines) {
        $count++;
        my @flds = split(/\t/, $line); # split tab delimited lines      
        # split fields of a PSIMITAB 2.5 line
        my ($idA, $idB, $altIdA, $altIdB, $aliasA, $aliasB, $detMethod, $author, $pub, $orgA, $orgB, $intType, $sourceDb, $intID, $conf) = @flds;
        ## Here you can add logic to limit the interactions by specific detection method codes ($detMethod)
        ## or database of origin etc. 

        ## Print
        print "$line\n"
    }
}
</code></pre>

<p>I tested it by using a file with the UniProt ID for human TP53 (P04637) and it returns a list of 3988 interactions (showing 10 randomly selected results below):</p>

<pre><code>$ foo.pl names.txt | shuf -n 10
uniprotkb:Q9BWC9    uniprotkb:P04637    -   -   uniprotkb:CCDC106(gene_name)    uniprotkb:TP53(gene_name)   psi-mi:"MI:0007"(anti tag coimmunoprecipitation)    Zhou, J. et al.(2010)   pubmed:20159018 taxid:9606(Homo sapiens)    taxid:9606(Homo sapiens)    -   psi-mi:"MI:0469"(intact)    intact:EBI-7812926  -
uniprotkb:P04637    uniprotkb:O15126    -   -   uniprotkb:TP53(gene_name)   uniprotkb:SCAMP1(gene_name) psi-mi:"MI:0018"(two hybrid)    Lim, J. et al.(2006)    pubmed:16713569 taxid:9606(Homo sapiens)    taxid:9606(Homo sapiens)    -   psi-mi:"MI:0463"(biogrid)   biogrid:720622  -
uniprotkb:P63165    uniprotkb:P04637    -   -   uniprotkb:SUMO1(gene_name)  uniprotkb:TP53(gene_name)   psi-mi:"MI:0018"(two hybrid)    Minty, A. et al.(2000)  pubmed:10961991 taxid:9606(Homo sapiens)    taxid:9606(Homo sapiens)    -   psi-mi:"MI:0463"(biogrid)   biogrid:262339  -
uniprotkb:P04637    uniprotkb:P31350    -   -   uniprotkb:TP53(gene_name)   uniprotkb:RRM2(gene_name)   psi-mi:"MI:0416"(fluorescence microscopy)   Xue, L. et al.(2003)    pubmed:12615712 taxid:9606(Homo sapiens)    taxid:9606(Homo sapiens)    -   psi-mi:"MI:0465"(dip)   dip:DIP-40167E  -
uniprotkb:P04637    uniprotkb:Q00987    -   -   uniprotkb:TP53(gene_name)   uniprotkb:MDM2(gene_name)   psi-mi:"MI:0004"(affinity chromatography technology)    Dai, MS. et al.(2004)   pubmed:15308643 taxid:9606(Homo sapiens)    taxid:9606(Homo sapiens)    -   psi-mi:"MI:0463"(biogrid)   biogrid:478073  -
uniprotkb:Q99576    uniprotkb:P04637    -   -   uniprotkb:TSC22D3(gene_name)    uniprotkb:TP53(gene_name)   psi-mi:"MI:0428"(imaging technique) Ayroldi, E. et al.(2015)    pubmed:25168242 taxid:9606(Homo sapiens)    taxid:9606(Homo sapiens)    -   psi-mi:"MI:0463"(biogrid)   biogrid:1255896 -
uniprotkb:P04637    uniprotkb:Q00987    -   -   uniprotkb:TP53(gene_name)   uniprotkb:MDM2(gene_name)   psi-mi:"MI:0415"(enzymatic study)   Lui, K. et al.(2013)    pubmed:23572512 taxid:9606(Homo sapiens)    taxid:9606(Homo sapiens)    -   psi-mi:"MI:0463"(biogrid)   biogrid:859223  -
uniprotkb:P25685    uniprotkb:P04637    -   -   uniprotkb:DNAJB1(gene_name) uniprotkb:TP53(gene_name)   psi-mi:"MI:0004"(affinity chromatography technology)    Qi, M. et al.(2014) pubmed:24361594 taxid:9606(Homo sapiens)    taxid:9606(Homo sapiens)    -   psi-mi:"MI:0463"(biogrid)   biogrid:938952  -
uniprotkb:P04637    uniprotkb:Q8IW41    -   -   uniprotkb:TP53(gene_name)   uniprotkb:MAPKAPK5(gene_name)   psi-mi:"MI:0424"(protein kinase assay)  Sun, P. et al.(2007)    pubmed:17254968 taxid:9606(Homo sapiens)    taxid:9606(Homo sapiens)    -   psi-mi:"MI:0469"(intact)    intact:EBI-1202077  -
uniprotkb:Q13526    uniprotkb:P04637    -   -   uniprotkb:PIN1(gene_name)   uniprotkb:TP53(gene_name)   psi-mi:"MI:0096"(pull down) Mantovani, F. et al.(2007)  pubmed:17906639 taxid:9606(Homo sapiens)    taxid:9606(Homo sapiens)    -   psi-mi:"MI:0469"(intact)    intact:EBI-6112688  -
</code></pre>

CC BY-SA 3.0
2017-06-11T12:54:54.737Z
Thank you, I am not sure what's EBI nor how to convert/map gene names to list of proteins.
0x90
CC BY-SA 3.0
2017-06-11T13:00:50.920Z
@0x90 EBI is just the [European Bioinformatics Institute](https://www.ebi.ac.uk/). Mapping is always complicated, I am afraid, and one of the main practical problems for this sort of analysis is that both genes and proteins have many, many different identifiers in the different databases. However, there are many tools that can help you map. For example: [1](http://www.uniprot.org/uploadlists/), [2](https://david.ncifcrf.gov/conversion.jsp).
terdon
CC BY-SA 3.0
2017-06-08T10:31:33.980Z
2017-06-09T00:07:33.717Z
2017-06-09T00:07:33.717Z
terdon
<p>If you run this Rscript using the gene name as an argument, you'll get a file with the pathway written to the directory.</p>

<pre><code>#!/usr/bin/Rscript
args = commandArgs(trailingOnly=TRUE)
library(paxtoolsr)
id &lt;- args[1]
write.table(graphPc(source=id,kind='neighborhood',
            format='BINARY_SIF',verbose=TRUE), 
            file=paste(id,'pathway',sep='_'), sep='\t',quote=FALSE)
</code></pre>

CC BY-SA 3.0
2017-06-15T19:21:31.780Z
2017-06-15T19:21:31.780Z
jaslibra
<p>Why not just use string-db's <a href="http://string-db.org" rel="nofollow noreferrer">online tool</a>? There you can adjust all parameters of interest such as interaction confidence as well as pull in extra protein interactions.</p>

<p>If you make a user you can also upload a custom background gene-set set which means the analysis of go-terms and interconnectedness that sting provides is usable.</p>

CC BY-SA 3.0
2017-06-16T10:50:45.063Z
2017-06-16T10:50:45.063Z
Kristoffer Vitting-Seerup
<p>Assume I have found the top 0.01% most frequent genes from a <a href="https://bioinformatics.stackexchange.com/questions/559/how-to-read-and-interpret-a-gene-expression-quantification-file">gene expression file</a>. </p>

<p>Let's say, these are 10 genes and I want to study the <a href="https://en.wikipedia.org/wiki/Protein%E2%80%93protein_interaction" rel="nofollow noreferrer">protein protein interactions</a>, the protein network and pathway.</p>

<p>I thought to use <a href="https://string-db.org" rel="nofollow noreferrer">string-db</a> or <a href="http://interactome.dfci.harvard.edu" rel="nofollow noreferrer">interactome</a>, but I am not sure what would be a plausible way to approach this problem and to build the protein network etc. Are there other more suitable databases?</p>

<p>How can I build a mathematical graph or network for these data?</p>

<proteins><networks><gene><pathway>
How can I build a protein network pathway from a gene expression quantification file?
# How can I build a protein network pathway from a gene expression quantification file?

(Asked by: username_0 on 2017-06-08)

Assume I have found the top 0.01% most frequent genes from a [gene expression file](https://bioinformatics.stackexchange.com/questions/559/how-to-read-and-interpret-a-gene-expression-quantification-file).

Let's say, these are 10 genes and I want to study the [protein protein interactions](https://en.wikipedia.org/wiki/Protein%E2%80%93protein_interaction), the protein network and pathway.

I thought to use [string-db](https://string-db.org) or [interactome](http://interactome.dfci.harvard.edu), but I am not sure what would be a plausible way to approach this problem and to build the protein network etc. Are there other more suitable databases?

How can I build a mathematical graph or network for these data?

**Tags:** proteins, networks, gene, pathway

---

## 4 answers

### Answer by username_1 on 2017-06-08. Score: 9 | Accepted answer

There are multiple ways to do this, and multiple protein interaction databases besides the ones you mentioned, such as BioGRID or IntAct. Interaction databases are different in how interactions are defined, sometimes it can be experimental evidence of interaction, sometimes coexpression, orthology-based predictions, etc. 
There is no single solution to your problem. For String-DB you can use their R package STRINGdb.
# string-db
library(STRINGdb)

# retrieve full graph for H. sapiens
string_db <- STRINGdb$new(version="10", species=9606,
                          score_threshold=400, input_directory="" )

# define genes of interest
genes.of.interest <- ...

# get their neighbors
neighbors <- string_db$get_neighbors(genes.of.interest)

# get the subgraph of interest (your genes + their neighbors)
my.subgraph <- string_db$get_subnetwork(c(genes.of.interest, neighbors))

# look how many genes and interactions you have
my.subgraph

If you prefer GUI, you might consider using Cytoscape. They have multiple addons for interaction databases, e.g. for STRINGdb. There you can just provide your gene list and get a network in a few clicks.

> **Comments:**
> **username_2**: Note that STRING is *very* dirty. if you want to use it toi build a network it is essential to filter the results by detection method (it has many, many inferred interactions).  

---

### Answer by username_2 on 2017-06-08. Score: 6

Many interaction databases now work with PSI format files. Most of the main databases can do this and the EBI has set up PSICQUIC View, a very useful page where you can query multiple databases at once. 
Note that it is very important to limit the results according to the detection method. There is a lot of noise in protein interaction databases. Depending on what you want to do you could limit to only experimentally verified interactions or to only direct, binary interactions 
(so exclude the results of, for example, ChIP analyses which can also find complexes) etc.
That said, here's a simple example script that will query the APID database using its PSICQUIC service:
#!/usr/bin/perl
use strict;
use warnings;
use LWP::Simple;

my @proteins;
## Read a list of target proteins, one per line (this expects UniProt names)
open(my $fh, "$ARGV[0]") or die "Need a list of proteins as the 1st argument: $!\n";
while (<$fh>) {
    chomp;
    push @proteins, $_;
}
close($fh);
## Get human interactions only
my $species="9606";

## Get the interactions for each target protein
foreach my $protein (@proteins) {
    my $queryUrl= "http://cicblade.dep.usal.es/psicquic-ws/webservices/current/search/query/$protein";
    $queryUrl  .= "?taxidA:$species%20ANDtaxidB:$species";

    my $tries=1;
    my $content = get $queryUrl;
    while ($tries<=10) {
        if (defined($content)) {
            $tries=11;
        } else {
            print STDERR "Could not retrieve $queryUrl, retrying($tries)...\n";
            $content = get $queryUrl;
        }
        $tries++;
    }

    # Now list all interactions
    my @lines = split(/\n/, $content);
    my $LINES= @lines;
    my $count = 0;
    for my $line (@lines) {
        $count++;
        my @flds = split(/\t/, $line); # split tab delimited lines      
        # split fields of a PSIMITAB 2.5 line
        my ($idA, $idB, $altIdA, $altIdB, $aliasA, $aliasB, $detMethod, $author, $pub, $orgA, $orgB, $intType, $sourceDb, $intID, $conf) = @flds;
        ## Here you can add logic to limit the interactions by specific detection method codes ($detMethod)
        ## or database of origin etc. 

        ## Print
        print "$line\n"
    }
}

I tested it by using a file with the UniProt ID for human TP53 (P04637) and it returns a list of 3988 interactions (showing 10 randomly selected results below):
$ foo.pl names.txt | shuf -n 10
uniprotkb:Q9BWC9    uniprotkb:P04637    -   -   uniprotkb:CCDC106(gene_name)    uniprotkb:TP53(gene_name)   psi-mi:"MI:0007"(anti tag coimmunoprecipitation)    Zhou, J. et al.(2010)   pubmed:20159018 taxid:9606(Homo sapiens)    taxid:9606(Homo sapiens)    -   psi-mi:"MI:0469"(intact)    intact:EBI-7812926  -
uniprotkb:P04637    uniprotkb:O15126    -   -   uniprotkb:TP53(gene_name)   uniprotkb:SCAMP1(gene_name) psi-mi:"MI:0018"(two hybrid)    Lim, J. et al.(2006)    pubmed:16713569 taxid:9606(Homo sapiens)    taxid:9606(Homo sapiens)    -   psi-mi:"MI:0463"(biogrid)   biogrid:720622  -
uniprotkb:P63165    uniprotkb:P04637    -   -   uniprotkb:SUMO1(gene_name)  uniprotkb:TP53(gene_name)   psi-mi:"MI:0018"(two hybrid)    Minty, A. et al.(2000)  pubmed:10961991 taxid:9606(Homo sapiens)    taxid:9606(Homo sapiens)    -   psi-mi:"MI:0463"(biogrid)   biogrid:262339  -
uniprotkb:P04637    uniprotkb:P31350    -   -   uniprotkb:TP53(gene_name)   uniprotkb:RRM2(gene_name)   psi-mi:"MI:0416"(fluorescence microscopy)   Xue, L. et al.(2003)    pubmed:12615712 taxid:9606(Homo sapiens)    taxid:9606(Homo sapiens)    -   psi-mi:"MI:0465"(dip)   dip:DIP-40167E  -
uniprotkb:P04637    uniprotkb:Q00987    -   -   uniprotkb:TP53(gene_name)   uniprotkb:MDM2(gene_name)   psi-mi:"MI:0004"(affinity chromatography technology)    Dai, MS. et al.(2004)   pubmed:15308643 taxid:9606(Homo sapiens)    taxid:9606(Homo sapiens)    -   psi-mi:"MI:0463"(biogrid)   biogrid:478073  -
uniprotkb:Q99576    uniprotkb:P04637    -   -   uniprotkb:TSC22D3(gene_name)    uniprotkb:TP53(gene_name)   psi-mi:"MI:0428"(imaging technique) Ayroldi, E. et al.(2015)    pubmed:25168242 taxid:9606(Homo sapiens)    taxid:9606(Homo sapiens)    -   psi-mi:"MI:0463"(biogrid)   biogrid:1255896 -
uniprotkb:P04637    uniprotkb:Q00987    -   -   uniprotkb:TP53(gene_name)   uniprotkb:MDM2(gene_name)   psi-mi:"MI:0415"(enzymatic study)   Lui, K. et al.(2013)    pubmed:23572512 taxid:9606(Homo sapiens)    taxid:9606(Homo sapiens)    -   psi-mi:"MI:0463"(biogrid)   biogrid:859223  -
uniprotkb:P25685    uniprotkb:P04637    -   -   uniprotkb:DNAJB1(gene_name) uniprotkb:TP53(gene_name)   psi-mi:"MI:0004"(affinity chromatography technology)    Qi, M. et al.(2014) pubmed:24361594 taxid:9606(Homo sapiens)    taxid:9606(Homo sapiens)    -   psi-mi:"MI:0463"(biogrid)   biogrid:938952  -
uniprotkb:P04637    uniprotkb:Q8IW41    -   -   uniprotkb:TP53(gene_name)   uniprotkb:MAPKAPK5(gene_name)   psi-mi:"MI:0424"(protein kinase assay)  Sun, P. et al.(2007)    pubmed:17254968 taxid:9606(Homo sapiens)    taxid:9606(Homo sapiens)    -   psi-mi:"MI:0469"(intact)    intact:EBI-1202077  -
uniprotkb:Q13526    uniprotkb:P04637    -   -   uniprotkb:PIN1(gene_name)   uniprotkb:TP53(gene_name)   psi-mi:"MI:0096"(pull down) Mantovani, F. et al.(2007)  pubmed:17906639 taxid:9606(Homo sapiens)    taxid:9606(Homo sapiens)    -   psi-mi:"MI:0469"(intact)    intact:EBI-6112688  -

> **Comments:**
> **username_0**: Thank you, I am not sure what's EBI nor how to convert/map gene names to list of proteins.  
> **username_2**: @0x90 EBI is just the [European Bioinformatics Institute](https://www.ebi.ac.uk/). Mapping is always complicated, I am afraid, and one of the main practical problems for this sort of analysis is that both genes and proteins have many, many different identifiers in the different databases. However, there are many tools that can help you map. For example: [1](http://www.uniprot.org/uploadlists/), [2](https://david.ncifcrf.gov/conversion.jsp).  

---

### Answer by username_3 on 2017-06-15. Score: 2

If you run this Rscript using the gene name as an argument, you'll get a file with the pathway written to the directory.
#!/usr/bin/Rscript
args = commandArgs(trailingOnly=TRUE)
library(paxtoolsr)
id <- args[1]
write.table(graphPc(source=id,kind='neighborhood',
            format='BINARY_SIF',verbose=TRUE), 
            file=paste(id,'pathway',sep='_'), sep='\t',quote=FALSE)


---

### Answer by username_4 on 2017-06-16. Score: 1

Why not just use string-db's [online tool](http://string-db.org)? There you can adjust all parameters of interest such as interaction confidence as well as pull in extra protein interactions.

If you make a user you can also upload a custom background gene-set set which means the analysis of go-terms and interconnectedness that sting provides is usable.


---

