Edinburgh-Genome-Foundry / DnaFeaturesViewer

:eye: Python library to plot DNA sequence features (e.g. from Genbank files)
https://edinburgh-genome-foundry.github.io/DnaFeaturesViewer/
MIT License
584 stars 90 forks source link

Genebank to circular view #5

Closed ghost closed 6 years ago

ghost commented 6 years ago

I would like to plot a Genebank file not in the linear, but in the circular view. Could you please provide code for that? Thanks in advance.

Zulko commented 6 years ago

Use the following code:

from dna_features_viewer import BiopythonTranslator, CircularGraphicRecord
translator = BiopythonTranslator()
circular_record = translator.translate_record(record_or_genbank_path,
                                              grecord_class=CircularGraphicRecord)
axes, infos = circular_record.plot(figure_width=12)

Note that the circular view does not get used often here. Hopefully everything will be alright for you.

sarah872 commented 6 years ago

I am now getting the following error with the new release when trying the code from above:

 TypeError: translate_record() got an unexpected keyword argument 'grecord_class'
Zulko commented 6 years ago

I didn't like grecord_class so i changed the parameter name to record_class (without the g). Can you try this and tell me if it worked ?

sarah872 commented 6 years ago

yep, thanks!