else: file_label = args.fl if args.data == '': data_filename = 'n_contacts_{}.txt'.format(file_label) else: data_filename = args.data main_plot_data(data_filename, sys_path, system, args.lipid, args.fitting, args.annotations, n_monomers, nres_monomer, file_label) parser = argparse.ArgumentParser(description='Run n contacts on each modularity network', formatter_class=argparse.ArgumentDefaultsHelpFormatter) subparsers = parser.add_subparsers() parser_data = subparsers.add_parser('data', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser_data.add_argument('-sys', help='system name - used to fetch gro and xtc filenames, and nprot, and nframes', choices=files_dict.keys(), default='none') parser_data.add_argument('-p', help='protein name - used to fetch nresm and nmono and protseq', choices=protein_info.keys(), default='Kir2.2_3spi') parser_data.add_argument('-reslist',default='all', help='''reslist should be input in the format: 1:4,6:9,300,310:333 \n(no spaces, residue ranges are inclusive, \n Residue numbering starts at 0 - eg. residue 1 in your gro file is residue 0 when inputting here.)\n OR ALL residues can be specified using: all''') parser_data.add_argument('-syspath', help='system pathname - used to fetch bs info files - can be prespecified in files_dict', default='none') parser_data.add_argument('-f',help='input gro file - can be pre-specified in files_dict', default = 'none') parser_data.add_argument('-x', help='List of xtc files - can be pre-specified in files_dict', nargs='+', default = 'none') parser_data.add_argument('-np',default=1, help='Number of proteins in system - can be pre-specified in files_dict') parser_data.add_argument('-lipid', help='Name of lipid', required=True) parser_data.add_argument('-nframes', type=int, default = 0, help='Number of frames in trajectory - can be pre-specified in files_dict') parser_data.add_argument('-stride', type=int, default = 1, help='Frame number intervals that xtc will be read at') parser_data.add_argument('-lp', default='headgroup', help='Part of lipid to consider in interactions: headgroup or phosphate', choices=lipid_particles.keys()) parser_data.add_argument('-d', type=float, default=6.5, help='Interactions cutoff distance (Angstroms)') #parser.add_argument('-dt', type=int, default=1, help='Number of nanoseconds per frame (once "stride" has been taken into account) - can be pre-specified in files_dict') # parser.add_argument('-permonomer', action='store_true', help='process results separately for each monomer - for this analysis you would not normally specify this') parser_data.add_argument('-nresm', type=int, default = 0, help='number of residues in each prot monomer - can be pre-specified in protein_info')
f.write('unset viewplist\n') f.write('unset fixedlist\n') f.write('mol top $topmol\n') f.write('unset topmol\n') f.write('render Tachyon binding_sites_{}_{} "/sbcb/packages/opt/Linux_x86_64/vmd/1.9.2/lib/vmd/tachyon_LINUXAMD64" -aasamples 12 %s -format TARGA -o %s.tga'.format(system,lipid)) f.close() #nres_monomer=332 #n_monomers=4 #nres_monomer=1328 #n_monomers=1 #gro_filename= '/sansom/s105/bioc1280/Simulations/Kir2_2/sys3_3SPI/exchange_lipids1/test_em_1x1_10ns.gro' print 'Use: system, lipid, protein, gro_filename, permonomer, fitting <list of modularity network file indexes>' print 'protein can be one of: {}'.format(protein_info.keys()) system = sys.argv[1] lipid = sys.argv[2] protein = sys.argv[3] gro_filename = sys.argv[4] permonomer = bool(int(sys.argv[5])) fitting = sys.argv[6] #option to supply annotations as list of numbers if already know the order you want these to load in if len(sys.argv) > 7: annotations_list = sys.argv[7:] else: annotations_list = [] nres_monomer = len(protein_info[protein]['protein_seq']) n_monomers = protein_info[protein]['protein_nmonomers']
parser_ints = subparsers.add_parser( 'cov', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser_ints.add_argument('-f', help='input gro file', required=True) parser_ints.add_argument('-x', help='List of xtc files', nargs='+', required=True) parser_ints.add_argument( '--protlist', default='0', help= '''protlist should be input in the format: 0:4,6:8 (no spaces, index ranges are inclusive) Protein numbering starts at 0)''') parser_ints.add_argument('-p', help='Protein name', choices=protein_info.keys(), required=True) parser_ints.add_argument('-lipid', nargs='+', help='Name of lipid', choices=lipid_particles['headgroup'], required=True) parser_ints.add_argument('-nframes', type=int, default=400, help='Number of frames in trajectory') parser_ints.add_argument( '-stride', type=int, default=1,
f=open('frequencies_dictionary_sumlipids_v2_5'.format(), 'w') f.write('Generated using the command:\npython {}\n'.format(' '.join(sys.argv))) f.write(str(total_interactions)+'\n') f.close() parser = argparse.ArgumentParser(description='Analyse prot-lipid interactions at the residue level', formatter_class=argparse.ArgumentDefaultsHelpFormatter) subparsers = parser.add_subparsers() parser_ints = subparsers.add_parser('get_ints', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser_ints.add_argument('-f',help='input gro file', required=True) parser_ints.add_argument('-x', '--xtc', help='List of xtc files', nargs='+', required=True) parser_ints.add_argument('-reslist',default='all', help='''reslist should be input in the format: 1:4,6:9,300,310:333 (no spaces, residue ranges are inclusive) Residue numbering starts at 1) OR ALL residues can be specified using: all''') parser_ints.add_argument('-p', help='Protein name', choices=protein_info.keys(), required=True) parser_ints.add_argument('-r', '--nrepeats', type=int, help='Number of protein MONOMERS in system', required=True) parser_ints.add_argument('-lipid', help='Name of lipid', choices=lipid_particles['headgroup'], required=True) parser_ints.add_argument('-stride', type=int, default = 1, help='Frame number intervals that xtc will be read at') parser_ints.add_argument('-lp', '--lipid_part', default='headgroup', help='Part of lipid to consider in interactions', choices=lipid_particles.keys()) parser_ints.add_argument('-c', default='centroid', help='Part of protein to measure lipid distances from, for first approximation - can be either "centroid" for protein centroid, or an integer residue number (residue numbering starts from 1)') parser_ints.add_argument('-cd', type = float, default=80, help='Distance away from protein to select lipids that will undergo a closer inspection (a lower number speeds the script up, but too low may mean that some lipids aren\'t considered') parser_ints.add_argument('-d', '--cutoff', type=float, default=6.5, help='Interactions cutoff distance') parser_ints.set_defaults(func=get_ints) parser_pff = subparsers.add_parser('plot_ff', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser_pff.add_argument('-reslist',default='all', help='''reslist should be input in the format: 1:4,6:9,300,310:333 (no spaces, residue ranges are inclusive - Residue numbering starts at 1) OR ALL residues can be specified using: all''') parser_pff.add_argument('-i',help='Interaction file - can take multiple and display on one bar chart', nargs='+') parser_pff.add_argument('-s',help='list of systems (to give edge colour)', nargs='+')