This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from login import WD_USER, WD_PASS | |
import json | |
from wikibaseintegrator import WikibaseIntegrator | |
from wikibaseintegrator.wbi_helpers import remove_claims | |
from wikibaseintegrator.wbi_login import Clientlogin | |
from helper import wbi_config | |
## Deleted items are manually selected at this point | |
deleted_items = ["Q334", "Q348", "Q349", "Q351"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import qrcode | |
# the link that you want to convert into a QR code | |
link = "https://lubianat.github.io/natal_bioinformatics2wikidata/" | |
# create a QR code instance | |
qr = qrcode.QRCode(version=1, box_size=10, border=5) | |
# add data to the QR code instance | |
qr.add_data(link) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pubchempy as pcp | |
cid = 44584134 | |
name = "cannabisin D" | |
compound = pcp.Compound.from_cid(cid) | |
ref = "|S248|Q278487" | |
quickstatements = ( | |
"CREATE\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
?cellTypeLabel ?diseaseLabel | |
(COUNT(DISTINCT ?diseaseGene) AS ?count) | |
(GROUP_CONCAT(DISTINCT ?geneLabel; SEPARATOR=", ") AS ?genes) | |
WHERE | |
{ | |
wd:Q101405087 wdt:P8872 ?diseaseGene . | |
?disease wdt:P2293 ?diseaseGene . | |
wd:Q101405087 rdfs:label ?cellTypeLabel . | |
?disease rdfs:label ?diseaseLabel . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | |
@prefix cl: <http://purl.obolibrary.org/obo/CL_> . | |
cl:0000451 rdfs:label "dendritic cell" . | |
cl:0000784 rdfs:label "plasmacytoid dendritic cell" . | |
cl:0000784 rdfs:subClassOf cl:0000451 . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import sys | |
import pandas as pd | |
url = sys.argv[1] | |
session = requests.Session() # so connections are recycled | |
resp = session.head(url, allow_redirects=True) | |
url_sparql = resp.url.replace("https://query.wikidata.org/#", "https://query.wikidata.org/sparql?query=") | |
r = requests.get(url_sparql, params = {'format':'json'}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doentes_no_placebo = 1 | |
doentes_na_vacina = 0 | |
total_de_pessoas_por_grupo = 2 | |
chance_de_covid = doentes_no_placebo/total_de_pessoas_por_grupo | |
doentes_totais = doentes_na_vacina + doentes_no_placebo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doentes_no_placebo = 1 | |
doentes_na_vacina = 0 | |
total_de_pessoas_por_grupo = 2 | |
chance_de_covid = doentes_no_placebo/total_de_pessoas_por_grupo | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chance_de_covid = 0.5 | |
doentes_no_placebo = 1 | |
doentes_na_vacina = 0 | |
total_de_pessoas_por_grupo = 2 | |
doentes_totais = doentes_na_vacina + doentes_no_placebo |