DNA Questions

Thread Solved

Join Date: Oct 2009
Posts: 13
Reputation: mms6 is an unknown quantity at this point 
Solved Threads: 0
mms6 mms6 is offline Offline
Newbie Poster

DNA Questions

 
-2
  #1
31 Days Ago
def binding_locations(strA, strB):

The first parameter represents a strand of DNA. The second parameter is one strand from a recognition sequence. Return a list of all the indices where the recognition sequence appears in the DNA strand. (These are the restriction sites.) For example, if the DNA palindrome appears at the beginning of the DNA strand, then 0 would be one of the items in the returned list. Only look from left to right; don't reverse the first parameter and look backwards. str.find will probably be helpful.

Example:
the first string is 'AAAAAAAAGGTTCCGTCGAAAA' for example and the second string is 'AAAA'

---------------------------------------------

def match_enzymes(str, list, list):

The first parameter is a DNA strand; the second is a list of strings that are restriction enzyme names; and the third is a list of recognition sequences that are matched by the corresponding restriction enzymes. The first list might be ['BamHI', 'TaqI'] and the second list might be ['GGATCC', 'TCGA'], for example. Return a list of tuples where the first item of each tuple 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.

Example:
match_enzymes("TCGAGGATCC", ['BamHI', 'TaqI'], ['GGATCC', 'TCGA'])

return [('BamHI', [4]), ('TaqI', [0])]

---------------------------------------------------------

def one_cutters(str, list, list):

The first parameter is a DNA strand; the second is a list of strings that are restriction enzyme names; and the third is a list of recognition sequences that are matched by the corresponding restriction enzymes. Return a list of tuples representing the 1-cutters for that strand. The first item of each tuple is the name of a restriction enzyme and the second item is the index (in the DNA strand) of the one restriction site that the enzyme cuts.

This function is the same as the previous match_enzymes function but instead, it will return the index of where the first cut of the DNA strand occurs.



Please help me out.

Thanks
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 13
Reputation: mms6 is an unknown quantity at this point 
Solved Threads: 0
mms6 mms6 is offline Offline
Newbie Poster
 
-2
  #2
31 Days Ago
anyone plz help me out here
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 197
Reputation: masterofpuppets is an unknown quantity at this point 
Solved Threads: 47
masterofpuppets's Avatar
masterofpuppets masterofpuppets is online now Online
Junior Poster
 
0
  #3
31 Days Ago
hi
after reading the specification like 5 times here's what I came up with

first part:
  1. def binding_locations( strA, strB ):
  2. indexes = []
  3. i = 0
  4. while i < len( strA ):
  5. # compare the strA cut from the index i to whatever size strB is
  6. # and if the strings are equal add the index to the list and increment the value of i depending on the length of strB
  7. if strA[ i : i + len( strB ) ] == strB:
  8. indexes += [ i ]
  9. i += len( strB ) - 1
  10. i += 1 #go to next index
  11. return indexes

second part:
  1. def match_enzymes( strand, enzymes, recognitionSequence ):
  2. l = []
  3. # basically using the first function :)
  4. for i in range( len( enzymes ) ):
  5. indexes = binding_locations( strand, recognitionSequence[ i ] )
  6. l += [ ( enzymes[ i ], indexes ) ]
  7. return l

I couldn't understand the specification for the third part if you could provide an example I'll try to help
My site ->> http://8masterofpuppets8.webs.com/
"My belief is stronger than your doubt."
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 197
Reputation: masterofpuppets is an unknown quantity at this point 
Solved Threads: 47
masterofpuppets's Avatar
masterofpuppets masterofpuppets is online now Online
Junior Poster
 
0
  #4
31 Days Ago
P.S I tested this using your examples and here are my results:

  1. >>> binding_locations( "AAAAAAAAGGTTCCGTCGAAAA", "AAAA" )
  2. [0, 4, 18]
  3. >>> binding_locations( "AAAAAAAAGGTTCCGTCGAAAA", "GT" )
  4. [9, 14]
  5. >>> match_enzymes( "TCGAGGATCC", ['BamHI', 'TaqI'], ['GGATCC', 'TCGA'] )
  6. [('BamHI', [4]), ('TaqI', [0])]
  7. >>>
My site ->> http://8masterofpuppets8.webs.com/
"My belief is stronger than your doubt."
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,046
Reputation: jlm699 is a jewel in the rough jlm699 is a jewel in the rough jlm699 is a jewel in the rough jlm699 is a jewel in the rough 
Solved Threads: 263
Sponsor
jlm699's Avatar
jlm699 jlm699 is offline Offline
Knows where his Towel is
 
0
  #5
30 Days Ago
Originally Posted by mms6 View Post
anyone plz help me out here
We're not here to do your homework for you. But good job on copy-pasting your assignment.
Originally Posted by masterofpuppets View Post
hi
after reading the specification like 5 times here's what I came up with
Dear MasterofPuppets,
You shouldn't be spoon feeding people looking for us to do their homework for them. Even though you provided good code, it doesn't help the OP at all because he's obviously going to just copy-paste your solutions and turn them in exactly in the same manner as he copy-pasted his assignment and posted it here.
1. Use Code Tags.
2. Homework? Show Effort.
3. Keep discussions on the forum: no PMs
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 4,003
Reputation: vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice 
Solved Threads: 928
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
DaniWeb's Hypocrite
 
0
  #6
27 Days Ago
If the OP has not even given an example of what has been tried, I would prod them to at least give an idea of how they would approach the solution. Then you can give hints how to proceed.

Another way to help is to give a related example that would be a part of the solution. At least this way the OP gets involved in the quest to solve the problem.

If you had fun with the challenge to solve the problem, be a little patient and don't post your solution right away.
May 'the Google' be with you!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC