コード例 #1
0
ファイル: tICA.py プロジェクト: RobertArbon/AADH_Analysis
def load_metadata(traj_dir, top):
    """
    Loads metadata of features and saves them.

    :param traj_dir: directory containing trajectories
    :param top: topology file name
    :return: metadata data frame
    """
    re_pattern = '(\w+)-([0-9]{3})k-([0-9])atm-prod([0-9]+\.[0-9]+).*BT([0-9]+)*'
    captured_group_names = [
        'PDB', 'Temp', 'Pressure', 'Prod_Round', 'Act_Site'
    ]
    captured_group_transforms = [identity, float, float, identity, int]
    time_step = 1  # in picoseconds
    file_type = 'dcd'

    parser = GenericParser(re_pattern,
                           group_names=captured_group_names,
                           group_transforms=captured_group_transforms,
                           top_fn=top,
                           step_ps=time_step)
    meta = gather_metadata(os.path.join(traj_dir, "*.{}".format(file_type)),
                           parser)
    save_meta(meta)
    return meta
コード例 #2
0
"""Find trajectories and associated metadata

msmbuilder autogenerated template version 2
created 2017-05-30T15:16:59.066163
please cite msmbuilder in any publications


"""

from msmbuilder.io import gather_metadata, save_meta, NumberedRunsParser

## Construct and save the dataframe
parser = NumberedRunsParser(
    traj_fmt="trajectory-{run}.xtc",
    top_fn="top.pdb",
    step_ps=50,
)
meta = gather_metadata("trajs/*.xtc", parser)
save_meta(meta)
コード例 #3
0
"""Find trajectories and associated metadata

{{header}}

Meta
----
depends:
  - trajs
  - top.pdb
"""

from msmbuilder.io import gather_metadata, save_meta, NumberedRunsParser

## Construct and save the dataframe
parser = NumberedRunsParser(
    traj_fmt="trajectory-{run}.xtc",
    top_fn="top.pdb",
    step_ps=50,
)
meta = gather_metadata("trajs/*.xtc", parser)
save_meta(meta)