In this tutorial we show you how to query interactions from one of the many resources included in OmniPath, customize the data by interaction types, and further quality controls.
We'll start by importing libraries, first omnipath
, and pandas
for data wrangling.
import omnipath as op
import pandas as pd
OmniPath contains many resources we can choose to collate our desired network from. To browse the list available resources call the op.interactions.AllInteractions.resources()
function.
op.interactions.AllInteractions.resources()
OmniPath can serve multiple kinds of interactions, based on the quality of the interactors or the interactions themselves:
post_translational
i.e. physical interactions of proteins, protein-protein interactions (or PPIs)transcriptional
i.e. gene regulatory interactionspost_transcriptional
i.e. miRNA-mRNA interactionsmirna_transcriptional
i.e. transcriptional regulation of miRNA genesIn the following code blocks we are going to query all of them, and show the URLS these queries generate, through which the data is also accessible, through a browser.
First, let's take a look at PPI interactions.
By default, this query returns data from the omnipath
dataset, which means literature curated activity flow (directed, signed interactions in most cases, curation effort).
interactions = op.interactions.PostTranslational.get()
interactions
#
#RecursionError: maximum recursion depth exceeded
We can include interactions without explicit literature references as well, by including the extra datasets pathwayextra
, kinaseextra
, or ligrecextra
.
To get just one of these extra sets, one can call the specific function for it:
interactions_pathwayextra = op.interactions.PathwayExtra.get()
interactions_pathwayextra
interactions_pathwayextra_citations = interactions_pathwayextra[
interactions_pathwayextra['curation_effort'] >= 7
]
interactions_pathwayextra_citations
We can use these properties to further specify our queries, for example on curation effort. The curation_effort
value we filtered our query on shows the unique database - citation pairs, i.e. how many times was an interaction described in a paper and mentioned in a database.
To get all PPI interactions call interactions.AllInteractions
. By default only directed interactions are included, but we can include a flag to import undirected interactions as well.
op.interactions.AllInteractions.get(directed = False, organism = 'human')
The other interaction types have their own built-in functions as well. This query accesses interactions from DoRothEA
, from confidence levels A to D, from highest to lowest. It is set to pull out A and B by default, but naturally we can extend it.
op.interactions.Transcriptional.get(dorothea_levels = ["A","B","C"], organism = 'human')
To access post_transcriptional
and mirna_transcriptional
interactions, we can utilise their respective functions, or call the corresponding URLs:
op.interactions.TFmiRNA.get()
op.interactions.miRNA.get()
In this tutorial we learned:
OmniPath