Beispiel #1
0
def equilibrate(groups=None,structure='system'):

	"""
	equilibrate()
	Standard equilibration procedure.
	"""

	#---sequential equilibration stages
	seq = wordspace.equilibration.split(',') if wordspace.equilibration else []
	for eqnum,name in enumerate(seq):
		if not equilibrate_check(name):
			gmx('grompp',base='md-%s'%name,top='system',
				structure=structure if eqnum == 0 else 'md-%s'%seq[eqnum-1],
				log='grompp-%s'%name,mdp='input-md-%s-eq-in'%name,
				flag=('' if not groups else '-n %s'%groups)+' -maxwarn 10')
			gmx('mdrun',base='md-%s'%name,log='mdrun-%s'%name,skip=True)
			assert os.path.isfile(wordspace['step']+'md-%s.gro'%name)
			checkpoint()

	#---first part of the equilibration/production run
	name = 'md.part0001'
	if not equilibrate_check(name) or seq == []:
		gmx('grompp',base=name,top='system',
			structure='md-%s'%seq[-1] if seq else structure,
			log='grompp-0001',mdp='input-md-in',
			flag='' if not groups else '-n %s'%groups)
		gmx('mdrun',base=name,log='mdrun-0001')
		#---we don't assert that the file exists here because the user might kill it and upload
		checkpoint()
def minimize_steep_cg(name):
    """
	minimize_steep_cg(name)
	Minimization using steepest descent followed by conjugate gradient.
	Note that this method has been retired due to reliability issues.
	"""

    gmx('grompp',
        base='em-%s-steep' % name,
        top=name,
        structure=name,
        log='grompp-em-%s-steep' % name,
        mdp='input-em-steep-in')
    gmx('mdrun',
        base='em-%s-steep' % name,
        log='mdrun-%s-steep' % name,
        skip=True)
    #---if first step fails we skip it and try again with the second minimizer
    if not os.path.isfile(wordspace['step'] + 'em-%s-steep.gro'):
        filecopy(wordspace['step'] + '%s.gro' % name,
                 wordspace['step'] + 'em-%s-steep.gro' % name)
    gmx('grompp',
        base='em-%s-cg' % name,
        top=name,
        structure='em-%s-steep' % name,
        log='grompp-%s-cg' % name,
        mdp='input-em-cg-in',
        skip=True)
    gmx('mdrun', base='em-%s-cg' % name, log='mdrun-%s-cg' % name)
    select_minimum('%s-steep' % name,
                   '%s-cg' % name,
                   gro='%s-minimized' % name)
    checkpoint()
Beispiel #3
0
def equilibrate(groups=None, structure='system'):
    """
	equilibrate()
	Standard equilibration procedure.
	"""

    #---sequential equilibration stages
    seq = wordspace.equilibration.split(',') if wordspace.equilibration else []
    for eqnum, name in enumerate(seq):
        if not equilibrate_check(name):
            gmx('grompp',
                base='md-%s' % name,
                top='system',
                structure=structure if eqnum == 0 else 'md-%s' %
                seq[eqnum - 1],
                log='grompp-%s' % name,
                mdp='input-md-%s-eq-in' % name,
                flag=('' if not groups else '-n %s' % groups) + ' -maxwarn 10')
            gmx('mdrun', base='md-%s' % name, log='mdrun-%s' % name, skip=True)
            assert os.path.isfile(wordspace['step'] + 'md-%s.gro' % name)
            checkpoint()

    #---first part of the equilibration/production run
    name = 'md.part0001'
    if not equilibrate_check(name) or seq == []:
        gmx('grompp',
            base=name,
            top='system',
            structure='md-%s' % seq[-1] if seq else structure,
            log='grompp-0001',
            mdp='input-md-in',
            flag='' if not groups else '-n %s' % groups)
        gmx('mdrun', base=name, log='mdrun-0001')
        #---we don't assert that the file exists here because the user might kill it and upload
        checkpoint()
Beispiel #4
0
def minimize(name,method='steep',top=None):

	"""
	minimize(name,method='steep')
	Standard minimization procedure.
	"""

	gmx('grompp',base='em-%s-%s'%(name,method),top=name if not top else re.sub('^(.+)\.top$',r'\1',top),
		structure=name,log='grompp-%s-%s'%(name,method),mdp='input-em-%s-in'%method,skip=True)
	assert os.path.isfile(wordspace['step']+'em-%s-%s.tpr'%(name,method))
	gmx('mdrun',base='em-%s-%s'%(name,method),log='mdrun-%s-%s'%(name,method))
	filecopy(wordspace['step']+'em-'+'%s-%s.gro'%(name,method),
		wordspace['step']+'%s-minimized.gro'%name)
	checkpoint()
def minimize_steep_cg(name):

	"""
	minimize_steep_cg(name)
	Minimization using steepest descent followed by conjugate gradient.
	Note that this method has been retired due to reliability issues.
	"""

	gmx('grompp',base='em-%s-steep'%name,top=name,structure=name,
		log='grompp-em-%s-steep'%name,mdp='input-em-steep-in')
	gmx('mdrun',base='em-%s-steep'%name,log='mdrun-%s-steep'%name,skip=True)
	#---if first step fails we skip it and try again with the second minimizer
	if not os.path.isfile(wordspace['step']+'em-%s-steep.gro'):
		filecopy(wordspace['step']+'%s.gro'%name,wordspace['step']+'em-%s-steep.gro'%name)
	gmx('grompp',base='em-%s-cg'%name,top=name,structure='em-%s-steep'%name,
		log='grompp-%s-cg'%name,mdp='input-em-cg-in',skip=True)
	gmx('mdrun',base='em-%s-cg'%name,log='mdrun-%s-cg'%name)
	select_minimum('%s-steep'%name,'%s-cg'%name,gro='%s-minimized'%name)
	checkpoint()
Beispiel #6
0
def minimize(name, method='steep', top=None):
    """
	minimize(name,method='steep')
	Standard minimization procedure.
	"""

    gmx('grompp',
        base='em-%s-%s' % (name, method),
        top=name if not top else re.sub('^(.+)\.top$', r'\1', top),
        structure=name,
        log='grompp-%s-%s' % (name, method),
        mdp='input-em-%s-in' % method,
        skip=True)
    assert os.path.isfile(wordspace['step'] + 'em-%s-%s.tpr' % (name, method))
    gmx('mdrun',
        base='em-%s-%s' % (name, method),
        log='mdrun-%s-%s' % (name, method))
    filecopy(wordspace['step'] + 'em-' + '%s-%s.gro' % (name, method),
             wordspace['step'] + '%s-minimized.gro' % name)
    checkpoint()