Skip to content

Instantly share code, notes, and snippets.

💤

Albert Tian Chen blahoink

💤
Block or report user

Report or block blahoink

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@blahoink
blahoink / cons.py
Last active Sep 26, 2019
Valdar Sequence Conservation
View cons.py
# Sequence conservation score function, from Valdar 2001 - https://doi.org/10.1002/1097-0134\(20010101\)42:1<108::AID-PROT110>3.0.CO;2-O
import pandas as pd
import numpy as np
# Load substitution matrix (PET91)
# https://doi.org/10.1093/bioinformatics/8.3.275
pet91 = pd.read_csv('pet91.csv', comment='!', index_col=0)
m = pet91
@blahoink
blahoink / build_inclusion_list.R
Last active Apr 29, 2019
Build XCalibur Inclusion List
View build_inclusion_list.R
# BUILD THERMO XCALIBUR INCLUSION LIST
# returns inclusion list dataframe
build_inclusion_list <- function(
input, # dataframe, with columns:
# `Raw file`, `Modified sequence`, `Retention time`, `Charge`
file='inclusion_list.csv', # output file
rt_width=3, # width, in minutes, of the RT window on either side
mz_decimals=5, # number of decimals to round m/z to
rt_decimals=1, # number of decimals to round RT to
@blahoink
blahoink / gist:e42ca11b07832ccbce02
Created Jul 13, 2015
Long Polling in React Native
View gist:e42ca11b07832ccbce02
/*--- LONG POLL --*/
/**
* Adapted from http://blog.gospodarets.com/fetch_in_action/
* many thanks!
*/
var MAX_WAITING_TIME = 5000;// in ms
var getJSON = function (params) {
var wrappedPromise = {};
@blahoink
blahoink / index.ios.js
Last active Aug 29, 2015
React Native - Backbone fetch patch
View index.ios.js
/**
* patch to make backbone work on react native
* replaces the underlying jQuery API with the whatwg fetch API
* doesn't cover all use cases... but has worked fine with our project
*/
var Backbone = require('backbone');
var _ = require('underscore');
Backbone.sync = function(method, model, options) {
You can’t perform that action at this time.