carta
pymvpa2-select(1)

pymvpa2-select1

Select a subset of samples and/or features from a dataset

Usage

pymvpa2 select [--version] [-h] -i DATASET [DATASET ...] [{--samples-by-index IDX [IDX ...] | --samples-by-attr EXPR [EXPR ...]}] [{--features-by-index IDX [IDX ...] | --features-by-attr EXPR [EXPR ...]}] [--strip-sa ATTR [ATTR ...]] [--strip-fa ATTR [ATTR ...]] [--strip-da ATTR [ATTR ...]] -o OUTPUT [--hdf5-compression TYPE]

Overview

Select a subset of samples and/or features from a dataset

A subset of samples and/or feature can be selected by their indices (see --samples/features-by-index) or via simple expressions evaluating attribute value (see --samples/features-by-attr). It is possible to specify options for selecting samples and features simultaneously. It is also possible to strip arbitrary attributes from the output dataset (see --strip-...).

SELECTION BY INDEX

All --...-by-index options accept a sequence of integer indices. Alternatively it is possible to specify regular sequences of indices using a START:STOP:STEP notation (zero-based). For example, ':5' selects the first five elements, '2:4' selects the third and fourth element, and ':20:2' selects all even numbered elements from the first 20.

SELECTION BY ATTRIBUTE

All --...by-attr options support a simple expression language that allows for creating filters/masks from attribute values. Such selection expressions are made up of ATTRIBUTE OPERATOR VALUE triplets that can be combined via 'and' or 'or' keywords. For example:

... --samples-by-attr subj eq 5 and run lt 5 or run gt 10

selects all samples where attribute 'subj' equals 5 and the run attribute is either less than 5 or greater than 10. 'and' and 'or' operations are done in strictly serial order (no nested conditions).

Supported operators are:

eq (equal) ne (not equal) ge (greater or equal) le (less or equal) gt (greater than) lt (less than)

Options

--version

show program's version and license information and exit

-h, --help, --help-np

show this help message and exit. --help-np forcefully disables the use of a pager for displaying the help.

-i DATASET [DATASET ...], --input DATASET [DATASET ...]

path(s) to one or more PyMVPA dataset files. All datasets will be merged into a single dataset (vstack'ed) in order of specification. In some cases this option may need to be specified more than once if multiple, but separate, input datasets are required.

Options for selecting samples:

--samples-by-index IDX [IDX ...]

select a subset of samples by index. See section 'SELECTION BY INDEX' for more details.

--samples-by-attr EXPR [EXPR ...]

select a subset of samples by attribute evaluation. See section 'SELECTION BY ATTRIBUTE' for more details.

Options for selecting features:

--features-by-index IDX [IDX ...]

select a subset of features by index. See section 'SELECTION BY INDEX' for more details.

--features-by-attr EXPR [EXPR ...]

select a subset of features by attribute evaluation. See section 'SELECTION BY ATTRIBUTE' for more details.

Options for removing attributes:

--strip-sa ATTR [ATTR ...]

strip one or more samples attributes given by their name from a dataset.

--strip-fa ATTR [ATTR ...]

strip one or more feature attributes given by their name from a dataset.

--strip-da ATTR [ATTR ...]

strip one or more dataset attributes given by their name from a dataset.

Output options:

-o OUTPUT, --output OUTPUT

output filename ('.hdf5' extension is added automatically if necessary). NOTE: The output format is suitable for data exchange between PyMVPA commands, but is not recommended for long-term storage or exchange as its specific content may vary depending on the actual software environment. For long-term storage consider conversion into other data formats (see 'dump' command).

--hdf5-compression TYPE

compression type for HDF5 storage. Available values depend on the specific HDF5 installation. Typical values are: 'gzip', 'lzf', 'szip', or integers from 1 to 9 indicating gzip compression levels.

History

  • Debian 9 (Stretch): the text shown here
  • Debian 8 (Jessie)

Author

Written by Michael Hanke & Yaroslav Halchenko, and numerous other contributors.

From python-mvpa2 2.6.0-1 in Debian 9 (Stretch). Parsed by carta from the page's man source.