nichesphere.comm.lr_ctPairScores_perCat_dir#
- nichesphere.comm.lr_ctPairScores_perCat_dir(ccommTable, db, dbCatCol, dbMatchCol, ccommMatchCol, ccommLRscoresCol, oneCTinteractions, condition, pairCatDF)#
Calculate cell communication scores per ligand category from a database
- Parameters:
ccommTable (pd.DataFrame) – Condition specific cell - cell communication table (output from CrossTalkeR)
db (pd.DataFrame) – database table with information about element (ligand or receptor or both) category (eg: biological processes)
dbCatCol (str) – column in the database table containing the category (eg: biological process) with which the ligands/receptors/LR pairs are associated
dbMatchCol (str) – column in the database table containing the elements (ligands/receptors/LR pairs) associated to the categories
ccommMatchCol (str) – column in the ccommTable table containing the elements (ligands/receptors/LR pairs) associated to the categories
ccommLRscoresCol (str) – name of the ccommTable column where the LR scores are (usually ‘MeanLR’ for CrossTalkeR)
oneCTinteractions (list) – list of single cell interactions (celltype@celltype)
condition (str) – name of the analyzed condition (a column with this string will be added to the resulting table)
pairCatDF (pd.DataFrame) – dataframe of cell pairs and corresponding co-localization niche pairs
- Returns:
CTpairScores_byCat – cell communication table with new columns ‘cell_pairs’, ‘niche_pairs’, ‘LRcat’ and ‘condition’
- Return type:
pd.DataFrame