Commit c6e082b9 authored by cmaffeo2's avatar cmaffeo2
Browse files

Updated mrdna script to use dimensions of object for system

parent a80f8bf4
......@@ -29,6 +29,9 @@ parser.add_argument('--debye-length', type=float, default=None,
parser.add_argument('--temperature', type=float, default=295,
help='Temperature in Kelvin.')
parser.add_argument('--dimensions', type=str, default=None,
help='Comma-separated sides of box in Angstroms.')
parser.add_argument('--sequence-file', type=str, default=None,
help='Sequence of longest strand.')
......@@ -73,6 +76,16 @@ parser.add_argument('input_file', type=str,
args = parser.parse_args()
if args.dimensions is not None:
try:
tmp = [float(f) for f in args.dimensions.split(',')]
if len(tmp) != 3:
raise ValueError
args.dimensions = tmp
except:
raise ValueError('--dimensions requires a comma separated list of floating point values, not "{}"'.format(args.dimensions))
def main():
infile = pathlib.Path(args.input_file)
try:
......@@ -91,6 +104,12 @@ def main():
raise Exception("Unrecognized input file '{}'".format(infile))
model = read_model( str(infile), debye_length=args.debye_length, temperature=args.temperature )
if args.dimensions is None:
model.dimensions = [max(f,2500)
for f in model.dimensions_from_structure( padding_factor=2.5 )]
else:
model.dimensions = args.dimensions
if args.output_prefix is not None:
prefix = args.output_prefix
......
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