This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<htmk> | |
<head> | |
<style> | |
.graticule { | |
fill: none; | |
stroke: #777; | |
stroke-opacity: .5; | |
stroke-width: .5px; | |
} |