Skip to content

Instantly share code, notes, and snippets.

I am attesting that this GitHub handle stepjue is linked to the Tezos account tz1LhoBCe6e3wM5LRqyXBX8DjZnKNg5ybGsu for tzprofiles
sig:edsigtowU15cxn4QgayDp5qt1A6Gue3MBHMXxRuWvc7LKuEqiAgQy9fSvXXT2WAHtcoBFXnh4rdG5Xr12AFHhRTK4fRNgLen7am
@stepjue
stepjue / neon-noodles.js
Last active April 19, 2023 01:50
Animated GIF made for Genuary 2021 Day 9: Interference patterns https://genuary2021.github.io/prompts#jan8. Uses the canvas-sketch framework: https://github.com/mattdesl/canvas-sketch
const canvasSketch = require('canvas-sketch');
const settings = {
dimensions: [ 800, 800 ],
animate: true,
duration: 7.5,
fps: 24
};
const sketch = () => {
@stepjue
stepjue / grph.py
Created June 10, 2014 21:57
Solution to Rosalind's "grph" problem (http://rosalind.info/problems/grph/). Prints the adjacency list of the 3-overlap-graph of DNA strings in FASTA format.
def prefix(l, k):
return l[0:k]
def suffix(l, k):
return l[-k:]
def parse_fasta(file):
fasta = {}
with open(file) as f:
lines = f.readlines()
@stepjue
stepjue / monoisotopic_mass.py
Created June 10, 2014 00:22
Monoisotopic mass table
mass = {
"A" : 71.03711,
"C" : 103.00919,
"D" : 115.02694,
"E" : 129.04259,
"F" : 147.06841,
"G" : 57.02146,
"H" : 137.05891,
"I" : 113.08406,
"K" : 128.09496,
@stepjue
stepjue / hamm.py
Last active August 29, 2015 14:02
Solution for Rosalind's "hamm" problem (http://rosalind.info/problems/hamm/). Finds the Hamming distance of two DNA strings.
def hamming_distance(s,t):
dist = 0
for i in range(s):
if(s[i] != t[i]):
dist++
return dist
if __name__ == "__main__":
lines = []
for line in open("rosalind_hamm.txt"):
@stepjue
stepjue / rna_codons.py
Created June 9, 2014 22:41
Python dict for translating for RNA codon table (http://rosalind.info/glossary/rna-codon-table/)
codons = {
"UUU" : "F",
"CUU" : "L",
"AUU" : "I",
"GUU" : "V",
"UUC" : "F",
"CUC" : "L",
"AUC" : "I",
"GUC" : "V",
"UUA" : "L",
@stepjue
stepjue / prot.py
Last active August 29, 2015 14:02
Solution for Rosalind "prot" problem. Translates an RNA string into a protein string.
from rna_codons import codons
def chunks(l, n):
for i in xrange(0, len(l), n):
yield l[i:i+n]
def translate(dna):
protein = ""
for codon in chunks(dna, 3):
amino = codons[codon]