Load Data

RNA-seq

Available in the supplementary material from Warner AD, Gevirtzman L, Hillier LW, Ewing B, Waterston RH. The C. elegans embryonic transcriptome with tissue, time, and alternative splicing resolution. Genome Res. 2019 Jun;29(6):1036-1045. doi: 10.1101/gr.243394.118.: https://genome.cshlp.org/content/suppl/2019/05/14/gr.243394.118.DC1/Supplemental_Table_S22.txt

Ligand-Receptor pairs

Specify columns containing ligands and receptors

Keep LR pairs that are present in the RNAseq dataset

Filter LR pairs by functions. Keep Wnt, TGF-B, Hedgehog and Notch signalings.

Generate a dictionary with function info for each LR pairs. Keys are ligand_name^receptor_name and values are the function in the LR Function column in the dataframe containing ligand-receptor pairs.

Metadata

Names for different time points and tissues. Later used for naming elements in respective orders/dimensions of the tensor.

Data Preprocessing

Log1p transform RNA-seq data

Generate list of condition-specific expression matrices

Analysis

Build 4D-Communication Tensor

how='inner' is used to keep only cell types that are across all samples/patients.

upper_letter_comparison is used to integrate list of LR pairs and gene expression matrix. Since here we are sure that both dataframes use exactly the same gene symbols, we disabled this option and avoided using all capital leters in their names.

Generate a list containing metadata for each tensor order/dimension - Later used for coloring factor plots

Elbow analysis for selecting Rank for Tensor-Factorization

Perform tensor factorization

Plot Factors

Colors for metadatas

Top-5 LR pairs for each factor

Export All Loadings