lazyslide.tl.RNALinker#
- class RNALinker(agg_features, others, gene_name=None)#
Bases:
objectLink the aggregated WSI features with other omics data.
- Parameters:
- agg_featuresAnnData
The aggregated WSI features
- othersAnnData
Other omics data, like RNA-seq, must have the same number of observations as agg_features.
- gene_namestr, default: None
The key to use for the name of the omics data.
- associate(method='linear_reg', score_key=None, key_added='association_score')#
Associate scores with other omics.
- associated_genes(n_genes=5, gene_name=None)#
Get the top and bottom associated genes.
- plot_rank(n_genes=5, gene_name=None)#
Plot the rank of the association score.
- plot_score(ax=None)#
Plot the score distribution for the score group and others.
- score(groupby, score_group, scale=True, test_method='t-test', n_features=100, key_added=None)#
Score a group of samples based on the aggregated features.
The score will be higher for the score group and lower for the rest.
- Parameters:
- groupbystr
The key in the obs of agg_features.
- score_groupstr
The specific group in the column of groupby to score.
- scalebool, default: True
Scale the features between -1 and 1.
- test_methodstr, default: “t-test”
The method to use for ranking omics features like genes.
- n_featuresint | str, default: 100
The number of features to use for scoring. If “all”, use all features.
- key_addedstr | None, default: None
The key to store the scores in the obs of agg_features. If not specify, f”{score_group}_score” will be added to the obs of agg_features.