forked from freudiandrip/igem-code-2016
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstopInsertion.py
More file actions
28 lines (21 loc) · 984 Bytes
/
stopInsertion.py
File metadata and controls
28 lines (21 loc) · 984 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""
#####################################################################
Identifies the read-through efficiencies that can be obtained for
possible locations for stop codon insertion
Input: file (sequence.txt) that contains a single line of nt bases
#####################################################################
"""
# Imports regular expression library
from re import * #blindly copying Laura's method of importing
from numpy import *
### Scoring for stop codon contexts ###
# This score is somewhat representative of read-through efficiency
# determined by Namy et al, 2001
TMV = [GGA ACA CAA TAG CAA TTA CAG, 23]
### Receive .txt file containing in-frame sequence ###
# The newlines are removed, in case the sequence is multi-lined
sequence = (line.rstrip("\n") for line in open("sequence.txt", "r"))
### Search for important codon contexts ###
# Python has a built-in re.finditr method that returns the index of matches
for pos, nt in enumerate(sequence):
if