ecotyper.io¶
Readers for EcoTyper’s user-facing inputs and conversion to AnnData.
The readers reproduce how the R scripts read the same files (read.delim
for bulk/Visium matrices and annotations, data.table::fread for scRNA-seq
matrices), including R’s number parsers, so that a Python run starts from
bit-identical values.
Functions
|
|
|
AnnData → genes x samples DataFrame (dense). |
|
|
|
|
|
CIBERSORTx fractions ( |
|
|
|
Genes x samples DataFrame (+ annotation with an |
- ecotyper.io.read_bulk_matrix(path)[source]¶
read.delim(path); rownames(data) = data[,1]; data = data[,-1].Returns a genes x samples DataFrame; sample names go through
make.namesas in R (check.names = TRUE).- Return type:
- ecotyper.io.read_scrna_matrix(path)[source]¶
fread(path, data.table = F), then drop NA and duplicated gene names (read_scRNAin lib/scRNA.R). Column names are kept verbatim.- Return type:
- ecotyper.io.read_annotation(path)[source]¶
read.delim(annotation);Noneifpathis None/”NULL”/missing.- Return type:
DataFrame | None
- ecotyper.io.read_fractions(path)[source]¶
CIBERSORTx fractions (
read_fractionsin lib/misc.R): columns up to (excluding)P.valueare kept.- Return type:
- ecotyper.io.to_anndata(expr, annotation=None)[source]¶
Genes x samples DataFrame (+ annotation with an
IDcolumn) → AnnData with samples/cells asobsand genes asvar.