Spatial cartography of human thymus enables the geopositioning of lineage transcription factors in rare mimetic thymic epithelial cells.
The 15 matches
- [1] § Method › Integration of spatial clusters across samples ↔ 2.DefineNiche/integrate_niches_functions.ipynb, lines 108–256 · score 0.98 · pyCombat, batch corrected, pseudobulk profiles, COL1A2, MS4A1, CD8A
- [2] § Method › Signalling pathways ↔ 3.CellCommunication/run_cellularCommunication.ipynb, lines 33–181 · score 0.86 · truncatedMean, cell communication, incoming, outgoing, probability, CellChat
- [3] § Method › Integration of spatial clusters across samples ↔ 1.ProcessSamples/scRNA_integrate.Rmd, lines 739–861 · score 0.85 · COL1A1, CD8A, FOXP3, IGHM, MKI67, TPSAB1
- [4] § Method › Spatial cell type annotation ↔ 2.DefineNiche/integrate_niches_functions.ipynb, lines 536–652 · score 0.84 · expressed genes identified, combined known cell, gene score, integrated fetal, 0–1, scRNA
- [5] § Method › Signalling pathways ↔ 1.ProcessSamples/scRNA_integrate.Rmd, lines 1228–1337 · score 0.81 · CellChat, communication probability, cell communication, incoming, outgoing, signals
- [6] § Method › Differential GO function ↔ 2.DefineNiche/integrate_niches_functions.ipynb, lines 776–797 · score 0.77 · GO_Biological_Process_2023, drug2cell, gene ontology
- [7] § Results › Thymus architecture and geopositioning of cell types ↔ 2.DefineNiche/integrate_niches_functions.ipynb, lines 108–256 · score 0.72 · PCA transformation, batch corrected, COL1A2, VWF, gene expression, CD34
- [8] § Method › sn/scRNA-seq integration with public data ↔ 1.ProcessSamples/scRNA_integrate.Rmd, lines 105–187 · score 0.69 · FindIntegrationAnchors, FindAllMarkers, UMAP, Seurat, sc, seq
- [9] § Results › Thymus architecture and geopositioning of cell types ↔ 2.DefineNiche/integrate_niches_functions.ipynb, lines 536–652 · score 0.69 · mTEC, known cell, spatial spot, expressed genes, scRNA, DP
- [10] § Results › High-resolution spatial transcriptomic atlas of human thymus ↔ 2.DefineNiche/integrate_niches_functions.ipynb, lines 654–720 · score 0.67 · COL1A2, MS4A1, CD8A, CD83, CD14, CD34
- [11] § Method › sc/snRNA-seq data processing ↔ 1.ProcessSamples/scRNA_integrate.Rmd, lines 33–100 · score 0.57 · SCTransform, Seurat, filtered, UMAP, RNA, PCA
- [12] § Method › Identification of mimeTFs in spatial multiome ↔ 4.MimeTFs/IdentifyMimeTFs.ipynb, lines 237–289 · score 0.55 · CITE spatial, mimeTFs, septa, multiome, protein, Stereo
- [13] § Method › Spatial transcriptomics data processing ↔ 3.CellCommunication/run_cellularCommunication.ipynb, lines 33–181 · score 0.54 · weighted, edge, mouse, diameter, networks, neighbours
- [14] § Results › Cell type mimicking function by mimeTFs expressing TECs ↔ 2.DefineNiche/integrate_niches_functions.ipynb, lines 776–797 · score 0.53 · Gene Ontology, biological processes, GO
- [15] § Results › Abundance and geopositioning of mimeTFs expressing cells ↔ 2.DefineNiche/Integrate_niche_celltype_samples.ipynb, lines 443–465 · score 0.50 · KRT1 high region, HC region, HCs, LQ, niche, spots
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Jupyter notebook · 857 lines · 33 KB · CC-BY-4.0 · 7 matches
- # %% [markdown]
- # # Functions
- # ### 1. integrate spatial samples
- # ### 2. define niches
- # ### 3. determine cell type -> cell-type-specificity score and RCTD
- # %%
- import scanpy as sc
- import networkx as nx
- import pandas as pd
- import matplotlib.pyplot as plt
- import numpy as np
- import h5py
- from anndata._io.specs import read_elem
- import seaborn as sns
- from numpy import inf
- from scipy.interpolate import griddata
- from skimage import measure
- from shapely.geometry import MultiPoint, Polygon
- import alphashape
- import matplotlib.colors as mcol
- import decoupler as dc
- from combat.pycombat import pycombat
- import matplotlib.pyplot as plt
- import matplotlib.colors as mcolors
- from sklearn.cluster import KMeans
- from sklearn import datasets
- from sklearn.decomposition import PCA
- from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
- import h5py
- from anndata._io.specs import read_elem
- import drug2cell as d2c
- import blitzgsea as blitz
- import warnings
- warnings.simplefilter(action='ignore', category=pd.errors.PerformanceWarning)
- warnings.filterwarnings("ignore", category=DeprecationWarning)
- warnings.simplefilter(action='ignore', category=FutureWarning)
- warnings.simplefilter(action='ignore', category=UserWarning)
- import matplotlib
- matplotlib.rcParams['pdf.fonttype'] = 42
- matplotlib.rcParams['ps.fonttype'] = 42
- plt.rcParams['pdf.fonttype'] = 42
- plt.rcParams['ps.fonttype'] = 42
- plt.style.use('seaborn-white')
- # %%
- # Load marker genes
- degenes_annot2 = pd.read_csv("/data/Combined_Analysis/DEG_scRNA-seq.csv", sep=",")
- custom_marker = pd.read_csv("/data/Combined_Analysis/Custom_markers.csv", sep=",")
- # %%
- ## Define colours scheme for the domain and niches
- domain_color = { 'C': '#4292c6',
- 'M':'#fc9272',
- 'S': '#41ab5d',
- 'LQ' : '#f0f0f0'
- }
- niche_color = {'C1': '#9ecae1','C2': '#4292c6','C3': '#08519c', 'M1':'#fc9272', 'M2':'#ef3b2c','M3':'#a50f15',
- 'S1': '#a1d99b','S2': '#74c476', 'S3': '#41ab5d', 'S4': '#006d2c', 'LQ' : '#f0f0f0', 'HC' : '#252525'
- }
- HC_niche_color = {'C1': '#9ecae1','C2': '#4292c6','C3': '#08519c', 'M1':'#fc9272', 'M2':'#ef3b2c','M3':'#a50f15',
- 'S1': '#a1d99b','S2': '#74c476', 'S3': '#41ab5d', 'S4': '#006d2c', 'LQ' : '#f0f0f0', 'KRT1+' : '#6a51a3','KRT1++' : '#3f007d'
- }
- # %%
- # Get pseudo-bulk profile for each leiden cluster within leiden cluster
- def findPseudobulk(adata, adata_raw, sample_name, save_folder, group='leiden'):
- """
- Calculate the pseudo bulk profile of the leiden clusters.
- Parameters:
- adata: spatial data with leiden cluster meta data
- adata_raw: raw counts spatial data
- sample_name: sample name
- save_folder: folder to save the file
- Returns:
- Write the pseudobulk profile to csv file
- """
- adata_raw.obs[group] = adata.obs.leiden
- adata_raw.obs.leiden = adata_raw.obs.leiden.astype('str')
- adata_raw.X = np.round(adata_raw.X)
- adata_raw.layers['raw_counts'] = adata_raw.X
- adata_raw.obs['orig.ident'] = sample_name
- pdata = dc.get_pseudobulk(
- adata_raw,
- sample_col='orig.ident',
- groups_col=group,
- layer='raw_counts',
- mode='sum',
- min_cells=0,
- min_counts=0
- )
- dc.plot_psbulk_samples(pdata, groupby=[group,'orig.ident'], figsize=(8, 4))
- pdata.T.to_df().to_csv(f"{save_folder}" + sample_name + group + '_sumgeneexp.csv')
- adata.obs.to_csv(f"{save_folder}" + sample_name + group + "_meta.csv")
- # %%
- def integrate_pca(df_exp, datasets, target_names, nPC=5, ncluster=20):
- """
- Integrate the sample cluster pseudobulk profiles using PCA
- - pyCombat batch correction
- - PCA transformation
- - Kmeans clustering
- - Plot marker gene expression
- Parameters:
- df_exp: pandas object with normalised
- datasets: list of data to correct for data
- target_names: sample names
- nPC: number of PCs to model
- ncluster: number of resulting groups
- Returns:
- Write the pseudobulk profile to csv file
- df_segment_avgSonly: Average profile of the kmeans group
- df_clusters: Contain sample-wise group information
- """
- batch = []
- for j in range(len(datasets)):
- batch.extend([j for _ in range(len(datasets[j].columns)-1)])
- # run pyComBat
- df_corrected = pycombat(df_exp,batch)
- df_corrected.to_csv(f"{save_folder}Psuedo_batchCorrected.csv")
- plt.boxplot(df_corrected)
- plt.show()
- X = df_corrected.transpose()
- y = np.array(batch)
- plt.style.use('seaborn-white')
- pca = PCA()
- pca.fit(X)
- per_var = np.round(pca.explained_variance_ratio_*100, decimals = 1)
- plt.figure(figsize = (10,6))
- plt.plot(range(1, len(per_var)+1), per_var.cumsum(), marker = "o", linestyle = "--")
- plt.grid()
- plt.ylabel("Percentage Cumulative of Explained Variance")
- plt.xlabel("Number of Components")
- plt.title("Explained Variance by Component")
- plt.show()
- pca = PCA(n_components = nPC)
- pca.fit(X)
- scores_pca = pca.transform(X)
- WCSS = []
- for i in range(1,30):
- kmeans_pca = KMeans(n_clusters = i, init = "k-means++", random_state = 42)
- kmeans_pca.fit(scores_pca)
- WCSS.append(kmeans_pca.inertia_)
- plt.figure(figsize = (10,6))
- plt.plot(range(1,30), WCSS, marker = "o", linestyle = "--")
- plt.grid()
- plt.title("Cluster using PCA Scores")
- plt.ylabel("WCSS")
- plt.xlabel("N Clusters")
- plt.show()
- kmeans_pca = KMeans(n_clusters = ncluster, init = "k-means++", random_state = 42)
- kmeans_pca.fit(scores_pca)
- df = pd.DataFrame(df_corrected.columns)
- # Concatening the original df with the components informations present in scores_pca
- df_clust_pca_kmeans = pd.concat([df, pd.DataFrame(scores_pca)], axis = 1)
- #print(df_clust_pca_kmeans)
- # Renaming the column label from each component
- df_clust_pca_kmeans.columns = ["sample_leiden", "comp1", "comp2", "comp3", "comp4", "comp5"]
- # Seting the cluster label to each observation, using the atribute .labels_
- df_clust_pca_kmeans["segment_kmeans_pca"] = kmeans_pca.labels_
- # Mapping each cluster segmentation and renaming their labels
- df_clust_pca_kmeans["segment"] = df_clust_pca_kmeans["segment_kmeans_pca"]
- df_clust_pca_kmeans.to_csv(f"{save_folder}Sample_psuedo_PCA.csv")
- sns.pairplot(df_clust_pca_kmeans[1:], hue='segment', palette='tab20')
- df_clust_pca_kmeans[['Sample', 'leiden_clusters']] = df_clust_pca_kmeans['sample_leiden'].str.split('_', n=1, expand=True)
- sns.pairplot(df_clust_pca_kmeans[1:], hue='Sample', palette='tab20')
- df_corrected_long = df_corrected.stack().reset_index().set_axis('Genes Sample_leiden avgExp'.split(), axis=1)
- df_corrected_long = pd.merge(df_corrected_long, df_clust_pca_kmeans, left_on='Sample_leiden', right_on='sample_leiden')
- df_corrected_long[['Sample', 'leiden_clusters']] = df_corrected_long['sample_leiden'].str.split('_', n=1, expand=True)
- df_corrected_long['Sample_segment'] = df_corrected_long['Sample'] + df_corrected_long['segment'].astype('str')
- df_segment_avg = df_corrected_long.groupby(['Sample_leiden', 'Genes']).mean('avgExp')
- df_segment_avg = df_segment_avg.reset_index()
- df_segment_avgM = df_segment_avg.pivot(index='Genes', columns='Sample_leiden', values='avgExp')
- sns.clustermap(df_segment_avgM[df_segment_avgM.axes[0].isin(['PRSS16',
- 'AIRE',
- 'COL1A2',
- 'HBB',
- 'CD4', 'CD8A',
- 'MS4A1', 'CD14', 'CD34'
- ])], annot=False, cmap="Reds", figsize=(50,3))
- df_segment_avg= df_corrected_long.groupby(['Sample_segment', 'Genes']).mean('avgExp')
- df_segment_avg = df_segment_avg.reset_index()
- df_segment_avgS = df_segment_avg.pivot(index='Genes', columns='Sample_segment', values='avgExp')
- df_segment_avgS.to_csv('df_segment_avgS.csv')
- sns.clustermap(df_segment_avgS[df_segment_avgS.axes[0].isin(['PRSS16', 'PSMB11','CCL25', 'LY75', 'TBATA',
- 'AIRE', 'FEZF2',
- 'KRT15',
- 'KRT1',
- 'EPCAM',
- 'LAMP3',
- 'ITGAX',
- 'CD74', 'CD83', 'MS4A1', 'CD34', 'VWF', 'COL1A2','CD4', 'CD8A', 'CD14','CDH5',
- 'PECAM1',
- 'HBB',
- 'LUM',
- 'PRX1'
- ])], annot=False, cmap="Reds", figsize=(15,8)).savefig(f"{save_folder}Sample_Segment.pdf")
- df_segment_avgSonly = df_corrected_long.groupby(['segment', 'Genes']).mean('avgExp')
- df_segment_avgSonly = df_segment_avgSonly.reset_index()
- df_segment_avgSonly = df_segment_avgSonly.pivot(index='Genes', columns='segment', values='avgExp')
- df_segment_avgSonly.to_csv(f"{save_folder}df_segment_avgSonlyF.csv")
- df_segment_avgSonly.sum().to_csv(f"{save_folder}segments_sumGenes.csv")
- df_clusters = df_clust_pca_kmeans
- df_clusters[['Sample', 'leiden_clusters']] = df_clusters['sample_leiden'].str.split('_', n=1, expand=True)
- sns.clustermap(df_segment_avgSonly[df_segment_avgSonly.axes[0].isin([
- 'PRSS16', 'PSMB11','CCL25', 'LY75', 'TBATA',
- 'AIRE', 'FEZF2',
- 'KRT15',
- 'KRT1',
- 'EPCAM',
- 'LAMP3',
- 'ITGAX',
- 'CD74', 'CD83', 'MS4A1', 'CD34', 'VWF', 'COL1A2','CD4', 'CD8A', 'CD14','CDH5',
- 'PECAM1',
- 'HBB',
- 'LUM',
- 'PRX1', 'VWF'
- ])], annot=False, cmap="viridis", z_score=True, figsize=(8,8)).savefig(f"{save_folder}Segments_markergenes_long.pdf")
- sns.clustermap(df_segment_avgSonly[df_segment_avgSonly.axes[0].isin(['AIRE',
- 'PRSS16', 'HBB'])], z_score=True, annot=False, cmap="Reds", figsize=(10,2)).savefig(f"{save_folder}Segments_markergenes.pdf")
- return df_segment_avgSonly, df_clusters
- # %%
- def addAnnotation(tmp_adata, Medulla, Cortex, Septa, LowQuality):
- """
- Add annotation based on the cluster/group numbers
- Parameters:
- tmp_adata: spatial data
- Medulla: list of medulla cluster numbers
- Cortex: list of cortex cluster numbers
- Septa: list of septa cluster numbers
- LowQuality: list of LQ cluster numbers
- Returns:
- spatial data with additional meta data
- """
- tmp_adata.obs["Domain"] = "NA"
- x = list(tmp_adata[tmp_adata.obs['segment'].isin(Medulla)].obs_names)
- tmp_adata.obs.loc[ x, 'Domain'] = 'M'
- x = list(tmp_adata[tmp_adata.obs['segment'].isin(Cortex)].obs_names)
- tmp_adata.obs.loc[ x, 'Domain'] = 'C'
- x = list(tmp_adata[tmp_adata.obs['segment'].isin(Septa)].obs_names)
- tmp_adata.obs.loc[ x, 'Domain'] = 'S'
- x = list(tmp_adata[tmp_adata.obs['segment'].isin(LowQuality)].obs_names)
- tmp_adata.obs.loc[ x, 'Domain'] = 'LQ'
- return tmp_adata
- # %%
- def compute_contour_boundary(points, alpha):
- """
- Compute the contour boundary (outline) of a given set of points.
- Compute alpha shape (concave hull)
- Parameters:
- points: x y points
- alpha: Large alpha values → More convex, simpler shape. Small alpha values → More concave, tighter fit around the points.
- Returns:
- Boundary coordinates
- """
- shape = alphashape.alphashape(points, alpha)
- if shape.is_empty:
- raise ValueError("Alpha shape failed; adjust alpha parameter.")
- if isinstance(shape, Polygon):
- boundary_coords = np.array(shape.exterior.coords)
- else:
- # If multiple polygons, combine their boundaries
- boundary_coords = np.vstack([np.array(poly.exterior.coords) for poly in shape.geoms])
- return boundary_coords
- def compute_contours(data, alpha):
- """
- Find the contour or boundary of the spatial groups
- Parameters:
- data: spatial data
- alpha: Large alpha values → More convex, simpler shape. Small alpha values → More concave, tighter fit around the points.
- Returns:
- The location of boundary position between spatial groups
- """
- df_all = pd.DataFrame(data)
- thres_len = 100
- category_mapping = {'C': 1, 'M': 2, 'S': 3}
- ###Outline
- outline_coords = compute_contour_boundary(df_all[['X', 'Y']].to_numpy(), alpha= alpha)
- boundary_data = []
- for point in outline_coords:
- boundary_data.append({
- 'Boundary': 'Outline',
- 'X': point[0],
- 'Y': point[1]
- })
- ### M
- df = df_all[df_all.Z.isin(['M'])]
- outline_coords = compute_contour_boundary(df[['X', 'Y']].to_numpy(), alpha=alpha)
- for point in outline_coords:
- boundary_data.append({
- 'Boundary': 'M',
- 'X': point[0],
- 'Y': point[1]
- })
- ### C-M
- df = df_all[df_all.Z.isin(['C','M'])]
- outline_coords = compute_contour_boundary(df[['X', 'Y']].to_numpy(), alpha=alpha)
- for point in outline_coords:
- boundary_data.append({
- 'Boundary': 'C-M',
- 'X': point[0],
- 'Y': point[1]
- })
- ### C-S
- df = df_all[df_all.Z.isin(['C','M', 'S'])]
- outline_coords = compute_contour_boundary(df[['X', 'Y']].to_numpy(), alpha= alpha)
- for point in outline_coords:
- boundary_data.append({
- 'Boundary': 'C-M-S',
- 'X': point[0],
- 'Y': point[1]
- })
- boundary_df = pd.DataFrame(boundary_data)
- return boundary_df
- def shortest_distance(point, coordinates):
- """
- Calculate the shortest distance from a given point to a list of coordinates.
- Parameters:
- point: one data x-y point
- coordinates: compare against these collection of points
- Returns:
- shortest distance value
- """
- point = np.array(point)
- coordinates = np.array(coordinates)
- # Compute squared distances (faster than directly computing Euclidean distances)
- squared_distances = np.sum((coordinates - point) ** 2, axis=1)
- # Find the index of the minimum distance
- min_index = np.argmin(squared_distances)
- # Compute the actual shortest distance
- shortest_dist= np.sqrt(squared_distances[min_index])
- # Get the closest point
- closest_point = tuple(coordinates[min_index])
- return shortest_dist
- def assign_subcategory(x, y, region, boundary_df): #contours):
- """
- Calculate distances and assign subcategories
- Parameters:
- region: C, M or S
- boundary_df: boundary positions
- Returns:
- Sub region assignment value
- """
- #distance_to_outline = shortest_distance((x,y), np.array(boundary_df[boundary_df.Boundary == 'Outline' ][['X', 'Y']].to_records(index=False)).tolist())
- distance_to_m = shortest_distance((x,y), np.array(boundary_df[boundary_df.Boundary == 'M' ][['X', 'Y']].to_records(index=False)).tolist())
- distance_to_cm = shortest_distance((x,y), np.array(boundary_df[boundary_df.Boundary == 'C-M' ][['X', 'Y']].to_records(index=False)).tolist())
- distance_to_cms = shortest_distance((x,y), np.array(boundary_df[boundary_df.Boundary == 'C-M-S' ][['X', 'Y']].to_records(index=False)).tolist())
- if region == 'C':
- if distance_to_m <= distance_to_cm:
- if distance_to_m <= distance_to_cms:
- return 'C1'
- elif distance_to_m > distance_to_cms:
- return 'C3'
- elif distance_to_m > distance_to_cm:
- if distance_to_m <= distance_to_cms:
- return 'C2'
- elif distance_to_m > distance_to_cms:
- return 'C3'
- elif region == 'M':
- if distance_to_m <= distance_to_cm:
- if distance_to_m <= 100:
- return 'M2'
- elif distance_to_m > 100:
- return 'M1'
- elif distance_to_m > distance_to_cm:
- return 'M3'
- elif region == 'S':
- if distance_to_cm <= distance_to_cms:
- if distance_to_m <= distance_to_cm:
- return 'S1'
- elif distance_to_m > distance_to_cm:
- return 'S2'
- else:
- return 'S3'
- def find_niche(tmp_adata, sample, s_value, alpha):
- """
- Main function to Find Niche based on boundaries and closeness to the boundaries
- Parameters:
- tmp_adata: spatial data
- s_value: spot size for spatial plotting function
- alpha: Large alpha values → More convex, simpler shape. Small alpha values → More concave, tighter fit around the points.
- sample: sample name
- Returns:
- spatial data with meta on Niche subregions based closeness to the boundaries
- """
- data = {
- 'X': tmp_adata.obs.x,
- 'Y': tmp_adata.obs.y,
- 'Z': tmp_adata.obs.Domain
- }
- df = pd.DataFrame(data)
- boundary_df = compute_contours(data, alpha)
- boundary_color = mcol.ListedColormap(["grey", "red", "blue","green"])
- plt.figure(figsize=(4, 3))
- plt.scatter(boundary_df['X'], boundary_df['Y'], c=pd.factorize(boundary_df['Boundary'])[0], s=0.05, cmap=boundary_color )
- plt.title("Boundaries")
- plt.xlabel("X")
- plt.ylabel("Y")
- plt.savefig(sample + "_boundary.pdf")
- print(boundary_df.Boundary.value_counts())
- df['Subcategory'] = df.apply(
- lambda row: assign_subcategory(row['X'], row['Y'], row['Z'], boundary_df),
- axis=1
- )
- df.to_csv(sample + '_subcategories.csv', index=False)
- boundary_df.to_csv(sample + '_boundaries.csv', index=False)
- tmp_adata.obs['Niche'] = df.Subcategory
- #sc.pl.embedding(tmp_adata, basis="spatial", color=['segment', 'Domain', 'Niche'], s=s_value, save= sample + "_domain_niche.pdf")
- tmp_adata.obs.to_csv(sample + '_meta_niche.csv', index=True)
- print(df.Subcategory.value_counts())
- # with plt.rc_context(): # Use this to set figure params like size and dpi
- # plt.rcParams['figure.dpi'] = 100
- # plt.rcParams["figure.figsize"] = (3,2)
- # sc.pl.dotplot(tmp_adata, gene_list, 'Niche', use_raw=False, cmap='viridis', show=True, dendrogram=False)
- return tmp_adata
- # %%
- # %%
- ## TissueTag
- import tissue_tag as tt
- def tissue_tag(adata, annotation_column, Number1, Number2):
- """
- Call the Tissue Tag python function to split the spatial Domains into concentric bins
- Parameters:
- adata: spatial data
- annotation_column: Domain C, M or S
- Number1: number of concentric bins - C
- Number2: number of concentric bins - M or S
- Returns:
- spatial data with meta on Tissue Tag based concentric niches
- """
- adata.obs['x'] = adata.obsm['spatial'][:, 0]
- adata.obs['y'] = adata.obsm['spatial'][:, 1]
- tt.dist2cluster_fast(
- df=adata.obs,
- annotation=annotation_column,
- KNN=10
- ) # calculate minimum mean distance of each spot to clusters
- structure = ['S','C','M']
- w = [0.2,0.8]
- df_anno = tt.calculate_axis_3p(adata.obs, anno=annotation_column, structure=structure, output_col='cma_3p', w=w)
- adata.obs = df_anno
- #cortex group
- labels_cortex = [f'C{i}' for i in range(1, Number1+1)]
- labels_cortex
- adata.obs['Cell_group'] = adata.obs[annotation_column].astype(str)
- adata.obs.loc[adata.obs[annotation_column] == 'C', 'Cell_group'] = pd.qcut(adata.obs.loc[adata.obs[annotation_column] == 'C', 'cma_3p'], q=Number1, labels=labels_cortex).astype(str)
- #Medulla group
- labels_medulla = [f'M{i}' for i in range(1, Number2+1)]
- labels_medulla
- adata.obs.loc[adata.obs[annotation_column] == 'M', 'Cell_group'] = pd.qcut(adata.obs.loc[adata.obs[annotation_column] == 'M', 'cma_3p'], q=Number2, labels=labels_medulla).astype(str)
- #Septa group
- labels_septa = [f'S{i}' for i in range(1, Number2+1)]
- labels_septa
- adata.obs.loc[adata.obs[annotation_column] == 'S', 'Cell_group'] = pd.qcut(adata.obs.loc[adata.obs[annotation_column] == 'S', 'cma_3p'], q=Number2, labels=labels_septa).astype(str)
- return adata
- # %%
- ## Cellspecificity score and RCTD cell type
- cts = [
- 'cTEC(P)','cTEC(Q)', 'cTEC(Q) SIRT1lo','cTEC DP',
- 'DN(Q)','DP(P) RUNX3hi', 'DP(P) FABP5hi', 'DP(Q) AQP3hi', 'DP(Q) FABP5lo', 'CD8aa','ab entry',
- 'mTEC I', 'mTEC II', 'mTEC III', 'mimeTEC', 'CD4/CD8/Treg', 'B pro(P)', 'B pro(Q)', 'B IGHMhi','B TRAF1hi', 'B TRAF5hi',
- 'DC1','DC2','aDC3','aDC1.2', 'pDC', 'Mono', 'Macro(Q)','Macro(Phago)', 'Mast',
- 'ETP', 'VSMC','Ery', 'Fib(P)', 'Fib(Q)', 'Endo']
- cts_rctd = ['ab.entry',
- 'aDC1.2', 'aDC3', 'B.IGHMhi', 'B.pro.P.', 'B.pro.Q.', 'B.TRAF1hi',
- 'B.TRAF5hi', 'CD4_CD8_Treg', 'CD8aa', 'cTEC.DP', 'cTEC.P.', 'cTEC.Q.',
- 'cTEC.Q..SIRT1lo', 'DC1', 'DC2', 'DN.Q.', 'DP.P..FABP5hi',
- 'DP.P..RUNX3hi', 'DP.Q..AQP3hi', 'DP.Q..FABP5lo', 'Endo', 'Ery', 'ETP',
- 'Fib.P.', 'Fib.Q.', 'Macro.Phago.', 'Macro.Q.', 'Mast', 'mimeTEC',
- 'Mono', 'mTEC.I', 'mTEC.II', 'mTEC.III', 'pDC', 'VSMC']
- def cell_specificity_score(adata, cts, sample):
- """
- cell-specificity-score calculates a gene score by combining known cell-type marker genes with the top ten differentially expressed genes
- identified from integrated fetal and pediatric scRNA-seq dataset
- Parameters:
- adata: spatial data
- cts: list of cell type names
- sample: sample name
- Returns:
- writes the cell type specificity score for all the spatial spots and cell type combination to a csv file
- """
- for c in cts:
- gl = degenes_annot2.gene[degenes_annot2.cluster == c][0:10]
- gl = list(set(gl).union(set(custom_marker.gene[custom_marker.celltype == c])))
- if len(gl) >0 :
- sc.tl.score_genes(adata,
- gl,
- ctrl_size=50,
- gene_pool=None, n_bins=25, score_name=c,
- random_state=0, copy=False, use_raw=None)
- adata.obs.loc[adata.obs[c] < 0.75, c] = 0
- adata.obs.loc[adata.obs[c] < 0.75, c] = 0
- adata.obs.loc[adata.obs[c] >= 0.75, c] = 1
- adata.obs.loc[adata.obs[c] >= 0.75, c] = 1
- adata.obs.to_csv(f'{save_folder}' + sample + "_CS_valuesMeta.csv")
- plot_CT_heatmaps(adata, cts, sample + 'CS')
- def plot_CT_heatmaps(adata, cts, sample):
- """
- Normalizes the cell type enrichment scores in sample based on Domains, Niche by boundary and Niche by tissuetag and visualises as heatmap
- Parameters:
- adata: spatial data
- cts: list of cell type names
- sample: sample name
- Returns:
- writes the cell type specificity score for all the spatial spots and cell type combination to a csv file
- """
- adata_meta = adata.obs
- meta_niche = adata_meta.groupby('Domain')[cts].sum()
- dfMax = meta_niche.max(axis=0) ### NOrmalize to 0-1 for each cell type
- meta_niche = meta_niche.divide(dfMax, axis=1)
- meta_niche[meta_niche ==np.nan] =0
- #print(meta_niche)
- t = meta_niche.sum(axis = 0)
- meta_niche.to_csv(f'{save_folder}' + sample + "_domain.csv")
- sub = meta_niche[meta_niche.index.isin (['C','M','S' ])]
- sns.clustermap(sub, row_cluster= False, col_cluster=False,
- cmap="viridis", figsize=(10,4)).savefig(f'{save_folder}' + sample + "_heatmap.pdf")
- adata_meta = adata.obs
- meta_niche = adata_meta.groupby('Niche')[cts].sum()
- dfMax = meta_niche.max(axis=0) ### NOrmalize to 0-1 for each cell type
- meta_niche = meta_niche.divide(dfMax, axis=1)
- meta_niche[meta_niche ==np.nan] =0
- #print(meta_niche)
- t = meta_niche.sum(axis = 0)
- meta_niche.to_csv(f'{save_folder}' + sample + "_niche.csv")
- # sub = meta_niche[meta_niche.index.isin (['C1','C2','C3','C4','M1','M2','M3','S1','S2','S3','S4' ])]
- sns.clustermap(sub, row_cluster= False, col_cluster=False,
- cmap="viridis", figsize=(10,4)).savefig(f'{save_folder}' + sample + "_niche_heatmap.pdf")
- adata_meta = adata.obs
- meta_niche = adata_meta.groupby('Niche_bysegment')[cts].sum() #Niche by boundary
- dfMax = meta_niche.max(axis=0) ### NOrmalize to 0-1 for each cell type
- meta_niche = meta_niche.divide(dfMax, axis=1)
- meta_niche[meta_niche ==np.nan] =0
- t = meta_niche.sum(axis = 0)
- meta_niche.to_csv(f'{save_folder}' + sample + "_Niche_bysegment.csv")
- sns.clustermap(meta_niche, row_cluster= False, col_cluster=False,
- cmap="viridis", figsize=(10,4)).savefig(f'{save_folder}' + sample + "_segment_heatmap.pdf")
- adata_meta = adata.obs
- meta_niche = adata_meta.groupby('Cell_group')[cts].sum() #Niche by tissuetag
- dfMax = meta_niche.max(axis=0) ### NOrmalize to 0-1 for each cell type
- meta_niche = meta_niche.divide(dfMax, axis=1)
- meta_niche[meta_niche ==np.nan] =0
- t = meta_niche.sum(axis = 0)
- meta_niche.to_csv(f'{save_folder}' + sample + "_Cell_group.csv")
- sns.clustermap(meta_niche, row_cluster= False, col_cluster=False,
- cmap="viridis", figsize=(10,4)).savefig(f'{save_folder}' + sample + "_Cell_group_heatmap.pdf")
- def rctd_score(adata, cts, sample, rctd):
- """
- Summarizes the RCTD cell type values
- Parameters:
- adata: spatial data
- cts: list of cell type names
- sample: sample name
- rctd: RCTD meta data
- Returns:
- calls cell type enrichment plots function for RCTD
- """
- adata.obs[cts] = rctd[cts].to_numpy()
- plot_CT_heatmaps(adata, cts, sample + 'RCTD')
- # %%
- def plot_spatialGeneExpression(adata, save_folder, sample, svalue):
- """
- Plotting functions for sptaial gene expression, clusters and niches.
- Parameters:
- adata: spatial data
- save_folder: folder to save plots
- sample: sample name
- svalue: spot size for spatial plotting function
- Returns:
- saves spatial plots in pdf and png for publication
- """
- with plt.rc_context(): # Use this to set figure params like size and dpi
- plt.rcParams['figure.dpi'] = 300
- plt.rcParams["figure.figsize"] = (3,3)
- sc.pl.embedding(adata, basis="spatial",
- color=['leiden_clusters'],
- s=svalue,
- show=False,
- color_map='Reds'
- )
- plt.savefig(f"{save_folder}" + sample + "leiden.png", bbox_inches="tight")
- plt.savefig(f"{save_folder}" + sample + "leiden.pdf", bbox_inches="tight")
- sc.pl.embedding(adata, basis="spatial",
- color=['Domain'],
- s=svalue, palette=domain_color,
- show=False,
- color_map='Reds'
- )
- plt.savefig(f"{save_folder}" + sample + "domain.png", bbox_inches="tight")
- plt.savefig(f"{save_folder}" + sample + "domain.pdf", bbox_inches="tight")
- sc.pl.embedding(adata, basis="spatial",
- color=[ 'Niche', 'Niche_bysegment', 'Cell_group'],
- s=svalue, palette=niche_color,
- show=False,
- color_map='Reds'
- )
- plt.savefig(f"{save_folder}" + sample + "groups.png", bbox_inches="tight")
- plt.savefig(f"{save_folder}" + sample + "groups.pdf", bbox_inches="tight")
- gene_list = ['CD4', 'CD8A', 'PRSS16', 'AIRE', 'CD34', 'MS4A1', 'CD83', 'CD14', 'COL1A2']
- nrow=1
- ncol=len(gene_list)
- fig,axs=plt.subplots(nrow,ncol,figsize=(18,2), dpi=100)
- # Plot expression for every marker on the corresponding Axes object
- col_idx=0
- row_idx=0
- for marker in gene_list:
- ax=axs[col_idx]
- sc.pl.embedding(adata, basis="spatial",
- color=marker,
- s=svalue, ax=ax,frameon=False,
- show=False,
- color_map='Reds')
- col_idx+=1
- # Alignment within the Figure
- fig.tight_layout()
- plt.savefig(f"{save_folder}" + sample + "markers.png", bbox_inches="tight")
- plt.savefig(f"{save_folder}" + sample + "marker.pdf", bbox_inches="tight")
- # %%
- def find_HC_regions(adata, save_folder, sample):
- """
- Annotating the spots with high KRT1 gene expression
- Parameters:
- adata: spatial data
- save_folder: folder to save plots
- sample: sample name
- Returns:
- saves meta data with KRT1 region information
- """
- cp_list = ['Sample', 'leiden_clusters', 'Domain', 'Niche', 'Niche_bysegment', 'Cell_group']
- adata.obs[cp_list] = meta[cp_list].to_numpy()
- adata.obs[cp_list] = adata.obs[cp_list].astype('category')
- adata.obs['Niche_bysegment_HC'] = adata.obs.Niche_bysegment.to_numpy()
- adata.obs['Niche_bysegment_HC'] = adata.obs.Niche_bysegment.to_numpy()
- adata.obs['Niche_bysegment_HC_M'] = adata.obs.Niche_bysegment.to_numpy()
- sub_adata = adata[adata[: , 'KRT1'].X > 0, :]
- sub_adata = sub_adata[sub_adata.obs.Domain.isin(['LQ', 'S']) ]
- sub_adataM = adata[adata[: , 'KRT1'].X > 0, :]
- sub_adataM = sub_adataM[sub_adataM.obs.Domain.isin(['LQ', 'S', 'M']) ]
- x = list(adata[adata.obs.index.isin(sub_adata.obs.index)].obs_names)
- adata.obs.loc[ x, 'Niche_bysegment_HC'] = 'KRT1+'
- x = list(adata[adata.obs.index.isin(sub_adataM.obs.index)].obs_names)
- adata.obs.loc[ x, 'Niche_bysegment_HC_M'] = 'KRT1+'
- sub_adata = adata[adata[: , 'KRT1'].X > 10, :]
- sub_adata = sub_adata[sub_adata.obs.Domain.isin(['LQ', 'S']) ]
- sub_adataM = adata[adata[: , 'KRT1'].X > 10, :]
- sub_adataM = sub_adataM[sub_adataM.obs.Domain.isin(['LQ', 'S', 'M']) ]
- x = list(adata[adata.obs.index.isin(sub_adata.obs.index)].obs_names)
- adata.obs.loc[ x, 'Niche_bysegment_HC'] = 'KRT1++'
- x = list(adata[adata.obs.index.isin(sub_adataM.obs.index)].obs_names)
- adata.obs.loc[ x, 'Niche_bysegment_HC_M'] = 'KRT1++'
- with plt.rc_context(): # Use this to set figure params like size and dpi
- plt.rcParams['figure.dpi'] = 300
- plt.rcParams["figure.figsize"] = (3,3)
- sc.pl.embedding(adata, basis="spatial", palette= HC_niche_color,
- color=['Niche_bysegment', 'Niche_bysegment_HC', 'Niche_bysegment_HC_M'], s=4)
- plt.savefig(f"{save_folder}" + sample + "groupsHC.png", bbox_inches="tight")
- plt.savefig(f"{save_folder}" + sample + "groupsHC.pdf", bbox_inches="tight")
- adata.obs.to_csv(f"{save_folder}" + sample + "_niche_HC.csv")
- print(adata.obs.Niche_bysegment_HC.value_counts())
- print(adata.obs.Niche_bysegment_HC_M.value_counts())
- # %%
- targets = blitz.enrichr.get_library("GO_Biological_Process_2023")
- def find_GO(adata, region):
- """
- Determine the differential gene ontology (GO) biological process terms y Domains or Niches
- Parameters:
- adata: spatial data
- save_folder: folder to save plots
- sample: sample name
- Returns:
- returns top 10 GO for each group as dataframe
- """
- d2c.score(adata, targets=targets, use_raw=True)
- sc.tl.rank_genes_groups(adata.uns['drug2cell'], groupby=region, method='wilcoxon')
- # Convert results to a pandas DataFrame
- df = pd.DataFrame({
- group: adata.uns['drug2cell'].uns['rank_genes_groups']['names'][group][:10]
- for group in adata.uns['drug2cell'].uns['rank_genes_groups']['names'].dtype.names
- })
- return (df)
- # %%
- def ThreeGene_plot(adata, gene, name):
- """
- Plot spatial three genes in RGB colours and also co-localization by the overlap of 2 colours
- Parameters:
- adata: spatial data
- gene: combination of genes
- name: file name
- Returns:
- spatial plots in png and pdf
- """
- combinations = gene
- for i in range(len(combinations)):
- cc = combinations[i]
- sc.tl.score_genes(adata, [cc[0]], ctrl_size=50,
- gene_pool=None, n_bins=25, score_name="1",
- random_state=0, copy=False, use_raw=None)
- sc.tl.score_genes(adata, [cc[1]], ctrl_size=50,
- gene_pool=None, n_bins=25, score_name="2",
- random_state=0, copy=False, use_raw=None)
- sc.tl.score_genes(adata, [cc[2]], ctrl_size=50,
- gene_pool=None, n_bins=25, score_name="3",
- random_state=0, copy=False, use_raw=None)
- adata.obs['1'] = adata.obs['1'] / max(adata.obs['1'])
- adata.obs['2'] = adata.obs['2'] / max(adata.obs['2'])
- adata.obs['3'] = adata.obs['3'] / max(adata.obs['3'])
- adata.obs.loc[adata.obs['1'] < 0.1, '1'] = 0
- adata.obs.loc[adata.obs['2'] < 0.1, '2'] = 0
- adata.obs.loc[adata.obs['3'] < 0.1, '3'] = 0
- adata.obs.loc[adata.obs['1'] >= 0.1, '1'] = 1
- adata.obs.loc[adata.obs['2'] >= 0.1, '2'] = 1
- adata.obs.loc[adata.obs['3'] >= 0.1, '3'] = 1
- adata.obs['Colour3'] = 'k'
- adata.obs['Colour3'][(adata.obs['1'] == 0) & (adata.obs['2'] == 0) & (adata.obs['3'] == 0)] = np.nan
- adata.obs['Colour3'][(adata.obs['1'] == 1) & (adata.obs['2'] == 0) & (adata.obs['3'] == 0)] = 'r'
- adata.obs['Colour3'][(adata.obs['1'] == 0) & (adata.obs['2'] == 1) & (adata.obs['3'] == 0)] = 'g'
- adata.obs['Colour3'][(adata.obs['1'] == 0) & (adata.obs['2'] == 0) & (adata.obs['3'] == 1)] = 'b'
- adata.obs['Colour3'][(adata.obs['1'] == 1) & (adata.obs['2'] == 1) & (adata.obs['3'] == 0)] = 'y'
- adata.obs['Colour3'][(adata.obs['1'] == 1) & (adata.obs['2'] == 0) & (adata.obs['3'] == 1)] = 'm'
- adata.obs['Colour3'][(adata.obs['1'] == 0) & (adata.obs['2'] == 1) & (adata.obs['3'] == 1)] = 'c'
- adata.obs['Colour3'][(adata.obs['1'] == 1) & (adata.obs['2'] == 1) & (adata.obs['3'] == 1)] = 'k'
- with plt.rc_context():
- plt.rcParams['figure.dpi'] = 4000
- plt.rcParams["figure.figsize"] = (2, 2)
- sc.pl.embedding(adata, basis="spatial",
- color="Colour3", s=0.35, show=False,
- palette=mcolors.BASE_COLORS, na_color='whitesmoke')
- plt.savefig(f"{name}_{cc}_50_4000dpi.png", bbox_inches="tight", format="png")
- plt.savefig(f"{name}_{cc}_50_4000dpi.pdf", bbox_inches="tight", format="pdf" )
- # %%
integrate_niches_functions.ipynb, under CC-BY-4.0 · at the source
Overview
13 affiliations
- Institute of Molecular and Cell Biology (IMCB), Agency for Science, Technology and Research (A*STAR),Singapore, Republic of Singapore
- Department of Physiology, NUS Yong Loo Lin School of Medicine,Singapore, Singapore
- Department of Pediatrics, Yong Loo Lin School of Medicine, National University of Singapore,Singapore, Singapore
- Department of Pediatrics, Division of Stem Cell Transplantation and Regenerative Medicine, Stanford University,Stanford, CA USA
- Immunology Translational Research Programme, Yong Loo Lin School of Medicine, National University of Singapore,Singapore, Singapore
- Department of Microbiology and Immunology, Yong Loo Lin School of Medicine, National University of Singapore,Singapore, Singapore
- Cancer Translational Research Programme, Yong Loo Lin School of Medicine, National University of Singapore,Singapore, Singapore
- NUS Graduate School’s Integrative Sciences and Engineering Programme, National University of Singapore,Singapore, Singapore
- Singapore Immunology Network (SIgN), Agency for Science, Technology and Research (A*STAR),Singapore, Singapore
- Immunology Translational Research Program, Department of Microbiology and Immunology, Yong Loo Lin School of Medicine, National University of Singapore,Singapore, Singapore
- Division of Cardiology, Department of Paediatrics, Khoo Teck Puat-National University Children’s Medical Institute, National University Health System,Singapore, Singapore
- Shanghai Immune Therapy Institute, School of Medicine, Shanghai Jiao Tong University, Renji Hospital,Shanghai, China
- Department of Biological Sciences, National University of Singapore,Singapore, Singapore
Abstract
The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.
Repositories
Its files are read in the Code ↔ Paper reader above, with 15 matches between paragraphs and lines of code.
UmaSangumathi/mimeTFs
6d1e67b8430c94e17b7bbe2803ed279995eef5d7, 6 October 2025Availability: 1 check, the latest on 30 September 2026: the link answers
- 30 September 2026: the link answers
2 files
- 1.ProcessSamples/
Example_citeSpatial_bin2 , Jupyter, 200 lines0.ipynb - 1.ProcessSamples/
Example_stereoseq_transc , Jupyter, 286 linesriptome_bin50.ipynb - repository limit reached (2,000 files or 30 MB): the rest is at the source (11 files)
Zenodo 17851510
Availability: 1 check, the latest on 30 September 2026: the link answers (HTTP 200)
- 30 September 2026: the link answers (HTTP 200)
7 files
- 1.ProcessSamples/
Example_citeSpatial_bin2 , Jupyter, 200 lines0.ipynb - 1.ProcessSamples/
scRNA_integrate.Rmd , R, 1,367 lines, 4 matches - 2.DefineNiche/
Integrate_niche_celltype , Jupyter, 550 lines, 1 match_samples.ipynb - 2.DefineNiche/
Macsima_process.ipynb , Jupyter, 133 lines - 2.DefineNiche/
integrate_niches_functio , Jupyter, 857 lines, 7 matchesns.ipynb - 3.CellCommunication/
run_cellularCommunicatio , Jupyter, 275 lines, 2 matchesn.ipynb - 4.MimeTFs/
IdentifyMimeTFs.ipynb , Jupyter, 530 lines, 1 match - repository limit reached (2,000 files or 30 MB): the rest is at the source
Code availability statement
The paper has a code availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to the authors' code: UmaSangumathi/
mimeTFs , Zenodo 17851510
Read it in the paper: doi.org/10.1038/s41467-026-68596-w.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 9 scripts, each with its path and the digest of its content;
- 15 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
Datasets cited
- bioproject:PRJNA1045362, at NCBI BioProject; found in “Data availability”
- bioproject:PRJNA1213311, at NCBI BioProject; found in “Data availability”
- zenodo:12595241, at Zenodo; found in “Data availability”
- zenodo:5500511, at Zenodo; found in “Data availability”
Data availability statement
The paper has a data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to 4 datasets: NCBI BioProject PRJNA1045362, NCBI BioProject PRJNA1213311, Zenodo 12595241, Zenodo 5500511
Read it in the paper: doi.org/10.1038/s41467-026-68596-w.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 30 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 14 authors, 4 keywords, 15 MeSH terms, 6 funders, 64 references.
Cite
This paper
Kamaraj, U. S., Chen, Y., Lei, J., Gautam, P., Horcharoensuk, P., Clemente, C. K. M., Weinacht, K. G., Gascoigne, N. R. J., Chen, J., Chen, C. K., Chen, Q., Li, Q.-J., Ng, L. G., & Loh, Y.-H. (2026). Spatial cartography of human thymus enables the geopositioning of lineage transcription factors in rare mimetic thymic epithelial cells. Nature communications, 17(1), 3721. https://
BibTeX
@article{kamaraj2026spat
author = {Kamaraj, Uma S. and Chen, Ying and Lei, Junjie and Gautam, Pradeep and Horcharoensuk, Pongsatorn and Clemente, Czaryna K. M. and Weinacht, Katja G. and Gascoigne, Nicholas R. J. and Chen, Jinmiao and Chen, Ching Kit and Chen, Qingfeng and Li, Qi-Jing and Ng, Lai Guan and Loh, Yuin-Han},
title = {{Spatial cartography of human thymus enables the geopositioning of lineage transcription factors in rare mimetic thymic epithelial cells}},
journal = {Nature communications},
year = {2026},
month = mar,
volume = {17},
number = {1},
pages = {3721},
publisher = {Nature Publishing Group},
issn = {2041-1723},
doi = {10.1038/
url = {https://
pmid = {41807357},
pmcid = {PMC13102919}
}
RIS
TY - JOUR
AU - Kamaraj, Uma S.
AU - Chen, Ying
AU - Lei, Junjie
AU - Gautam, Pradeep
AU - Horcharoensuk, Pongsatorn
AU - Clemente, Czaryna K. M.
AU - Weinacht, Katja G.
AU - Gascoigne, Nicholas R. J.
AU - Chen, Jinmiao
AU - Chen, Ching Kit
AU - Chen, Qingfeng
AU - Li, Qi-Jing
AU - Ng, Lai Guan
AU - Loh, Yuin-Han
TI - Spatial cartography of human thymus enables the geopositioning of lineage transcription factors in rare mimetic thymic epithelial cells
T2 - Nature communications
J2 - Nat Commun
PY - 2026
DA - 2026/
VL - 17
IS - 1
SP - 3721
SN - 2041-1723
PB - Nature Publishing Group
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"type": "article-journal",
"title": "Spatial cartography of human thymus enables the geopositioning of lineage transcription factors in rare mimetic thymic epithelial cells",
"container-title": "Nature communications",
"author": [
{
"family": "Kamaraj",
"given": "Uma S."
},
{
"family": "Chen",
"given": "Ying"
},
{
"family": "Lei",
"given": "Junjie"
},
{
"family": "Gautam",
"given": "Pradeep"
},
{
"family": "Horcharoensuk",
"given": "Pongsatorn"
},
{
"family": "Clemente",
"given": "Czaryna K. M."
},
{
"family": "Weinacht",
"given": "Katja G."
},
{
"family": "Gascoigne",
"given": "Nicholas R. J."
},
{
"family": "Chen",
"given": "Jinmiao"
},
{
"family": "Chen",
"given": "Ching Kit"
},
{
"family": "Chen",
"given": "Qingfeng"
},
{
"family": "Li",
"given": "Qi-Jing"
},
{
"family": "Ng",
"given": "Lai Guan"
},
{
"family": "Loh",
"given": "Yuin-Han"
}
],
"container-title-short":
"volume": "17",
"issue": "1",
"page": "3721",
"DOI": "10.1038/
"PMID": "41807357",
"PMCID": "PMC13102919",
"ISSN": "2041-1723",
"publisher": "Nature Publishing Group",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
3,
10
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1016/j.xcrm.2026.102766 [code]
- A longitudinal single-cell and spatial multiomic atlas of pediatric high-grade glioma.Journal: Cell reports. MedicineIn common: anndata, clusterProfiler, Scanpy, 15 other tools, genetics / omics, cellular / molecular, 5 references
- [2] doi:10.1038/s42003-026-10034-0 [code]
- Region- and cell type-specific changes in gene expression in the cerebellum after classical fear conditioning.Journal: Communications biologyIn common: Squidpy, anndata, clusterProfiler, 13 other tools, genetics / omics, cellular / molecular, 3 references
- [3] doi:10.1186/s13059-026-04177-w [code]
- Genomic sequence evolution underlying human neocortical interareal diversification.Journal: Genome biologyIn common: Squidpy, anndata, Scanpy, 11 other tools, genetics / omics, cellular / molecular, 5 references
- [4] doi:10.1038/s41467-026-71803-3 [code]
- Charting the transition from in vitro gliogenesis to the in vivo maturation of human glial progenitor cells transplanted into the hypomyelinated mouse brain.Journal: Nature communicationsIn common: Squidpy, anndata, Scanpy, 13 other tools, genetics / omics, cellular / molecular, 2 references
- [5] doi:10.1093/nar/gkag706 [code]
- scDifformer: diffusion-based post-training for virtual cell modeling across large-scale single-cell data.Journal: Nucleic acids researchIn common: Squidpy, anndata, Scanpy, 12 other tools, 3 references
- [6] doi:10.21203/rs.3.rs-9676637/v1 [code]
- A Comprehensive Benchmarking of Spatial Deconvolution and Domain Detection Methods across Diverse Tissues and Spatial Transcriptomic TechnologiesJournal: Research Square (preprint)In common: Squidpy, anndata, Scanpy, 14 other tools, genetics / omics, 1 reference
- [7] doi:10.64898/2026.03.30.714220 [code]
- An integrated single cell and spatial omics atlas of human prenatal developmentJournal: bioRxiv (preprint)In common: Squidpy, anndata, Scanpy, 9 other tools, 5 references
- [8] doi:10.1038/s41592-026-03194-8 [code]
- Beyond benchmarking: an expert-guided consensus approach to spatially aware clustering.Journal: Nature methodsIn common: Squidpy, anndata, Scanpy, 13 other tools, genetics / omics, 2 references
- [9] doi:10.1002/imt2.70163 [code]
- Spatial multi-omics unveils sphingolipid metabolic reprogramming within the retinal pathological niche.Journal: iMetaIn common: anndata, clusterProfiler, Scanpy, 13 other tools, genetics / omics, cellular / molecular, 2 references
- [10] doi:10.1186/s13073-026-01704-z [code]
- Gene expression profiling enables refined parcellation of cortical layers in the heterogeneous human cerebral cortex.Journal: Genome medicineIn common: anndata, Scanpy, Seurat, 13 other tools, genetics / omics, cellular / molecular, 2 references
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 2 repositories of the authors' code, each at its verified commit and with its license, 9 scripts, and 15 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:3108f57f6b03e9dd…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
