Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Введите бактерию")
- bacterion = input()
- seq = whole_seq(f"{bacterion}_fasta")
- ORF_start = []
- minus = []
- pseudo_check = []
- with open(f"{bacterion}_gb", mode = "r") as data:
- line = data.readline()
- while line!="":
- while not line.startswith(" gene") and line != "":
- line = data.readline()
- if line!= "":
- pseudo = line
- pseudo_check.append(pseudo)
- pseudo = data.readline()
- while pseudo.startswith(" "):
- pseudo_check.append(pseudo)
- pseudo = data.readline()
- if pseudo_check != []:
- pseudo_check = "".join(pseudo_check)
- if pseudo_check.find("pseudo") < 0:
- line = line.split()
- if line[1].find("join") < 0:
- if line[1].startswith("complement"):
- ORF_start.append(int(line[1][11:].split("..")[0]))
- else:
- ORF_start.append(int(line[1].split("..")[0]))
- line = data.readline()
- pseudo_check = []
- Six_mer = {}
- Mers = []
- index = 0
- for i in ORF_start:
- minus.append(seq[i-21:i-1]) # на этом этапе имеем список всех нужных участков длиной 20 п.н.
- for j in range(0,14,1):
- if minus[index][j:j+6] in Six_mer:
- Six_mer[minus[index][j:j+6]] +=1
- else:
- Six_mer[minus[index][j:j+6]] = 1
- Mers.append(minus[index][j:j+6])
- index += 1
- Mers.sort()
- with open(f"Six_mer_{bacterion}.txt",mode = "w") as result:
- for i in Mers:
- print (f"{i}\t{Six_mer[i]}", file=result)
Add Comment
Please, Sign In to add comment