Skip to content

Instantly share code, notes, and snippets.

'''
Naive probabilistic approach backwards engineer the vaccine sequence:
1. For every codon-position, base, and amino-acid result, calculate a probability of base change.
2. Apply this probability to the viral sequence and generate a vaccine sequence.
3. Compare the generated vaccine sequence to the known vaccine sequence and check for % match.
This code is in reference to:
https://berthub.eu/articles/posts/part-2-reverse-engineering-source-code-of-the-biontech-pfizer-vaccine/
Requires python3
@damiankao
damiankao / py-coordinateOperations
Created December 12, 2015 12:17
Python functions to find union of multiple coordinates and intersection of multiple coordinates
def tileCoords(coords):
formatCoords = []
for coord in coords:
coord = [int(coord[0]),int(coord[1])]
formatCoords.append(('s',min(coord)))
formatCoords.append(('e',max(coord)))
formatCoords.sort(key = lambda x : x[0], reverse = True)
@damiankao
damiankao / py-bwt.py
Last active December 12, 2015 12:29
Simple implementation of Burrows-Wheeler transformation in python
def encode(inputStr):
rotations = [inputStr[i:] + inputStr[:i] for i in range(len(inputStr))]
rotations.sort()
encodedStr = [x[-1] for x in rotations]
index = rotations.index(inputStr)
return (''.join(encodedStr), index)
def decode(encodedStr, index):
rotations = [encodedStr[i] for i in range(len(encodedStr))]
for i in range(len(encodedStr) - 1):
<htmk>
<head>
<style>
.graticule {
fill: none;
stroke: #777;
stroke-opacity: .5;
stroke-width: .5px;
}