Question: Morning. I have got to make a python script that reads a reading frame and locates the amino acid 'M', and prints whatever is after
Morning. I have got to make a python script that reads a reading frame and locates the amino acid 'M', and prints whatever is after that 'M' till it reaches a stop codon '-'. EXAMPLE 1, if the input is 'KS-MG_', the protein_finder function will return ['MG']. Example 2: input is 'KMQKKML' and the out put will be ['MQKKML']. I want the function to only read the first M, and treat every other M as normal and add to the output as normal M.
if I input string 'RLDMVGQ---KLVV', then the output should be [ MVGQ]. Not an two empty strings '',''
if I input empty string ' ', then the output should be [ ]. Not an error. if I input a reading frame without the 'M' amino acid (aa), then the out should be empty [ ].
Not just those among acids, it should be Abel to read any dan sequence and give me back a amino acid string
I have added a sample starting function that should be modified to return the results

def protein_finder(): >>>Sample input: 'KS-MG-' ['MG'] >>>Sample input: 'HRTMAVPS' ['MAVPS'] >>>Sample input: 'KMLS-MG-' ['MLS', 'MG'] >>>Sample input: 'KMQKKML-' ['MQKKML'] >>>Sample input: 'VFPTWS' [] potein protein_list = [] for each aa in the reading frame: if the aa is an 'M': protein += 'M' elif the aa is an '-': append the protein to the protein_list protein return protein_list for amino acid in reading frame: #look for M if the amino_acid is an "M": #so we should start add amino acid to protein and protein lenght will be more than 0 else if the amino acid is a stop codon: #see if protein is empty or not if the protein is not empty: append the protein to the protein_list protein ( start with another empty protein else: #see if protein is empty or not. if the protein is not empty
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
