Skip to content

Instantly share code, notes, and snippets.

View rwst's full-sized avatar
😎
I may be slow to respond.

Ralf Stephan rwst

😎
I may be slow to respond.
View GitHub Profile
@rwst
rwst / howto-neo4j5-reactome.md
Last active December 22, 2023 15:59
HOWTO: Use neo4j V5 with reactome database

Reactome dumps are in Neo4j 4 format. To use them with Neo4j 5 the Reactome database needs to be downloaded as a dump and converted:

  • Following instructions are for CLI installation of Neo4j (Linux)
  • Install any 5.* version of Neo4j (tested with neo4j-community-5.15.0)
  • Download Reactome database dump from https://reactome.org/download/current/reactome.graphdb.dump
  • cd to installation directory, all commands below from there
  • cp <PATH OF DOWNLOADED DUMP> reactome.dump (so the dump file is in the same directory, also the file is renamed because dots in the database name are not allowed)
  • ./bin/neo4j-admin database migrate --force-btree-indexes-to-range reactome
  • Now there should be a new directory created under data/databases
  • Don't forget to add these lines in conf/neo4j.conf:
@rwst
rwst / gist:8b78842260faff8402a5a10fc33908a9
Created February 17, 2021 17:05
wdtaxonomy -iS Q26879200 (biochemistry method)
biochemistry method (Q26879200) ↑↑
|-Bradford protein assay (Q247562)
|-Serial analysis of gene expression (Q286721)
|-Förster resonance energy transfer (Q367473)
|-Bimolecular fluorescence complementation (Q863465)
|-Electrophoretic mobility shift assay (Q903596)
|-density gradient electrophoresis (Q1209472)
|-Protein Misfolding Cyclic Amplification (Q2044394)
|-perfusion culture (Q2070705)
|-submersed fermentation (Q2361902)
@rwst
rwst / gist:258cb717ed548210913803ea7577fb31
Created February 17, 2021 17:02
wdtaxonomy -iS Q3516872 (molecular biology technique)
molecular biology technique (Q3516872) ↑
|-polymerase chain reaction (Q176996)
|-cell-free protein synthesis (Q189030)
|-Rapid amplification of cDNA ends (Q381434)
|-SuperSAGE (Q826829)
|-restriction fragment length polymorphism (Q857299)
|-Tandem affinity purification (Q893051)
|-DNA-DNA hybridization (Q900923)
|-Chromatin immunoprecipitation (Q901026)
|-Immunophenotyping (Q902926)
@rwst
rwst / move-sitelinks.py
Last active November 7, 2019 09:42
produces QS commands to move all sitelinks from a list of WD items to corresponding items
@rwst
rwst / tpfam.py
Created October 4, 2019 05:53
Maintaining transport protein WD item links to resp. families via QS statements
import csv
from anytree import Node, find, findall, PreOrderIter, RenderTree, Resolver, AsciiStyle, ChildResolverError
from sys import *
class TCNode(Node):
q = ''
lab = ''
print_missing_triples = False
print_qs = True
@rwst
rwst / enzfam-subclass.py
Created September 28, 2019 13:12
creates QS subclass-of statements for Wikidata enzyme families, to create hierarchy
import csv
from anytree import Node, find, findall, PreOrderIter, RenderTree, Resolver, AsciiStyle, ChildResolverError
from sys import *
class ECNode(Node):
q = ''
lab = ''
tree = ECNode('Root')
@rwst
rwst / missing-gene-disease.py
Created August 24, 2019 17:08
creates QS statements associating gene items with disease items, from WD and UniProt data
from sys import *
import csv
reader = csv.DictReader(open('gene-diseaseassoc.tab', 'r'), delimiter='\t')
genes = {}
for item in reader:
iturl = item.get('item')
it = iturl[iturl.rfind('/')+1:]
disurl = item.get('dis')
dis = disurl[disurl.rfind('/')+1:]
@rwst
rwst / add-omim.py
Created August 21, 2019 06:56
creating QuickStatement batches for missing claims on Wikidata objects about genes and their corresponding OMIM entries
from sys import *
import csv
reader = csv.DictReader(open('gene-entrezids.tab', 'r'), delimiter='\t')
genes = {}
for item in reader:
gid = item.get('geneid')
iturl = item.get('item')
iturl = iturl[iturl.rfind('/')+1:]
gitem = genes.get(gid)
@rwst
rwst / piranha-degree.cpp
Created November 16, 2015 08:17
benchmark program, compile with g++ -O0 -std=c++11 piranha-degree.cpp -lgmp -lmpfr -lpthread
#define BENCHPRESS_CONFIG_MAIN
#include <cstddef>
#include <benchpress/benchpress.hpp>
//#include "series-benchmark.h"
#include <string>
#include <iostream>
#include <tuple>
#include <type_traits>
@rwst
rwst / patchbot-13282-log.txt
Created May 4, 2014 14:56
infinite loop when testing sage-patchbot with ticket 13282
Forcing sage-location, probably because a new package was installed.
Updating various hardcoded paths...
(Please wait at most a few minutes.)
DO NOT INTERRUPT THIS.
Done updating paths.
Found package ccache in /scratch/sage/upstream/ccache-3.1.9.spkg
Package ccache-3.1.9 is already installed.
Use 'sage -f /scratch/sage/upstream/ccache-3.1.9.spkg' to force a reinstallation.
--2014-05-04 08:27:25-- http://coates.ma.ic.ac.uk/grdb_polytopes-0.1.spkg
Resolving coates.ma.ic.ac.uk (coates.ma.ic.ac.uk)... 155.198.35.88