Esempio n. 1
0
def inputComplex(options):
    if 'c' in options:
        return T.load(T.absfile(options['c']))

    m = PDBModel(T.absfile(options['i']))

    ## extract rec and lig chains
    rec_chains = T.toIntList(options['r'])
    lig_chains = T.toIntList(options['l'])

    rec = m.takeChains(rec_chains)
    lig = m.takeChains(lig_chains)

    ## create Protein complex
    com = Complex(rec, lig)
    return com
Esempio n. 2
0
    def table_ensemble(self, member=None, vpos=None, title=1):
        """
        Tabulate different entropy components versus variable parameter.
        d      - dict, result of calculate()
        vpos   - int, report result for |i|th variable parameter value
        title  - 1|0, add title lines
        """
        d = self.calculate(member)

        s = ''
        if title:
            s += self.table_header()

        vpos = T.toIntList(vpos or range(len(d['dS'])))

        for i in vpos:
            v = [
                d[x][i] for x in [
                    'dS_rt', 'dS', 'dS_intra', 'dS_rigid', 'dS_cross',
                    'ddS_fake1'
                ]
            ]

            s += "%4.0f  %4.0f  %5.0f %4.0f %4.0f %4.0f\n" % \
                 tuple( v )

        return s
Esempio n. 3
0
def inputComplex( options ):
    if 'c' in options:
        return T.load( T.absfile( options['c'] ) )

    m = PDBModel( T.absfile( options['i'] ) )
    
    ## extract rec and lig chains
    rec_chains = T.toIntList( options['r'] )
    lig_chains = T.toIntList( options['l'] )

    rec = m.takeChains( rec_chains )
    lig = m.takeChains( lig_chains )

    ## create Protein complex
    com = Complex( rec, lig )
    return com
Esempio n. 4
0
    def table_ensemble( self, member=None, vpos=None, title=1 ):
        """
        Tabulate different entropy components versus variable parameter.
        d      - dict, result of calculate()
        vpos   - int, report result for |i|th variable parameter value
        title  - 1|0, add title lines
        """
        d = self.calculate( member )
        
        s = ''
        if title:
            s += self.table_header()

        vpos = T.toIntList( vpos or range( len( d['dS'] ) ) )

        for i in vpos:
            v = [ d[x][i] for x in ['dS_rt','dS', 'dS_intra', 'dS_rigid',
                                    'dS_cross', 'ddS_fake1'] ]

            s += "%4.0f  %4.0f  %5.0f %4.0f %4.0f %4.0f\n" % \
                 tuple( v )

        return s
Esempio n. 5
0
### MAIN ###
############

options = T.cmdDict( {'o':'ref.complex', 'lo':'lig.model', 'ro':'rec.model' } )

if len (sys.argv) < 3:
    _use( options )

## create a reference complex
print "Loading..."
ref_com =  PDBModel( options['c'] )
print "Removing water..."
ref_com.remove( lambda a: a['residue_name'] in ['TIP3','HOH','WAT'] )

## extract rec and lig chains
rec_chains = T.toIntList( options['r'] )
lig_chains = T.toIntList( options['l'] )

print "Extracting rec and lig..."
ref_rec = ref_com.takeChains( rec_chains )
ref_lig = ref_com.takeChains( lig_chains )

## create Protein complex
com = ProteinComplex( ref_rec, ref_lig )

print "Saving..."
ref_lig.saveAs( T.absfile( options['lo'] ) )

ref_rec.saveAs( T.absfile( options['ro'] ) )

T.dump( com, T.absfile( options['o']) )
Esempio n. 6
0
]:
    if k in options:
        options[k] = int(options[k])

for k in [
        'debug', 'verbose', 'cast', 'split', 'shuffle', 'shift', 'heavy',
        'solvent', 'protein'
]:
    if k in options:
        options[k] = 1
    else:
        options[k] = 0

for k in ['chains', 'ex1', 'ex2', 'ex']:
    if k in options:
        options[k] = t.toIntList(options[k])

if 'atoms' in options:
    options['atoms'] = t.toList(options['atoms'])

if 'ex1' in options and 'ex2' in options:
    options['ex'] = (options['ex1'], options['ex2'])
else:
    options['ex'] = options.get('ex', options.get('ex1', None))

if 'log' in options:
    options['log'] = LogFile(options['log'])

f_in = options['i']
del options['i']
Esempio n. 7
0
options = t.cmdDict( {'o':'out.parm'} )

try:

    f_out = options['o']

    if 'ocrd' in options: 
        options['f_out_crd'] = options['ocrd']
    if 'opdb' in options:
        options['f_out_pdb'] = options['opdb']
    if 'box' in options:
        options['box'] = float( options['box'] )

    options['cap'] = 'cap' in options
    options['capN']= t.toIntList( options.get('capN',[]))
    options['capC']= t.toIntList( options.get('capC',[]))
    options['hetatm'] = 'hetatm' in options
    options['norun'] = 'norun' in options
    options['debug'] = 'debug' in options
    options['center'] = not 'nocenter' in options

    if 'log' in options:
        options['log'] = LogFile( options['log'] )

    if 'norun' in options:
        fbase = t.stripSuffix( t.absfile( options['i'] ) )
        options['leap_in'] = options.get('leap_in', fbase+'_leap.in')
        options['leap_pdb']= options.get('leap_pdb',fbase+'_forleap.pdb')

    a = AmberParmBuilder( options['i'], **options )
Esempio n. 8
0
## convert command line parameters
for k in ['s','e','ss', 'se', 'step','fit_s', 'fit_e', 'nice','thin', 'ex_n',
          'ex3', 'shift', 'border']:
    if k in options:
        options[k] = int( options[k] )

for k in ['debug', 'verbose', 'cast', 'split', 'shuffle', 'shift', 'heavy',
          'solvent', 'protein']:
    if k in options:
        options[k] = 1
    else:
        options[k] = 0

for k in ['chains','ex1', 'ex2', 'ex']:
    if k in options:
        options[k] = t.toIntList( options[k] )

if 'atoms' in options:
    options['atoms'] = t.toList( options['atoms'] )

if 'ex1' in options and 'ex2' in options:
    options['ex'] = ( options['ex1'], options['ex2'] )
else:
    options['ex'] = options.get( 'ex', options.get('ex1', None) )

if 'log' in options:
    options['log'] = LogFile( options['log'] )

f_in = options['i']
del options['i']