pyemma.coordinates.source

pyemma.coordinates.source(inp, features=None, top=None, chunk_size=100)

Wraps input as data source for pipeline.

Use this function to construct the first stage of a data processing pipeline().

Parameters:
  • inp (str (file name) or ndarray or list of strings (file names) or list of ndarrays) –

    The inp file names or input data. Can be given in any of these ways:

    1. File name of a single trajectory. It can have any of the molecular dynamics trajectory formats or raw data formats specified in load().
    2. List of trajectory file names. It can have any of the molecular dynamics trajectory formats or raw data formats specified in load().
    3. Molecular dynamics trajectory in memory as a numpy array of shape (T, N, 3) with T time steps, N atoms each having three (x,y,z) spatial coordinates.
    4. List of molecular dynamics trajectories in memory, each given as a numpy array of shape (T_i, N, 3), where trajectory i has T_i time steps and all trajectories have shape (N, 3).
    5. Trajectory of some features or order parameters in memory as a numpy array of shape (T, N) with T time steps and N dimensions.
    6. List of trajectories of some features or order parameters in memory, each given as a numpy array of shape (T_i, N), where trajectory i has T_i time steps and all trajectories have N dimensions.
    7. List of NumPy array files (.npy) of shape (T, N). Note these arrays are not being loaded completely, but mapped into memory (read-only).
    8. List of tabulated ASCII files of shape (T, N).
  • features (MDFeaturizer, optional, default = None) – a featurizer object specifying how molecular dynamics files should be read (e.g. intramolecular distances, angles, dihedrals, etc). This parameter only makes sense if the input comes in the form of molecular dynamics trajectories or data, and will otherwise create a warning and have no effect
  • top (str, optional, default = None) – A topology file name. This is needed when molecular dynamics trajectories are given and no featurizer is given. In this case, only the Cartesian coordinates will be read.
  • chunk_size (int, optional, default = 100) – The chunk size at which the input file is being processed.
Returns:

reader obj – 1. FeatureReader for MD-data 2. NumPyFileReader for .npy files 3. PyCSVReader for csv files. 4. DataInMemory for already loaded data (e.g NumPy arrays)

Return type:

type depends on input data

See also

pyemma.coordinates.pipeline()
The data input is the first stage for your pipeline. Add other stages to it and build a pipeline to analyze big data in streaming mode.