This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Create an output file which the result is a map

Hi!

I need to create an output file, the problem is that the output is a map of a sequence with restriction enzymes. I used this code:

cdna = Seq.Seq(sequence, IUPAC.unambiguous_dna)

anal=Restriction.Analysis(Restriction.CommOnly, cdna)
anal.print_as ("map")
anal.print_that()

print >> outputf, "Restriction map: \n", anal.print_that()

I don't know what I must do, replace anal.print_that() for...?

It's possible to create the output file with the map as it print in the terminal?

Thank you :)

python restriction-map biopython

1 answer

I'm not too familiar with your particular analysis, but it looks like you can get the string representation of the map:

print >> outputf, "Restriction map: \n", anal.make_format("map")
                                         ^_____________________^

It doesn't work, the error is:

print >> outputf, "Restriction map: \n", anal.make_format("map")
TypeError: _make_map() takes exactly 5 arguments (2 given)

Log in to answer this question.