FrequencyTable

class FrequencyTable(frequency, skipcols=None, allow_nan=False, **kwargs)[source]

An essential class for handling frequency data.

Constructor for FrequencyTable

Parameters
  • frequency (Union[pandas.core.frame.DataFrame, str]) – Data containing frequency data.

  • skipcols (Union[Sequence[Union[int, str]], str, int]) – Columns to skip when processing data.

  • allow_nan (bool) – Allow NA/NaN values or raise an error.

  • kwargs – Remaining parameters passed to read_csv() or biom loader

Attributes

any_nan

Is there nan values present?

controller

Active essentials controller instance.

data

Pandas dataframe of FrequencyTable

is_buckled

Is current essentials instance is mounted or not.

is_mounted

True if current essentials instance is mounted or not.

metadata

The essential instance metadata.

name

The essential instance name.

shape

Return the shape/size of the essential instance.

xrid

Feature axis.

xsid

Sample axis.

Methods

copy()

Copy of the instance.

drop_features_by_id(ids)

Drop features by ids

drop_features_without_counts()

Drop features that has no counts.

drop_samples_by_id(ids)

Drop samples by ids

export(output_fp, *args[, _add_ext, sep])

Exports the sample metadata content into the specified file.

from_biom(filepath, **kwargs)

Factory method to construct a FrequencyTable from biom file.

from_csv(filepath, **kwargs)

Factory method to construct a FrequencyTable from CSV file.

get_feature_ids([dtype])

This function and its sample twin is a rescue method to fix RepPhylogeny index problem.

get_sample_ids([dtype])

This function and its sample twin is a rescue method to fix RepPhylogeny index problem.

get_subset([rids, sids])

Get subset of the FrequencyTable.

merge_features_by_map(mapping[, aggfunc])

Merge features by mapping

merge_samples_by_map(mapping[, aggfunc])

Merge samples by mapping

rename_samples(mapper)

Rename sample names.

replace_nan_with(value)

Replace NaN values with value.

transform_to_relative_abundance()

Transform absolute counts to relative.