Exemple #1
0
            pass
        else:
            ns_new.basepairs.append(ni)
        add1 = False
        add2 = False

    # BaseStacks
    add1 = False
    add2 = False
    for ni in ns.basestacks:
        if ni.iunit1 == target:
            if ni.imp1un in aln:
                ni.imp1un = aln[ni.imp1un]
                add1 = True
        if ni.iunit2 == target:
            if ni.imp2un in aln:
                ni.imp2un = aln[ni.imp2un]
                add2 = True
        if ((ni.iunit1 == target and not add1)
                or (ni.iunit2 == target and not add2)):
            pass
        else:
            ns_new.basestacks.append(ni)
        add1 = False
        add2 = False

    out_ninfo = NinfoFile(sys.argv[5])
    out_ninfo.open_to_write()
    out_ninfo.write_all(ns_new)
    out_ninfo.close()
#!/usr/bin/env python

import sys
from cafysis.file_io.ninfo import NinfoFile
from cafysis.elements.ninfo import NinfoSet

if len(sys.argv) != 3:
    print ('Usage: SCRIPT [input ninfo] [output ninfo]')
    sys.exit(2)

ninfo = NinfoFile(sys.argv[1])
ninfo.open_to_read()
ns = NinfoSet()
ninfo.read_all(ns)
ninfo.close()

ns.update_info()
ns.sort_by_mp()
ns.reassign_id()

ninfo = NinfoFile(sys.argv[-1])
ninfo.open_to_write()
ninfo.write_all(ns)
ninfo.close()
Exemple #3
0
            dih2_iunit2=seq_2,
            dih2_imp1un=imp_1_un,
            dih2_imp2un=imp_2_un,
            dih2_imp3un=imp_4_un,
            dih2_imp4un=imp_6_un,
            dih2_native=dih2_native,
            dih2_coef=CHT18.HB_DIH_CHAIN,
        )

        ns.hbondDTs.append(hb)

    ###########################
    ## Generate ninfo file   ##
    ###########################
    nf = NinfoFile(args.outfile)
    nf.open_to_write()
    nf.write_all(ns)
    nf.close()

    ###################################
    ## Generate exv file (optional)  ##
    ###################################
    if args.exvfile:
        n_sep_nlocal_P = 3
        n_sep_nlocal_S = 3
        n_sep_nlocal_B = 2

        if args.end5 == 'P':
            nmp = 3 * n_nt
        else:
            nmp = 3 * n_nt - 1
Exemple #4
0
    if len(sys.argv) != 10:
        print(
            'Usage: SCRIPT [ninfo (one-by-one)] [unit] [dist] [side] [unit] [dist] [side] [edc (post_edc.out)] [out]'
        )
        print('')
        sys.exit(2)

    fninfo_in = NinfoFile(sys.argv[1])
    fninfo_in.open_to_read()
    ns = NinfoSet()
    fninfo_in.read_all(ns)
    ns.update_info()
    fninfo_in.close()

    fninfo_out = NinfoFile(sys.argv[-1])
    fninfo_out.open_to_write()

    unit_aln1 = int(sys.argv[2])
    aln1 = {}
    side = int(sys.argv[4])
    for line in open(sys.argv[3]):
        linesp = line.split()
        res1 = int(linesp[0])  # Dunkle res
        mp1 = int(linesp[1])  # Dunkle mp
        res2 = int(linesp[2])  # Jenner res
        mp2 = int(linesp[3])  # Jenner mp
        #linesp[4] # dist
        if side == 1:
            aln1[mp1] = mp2
        elif side == 2:
            aln1[mp2] = mp1
Exemple #5
0
        'Usage: SCRIPT [ninfo file] [edc file] [dist(aln) file] [factor] [output ninfo file]'
    )
    sys.exit(2)

f_ninfo = NinfoFile(sys.argv[1])
f_edc = open(sys.argv[2], 'r')
f_dist = open(sys.argv[3], 'r')
factor = float(sys.argv[4])
f_out_ninfo = NinfoFile(sys.argv[-1])

f_ninfo.open_to_read()
ninfo = NinfoSet()
f_ninfo.read_all(ninfo)
f_ninfo.close()

f_out_ninfo.open_to_write()
f_out_ninfo._file.write('#0: ' + sys.argv[0] + '\n')
f_out_ninfo._file.write('#1: ' + sys.argv[1] + '\n')
f_out_ninfo._file.write('#2: ' + sys.argv[2] + '\n')
f_out_ninfo._file.write('#3: ' + sys.argv[3] + '\n')
f_out_ninfo._file.write('#4: ' + sys.argv[4] + '\n')
f_out_ninfo._file.write('#5: ' + sys.argv[5] + '\n')

aln = {}
# Read from dist file
'''
# Jenner        Dunkle
# res    mp     res   mp    dist
     1      1     4     11   1.55
     1      2     4     12   8.02
     2      3     5     13   0.93
            imp2_offset += c2.num_res()
            
        imp1_offset += c1.num_res()
    return


if __name__ == '__main__':
    import sys
    if len(sys.argv) != 3:
        print ('Usage: %SCRIPT [input PDB] [output ninfo]')
        sys.exit(2)

    from cafysis.file_io.pdb import PdbFile
    from cafysis.file_io.ninfo import NinfoFile
    from cafysis.elements.ninfo import NinfoSet

    f = PdbFile(sys.argv[1])
    f.open_to_read()
    chains = f.read_all()
    f.close()

    ns = NinfoSet()
    generate_FENEs(chains, ns)
    generate_LJs(chains, ns)

    f_ninfo = NinfoFile(sys.argv[-1])
    f_ninfo.open_to_write()
    f_ninfo.write_all(ns)
    f_ninfo.close()

Exemple #7
0
@author: Naoto Hori
'''

import sys
from cafysis.file_io.ninfo import NinfoFile
from cafysis.elements.ninfo import NinfoSet

if __name__ == '__main__':
    if len(sys.argv) != 3:
        print('Usage: %SCRIPT [input ninfo file] [output prefix]')
        sys.exit(2)

    file_ninfo = NinfoFile(sys.argv[1])
    file_ninfo.open_to_read()
    ns = NinfoSet()
    file_ninfo.read_all(ns)
    ns.update_info()
    file_ninfo.close()

    prefix = sys.argv[2]

    ndi = ns.dict_of_ninfoset_by_unit()
    for i in range(1, ns.max_unit + 1):
        for j in range(i, ns.max_unit + 1):
            if ndi[(i, j)].max_unit != 0:
                file_out = NinfoFile(prefix + '%03i_%03i.ninfo' % (i, j))
                file_out.open_to_write()
                file_out.write_all(ndi[(i, j)])
                #file_out.write_unit(ns, i, j)
                file_out.close()