Skip to content

Instantly share code, notes, and snippets.

View JudoWill's full-sized avatar

Will Dampier JudoWill

View GitHub Profile
@JudoWill
JudoWill / LocallyConnected3D.py
Last active July 13, 2020 20:35
3D version of locally connected keras layer
import numpy as np
from keras import backend as K
from keras.legacy import interfaces
import keras
from keras.layers import Layer, InputLayer, Input
import tensorflow as tf
from keras.engine.topology import Node
from keras.utils import conv_utils
#!/usr/bin/env python
"""
Guide users through installing the installation dependencies
"""
# Unfortunately, we can't rely on setuptools' install_requires
# keyword, because matplotlib doesn't properly install its dependencies
from subprocess import check_call, CalledProcessError
import sys
import os
{
"metadata": {
"name": "ExampleSeqFigure"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@JudoWill
JudoWill / bowlerscores.py
Created November 8, 2012 04:25
Simple script
nbowlers = 5
nscores = 3
team_score = 0
for bowlernum in range(nbowlers):
bowler_scores = []
for game_num in range(nscore):
prompt_string = “Please enter Bowler %i’s game score in game %i: \n” % (bowlernum+1, game_num+1) #because counting starts at zero
score = int(raw_input(prompt_string))
bowler_scores.append(score) #keep track of this bowler
@JudoWill
JudoWill / FBmodel.m
Created July 4, 2011 18:12
A function for getting F and My from simulation results
function dydt=FBmodel(t,y)
%global y2
% Model file to be initiated by FBstart.m
% extract variable from y-vector
X=y(1);
S=y(2);
V=y(3);
@JudoWill
JudoWill / LogHyperCDF.py
Created June 28, 2011 15:02
Using logarithms to do hypergeometric tests with large N
from math import log, exp
from mpmath import loggamma
def logchoose(ni, ki):
try:
lgn1 = loggamma(ni+1)
lgk1 = loggamma(ki+1)
lgnk1 = loggamma(ni-ki+1)
except ValueError:
#print ni,ki
@JudoWill
JudoWill / PWMSearch.py
Created January 4, 2011 01:20
This is a python script which processes a SeqInterval file and Jaspar matrix file to find all occurrences of the TF binding sites.
"""
PWMSearch
Searches through a fasta sequence for the relevant Position Weight Matrices
from the Jaspar Database.
"""
from __future__ import division
from optparse import OptionParser
@JudoWill
JudoWill / pavement
Created October 1, 2010 20:40
An example of using both paver and ruffus to do scientific workflows.
from paver.easy import *
import os.path, os
import csv
import ruffus
from collections import defaultdict
from types import GeneratorType, DictType
from itertools import ifilter
options(
@JudoWill
JudoWill / uploadpoints.py
Created September 16, 2010 03:58
Uploads CokeRewards points in a simple text file. Useful if you have a large number and want to make sure you're always uploading something every day so they don't expire!
import time, re, logging
from optparse import OptionParser
import os.path
import subprocess
from mechanize import Browser
from mechanize._form import ControlNotFoundError
USER_NAME = ''
PASSWORD = ''