rectanglepy.pp.RectangleSignatureResult¶
- class rectanglepy.pp.RectangleSignatureResult(signature_genes, bias_factors, pseudobulk_sig_cpm, marker_genes_per_cell_type, optimization_result=None, clustered_pseudobulk_sig_cpm=None, clustered_bias_factors=None, marker_genes_per_cluster=None, clustered_signature_genes=None, cluster_assignments=None, unkn_gene_corr=None, unkn_bulk_err=None)¶
Represents the result of a rectangle signature analysis (Created by the method pp.build_rectangle_signatures).
- Parameters:
signature_genes – The signature genes as a pd.Series.
bias_factors – The mRNA bias factors associated with each cell type.
pseudobulk_sig_cpm – The pseudo bulk signature build from the single cell data, contains all genes. Normalized to CPM. Columns are cell types, rows are genes.
clustered_pseudobulk_sig_cpm (default:
None) – The clustered pseudo bulk signature build from the single cell data, contains all genes. Normalized to CPM. Columns are cell types, rows are genes.clustered_bias_factors (default:
None) – The bias factors associated with each cell type cluster.cluster_assignments (default:
None) – The assignments of signature cell-types to clusters, as a list of ints or strings. In the same order as the pseudobulk_sig_cpm columns.marker_genes_per_cell_type – The number of marker genes per cell type, as a dictionary. Keys are cell type names, values are the number of marker genes.
optimization_result (default:
None) – The result of the p lfc cut off optimization, as a pd.DataFrame. Contains the following columns: p, lfc, pearson_r, rsmeunkn_gene_corr (default:
None) – A Dataframe that contains the correlation of the estimated unknown cell content with the gene expression in the bulk samples, and the correlation of the estimated unknown cell content with the bulk error.unkn_bulk_err (default:
None) – The result of ‘bulk - bulk_est’ for the reconstructed bulk used to calculate the unknown cell type content.
Methods table¶
|
Calculates the signature matrix by multiplying the pseudobulk_sig_cpm DataFrame subset by signature_genes and the bias_factors Series. |
Methods¶
- RectangleSignatureResult.get_signature_matrix(include_mrna_bias=True)¶
Calculates the signature matrix by multiplying the pseudobulk_sig_cpm DataFrame subset by signature_genes and the bias_factors Series.
- Parameters:
include_mrna_bias (default:
True) – If True, the method includes mRNA bias in the calculation. Defaults to True.- Return type:
DataFrame- Returns:
pandas.DataFrame: The signature matrix. Where columns are cell types and rows are genes.