import_character_matrix
Import a character-matrix CSV to create a TreeData object for lineage reconstruction. The CSV must contain cell IDs and integer character states with sentinel values for missing and unmodified states.
Instructions
Import a character-matrix CSV into a new TreeData, ready for reconstruction.
The CSV must have cell ids in the first column and one column per character;
integer states, with missing_state for dropout and unmodified_state for
the uncut state. The matrix is stored in obsm[characters_key].
Args: csv_path: Absolute path to the character-matrix CSV. characters_key: obsm key to store the matrix under (default "characters"). missing_state: Sentinel for missing/dropout entries (default -1). unmodified_state: Sentinel for the uncut/unmodified state (default 0).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"csv_path": "<csv_path>"
},
"name": "import_character_matrix"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| csv_path | Yes | ||
| missing_state | No | ||
| characters_key | No | characters | |
| unmodified_state | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n_obs | Yes | Number of observations (cells/leaves). | |
| trees | No | Keys in tdata.obst. | |
| layers | No | ||
| n_vars | Yes | Number of variables (e.g. genes). | |
| source | No | Origin path or generator. | |
| uns_keys | No | ||
| obsm_keys | No | ||
| dataset_id | Yes | ||
| obs_columns | No |