IO (read/write)
scyan.read_fcs(path, marker_regex='^cd|^hla|epcam|^ccr', exclude_markers=None, channel_suffix='S')
Read a FCS file and return an AnnData
object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
str
|
Path to the FCS file that has to be read. |
required |
marker_regex |
str
|
Regex used to find which columns correspond to markers. By default, it targets strings that starts with |
'^cd|^hla|epcam|^ccr'
|
exclude_markers |
Optional[List[str]]
|
Optional list of channel names that has to be considered as an observation (i.e., inside |
None
|
channel_suffix |
Optional[str]
|
Suffix for the channel naming convention, i.e. |
'S'
|
Returns:
Type | Description |
---|---|
AnnData
|
|
Source code in scyan/_io.py
scyan.read_csv(path, marker_regex='^cd|^hla|epcam|^ccr', exclude_markers=None, **pandas_kwargs)
Read a CSV file and return an AnnData
object.
Note
It tries to infer which columns are markers by checking which columns contain one of these: CD, HLA, CCR, EPCAM, CADM, SIGLEC. Though, if it didn't select the right markers, you can help it by providing extra_marker_names
or remove_marker_names
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
str
|
Path to the CSV file that has to be read. |
required |
marker_regex |
str
|
Regex used to find which columns correspond to markers. By default, it targets strings that starts with |
'^cd|^hla|epcam|^ccr'
|
exclude_markers |
Optional[List[str]]
|
Optional list of channel names that has to be considered as an observation (i.e., inside |
None
|
**pandas_kwargs |
int
|
Optional kwargs for |
{}
|
Returns:
Type | Description |
---|---|
AnnData
|
|
Source code in scyan/_io.py
scyan.write_fcs(adata, path, layer=None, columns_to_numeric=None, **fcswrite_kwargs)
Based on a AnnData
object, it writes a FCS file that contains (i) all the markers intensities, (ii) every numeric column of adata.obs
, and (iii) all adata.obsm
variables.
Note
As the FCS format doesn't support strings, some observations will not be kept in the FCS file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adata |
AnnData
|
|
required |
path |
str
|
Path to write the file. |
required |
layer |
Optional[str]
|
Name of the |
None
|
columns_to_numeric |
Optional[List]
|
List of non-numerical column names from |
None
|
**fcswrite_kwargs |
int
|
Optional kwargs provided to |
{}
|
Returns:
Type | Description |
---|---|
Union[None, Dict]
|
If |
Source code in scyan/_io.py
scyan.write_csv(adata, path, layer=None)
Based on a AnnData
object, it writes a CSV file that contains (i) all the markers intensities, (ii) every numeric column of adata.obs
, and (iii) all adata.obsm
variables.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adata |
AnnData
|
|
required |
path |
str
|
Path to write the file. |
required |
layer |
Optional[str]
|
Name of the |
None
|