Question

match_enzymes: (str, List[str], List[str]) -> List[list] The return type is a list of two-item [str, List[int]]...

match_enzymes: (str, List[str], List[str]) -> List[list]

The return type is a list of two-item [str, List[int]] lists

The first parameter represents a strand of DNA. The last two parameters are parallel lists: the second parameter is a list of restriction enzyme names, and the third is the corresponding list of recognition sequences. (For example, if the first item in the second parameter is 'BamHI', then the first item in the third parameter would be 'GGATCC', since the restriction enzyme named BamHI has the recognition sequence GGATCC — you can refer to the table of restriction enzymes to see more examples of restriction enzymes and their recognition sequences.) Return a list of two-item lists where the first item of each two-item list is the name of a restriction enzyme and the second item is the list of indices (in the DNA strand) of the restriction sites that the enzyme cuts.

The indices in the sublist that is returned are the indices of the start of each occurrence of the corresponding recognition sequence in the DNA strand.

Hint: how can you use function restriction_sites?

From the FAQ:

Question: In match_enzymes, should an enzyme be included in the returned list if its recognition sequence does not appear in the strand?

Answer: Yes it should, but the list of indices associated with the enzyme should be an empty list. The length of the list returned by match_enzymes must be the same as the length of the two parallel lists (enzyme names, corresponding recognition sequences).

0 0
Add a comment Improve this question Transcribed image text
Answer #1
def match_enzymes(DNA,namesList,sequenceList):
    result=[]
    for j in range(len(namesList)):
        sequence=sequenceList[j]
        i = 0
        indices = []
        while i != -1:
            i = DNA.find(sequence, i)
            if i != -1:
                indices.append(i)
                i = i + len(sequence)
        result.append([namesList[j],indices])
    return result

Add a comment
Know the answer?
Add Answer to:
match_enzymes: (str, List[str], List[str]) -> List[list] The return type is a list of two-item [str, List[int]]...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Identify two restriction endonucleases that could be used to make sticky ends near the 5’ end of this DNA sequence (uppe...

    Identify two restriction endonucleases that could be used to make sticky ends near the 5’ end of this DNA sequence (upper strand) so that it could be incorporated into a new plasmid. You have a short list of them in Table 9-2, and the specific, short sequences of bases that other enzymes cut at are easily obtained from web resources. You must cut as near to the 5' end as possible. Indicate the specific sequences of bases for each endonuclease...

  • TRUE OR FALSE: 1. Base-pairing rules apply from one DNA strand to its partner, but not...

    TRUE OR FALSE: 1. Base-pairing rules apply from one DNA strand to its partner, but not along the sugar-phosphate "handrails" of a DNA strand. 2. DNA polymerase cannot copy point mutations, so they are not passed on from parent cells to daughter cells in cell division. 3. It is not possible for a human gene to work in any other organism. 4. Mutations in regulatory DNA sequences may be more important to evolution than mutations in genes. 5. The enzyme...

  • 5. If you are digesting a large linear fragment that is 300,000 bp in length. How...

    5. If you are digesting a large linear fragment that is 300,000 bp in length. How many fragments would be produced if the DNA was digested by the following enzymes? Assume the fragment sizes are the average sizes calculated for a random DNA sequence. Use the information in the table from Question 3. Show your work. (A) Smal (B) Haelll (C) Noti Table 4.1 Recognition Sequences and Cutting Sites of Selected Restriction Endonucleases Enzyme Alul BamHI Bgli Clal ECORI Haelll...

  • def get_indices(lst, elm): ''' (list of lists, object) -> tuple of two ints Given a list...

    def get_indices(lst, elm): ''' (list of lists, object) -> tuple of two ints Given a list of lists and an element, find the first pair of indices at which that element is found and return this as a tuple of two ints. The first int would be the index of the sublist where the element occurs, and the second int would be the index within this sublist where it occurs. >>> get_indices([[1, 3, 4], [5, 6, 7]], 1) (0, 0)...

  • Help with these two would be appreciated JUVIJVVEL In a large unbiased random DNA sequence, how...

    Help with these two would be appreciated JUVIJVVEL In a large unbiased random DNA sequence, how often would you expect a 6 base targeting site specific restriction enzyme to cut? O On average every 4096 base pairs (446) O Never O On average every 1.296 base pairs (6^4) O Every 6 base pairs QUESTION 5 2 points Save Answer How do bacteria possessing restriction systems avoid targeting and cutting their own DNA? By methylating their chromosomal DNA O By methylating...

  • Read thoroughly. View the two responses and answer the question below. Basically making a comparison and...

    Read thoroughly. View the two responses and answer the question below. Basically making a comparison and stating similarities. Reflect on the Wright et al. (2014) paper. Did you and your classmates tend to make the same mistakes or different errors from the students that Wright interviewed? Please reference an aspect of the Wright paper in your replies. Discuss whether you and your peers, made some of the same errors or different ones when making your descriptions. Response 1: DNA replication...

  • Write a function called find_max that takes a two-dimensional list as a parameter and returns the...

    Write a function called find_max that takes a two-dimensional list as a parameter and returns the number of the row that sums to the greatest value. For example, if you had the following list of lists: list = [[1, 2, 3], [2, 3, 3], [1, 3, 3]] The first row would be 6, the second 8 and the third 7. The function would, therefore, return 1. You can assume the passed in list of lists has at least one row...

  • In prokaryotes the consensus sequence begins. is located about 10 bases upstream from the initiation site....

    In prokaryotes the consensus sequence begins. is located about 10 bases upstream from the initiation site. It has the and is responsible for identifying the precise nucleotide at which TATA box, TATAAA, transcription Pribnow box, TATAAT, transcription 0 0 0 0 0 Pribnow box, TATAAT, translation Pribnow bow, TTGACA, translation None of the answers are correct Ribosomes are made of: 1. rRNA 2. proteins 3. URNA 3 2 Both 1 and 2 are correct All answers are correct 1 Once...

  • Chromosomal and plasmid DNA can be cut into manageable pieces by restriction enzymes. Using agarose gel...

    Chromosomal and plasmid DNA can be cut into manageable pieces by restriction enzymes. Using agarose gel electrophoresis, the DNA fragments can be separated on a gel, based on their lengths. In order to see the fragments, a stain is typically added to the gel. The size of each fragment can be determined by comparing each one to a DNA molecular weight marker of known size. Below is a map of pBR22 plasmid. The position and base pair number of the...

  • AIDS (acquired immunodeficiency syndrome), caused by the HIV virus is very common in Zaire. The virus...

    AIDS (acquired immunodeficiency syndrome), caused by the HIV virus is very common in Zaire. The virus infects T cells of individuals by binding to a protein on the surface of T cells, named CCR5. Scientists observed that some people in Zaire never developed AIDS, even when they were exposed to the virus. They thought this could be due to the fact that CCR5 gene has two alleles in the Zairean population (CCR5-S (S); sensitive to AIDS; and CCR-R (R): resistant...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT