Commit fdc21600 authored by cmaffeo2's avatar cmaffeo2
Browse files

Added dnarbd binary to repository for command line invocation

parent 53b40620
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import re
from dnarbd.simulate import multiresolution_simulation as simulate
parser = argparse.ArgumentParser(prog="dnarbd",
description="""Easy multiresolution simulations of DNA nanotechnology objects using ARBD""")
parser.add_argument('-o','--output-prefix', type=str, default=None,
help="Name for your job's output")
parser.add_argument('-d','--directory', type=str, default=None,
help='Directory for simulation; does not need to exist yet')
parser.add_argument('-g','--gpu', type=int, default=0,
help='GPU for simulation; check nvidia-smi for availability')
parser.add_argument('--coarse-steps', type=int, default=1e7,
help='Simulation steps for coarse model (200 fs/step)')
parser.add_argument('--fine-steps', type=int, default=1e7,
help='Simulation steps for fine model (50 fs/step)')
parser.add_argument('--backbone-scale', type=float, default=1.0,
help='Factor to scale DNA backbone in atomic model; try 0.25 to avoid clashes for atomistic simulations')
parser.add_argument('input_file', type=str,
help="""Any of the following:
(1) a cadnano JSON file;
(2) a vHelix Maya (.ma) file;
(3) an atomic PDB file""")
args = parser.parse_args()
if __name__ == '__main__':
infile = args.input_file
re_result = re.match("(.*)\.([^.]+)",infile)
prefix =
extension =
raise Exception("Unrecognized input file '{}'".format(infile))
if extension == 'json':
from dnarbd.readers import read_cadnano as read_model
elif extension == 'ma':
from dnarbd.readers import read_vhelix as read_model
elif extension == 'pdb':
from dnarbd.readers import read_atomic_pdb as read_model
raise Exception("Unrecognized input file '{}'".format(infile))
model = read_model( infile )
run_args = dict(
model = model,
output_name = args.output_prefix,
job_id = "job-"+args.output_prefix,
directory =,
gpu = args.gpu,
coarse_steps = args.coarse_steps,
fine_steps = args.fine_steps,
backbone_scale = args.backbone_scale
if args.output_prefix == None:
run_args['output_name'] = prefix
simulate( **run_args )
......@@ -19,6 +19,7 @@ setuptools.setup(
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment