Daedalus - software to render nearly any 3D geometry as a scaffolded DNA origami nanoparticle.
Your 3D models can be input using the Polygon File Format (.ply).
- Clone this repo
- (optional) Set up a virtualenv.
pip install -r requirementsin this project's root.
- (optional) Also run
pip install -r dev_requirementsto give you the libraries used for testing / code development.
At the minimum when calling
demo_daedalus.py, you need to tell it what ply file to run. For example, running pyDAEDALUS on the included ply file
05_icosahedron.ply can be done with the command:
python demo_daedalus.py --input_filename=PLY_Files/05_icosahedron.ply
Note including the
.ply extension is optional. So the following command would be equivalent:
python demo_daedalus.py --input_filename=PLY_Files/05_icosahedron
You can also run a batch of ply files at a time by specifying an input foldername rather than a single ply file:
python demo_daedalus.py --input_foldername=PLY_Files
Adding the flag
--display_plots asks the program, in addition to saving the plots to your output folder, to print them to screen. For example:
python demo_daedalus.py --input_filename=PLY_Files/37_enneagonal_trapezohedron.ply --display_plots
Additional options include:
--results_foldername=yourfoldernamewhere 'yourfoldername' is the name of the folder you want to save this command's results in. Folder will be created if it doesn't already exist.
--suppress_console_output(flag) if you want to not have things printed to your console at runtime. (always suppressed when running a batch)
--reset_results_folder(flag) if you want to erase all data within your output folder before running the current command.
You can find the complete list of arguments with descriptions with
python demo_daedalus.py --help.
All files saved into Results includes both shape name and
min_len_nt in the filename to avoid undesired filename collisions.
Be sure to have installed dev_requirements.txt if you plan on running tests. Or at the very least, install
py.test. Ways to run tests manually include:
- Simply run
make test. This leverages
Makefileto run tests with the right syntax.
- Run all tests by directly calling pytest:
- Run all tests and drop into a
bpython-enabled debugger at failure:
- To run a test class or stand-alone function:
- To run a single function within a test class:
Testing coverage done with
pytest-cov package. Manually run coverage report with:
py.test --cov=Automated_Design tests/to run coverage on folder
Automated_Designusing all tests found in
py.test --cov-report html --cov-report term --cov=Automated_Design tests/to run coverage report as above, but with also generating a line-by-line report formatted as html (viewable in your browser by opening the created files)
The only code deliberately excluded from tests are plotting functions (e.g.,
ply_to_input.plot_edge_length_distributions) and functions that simply write raw internal data to disk (e.g.,
csv_staples). All such functions are marked to not be included in the coverage report by adding the comment
# pragma: no cover on the same line as the function definition.
Makefile is used to add several command shortcuts to do common testing operations:
maketo run both linting and tests (linting is only ran if tests pass)
make testto run only tests.
make lintto run only linting.
make coverageto run coverage report. The report is returned as both top level statistics to terminal and a line-by-line report saved into folder
htmlcovas html files.