def get_args(cmd_args): parser = utils.get_basic_parser( usage='used to calculate unun, neighbour residues are excluded') parser.add_argument( '--query', required=True, help= 'query for selecting atoms used for calculating non-polar interactions' ) parser.add_argument('--h5', required=True, help='written to hdf5 file directory') parser.add_argument( '-c', '--cutoff', default=0.55, type=float, help= 'cutoff in nm (will be converted to angstrom in the code so as to work with MDAnalysis)' ) parser.add_argument( '--nres-away', default=2, type=int, help='the atoms should be nres away to avoid neigbor interactions)') args = parser.parse_args(cmd_args) return args
def get_args(): p = utils.get_basic_parser(usage='used to calculate unun, neighbour residues are excluded') p.add_argument('-c', '--cutoff', type=float, required=True, help='cutoff in nm (will be converted to angstrom in the code so as to work with MDAnalysis)') p.add_argument('--debug', dest='debug', default=False, action='store_true', help='for debugging, verbose info will be printted to the screen') args = p.parse_args() return args
def parse_cmd(): usage='used to calculate sequence spacing' p = utils.get_basic_parser(usage=usage) p.add_argument('--pl', type=int, dest='peptide_length', default=None, required=True, help='specify the peptide_length') p.add_argument('--atom-selection', type=str, dest='atom_sel', default='resid {0} and not type H', help=("atom selection, the default is 'resid {0} and not type H': {0}" "will be substituted with a number, the atom selection option only" "applies to each resid! I know, it's WIRED and UGLY, let me know" "if you have a better way. Thanks! 2011-12-12")) args = p.parse_args() return args
def get_args(cmd_args): parser = utils.get_basic_parser(usage='used to calculate unun, neighbour residues are excluded') parser.add_argument('--query', required=True, help='query for selecting atoms used for calculating non-polar interactions') parser.add_argument('--h5', required=True, help='written to hdf5 file directory') parser.add_argument('-c', '--cutoff', default=0.55, type=float, help='cutoff in nm (will be converted to angstrom in the code so as to work with MDAnalysis)') parser.add_argument('--nres-away', default=2, type=int, help='the atoms should be nres away to avoid neigbor interactions)') args = parser.parse_args(cmd_args) return args
def parse_arguments(args): """ Parse program arguments """ parser = utils.get_basic_parser() parser.add_argument('--nz', type=int, default=100, help='size of the latent z vector') parser.add_argument('--ngf', type=int, default=64, help='the depth of feature maps carried through the generator') parser.add_argument('--ndf', type=int, default=64, help='the depth of feature maps propagated through the discriminator') opt = parser.parse_args(args) opt.device = utils.get_device(opt) return opt
def parse_arguments(args): """ Parse program arguments Arguments: args {[string]} -- Arguments to parse Returns: [argparse.Namespace] -- parsed arguments """ parser = utils.get_basic_parser() parser.add_argument("--latent_dim", type=int, default=100, help="dimensionality of the latent space") opt = parser.parse_args(args) opt.device = utils.get_device(opt) return opt
def main(args): parser = utils.get_basic_parser() opt = parser.parse_args(args) batch_sizes = [] for epoch in range(opt.n_epochs): batch_sizes.append(utils.get_batch_sizes(opt, epoch)) df = pd.DataFrame(batch_sizes, columns=['real_batch', 'fake_batch']) max_size = max(df.max()) ax = df.plot(ylim=(0, int(1.05 * max_size)), xlim=(0, opt.n_epochs), alpha=0.6) ax.set_xlabel("epoch") plt.savefig("{}_{}_{}_{}.png".format(opt.policy, opt.batch_size, opt.batch_interval, opt.n_epochs), dpi=1000)
def get_args(): p = utils.get_basic_parser( usage='used to calculate unun, neighbour residues are excluded') p.add_argument( '-c', '--cutoff', type=float, required=True, help= 'cutoff in nm (will be converted to angstrom in the code so as to work with MDAnalysis)' ) p.add_argument( '--debug', dest='debug', default=False, action='store_true', help='for debugging, verbose info will be printted to the screen') args = p.parse_args() return args
def parse_cmd(): usage = 'used to calculate sequence spacing' p = utils.get_basic_parser(usage=usage) p.add_argument('--pl', type=int, dest='peptide_length', default=None, required=True, help='specify the peptide_length') p.add_argument( '--atom-selection', type=str, dest='atom_sel', default='resid {0} and not type H', help=( "atom selection, the default is 'resid {0} and not type H': {0}" "will be substituted with a number, the atom selection option only" "applies to each resid! I know, it's WIRED and UGLY, let me know" "if you have a better way. Thanks! 2011-12-12")) args = p.parse_args() return args
tets = select_dihedrals(univer) # there should be a better name for tet # Write headers, hdr: header hdrs = [] for k, tet in enumerate(tets): # ca1 + ca2 + (NO. peptide-bond) hdr = (utils.swap_aa_name(tet[0].resname) + utils.swap_aa_name(tet[-1].resname) + "{0:02d}".format(k + 1)) # hdrs.append("{0:8s}".format(hdr)) hdrs.append("{0:4s}".format(hdr)) yield '#{0:8s}{1}\n'.format('t(ps)', ' '.join(hdrs)) if not xtcf: yield calc_dih(tets) else: for ts in univer.trajectory: if btime > ts.time: continue if etime > 0 and etime < ts.time: break res = calc_dih(tets, ts.time) yield res utils.print_progress(ts) if __name__ == "__main__": parser = utils.get_basic_parser() args = parser.parse_args() main(args)
tets = select_dihedrals(univer) # there should be a better name for tet # Write headers, hdr: header hdrs = [] for k, tet in enumerate(tets): # ca1 + ca2 + (NO. peptide-bond) hdr = (utils.swap_aa_name(tet[0].resname) + utils.swap_aa_name(tet[-1].resname) + "{0:02d}".format(k+1)) # hdrs.append("{0:8s}".format(hdr)) hdrs.append("{0:4s}".format(hdr)) yield '#{0:8s}{1}\n'.format('t(ps)', ' '.join(hdrs)) if not xtcf: yield calc_dih(tets) else: for ts in univer.trajectory: if btime > ts.time: continue if etime > 0 and etime < ts.time: break res = calc_dih(tets, ts.time) yield res utils.print_progress(ts) if __name__ == "__main__": parser = utils.get_basic_parser() args = parser.parse_args() main(args)
def get_args(): p = U.get_basic_parser( usage='used to calculate unun, neighbour residues are excluded') args = p.parse_args() return args
def get_args(): p = U.get_basic_parser(usage='used to calculate unun, neighbour residues are excluded') args = p.parse_args() return args