Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I don't want a status.

Egon Willighagen egonw

💭
I don't want a status.
View GitHub Profile
@egonw
egonw / smi_inchikeys.groovy
Created Sep 4, 2021
Convert a file with SMILES to InChIKeys
View smi_inchikeys.groovy
@Grab(group='org.openscience.cdk', module='cdk-bundle', version='2.5')
// Copyright (C) 2021 Egon Willighagen <0000-0001-7542-0286@orcid.org>
//
// MIT license
//
// If you use this script, please cite the CDK 2.0 article:
// https://jcheminf.biomedcentral.com/articles/10.1186/s13321-017-0220-4
import org.openscience.cdk.interfaces.*;
View gist:747a2afdac63d9920c1fc2794f72d14c
SELECT DISTINCT ?pathway ?pathwayLabel ?expressedIn ?expressedInLabel ?expressed ?all WITH {
SELECT DISTINCT ?pathway ?expressedIn (COUNT(DISTINCT ?expressedGene) AS ?expressed) WHERE {
VALUES ?expressedIn {wd:Q1072}
?expressedGene wdt:P5572 ?expressedIn .
?pathway wdt:P2410 ?wpid ;
wdt:P527 ?expressedGene .
} GROUP BY ?pathway ?expressedIn
} AS %EXPRESSEDPATHWAYS WHERE {
SELECT DISTINCT ?pathway ?pathwayLabel ?expressedIn ?expressedInLabel ?expressed (COUNT(DISTINCT ?gene) AS ?all) WHERE {
INCLUDE %EXPRESSEDPATHWAYS
@egonw
egonw / en.txt
Last active Apr 6, 2021
CAS numbers in Wikipedia (being checked) and Wikidata (validated)
View en.txt
CHECK HERE: https://en.wikipedia.org/wiki/Wikipedia_talk:WikiProject_Chemistry/CAS_validation/CASCommons
Expected the validated CAS registry number 17795-27-6 to be listed on https://commons.wikimedia.org/wiki/Category:Alliin but was missing
Expected the validated CAS registry number 526-73-8 to be listed on https://commons.wikimedia.org/wiki/Category:1,2,3-trimethylbenzene but was missing
Expected the validated CAS registry number 170984-72-2 to be listed on https://en.wikipedia.org/wiki/EGLU but was missing
Expected the validated CAS registry number 14392-02-0 to be listed on https://en.wikipedia.org/wiki/Chromium-51 but was missing
Expected the validated CAS registry number 749-13-3 to be listed on https://commons.wikimedia.org/wiki/Category:Trifluperidol but was missing
Expected the validated CAS registry number 15301-54-9 to be listed on https://commons.wikimedia.org/wiki/Category:Cypenamine but was missing
Expected the validated CAS registry number 520-85-4 to be listed on https://commons.wikimedia.org
@egonw
egonw / getBridgeDbDatabases.sh
Created Feb 15, 2021
Script to download all release BridgeDb Derby databases
View getBridgeDbDatabases.sh
!/bin/bash
wget -nc https://bridgedb.github.io/data/gene.json
wget -nc https://bridgedb.github.io/data/corona.json
wget -nc https://bridgedb.github.io/data/other.json
jq -r '.mappingFiles | .[] | "\(.file)=\(.downloadURL)"' gene.json > files.txt
jq -r '.mappingFiles | .[] | "\(.file)=\(.downloadURL)"' corona.json >> files.txt
jq -r '.mappingFiles | .[] | "\(.file)=\(.downloadURL)"' other.json >> files.txt
View gist:338d963c1904048dcfcd65c951670d5f
SELECT ?wpid ?pathway ?pathwayLabel ?cpx ?complex ?complexLabel ?part ?partLabel WITH {
SELECT DISTINCT ?complex ?cpx ?part WHERE {
?complex wdt:P7718 ?cpx ;
wdt:P527+ ?part .
{ ?part wdt:P31 wd:Q78782478 . }
UNION
{ ?part wdt:P31 wd:Q8054 . }
}
} AS %PARTS WHERE {
INCLUDE %PARTS
@egonw
egonw / start-server.sh
Created Nov 2, 2020
BridgeDb Webservice shell script
View start-server.sh
#!/bin/sh
# change to directory of this script
cd $(dirname $0)
CLASSPATH=dist/org.bridgedb.jar:\
dist/org.bridgedb.bio.jar:\
dist/org.bridgedb.rdb.jar:\
dist/org.bridgedb.server.jar:\
dist/org.bridgedb.webservice.bridgerest.jar:\
View threadreaderapp.txt
https://threadreaderapp.com/thread/1307246078589370370.html -> not #openscience
https://threadreaderapp.com/thread/1307579858646708224.html Balans van de Wetenschap 2020
@egonw
egonw / LICENSES.txt
Created Aug 30, 2020
Full list of license of dependencies of BridgeDb 3.0.0-SNAPSHOT
View LICENSES.txt
(3-Clause BSD License) Protocol Buffers [Core] (com.google.protobuf:protobuf-java:3.6.1 - https://developers.google.com/protocol-buffers/protobuf-java/)
(Aduna BSD license) OpenRDF Rio compliance tests (org.openrdf.sesame:sesame-rio-compliance:2.7.1 - http://www.openrdf.org/sesame-compliance/sesame-rio-compliance/)
(Aduna BSD license) OpenRDF Rio compliance test suite (org.openrdf.sesame:sesame-rio-testsuite:2.7.1 - http://www.openrdf.org/sesame-testsuites/sesame-rio-testsuite/)
(Aduna BSD license) OpenRDF Sesame: DatasetRepository (wrapper) (org.openrdf.sesame:sesame-repository-dataset:2.7.1 - http://www.openrdf.org/sesame-core/sesame-repository/sesame-repository-dataset/)
(Aduna BSD license) OpenRDF Sesame: Federation SAIL (org.openrdf.sesame:sesame-sail-federation:2.7.1 - http://www.openrdf.org/sesame-core/sesame-sail/sesame-sail-federation/)
(Aduna BSD license) OpenRDF Sesame: HTTP client (org.openrdf.sesame:sesame-http-client:2.7.1 - http://www.openrdf.org/sesame-core/sesame
View keybase.md

Keybase proof

I hereby claim:

  • I am egonw on github.
  • I am egonw (https://keybase.io/egonw) on keybase.
  • I have a public key ASCLt1J4TK6uvvwRip-pDwxy6jFT_C_LmFfZvGqMM9RqDAo

To claim this, I am signing this object:

View gist:d8f9f4f034bac1e6d0f550485fd50703
SELECT DISTINCT ?item ?itemLabel ?itemDescription ?image ?location ?distance ?sitelink WHERE {
SERVICE wikibase:around {
?item wdt:P625 ?location.
bd:serviceParam wikibase:center "[AUTO_COORDINATES]".
bd:serviceParam wikibase:radius "[RADIUS]".
bd:serviceParam wikibase:distance ?distance.
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,es,de". }
FILTER(NOT EXISTS {
?item wdt:P18 ?image