Commit cc705b35 authored by Kai's avatar Kai

h

parent c2485eb7
......@@ -4,12 +4,31 @@ import csv
from Bio.Seq import Seq
from Bio.Alphabet import generic_dna
import sys
from collections import Counter
def cond(hyb,start,stop):
s = hyb[:180]
i = ind(s,stop)
if i>=0:
sub_s = s[i:]
j = ind(sub_s,start)
if j<0:
return False
elif 180-j<30:
return False
elif 180-j>=30:
return True
return False
if __name__ == "__main__":
reader = csv.reader(open("./Pseudomonas_aeruginosa_UCBPP-PA14_109.csv","r"))
web_gene = list(open("./Pseudomonas_aeruginosa_UCBPP-PA14_109.fna","r"))[1:]
web_gene = "".join([e.strip() for e in web_gene])
data = list(reader)
web_ba_seqs = list()
hybrids = list()
for e in data[3:]:
if len(e)>=5:
_from = int(e[3]) - 1
......@@ -18,4 +37,9 @@ if __name__ == "__main__":
_ba = e[-2]
_aa = e[-1]
seq = Seq(_ba,generic_dna)
web_ba_seqs.append(seq)
hybrid = Seq(web_gene[_from-180:_to],generic_dna)
hybrids.append(hybrid)
start_codons = Counter([seq[:3] for seq in web_ba_seqs])
stop_codons = Counter([seq[-3:] for seq in web_ba_seqs])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment