示例#1
0
                          bead_label_list=[label_lists],
                          molecule_types=molecule_types)

cg_trj.save(output_dir + output_traj)
cg_trj[0].save(output_dir + output_top)

#actual map command
cg_id_trj = cg.map_identical_molecules(trj=trj,
                                       selection_list=name_lists,
                                       bead_label_list=label_lists)

cg_id_trj.save(output_dir + output_id_traj)
cg_id_trj[0].save(output_dir + output_id_top)

############################### check results ###############################
# reloading results from disk.

cg_traj = cg_trj.load(output_dir + output_traj, top=output_dir + output_top)
cg_id_traj = cg_trj.load(output_dir + output_id_traj,
                         top=output_dir + output_id_top)

ref_cg_traj = cg_trj.load(reference_dir + reference_traj,
                          top=reference_dir + reference_top)

result = check.md_content_equality(cg_traj, ref_cg_traj)

result_general = check.md_content_equality(cg_traj, ref_cg_traj)
result_id = check.md_content_equality(cg_id_traj, ref_cg_traj)

sys.exit(check.check_result_to_exitval(result_general & result_id))
              for mapping_list in mapping_atom_names_system]

############################### run ########################################

### pull in trajectories
trj = md.load(input_dir + input_traj, top=input_dir + input_top)

#the types of each molecule in the trajectory.
molecule_types = [lipid_types.index(r.name) for r in trj.top.residues]

#actual map command
cg_trj = cg.map_molecules(trj=trj,
                          selection_list=name_lists,
                          bead_label_list=label_lists,
                          molecule_types=molecule_types,
                          transfer_labels=True)

cg_trj.save(output_dir + output_traj)
cg_trj[0].save(output_dir + output_top)

############################### check results ###############################
# reloading results from disk.

cg_traj = cg_trj.load(output_dir + output_traj, top=output_dir + output_top)
ref_cg_traj = cg_trj.load(reference_dir + reference_traj,
                          top=reference_dir + reference_top)

result = check.md_content_equality(cg_traj, ref_cg_traj)

sys.exit(check.check_result_to_exitval(result))
示例#3
0
#preprocess trajectory content by adding new parts
for a in trj.top.atoms: a.element = Element.getBySymbol('H')

#actual map command
cg_trj = cg.map_molecules(            trj = trj,
                           selection_list = [ name_lists  ], 
                          bead_label_list = [ label_lists ], 
                           molecule_types = molecule_types,
                         mapping_function = 'com')

cg_trj.save(output_dir + output_traj_null_mass) 
cg_trj[0].save(output_dir + output_top_null_mass)

############################### check results ###############################
# reloading results from disk.

cg_traj_null_mass = cg_trj.load(output_dir + output_traj_null_mass,
                                top=output_dir + output_top_null_mass) 

cg_traj_native = cg_trj.load(output_dir + output_traj_native,
                             top=output_dir + output_top_native) 

ref_cg_traj = cg_trj.load(reference_dir + reference_traj,
                          top=reference_dir + reference_top) 

result_null   = check.md_content_equality(cg_traj_null_mass,ref_cg_traj)
result_native = check.md_content_equality(cg_traj_null_mass,ref_cg_traj)

sys.exit(check.check_result_to_exitval(result_null & result_native))