skbio.metadata.SampleMetadata.load#

classmethod SampleMetadata.load(filepath, column_types=None, column_missing_schemes=None, default_missing_scheme='blank')[source]#

Load a TSV metadata file.

The TSV metadata file format is described at https://docs.qiime2.org in the Metadata Tutorial.

Parameters:
filepathstr

Path to TSV metadata file to be loaded.

column_typesdict, optional

Override metadata column types specified or inferred in the file. This is a dict mapping column names (str) to column types (str). Valid column types are ‘categorical’ and ‘numeric’. Column names may be omitted from this dict to use the column types read from the file.

column_missing_schemesdict, optional

Override the metadata column handling for missing values described in the file. This is a dict mapping column names (str) to missing-value schemes (str). Valid values are ‘blank’, ‘no-missing’, and ‘INSDC:missing’. Column names may be omitted.

default_missing_schemestr, optional

The missing scheme to use when none has been provided in the file or in column_missing_schemes.

Returns:
Metadata

Metadata object loaded from filepath.

Raises:
MetadataFileError

If the metadata file is invalid in any way (e.g. doesn’t meet the file format’s requirements).

See also

save