Assume I have found the top 0.01% most frequent genes from a gene expression file.

Let's say, these are 10 genes and I want to study the protein protein interactions, the protein network and pathway.

I thought to use string-db or interactome, 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?


4 Answers 4


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

# 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

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.

  • 2
    $\begingroup$ 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). $\endgroup$
    – terdon
    Commented Jun 8, 2017 at 10:33

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:

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>) {
    push @proteins, $_;
## 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)) {
        } else {
            print STDERR "Could not retrieve $queryUrl, retrying($tries)...\n";
            $content = get $queryUrl;

    # Now list all interactions
    my @lines = split(/\n/, $content);
    my $LINES= @lines;
    my $count = 0;
    for my $line (@lines) {
        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  -
  • $\begingroup$ Thank you, I am not sure what's EBI nor how to convert/map gene names to list of proteins. $\endgroup$
    – 0x90
    Commented Jun 11, 2017 at 12:54
  • 1
    $\begingroup$ @0x90 EBI is just the European Bioinformatics Institute. 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, 2. $\endgroup$
    – terdon
    Commented Jun 11, 2017 at 13:00

If you run this Rscript using the gene name as an argument, you'll get a file with the pathway written to the directory.

args = commandArgs(trailingOnly=TRUE)
id <- args[1]
            file=paste(id,'pathway',sep='_'), sep='\t',quote=FALSE)

Why not just use string-db's online tool? 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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.