file = '/Users/svetlana/Downloads/E.coli.sequence.txt' with open(file, 'r') as fasta:
- starts = {} strtset = set() for line in fasta:
if line[0] == '>':
- nextline = fasta.readline() strtset.add(nextline[0:3]) if nextline[0:3] not in starts:
- starts[nextline[0:3]] = 1
- starts[nextline[0:3]] += 1
- nextline = fasta.readline() strtset.add(nextline[0:3]) if nextline[0:3] not in starts:
- print(f'{codon} {starts[codon]}')
file = '/Users/svetlana/Downloads/Candidatus_Gracilibacteria_bacterium.txt' with open(file, 'r') as fasta:
- starts = {} strtset = set() for line in fasta:
if line[0] == '>':
- nextline = fasta.readline() strtset.add(nextline[0:3]) if nextline[0:3] not in starts:
- starts[nextline[0:3]] = 1
- starts[nextline[0:3]] += 1
- nextline = fasta.readline() strtset.add(nextline[0:3]) if nextline[0:3] not in starts:
- print(f'{codon} {starts[codon]}')
file = '/Users/svetlana/Downloads/Mycoplasma_pneumoniae.sequence.txt' with open(file, 'r') as fasta:
- starts = {} strtset = set() for line in fasta:
if line[0] == '>':
- nextline = fasta.readline() strtset.add(nextline[0:3]) if nextline[0:3] not in starts:
- starts[nextline[0:3]] = 1
- starts[nextline[0:3]] += 1
- nextline = fasta.readline() strtset.add(nextline[0:3]) if nextline[0:3] not in starts:
- print(f'{codon} {starts[codon]}')