-
Notifications
You must be signed in to change notification settings - Fork 7
/
Co_mol_md.py
32 lines (23 loc) · 1.08 KB
/
Co_mol_md.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import optparse
import numpy as np
import pandas as pd
disclaimer="""\
Script for calculate Ligand concentration for Flooding MD. @autor: Ropón-Palacios G.
(C) All rigth to Autors. Contact: [email protected]"""
parser = optparse.OptionParser(description=disclaimer)
parser.add_option("-c", help="Concentration in mol/L", type=float)
parser.add_option("-b", help="Box volumen in A^3 [100 A^3 = 1000000]", type=float)
parser.add_option("-o", help="File name containing number of molecules to add", type=str)
options, args = parser.parse_args()
##; Constant values
Litre = 10e27 ##; this is number of molecules H2O in 1 water litre
avogadro = 6.02 * 10e23 ##; avogadro number
##; solving equation
num_mol = (options.b * options.c * avogadro)/Litre
##; write outfile
f = open(options.o, 'w')
f.write("Number of molecules: " + "%s" % str(num_mol) + " molecules" + "\n")
f.write("Concentration used: " + "%s" % str(options.c) + " mol/L" + "\n")
f.write("Box volumen used: " + "%s" % str(options.b) + " A^3" + "\n")
f.close()
print("Done, thanks for use my script")