global.graphkbRequests.push({ opt, result: { result: {} } }); global.graphkbRequests[global.graphkbRequests.length - 1].result = result;
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
keys = ('a', 'b', 'c') | |
Vais = (1, 2, 3) | |
myDict = {k:v for k, v in zip(keys, vals)} |
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 sys | |
def transform(nb): | |
binary = '0' if nb == 0 else '' | |
while nb > 0: | |
binary += str(nb % 2) | |
nb = nb // 2 | |
padding = 8 - (8 if len(binary) % 8 == 0 else len(binary) % 8) | |
padded = (padding * '0') + binary[::-1] |
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
const { applyFix } = require('./util'); | |
const test = async (session) => { | |
console.time('Execution Time'); | |
const test = await session.query( | |
`SELECT @class, reference1, reference2 FROM Variant | |
WHERE deletedAt IS NULL`, | |
).all(); | |
console.log(`There are ${test.length} Variant`); |
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 os | |
import re | |
from graphkb import GraphKBConnection | |
def main(): | |
""" | |
This script updates the GraphKB database via its API. | |
It adds crossReferenceOf edges to EvidenceLevel records to reference normalized ipr levels. |
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
def fib(n, k): | |
if n in (1, 2): | |
return 1 | |
return fib(n-1, k) + fib(n-2, k)*k | |
print(fib(5, 3)) | |
def fib_memo(n, k): |
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
query evidenceItems( | |
$after: String | |
$assertionId: Int | |
$before: String | |
$clinicalSignificance: EvidenceClinicalSignificance | |
$clinicalTrialId: Int | |
$description: String | |
$diseaseId: Int | |
$diseaseName: String | |
$drugId: Int |
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
/* | |
To be runned on orientdbdev.bcgsc.ca server | |
*/ | |
const fs = require('fs'); | |
const { OrientDBClient } = require('orientjs'); | |
const setClient = async () => { | |
const client = await OrientDBClient.connect({ | |
host: 'localhost', |
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
Alternatively, you can just paste from the clipboard |
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
MIT License | |
Copyright (c) 2021 Mathieu Lemieux | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
NewerOlder