This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Is it possible to create a restriction map using python?

 I have some fragments of DNA from single and double digests using three different restriction enzymes. I'm trying to construct a restriction map of a linear fragment of DNA. The map needs indicate the relative positions of the restriction sites along with distances from the ends.

Can this be done using python at all? 

Is it possible to create a restriction map using python?

python molecular biology sequence genome

For sure :)

But do you really want to roll-your-own in Python? It's perfectly valid if you do, but i'm sure there are complete tools to do this already that are out there (http://www.genome.ucsc.edu/cgi-bin/hgTrackUi?hgsid=325535671&c=chr17&g=cutters)

If you really want something in Python, it may be as simple as taking the reference genome fasta, and scanning through it for your cutter's motif, and taking note of the position as you go.

For the record, there's nothing (theoretically speaking) that one programming language can do that another one cannot. So long as they're "Turin Complete", they can solve any computational problem.

2 answers

Hello, you could use matplotlib. However, is there any particular reason you want to do that in Python? In my opinion, there are better tools for in silico DNA manipulation, e.g. SnapGene.

It's a piece of coursework, I have to do it by trial and error but I'm not having much luck. I thought perhaps python could help but I've only just recently started programming

I see. Personally I would not try to do it in Python unless it is mandatory to use it.

I've just installed snap gene but I don't think it can construct a linear restriction map from DNA fragments obtained from a double digest

Why not? You can cut and annotate sequences (also linear) as you like. Annotation options include a built-in restriction map that has a customizable enzyme set.

PS: in case you do not know that much of your undigested sequence, you could start with generating an unknown sequence of the desired length (for instance, on a Python shell, with something like print 'N'*3000 for a general 3 Kb-long sequence).

Check this out:

http://biopython.org/DIST/docs/cookbook/Restriction.html

Log in to answer this question.