コード例 #1
0
def test_Index_Atomlist_2_Index():
    global gro_file
    atom_list = GRO.Get_Atom_list(gro_file)
    index_list = Index.Atomlist_2_Index(atom_list)
    Index.Print_Index(index_list)
コード例 #2
0
            pass
    if not os.path.isfile(traj_file):
        print "the trajectory file %s is not exist." %traj_file
        sys.exit(0)

    if not os.path.isfile(coor_file):
        print "the structure file %s is not exist." %coor_file
        sys.exit(0)

    if out_coor_file[-4:] not in [".pdb",".gro"]:
        print "error: the output structure must *.pdb or *.gro."
        sys.exit(0)
    
    if not os.path.isfile(index_file):
        atom_list=Simple_atom.Get_Simple_atom_list(coor_file)
        index_list=Index.Atomlist_2_Index(atom_list)
    else:
        index_list=Index.Read_index_to_Inclass(index_file)

    Index.Print_Index(index_list)
    group_ID=raw_input("Choose a group: ")
    try:
        atom_list=index_list[int(group_ID)].group_list
    except:
        print "error"
        sys.exit()
    Traj.Traj_2_coor(coor_file, traj_file, out_coor_file, atom_list, skip)

def Usage():
    print "Usage: Trjconv -p <coor_file> -f <traj_file> -n <index_file> -o <coor_file> --skip num"
    print ""