Unverified Commit df78033b authored by Randy Heiland's avatar Randy Heiland Committed by GitHub
Browse files

Merge pull request #1 from pc4covid19/development

v2 updates
parents e949ed63 b5bd8844
BSD 3-Clause License
Copyright (c) 2019, PhysiCell-Tools
Copyright (c) 2020, PhysiCell-Tools
All rights reserved.
Redistribution and use in source and binary forms, with or without
......
# pc4covid19 - COVID19 tissue simulator nanoHUB app
**Version:** 1.0
**Version:** 2.0
**Release date:** 26 March 2020
**Release date:** 10 April 2020
This repository contains code and data for the nanoHUB app https://nanohub.org/tools/pc4covid19
## Overview
This repository contains code and data for the nanoHUB app https://nanohub.org/tools/pc4covid19.
Here, we primarily report on changes to the app's GUI.
### Refererences
https://github.com/MathCancer/COVID19
It is based on the model at https://github.com/pc4covid19/COVID19. Refer to that repository
for a summary of changes to the model.
https://github.com/MathCancer/COVID19/wiki/About
### Caveats and disclaimers:
**This model is under active development using rapid prototyping:**
* It has not been peer reviewed.
* It is intended to drive basic scientific research and public education at this stage.
* **It cannot be used for public policy decisions.**
* **It cannot be used for individual medical decisions.**
**This model will be continually refined with input from the community, particularly experts in infectious diseases. The validation state will be updated as this progresses.**
## Release summary:
### 2.0:
The major change to the GUI in this release is the addition of an 'Animate' tab.
This allows animation of cells (not substrates) in the tab and the generation of a .mp4
video that can be downloaded. The animation uses the cells' SVG files.
### 1.0:
Provides a "standard" PhysiCell-based Jupyter notebook GUI consisting of 5 tabs:
* About: a description of the model and the app
* Config Basics: input parameters common to all models (e.g., domain grid, simulation time, choice/frequency of outputs)
* Microenvironment: microenvironment parameters that are model-specific
* User Params: user parameters that are model-specific
* Out: Plots: output display of cells and substrates
from ipywidgets import Button, VBox, Output
from IPython.display import display, HTML
from ipywidgets import Button, Label, BoundedIntText, HBox, VBox, Output, HTML, Layout
from IPython.display import display
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from PIL import Image
import os
import glob
import subprocess
import time
import platform
import zipfile
import shutil
from pathlib import Path
hublib_flag = True
if platform.system() != 'Windows':
try:
# print("Trying to import hublib.ui")
from hublib.ui import Download
except:
hublib_flag = False
else:
hublib_flag = False
# hublib_flag = False # shared testing
class AnimateTab(object):
def __init__(self):
# self.tab = Output(layout={'height': '600px'})
# self.tab = Output(layout={'height': 'auto'})
self.mp4_zip_file = "cells_mp4.zip"
self.mp4_file = "cells.mp4"
gen_button = Button(
description='Generate',
self.instructions = Label("After a simulation completes, generate a video of cells (from SVG files). Does not work for cached results yet.")
self.feedback = Label(" ")
# self.feedback.value = "Converting all svg to jpg..."
self.gen_button = Button(
description='Generate video',
button_style='success', # 'success', 'info', 'warning', 'danger' or ''
tooltip='Generate a MP4 video of cells',
)
gen_button.on_click(self.gen_button_cb)
self.gen_button.disabled = True
self.gen_button.on_click(self.gen_button_cb)
fps_style = {'description_width': '35%'}
fps_layout = {'width': '85px'}
# tooltip='frames per sec', -- tooltip not available for *Text !
self.fps = BoundedIntText(description="fps=", value=5, min=1, max=30, step=1,
style=fps_style, layout=fps_layout)
size_style = {'description_width': '50%'}
size_layout = {'width': '150px'}
self.size = BoundedIntText(description="w,h(pixels)=", value=500, min=250, max=1500, step=10, disabled=False, tooltip='width, height of video',
style=size_style, layout=size_layout)
self.video = HTML( value="",
placeholder='',
description='',
layout= Layout(visibility='hidden')
)
animate_out = Output(layout={'height': 'auto'})
animate_out.append_display_data(HTML(filename='doc/animate.html'))
if (hublib_flag):
self.download_mp4_button = Download(self.mp4_zip_file, style='success', icon='cloud-download',
tooltip='Download mp4 (you need to allow pop-ups in your browser)')
self.download_mp4_button.w.disabled = True
self.tab = VBox([gen_button, animate_out])
self.tab = VBox([self.instructions, HBox([ self.gen_button, self.fps, self.size, self.feedback,
self.download_mp4_button.w]), self.video])
else:
self.tab = VBox([self.instructions, HBox([self.gen_button, self.fps, self.size, self.feedback]), self.video])
#---------------------------
# callback for the 'Generate video' button
def gen_button_cb(self, b):
print('running...')
tdir = os.path.abspath('tmpdir')
os.chdir(tdir)
# os.system('rm -rf tmpdir*')
# subprocess.Popen(["../bin/myproj", "config.xml"])
# cmd = 'magick mogrify -format jpg snapshot*.svg'
# print(cmd)
# os.system(cmd)
# cmd = 'mencoder "mf://snapshot*.jpg" -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=10000:mbd=2:trell -mf fps=5:type=jpg -nosound -o out.avi'
# print(cmd)
# os.system(cmd)
# cmd = 'convert out.avi cells.mp4'
# print(cmd)
# os.system(cmd)
# print('done.')
self.gen_button.description = 'working'
self.gen_button.button_style = 'warning' # 'success','info','warning','danger' or ''
self.gen_button.disabled = True
self.fps.disabled = True
self.size.disabled = True
feedback_base = "Converting all svg to jpg..."
self.feedback.value = feedback_base
cwd = os.getcwd()
if not 'tmpdir' in cwd:
tdir = os.path.abspath('tmpdir')
os.chdir(tdir)
num_svg = len(glob.glob('snap*.svg'))
idx_start = 0
idx_end = num_svg
for idx in range(idx_start,idx_end):
for idx in range(idx_start,idx_end): # perhaps allow stepsize > 1
fname = "snapshot%08d" % idx
# cmd = "convert " + fname + ".svg -resize " + str(resize_pct) + "% " + fname + ".jpg &"
svg_file = fname + ".svg"
jpg_file = fname + ".jpg"
# print("convert " + svg_file + " " + jpg_file)
# print(cmd)
# os.system(cmd)
# subprocess.Popen(["../bin/myproj", "config.xml"])
subprocess.Popen(["convert", svg_file, jpg_file])
print("Converting all svg to jpg...")
delay = 15 # secs
# while True:
delay = 2 # secs
for idx in range(num_svg):
print ("%s" % ( time.ctime(time.time()) ))
# print(len(glob.glob(os.path.join(".", 'snap*.svg'))))
num_jpg = len(glob.glob('snap*.jpg'))
print("%d of %d" % (num_jpg, num_svg))
self.feedback.value = feedback_base + str(num_jpg) + " of " + str(num_svg)
time.sleep(delay)
if num_jpg == num_svg:
break
cmd = 'mencoder "mf://snapshot*.jpg" -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=10000:mbd=2:trell -mf fps=5:type=jpg -nosound -o out.avi'
print(cmd)
os.system(cmd)
cmd = 'convert out.avi cells.mp4'
print(cmd)
img_width = self.size.value
if (img_width % 2): # req divisible by 2
img_width += 1
img_height = img_width + 36
try:
os.remove(self.mp4_file)
except OSError:
pass
cmd = 'ffmpeg -framerate ' + str(self.fps.value) + ' -i snapshot%08d.jpg -vf scale=' + str(img_width) + ':' + str(img_height) + ' ' + self.mp4_file
self.feedback.value = "Converting all jpg to mp4..."
os.system(cmd)
print('done.')
# %%HTML
# <video width=500 height=500 controls>
# <source src="out.mp4" type="video/mp4">
# </video>
self.gen_button.description = 'Generate'
self.gen_button.button_style = 'success'
self.gen_button.disabled = False
self.fps.disabled = False
self.size.disabled = False
zipfile.ZipFile(self.mp4_zip_file, mode='w').write(self.mp4_file)
try:
os.remove(os.path.join('..', self.mp4_zip_file))
except OSError:
pass
shutil.move(self.mp4_zip_file, "..")
self.download_mp4_button.w.disabled = False
self.feedback.value = "Done. (Wait for animation to appear below)"
# Generate/display the animation of jpgs
plt.ioff()
self.fig = plt.figure(figsize= [13, 13])
# print("------ gen_button_cb")
self.anim_imgs = []
fname = self.mp4_file
# for idx in range(0,19,3):
success = True
for idx in range(num_jpg):
fname = 'snapshot%08d.jpg' % idx
# fname = 'img%08d.jpg' % idx
# print(fname)
try:
img = Image.open(fname)
except:
self.feedback.value = "Error: cannot open " + fname
success = False
break
img.thumbnail((700, 700), Image.ANTIALIAS)
im = plt.imshow(img, animated=True)
self.anim_imgs.append([im])
if success:
self.mpl_anim = animation.ArtistAnimation(self.fig, self.anim_imgs, interval=500, blit=True, repeat_delay=1000)
self.video.value = self.mpl_anim.to_html5_video()
self.video.layout.visibility = None
self.feedback.value = "Done."
plt.close(self.fig)
......@@ -31,8 +31,8 @@ class MicroenvTab(object):
param_name1 = Button(description='diffusion_coefficient', disabled=True, layout=name_button_layout)
self.virion_diffusion_coefficient = FloatText(value=900.0,
step=10,style=style, layout=widget_layout)
self.virion_diffusion_coefficient = FloatText(value=90.0,
step=1,style=style, layout=widget_layout)
param_name2 = Button(description='decay_rate', disabled=True, layout=name_button_layout)
......@@ -46,82 +46,22 @@ class MicroenvTab(object):
self.virion_Dirichlet_boundary_condition = FloatText(value=0,style=style, layout=widget_layout)
self.virion_Dirichlet_boundary_condition_toggle = Checkbox(description='on/off', disabled=False,style=style, layout=widget_layout)
menv_var2 = Button(description='uncoated_virion (virion/um^3)', disabled=True, layout=name_button_layout)
menv_var2 = Button(description='assembled_virion (virion/um^3)', disabled=True, layout=name_button_layout)
menv_var2.style.button_color = 'lightgreen'
param_name5 = Button(description='diffusion_coefficient', disabled=True, layout=name_button_layout)
self.uncoated_virion_diffusion_coefficient = FloatText(value=900.0,
step=10,style=style, layout=widget_layout)
self.assembled_virion_diffusion_coefficient = FloatText(value=90.0,
step=1,style=style, layout=widget_layout)
param_name6 = Button(description='decay_rate', disabled=True, layout=name_button_layout)
self.uncoated_virion_decay_rate = FloatText(value=3.5e-4,
step=0.0001,style=style, layout=widget_layout)
param_name7 = Button(description='initial_condition', disabled=True, layout=name_button_layout)
self.uncoated_virion_initial_condition = FloatText(value=0,style=style, layout=widget_layout)
param_name8 = Button(description='Dirichlet_boundary_condition', disabled=True, layout=name_button_layout)
self.uncoated_virion_Dirichlet_boundary_condition = FloatText(value=0,style=style, layout=widget_layout)
self.uncoated_virion_Dirichlet_boundary_condition_toggle = Checkbox(description='on/off', disabled=False,style=style, layout=widget_layout)
menv_var3 = Button(description='viral_RNA (mRNA/um^3)', disabled=True, layout=name_button_layout)
menv_var3.style.button_color = 'tan'
param_name9 = Button(description='diffusion_coefficient', disabled=True, layout=name_button_layout)
self.viral_RNA_diffusion_coefficient = FloatText(value=9000.0,
step=100,style=style, layout=widget_layout)
param_name10 = Button(description='decay_rate', disabled=True, layout=name_button_layout)
self.viral_RNA_decay_rate = FloatText(value=3.5e-4,
step=0.0001,style=style, layout=widget_layout)
param_name11 = Button(description='initial_condition', disabled=True, layout=name_button_layout)
self.viral_RNA_initial_condition = FloatText(value=0,style=style, layout=widget_layout)
param_name12 = Button(description='Dirichlet_boundary_condition', disabled=True, layout=name_button_layout)
self.viral_RNA_Dirichlet_boundary_condition = FloatText(value=0,style=style, layout=widget_layout)
self.viral_RNA_Dirichlet_boundary_condition_toggle = Checkbox(description='on/off', disabled=False,style=style, layout=widget_layout)
menv_var4 = Button(description='viral_protein (protein/um^3)', disabled=True, layout=name_button_layout)
menv_var4.style.button_color = 'lightgreen'
param_name13 = Button(description='diffusion_coefficient', disabled=True, layout=name_button_layout)
self.viral_protein_diffusion_coefficient = FloatText(value=9000.0,
step=100,style=style, layout=widget_layout)
param_name14 = Button(description='decay_rate', disabled=True, layout=name_button_layout)
self.viral_protein_decay_rate = FloatText(value=3.5e-4,
step=0.0001,style=style, layout=widget_layout)
param_name15 = Button(description='initial_condition', disabled=True, layout=name_button_layout)
self.viral_protein_initial_condition = FloatText(value=0,style=style, layout=widget_layout)
param_name16 = Button(description='Dirichlet_boundary_condition', disabled=True, layout=name_button_layout)
self.viral_protein_Dirichlet_boundary_condition = FloatText(value=0,style=style, layout=widget_layout)
self.viral_protein_Dirichlet_boundary_condition_toggle = Checkbox(description='on/off', disabled=False,style=style, layout=widget_layout)
menv_var5 = Button(description='assembled_virion (virion/um^3)', disabled=True, layout=name_button_layout)
menv_var5.style.button_color = 'tan'
param_name17 = Button(description='diffusion_coefficient', disabled=True, layout=name_button_layout)
self.assembled_virion_diffusion_coefficient = FloatText(value=900.0,
step=10,style=style, layout=widget_layout)
param_name18 = Button(description='decay_rate', disabled=True, layout=name_button_layout)
self.assembled_virion_decay_rate = FloatText(value=0,
step=0.01,style=style, layout=widget_layout)
param_name19 = Button(description='initial_condition', disabled=True, layout=name_button_layout)
param_name7 = Button(description='initial_condition', disabled=True, layout=name_button_layout)
self.assembled_virion_initial_condition = FloatText(value=0,style=style, layout=widget_layout)
param_name20 = Button(description='Dirichlet_boundary_condition', disabled=True, layout=name_button_layout)
param_name8 = Button(description='Dirichlet_boundary_condition', disabled=True, layout=name_button_layout)
self.assembled_virion_Dirichlet_boundary_condition = FloatText(value=0,style=style, layout=widget_layout)
self.assembled_virion_Dirichlet_boundary_condition_toggle = Checkbox(description='on/off', disabled=False,style=style, layout=widget_layout)
......@@ -138,18 +78,6 @@ class MicroenvTab(object):
menv_units_button6 = Button(description='1/min', disabled=True, layout=units_button_layout)
menv_units_button7 = Button(description='virion/um^3', disabled=True, layout=units_button_layout)
menv_units_button8 = Button(description='virion/um^3', disabled=True, layout=units_button_layout)
menv_units_button9 = Button(description='micron^2/min', disabled=True, layout=units_button_layout)
menv_units_button10 = Button(description='1/min', disabled=True, layout=units_button_layout)
menv_units_button11 = Button(description='mRNA/um^3', disabled=True, layout=units_button_layout)
menv_units_button12 = Button(description='mRNA/um^3', disabled=True, layout=units_button_layout)
menv_units_button13 = Button(description='micron^2/min', disabled=True, layout=units_button_layout)
menv_units_button14 = Button(description='1/min', disabled=True, layout=units_button_layout)
menv_units_button15 = Button(description='protein/um^3', disabled=True, layout=units_button_layout)
menv_units_button16 = Button(description='protein/um^3', disabled=True, layout=units_button_layout)
menv_units_button17 = Button(description='micron^2/min', disabled=True, layout=units_button_layout)
menv_units_button18 = Button(description='1/min', disabled=True, layout=units_button_layout)
menv_units_button19 = Button(description='virion/um^3', disabled=True, layout=units_button_layout)
menv_units_button20 = Button(description='virion/um^3', disabled=True, layout=units_button_layout)
......@@ -159,28 +87,13 @@ class MicroenvTab(object):
row2 = [param_name2, self.virion_decay_rate, menv_units_button2]
row3 = [param_name3, self.virion_initial_condition, menv_units_button3]
row4 = [param_name4, self.virion_Dirichlet_boundary_condition, menv_units_button4, self.virion_Dirichlet_boundary_condition_toggle]
row_uncoated_virion = [menv_var2, ]
row5 = [param_name5, self.uncoated_virion_diffusion_coefficient, menv_units_button5]
row6 = [param_name6, self.uncoated_virion_decay_rate, menv_units_button6]
row7 = [param_name7, self.uncoated_virion_initial_condition, menv_units_button7]
row8 = [param_name8, self.uncoated_virion_Dirichlet_boundary_condition, menv_units_button8, self.uncoated_virion_Dirichlet_boundary_condition_toggle]
row_viral_RNA = [menv_var3, ]
row9 = [param_name9, self.viral_RNA_diffusion_coefficient, menv_units_button9]
row10 = [param_name10, self.viral_RNA_decay_rate, menv_units_button10]
row11 = [param_name11, self.viral_RNA_initial_condition, menv_units_button11]
row12 = [param_name12, self.viral_RNA_Dirichlet_boundary_condition, menv_units_button12, self.viral_RNA_Dirichlet_boundary_condition_toggle]
row_viral_protein = [menv_var4, ]
row13 = [param_name13, self.viral_protein_diffusion_coefficient, menv_units_button13]
row14 = [param_name14, self.viral_protein_decay_rate, menv_units_button14]
row15 = [param_name15, self.viral_protein_initial_condition, menv_units_button15]
row16 = [param_name16, self.viral_protein_Dirichlet_boundary_condition, menv_units_button16, self.viral_protein_Dirichlet_boundary_condition_toggle]
row_assembled_virion = [menv_var5, ]
row17 = [param_name17, self.assembled_virion_diffusion_coefficient, menv_units_button17]
row18 = [param_name18, self.assembled_virion_decay_rate, menv_units_button18]
row19 = [param_name19, self.assembled_virion_initial_condition, menv_units_button19]
row20 = [param_name20, self.assembled_virion_Dirichlet_boundary_condition, menv_units_button20, self.assembled_virion_Dirichlet_boundary_condition_toggle]
row21 = [self.calculate_gradient,]
row22 = [self.track_internal,]
row_assembled_virion = [menv_var2, ]
row5 = [param_name5, self.assembled_virion_diffusion_coefficient, menv_units_button5]
row6 = [param_name6, self.assembled_virion_decay_rate, menv_units_button6]
row7 = [param_name7, self.assembled_virion_initial_condition, menv_units_button7]
row8 = [param_name8, self.assembled_virion_Dirichlet_boundary_condition, menv_units_button8, self.assembled_virion_Dirichlet_boundary_condition_toggle]
row9 = [self.calculate_gradient,]
row10 = [self.track_internal,]
box_layout = Layout(display='flex', flex_flow='row', align_items='stretch', width='100%')
......@@ -189,28 +102,13 @@ class MicroenvTab(object):
box2 = Box(children=row2, layout=box_layout)
box3 = Box(children=row3, layout=box_layout)
box4 = Box(children=row4, layout=box_layout)
box_uncoated_virion = Box(children=row_uncoated_virion, layout=box_layout)
box_assembled_virion = Box(children=row_assembled_virion, layout=box_layout)
box5 = Box(children=row5, layout=box_layout)
box6 = Box(children=row6, layout=box_layout)
box7 = Box(children=row7, layout=box_layout)
box8 = Box(children=row8, layout=box_layout)
box_viral_RNA = Box(children=row_viral_RNA, layout=box_layout)
box9 = Box(children=row9, layout=box_layout)
box10 = Box(children=row10, layout=box_layout)
box11 = Box(children=row11, layout=box_layout)
box12 = Box(children=row12, layout=box_layout)
box_viral_protein = Box(children=row_viral_protein, layout=box_layout)
box13 = Box(children=row13, layout=box_layout)
box14 = Box(children=row14, layout=box_layout)
box15 = Box(children=row15, layout=box_layout)
box16 = Box(children=row16, layout=box_layout)
box_assembled_virion = Box(children=row_assembled_virion, layout=box_layout)
box17 = Box(children=row17, layout=box_layout)
box18 = Box(children=row18, layout=box_layout)
box19 = Box(children=row19, layout=box_layout)
box20 = Box(children=row20, layout=box_layout)
box21 = Box(children=row21, layout=box_layout)
box22 = Box(children=row22, layout=box_layout)
self.tab = VBox([
box_virion,
......@@ -218,28 +116,13 @@ class MicroenvTab(object):
box2,
box3,
box4,
box_uncoated_virion,
box_assembled_virion,
box5,
box6,
box7,
box8,
box_viral_RNA,
box9,
box10,
box11,
box12,
box_viral_protein,
box13,
box14,
box15,
box16,
box_assembled_virion,
box17,
box18,
box19,
box20,
box21,
box22,
])
# Populate the GUI widgets with values from the XML
......@@ -261,38 +144,11 @@ class MicroenvTab(object):
else:
self.virion_Dirichlet_boundary_condition_toggle.value = False
self.uncoated_virion_diffusion_coefficient.value = float(vp[1].find('.//diffusion_coefficient').text)
self.uncoated_virion_decay_rate.value = float(vp[1].find('.//decay_rate').text)
self.uncoated_virion_initial_condition.value = float(vp[1].find('.//initial_condition').text)
self.uncoated_virion_Dirichlet_boundary_condition.value = float(vp[1].find('.//Dirichlet_boundary_condition').text)
self.assembled_virion_diffusion_coefficient.value = float(vp[1].find('.//diffusion_coefficient').text)
self.assembled_virion_decay_rate.value = float(vp[1].find('.//decay_rate').text)
self.assembled_virion_initial_condition.value = float(vp[1].find('.//initial_condition').text)
self.assembled_virion_Dirichlet_boundary_condition.value = float(vp[1].find('.//Dirichlet_boundary_condition').text)
if vp[1].find('.//Dirichlet_boundary_condition').attrib['enabled'].lower() == 'true':
self.uncoated_virion_Dirichlet_boundary_condition_toggle.value = True
else:
self.uncoated_virion_Dirichlet_boundary_condition_toggle.value = False
self.viral_RNA_diffusion_coefficient.value = float(vp[2].find('.//diffusion_coefficient').text)
self.viral_RNA_decay_rate.value = float(vp[2].find('.//decay_rate').text)
self.viral_RNA_initial_condition.value = float(vp[2].find('.//initial_condition').text)
self.viral_RNA_Dirichlet_boundary_condition.value = float(vp[2].find('.//Dirichlet_boundary_condition').text)
if vp[2].find('.//Dirichlet_boundary_condition').attrib['enabled'].lower() == 'true':
self.viral_RNA_Dirichlet_boundary_condition_toggle.value = True
else:
self.viral_RNA_Dirichlet_boundary_condition_toggle.value = False
self.viral_protein_diffusion_coefficient.value = float(vp[3].find('.//diffusion_coefficient').text)
self.viral_protein_decay_rate.value = float(vp[3].find('.//decay_rate').text)
self.viral_protein_initial_condition.value = float(vp[3].find('.//initial_condition').text)
self.viral_protein_Dirichlet_boundary_condition.value = float(vp[3].find('.//Dirichlet_boundary_condition').text)
if vp[3].find('.//Dirichlet_boundary_condition').attrib['enabled'].lower() == 'true':
self.viral_protein_Dirichlet_boundary_condition_toggle.value = True
else:
self.viral_protein_Dirichlet_boundary_condition_toggle.value = False
self.assembled_virion_diffusion_coefficient.value = float(vp[4].find('.//diffusion_coefficient').text)
self.assembled_virion_decay_rate.value = float(vp[4].find('.//decay_rate').text)
self.assembled_virion_initial_condition.value = float(vp[4].find('.//initial_condition').text)
self.assembled_virion_Dirichlet_boundary_condition.value = float(vp[4].find('.//Dirichlet_boundary_condition').text)
if vp[4].find('.//Dirichlet_boundary_condition').attrib['enabled'].lower() == 'true':
self.assembled_virion_Dirichlet_boundary_condition_toggle.value = True
else:
self.assembled_virion_Dirichlet_boundary_condition_toggle.value = False
......@@ -323,29 +179,11 @@ class MicroenvTab(object):
vp[0].find('.//Dirichlet_boundary_condition').text = str(self.virion_Dirichlet_boundary_condition.value)
vp[0].find('.//Dirichlet_boundary_condition').attrib['enabled'] = str(self.virion_Dirichlet_boundary_condition_toggle.value).lower()
vp[1].find('.//diffusion_coefficient').text = str(self.uncoated_virion_diffusion_coefficient.value)
vp[1].find('.//decay_rate').text = str(self.uncoated_virion_decay_rate.value)
vp[1].find('.//initial_condition').text = str(self.uncoated_virion_initial_condition.value)
vp[1].find('.//Dirichlet_boundary_condition').text = str(self.uncoated_virion_Dirichlet_boundary_condition.value)
vp[1].find('.//Dirichlet_boundary_condition').attrib['enabled'] = str(self.uncoated_virion_Dirichlet_boundary_condition_toggle.value).lower()
vp[2].find('.//diffusion_coefficient').text = str(self.viral_RNA_diffusion_coefficient.value)
vp[2].find('.//decay_rate').text = str(self.viral_RNA_decay_rate.value)
vp[2].find('.//initial_condition').text = str(self.viral_RNA_initial_condition.value)
vp[2].find('.//Dirichlet_boundary_condition').text = str(self.viral_RNA_Dirichlet_boundary_condition.value)
vp[2].find('.//Dirichlet_boundary_condition').attrib['enabled'] = str(self.viral_RNA_Dirichlet_boundary_condition_toggle.value).lower()
vp[3].find('.//diffusion_coefficient').text = str(self.viral_protein_diffusion_coefficient.value)
vp[3].find('.//decay_rate').text = str(self.viral_protein_decay_rate.value)
vp[3].find('.//initial_condition').text = str(self.viral_protein_initial_condition.value)
vp[3].find('.//Dirichlet_boundary_condition').text = str(self.viral_protein_Dirichlet_boundary_condition.value)
vp[3].find('.//Dirichlet_boundary_condition').attrib['enabled'] = str(self.viral_protein_Dirichlet_boundary_condition_toggle.value).lower()
vp[4].find('.//diffusion_coefficient').text = str(self.assembled_virion_diffusion_coefficient.value)
vp[4].find('.//decay_rate').text = str(self.assembled_virion_decay_rate.value)
vp[4].find('.//initial_condition').text = str(self.assembled_virion_initial_condition.value)
vp[4].find('.//Dirichlet_boundary_condition').text = str(self.assembled_virion_Dirichlet_boundary_condition.value)
vp[4].find('.//Dirichlet_boundary_condition').attrib['enabled'] = str(self.assembled_virion_Dirichlet_boundary_condition_toggle.value).lower()
vp[1].find('.//diffusion_coefficient').text = str(self.assembled_virion_diffusion_coefficient.value)
vp[1].find('.//decay_rate').text = str(self.assembled_virion_decay_rate.value)
vp[1].find('.//initial_condition').text = str(self.assembled_virion_initial_condition.value)
vp[1].find('.//Dirichlet_boundary_condition').text = str(self.assembled_virion_Dirichlet_boundary_condition.value)
vp[1].find('.//Dirichlet_boundary_condition').attrib['enabled'] = str(self.assembled_virion_Dirichlet_boundary_condition_toggle.value).lower()
uep.find('.//options//calculate_gradients').text = str(self.calculate_gradient.value)
......
......@@ -12,7 +12,7 @@ from microenv_params import MicroenvTab
from user_params import UserTab
# from svg import SVGTab
from substrates import SubstrateTab
# from animate_tab import AnimateTab
from animate_tab import AnimateTab
from pathlib import Path
import platform
import subprocess
......@@ -46,7 +46,7 @@ microenv_tab = MicroenvTab()
user_tab = UserTab()
# svg = SVGTab()
sub = SubstrateTab()
# animate_tab = AnimateTab()
animate_tab = AnimateTab()
nanoHUB_flag = False
if( 'HOME' in os.environ.keys() ):
......@@ -236,6 +236,8 @@ def run_done_func(s, rdir):
# svg.update(rdir)
sub.update(rdir)
animate_tab.gen_button.disabled = False