Skip to content

Instantly share code, notes, and snippets.

@andrawaag
andrawaag / DifExInsullinSIgnalling.R
Last active October 4, 2015 21:29
Differentially expressed Genes in a pathway on Insulin Signaling in case of Diabetes Mellitus
library(SPARQL)
library(ggplot2)
wpSparql <- "http://sparql.wikipathways.org"
ebiSparql <- "https://www.ebi.ac.uk/rdf/services/atlas/sparql"
efoPathwaysQuery <- "PREFIX identifiers: <http://identifiers.org/ensembl/>
PREFIX atlas: <http://rdf.ebi.ac.uk/resource/atlas/>
PREFIX atlasterms: <http://rdf.ebi.ac.uk/terms/atlas/>
PREFIX efo: <http://www.ebi.ac.uk/efo/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dcterms: <http://purl.org/dc/terms/>
@andrawaag
andrawaag / TuberculosisinWikidata.R
Last active December 7, 2015 14:51
Get a spatial map in R on Number of cases of Tuberculosis in Wikidata added the SWAT4LS tutorial
library(SPARQL)
library(ggplot2)
library(rworldmap)
wdqs <- "https://query.wikidata.org/bigdata/namespace/wdq/sparql"
query <- "PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>
@andrawaag
andrawaag / WIkidataMalariaCounts.R
Created December 7, 2015 14:54
Get a spatial map in R on Number of cases of Malaria in Wikidata added the SWAT4LS tutorial
library(SPARQL)
library(ggplot2)
library(rworldmap)
wdqs <- "https://query.wikidata.org/bigdata/namespace/wdq/sparql"
query <- "PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>
<VirtualHost *:80>
ServerName rdf.wikipathways.org
RewriteEngine on
RewriteRule ^(.*)$ http://sparql.wikipathways.org/?default-graph-uri=&query=DESCRIBE+<http\:\/\/%{HTTP_HOST}$1> [P]
ProxyPassReverse / http://sparql.wikipathwys.org/
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
@andrawaag
andrawaag / gist:4642824
Created January 26, 2013 15:03
SPARQL query to find streaming media providers through dbpedia
SELECT DISTINCT * WHERE {
?resource <http://dbpedia.org/ontology/type> <http://dbpedia.org/resource/Streaming_media> .
?resource <http://xmlns.com/foaf/0.1/isPrimaryTopicOf> ?wikipediaPage .
?resource <http://dbpedia.org/property/url> ?website .
}
@andrawaag
andrawaag / GPML representation of a Directed Interaction
Created February 4, 2013 17:13
GPML file of a directed Interaction in WikiPathways
<?xml version="1.0" encoding="UTF-8"?>
<Pathway xmlns="http://genmapp.org/GPML/2010a" Name="untitled" Data-Source="COPIED">
<Graphics BoardWidth="582.0" BoardHeight="369.0" />
<DataNode TextLabel="GeneProduct" GraphId="eee89" Type="GeneProduct">
<Graphics CenterX="512.0" CenterY="329.0" Width="80.0" Height="20.0" ZOrder="32768" FontSize="10" Valign="Middle" />
<Xref Database="" ID="" />
</DataNode>
<DataNode TextLabel="GeneProduct" GraphId="da3fe" Type="GeneProduct">
<Graphics CenterX="352.0" CenterY="329.0" Width="80.0" Height="20.0" ZOrder="32768" FontSize="10" Valign="Middle" />
<Xref Database="" ID="" />
@andrawaag
andrawaag / GPMLsniplet
Created February 5, 2013 16:57
GPML sniplet from WP TCA cycle pathway
<?xml version="1.0" encoding="UTF-8"?>
<Pathway xmlns="http://genmapp.org/GPML/2010a" Name="untitled" Data-Source="COPIED">
<Graphics BoardWidth="177.2833366394043" BoardHeight="500.1666564941406" />
<DataNode TextLabel="MDH1" GraphId="bceb9" Type="GeneProduct">
<Attribute Key="org.pathvisio.model.BackpageHead" Value="MDH1" />
<Graphics CenterX="113.46667098999023" CenterY="415.6666564941406" Width="67.63333129882812" Height="20.0" ZOrder="32768" FontSize="10" Valign="Middle" />
<Xref Database="Entrez Gene" ID="459271" />
</DataNode>
<DataNode TextLabel="Malate" GraphId="b6f7a" Type="Metabolite">
<Attribute Key="org.pathvisio.model.BackpageHead" Value="Malate" />
@andrawaag
andrawaag / gist:4716000
Last active December 12, 2015 04:39
RDF with the WP vocabulary included
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ns1: <http://rdf.wikipathways.org/Pathway/WP881_r41576/DataNode/> .
@prefix wp: <http://vocabularies.wikipathways.org/wp#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix wprdf: <http://rdf.wikipathways.org/Pathway/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://rdf.wikipathways.org/Pathway/WP881_r41576/DataNode/bceb9> rdf:type wp:GeneProduct;
dc:identifier <http://identifiers.org/ncbigene/459271> .
@andrawaag
andrawaag / gist:4716028
Created February 5, 2013 17:22
RDF with only GPML vocabulary
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ns1: <http://rdf.wikipathways.org/Pathway/WP881_r41576/DataNode/> .
@prefix wp: <http://vocabularies.wikipathways.org/wp#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix wprdf: <http://rdf.wikipathways.org/Pathway/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://rdf.wikipathways.org/Pathway/WP881_r41576/DataNode/bceb9> dc:identifier <http://identifiers.org/ncbigene/459271> ;
dcterms:isPartOf wprdf:WP881_r41576 ;
@andrawaag
andrawaag / downloadOPSWpPw.sh
Created March 14, 2013 14:05
Shell script for the RDF serializer for the WikiPathways Pathways with the Analysis tag
rm -rf /tmp/GPML
mkdir /tmp/GPML
rm -rf /tmp/OPSWPRDF
mkdir /tmp/OPSWPRDF
rm -rf /tmp/OPSWIKIDUMP
mkdir /tmp/OPSWIKIDUMP
wget -O /tmp/OPSWIKIDUMP/Anopheles%20gambiae.zip "http://www.wikipathways.org//wpi/batchDownload.php?species=Anopheles%20gambiae&fileType=gpml&tag=Curation:AnalysisCollection"
wget -O /tmp/OPSWIKIDUMP/Arabidopsis%20thaliana.zip "http://www.wikipathways.org//wpi/batchDownload.php?species=Arabidopsis%20thaliana&fileType=gpml&tag=Curation:AnalysisCollection"
wget -O /tmp/OPSWIKIDUMP/Bos%20taurus.zip "http://www.wikipathways.org//wpi/batchDownload.php?species=Bos%20taurus&fileType=gpml&tag=Curation:AnalysisCollection"
wget -O /tmp/OPSWIKIDUMP/Bacillus%20subtilis.zip "http://www.wikipathways.org//wpi/batchDownload.php?species=Bacillus%20subtilis&fileType=gpml&tag=Curation:AnalysisCollection"