ColumnMapper
Abstract superclass for all Column Mapper classes, each of which applies a specific strategy to extracting HPO terms from columns of tables (e.g., supplemental files) representing cohorts of individuals with a given disease.
Source code in pyphetools/creation/column_mapper.py
__init__(column_name)
Constructor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
column_name
|
str
|
name of the column in the pandas DataFrame |
required |
is_valid_iso8601(cell_contents)
staticmethod
Check for a match with iso8601 age (period)
returns true for strings such as P6Y, P2M, P42Y1M2W1D etc.
Returns:
Type | Description |
---|---|
bool
|
true iff the cell_contents represent an iso8601 age |
Source code in pyphetools/creation/column_mapper.py
map_cell(cell_contents)
abstractmethod
preview_column(df)
abstractmethod
Show a preview of the entire column for review purposes
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df
|
DataFrame
|
the pandas DataFrame that contains the column (self._column_name) |
required |