Skip to content

Instantly share code, notes, and snippets.

View jerryvig's full-sized avatar

Jerry Vigil jerryvig

  • Invitae
  • Austin, TX, USA
View GitHub Profile
@jerryvig
jerryvig / RDIN-618.md
Last active March 4, 2022 17:56
Plan of action for RDIN-618 Coverage Statistics Summary Tickets

Need to simplify this to a series of steps that's easy to follow.

  1. Update the CROP Python backend to return the entire strings for "Percent depth of coverage" and "Mean depth of coverage" but do this only for the report type RT_EXOME_DIAGNOSTIC_V4. For exome_v4, the returned dictionary values for percent_depth_of_coverage and mean_depth_of_coverage will be strings like Proportion of tested genes with high confidence: 99.1% and Mean depth of coverage: 50x.

    For all other exome report types (RT_EXOME_DIAGNOSTIC, RT_EXOME_DIAGNOSTIC_V2, & RT_EXOME_DIAGNOSTIC_V3), the existing behavior, must be preserved in which the percent_depth_of_coverage and mean_depth_of_coverage dict values are still returned as stringified values of only the numbers such as 99.8% and 50x. This is because the report rendering service code will be updated asynchronous to these changes, and we don't control when those rendering service changes are released.

The relevant code needs updates in at leas

@jerryvig
jerryvig / Dockerfile
Created July 3, 2020 07:37
NodeJS - Example Dockerfile
FROM node:12.18.2-buster-slim
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
@jerryvig
jerryvig / one_incr_risk_positive.py
Last active July 21, 2020 17:31
one_incr_risk_positive.py
{
"reportType": "carrier_couples",
"reportSubtype": "standard",
"phiContentCarrierCouples": {
"maternalPHI": {
"name": "Rosalind Franklin",
"dob": "05/01/1981",
"gender": "Female",
"mrn": "12344321",
"invitaeNo": "RQ123456",
@jerryvig
jerryvig / five_edge_cases.py
Last active July 21, 2020 17:36
Mockup #5 - Edge Cases
{
"reportType": "carrier_couples",
"reportSubtype": "standard",
"phiContentCarrierCouples": {
"maternalPHI": {
"name": "Rosalind Franklin",
"dob": "05/01/1981",
"gender": "Female",
"mrn": "12344321",
"invitaeNo": "RQ123456",
@jerryvig
jerryvig / event_threads.py
Last active February 22, 2020 09:16
Event Objects - Threading Event Objects in Python
import io
import logging
import threading
import requests
logging.basicConfig(level=logging.DEBUG)
def print_response_data(received, data):
@jerryvig
jerryvig / index.ts
Last active August 2, 2019 23:20
redux-beacon index.ts example for pio
import {applyMiddleware, combineReducers, createStore} from 'redux'
import { createMiddleware } from 'redux-beacon'
import GoogleTagManager from '@redux-beacon/google-tag-manager'
import {reducer as formReducer} from 'redux-form'
import {createLogger} from 'redux-logger'
import reduxThunk, {ThunkMiddleware} from 'redux-thunk'
import {reducer as appState} from '~/store/appState'
import {reducer as healthHistoryState} from '~/store/healthHistoryState'
import {reducer as kitState} from '~/store/kitState'
@jerryvig
jerryvig / http2_example.ts
Created July 12, 2019 21:45
http2 Client Example in TypeScript
// this is just a rudimentary http2 client example in TypeScript.
import * as http2 from 'http2';
function main(): void {
let data = '';
const client = http2.connect('https://www.google.com', {});
client.on('error', (err) => {
console.log('Client raised error.');
console.error(err);
@jerryvig
jerryvig / import_fs.ts
Last active July 12, 2019 01:24
TypeScript import node "fs" module
import * as fs from 'fs';
import * as https from 'https';
function afterWrite(err): void {
if (err) {
throw new Error('Failed to write to file.');
}
}
function writeSomeData(err, fd): void {
@jerryvig
jerryvig / codility_disc_intersections.py
Last active June 26, 2019 23:02
WIP - Codility - Disc Intersections
def solution(A):
start_end_points = []
for i, r in enumerate(A):
start_end_points.append(((i - r), (i + r)))
end_start_points = list(start_end_points)
start_end_points.sort(key=lambda v: v[0])
end_start_points.sort(key=lambda v: v[1])
oc = 0
@jerryvig
jerryvig / codility_diamonds_count.py
Last active June 22, 2019 03:04
Codility - Diamonds Count
# Pick two points with the same value of X.
# Then given those two points, get the mean of their Y values. The two points on the diamond with the same
# Y-values must have their Y-values equal to the mean of the Y-values of the two given points with the same X.
# Check by looking up in the dictionary (hash table) if there exist points whose Y-values are equal to the mean of their values.
# If such points exist, then the mean of their X-values must equal the value of X for the two given points with the same value of X.
# If that is true, then the points form a diamond.
# When computing the means (mean_y and mean_x) you need to be sure that the mean values are integral values which can be done by
# checking that int(mean_x) == mean_x, etc.
from itertools import combinations