def download_mutation_images(self):
# TODO: dunno if this works
import ipywidgets
import math
views = []
for g in self.reference_gempro.genes:
if g.protein.representative_structure:
view = g.protein.view_all_mutations(alignment_type='seqalign', grouped=False, structure_opacity=0.5,
opacity_range=(0.6, 1), scale_range=(.5, 5))
view._remote_call("setSize", target='Widget', args=['300px', '300px'])
view.download_image(filename='{}_{}_mutations.png'.format(g.id, g.name))
views.append(view)
hboxes = [ipywidgets.HBox(views[i * 3:i * 3 + 3])
for i in range(int(math.ceil(len(views) / 3.0)))]
vbox = ipywidgets.VBox(hboxes)
return vbox
评论列表
文章目录