Skip to content

Instantly share code, notes, and snippets.

Avatar
😎
I may be slow to respond.

Ralf Stephan rwst

😎
I may be slow to respond.
  • Berlin, Germany
View GitHub Profile
@rwst
rwst / gist:8b78842260faff8402a5a10fc33908a9
Created Feb 17, 2021
wdtaxonomy -iS Q26879200 (biochemistry method)
View gist:8b78842260faff8402a5a10fc33908a9
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 Feb 17, 2021
wdtaxonomy -iS Q3516872 (molecular biology technique)
View gist:258cb717ed548210913803ea7577fb31
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 Nov 7, 2019
produces QS commands to move all sitelinks from a list of WD items to corresponding items
View move-sitelinks.py
@rwst
rwst / tpfam.py
Created Oct 4, 2019
Maintaining transport protein WD item links to resp. families via QS statements
View tpfam.py
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 Sep 28, 2019
creates QS subclass-of statements for Wikidata enzyme families, to create hierarchy
View enzfam-subclass.py
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 Aug 24, 2019
creates QS statements associating gene items with disease items, from WD and UniProt data
View missing-gene-disease.py
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 Aug 21, 2019
creating QuickStatement batches for missing claims on Wikidata objects about genes and their corresponding OMIM entries
View add-omim.py
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 Nov 16, 2015
benchmark program, compile with g++ -O0 -std=c++11 piranha-degree.cpp -lgmp -lmpfr -lpthread
View piranha-degree.cpp
#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
infinite loop when testing sage-patchbot with ticket 13282
View patchbot-13282-log.txt
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
@rwst
rwst / general_binet
Last active Jan 3, 2016
The general Binet form of the nth element of a binary recurrence over the integers is, given a(n) = c*a(n-1) + d*a(n-2). The Pari code is blinding fast, dependent on precision. It can maybe jump in when a floating point result is sufficient. The Sage function gives an expression in square roots.
View general_binet
(Pari/GP)
a(c,d,a0,a1,n)=my(r1,r2,s);s=sqrt(c^2+4*d);r1=2*d/(-c+s);r2=2*d/(-c-s);return(((a1-c*a0+a0*r1)*r1^n-(a1-c*a0+a0*r2)*r2^n)/s)
(Sage)
def a(c,d,a0,a1,n):
r1=2*d/(-c+sqrt(c^2+4*d))
r2=2*d/(-c-sqrt(c^2+4*d))