Brain injury reactivates a developmental program driving genesis and integration of transient LGE-class interneurons.
5 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.
The 5 matches
- [1] § Results › Astrocyte-generated striatal and cortical neuroblasts belong to the LGE interneurons class ↔ mouse/MouseWbGeKDCbAdult4_cellrank.py, lines 123 to 202 · score 0.63 · CGE_NR2F2, OB_MEIS2, LGE_MEIS2, PROX1, mapped, adult · block
oscr:b:B18E3AWDH4GC2-B· Report a mismatch - [2] § Results › Astrocyte-generated striatal and cortical neuroblasts belong to the LGE interneurons class ↔ mouse/MouseWbGeKDCbAdult.py, lines 200 to 257 · score 0.60 · CGE_NR2F2, OB_MEIS2, LGE_MEIS2, PROX1, adult, PAX6 · block
oscr:b:G3V58RF75J5TJ-8· Report a mismatch - [3] § Results › Astrocyte-generated striatal and cortical neuroblasts belong to the LGE interneurons class ↔ mouse/MouseWbGeKDCbAdult2.py, lines 124 to 212 · score 0.57 · NR2F2, LGE_MEIS2, nkx2, ERBB4, LHX6, Prox1 · block
oscr:b:2XQN5W1SV25BP-K· Report a mismatch - [4] § STAR★Methods › Method details › scRNA-seq quality control and clustering ↔ merge/QvMWbGeKDCb.py, lines 120 to 186 · score 0.57 · Cell Cycle scores, log, subsetting, batches, PCA, PCs · block
oscr:b:RN0H4X2VVQ54F-6· Report a mismatch - [5] § STAR★Methods › Method details › scRNA-seq quality control and clustering ↔ mouse/MouseWbGeKDCb1Subset.py, lines 204 to 249 · score 0.51 · Cell Cycle scores, subsetting, Rank, log, batches, genes · block
oscr:b:JPT46X478HY3Q-K· Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Python · 703 lines · 32 KB · no license · 1 match
- import os
- import scanpy
- import anndata
- import scanpy as sc
- import pandas as pd
- import numpy as np
- import scipy
- from scipy import stats
- import re
- import sklearn
- import matplotlib
- import matplotlib.pyplot as plt
- matplotlib.use('Agg')
- from collections import Counter
- import random
- import seaborn
- import sys
- import shutil
- import scvelo as scv
- import cellrank as cr
- import tqdm
- import bbknn
- #Load my pipeline functions
- import importlib
- import importlib.util
- spec = importlib.util.spec_from_file_location("ScanpyUtilsMT", os.path.join(os.path.dirname(os.path.abspath(__file__)),"../../utils/ScanpyUtilsMT.py"))
- sc_utils = importlib.util.module_from_spec(spec)
- spec.loader.exec_module(sc_utils)
- sc.settings.figdir='/wynton/group/ye/mtschmitz/figures/mouseWbGeAdult2/'
- scv.settings.figdir='/wynton/group/ye/mtschmitz/figures/mouseWbGeAdult2/'
- sc.settings.file_format_figs='pdf'
- sc.settings.autosave=True
- sc.settings.autoshow=False
- equalize=False
- if equalize:
- sc.settings.figdir='/wynton/group/ye/mtschmitz/figures/mouseWbGeAdult2ET/'
- scv.settings.figdir='/wynton/group/ye/mtschmitz/figures/mouseWbGeAdult2ET/'
- #adata=sc.read('/wynton/group/ye/mtschmitz/macaquedevbrain/CAT202002_h5ad/KDCbVelocityDYNAMICALMouseWbGeAdult.h5ad')
- if equalize:
- adata=sc.read('/wynton/group/ye/mtschmitz/macaquedevbrain/CAT202002_h5ad/KDCbVelocityEqualizeTerminalsDYNAMICALMouseWbGeAdult.h5ad')
- else:
- adata=sc.read('/wynton/group/ye/mtschmitz/macaquedevbrain/CAT202002_h5ad/KDCbVelocityDYNAMICALMouseWbGeAdult.h5ad')
- #adata=sc.read('/wynton/group/ye/mtschmitz/macaquedevbrain/CAT202002_h5ad/KDCbVelocityDYNAMICALsmallMouseWbGeAdult.h5ad')
- adata=adata[:,np.isfinite(adata.X.mean(0))]
- adata.obs['agg_supervised_name']='nan'
- adata.obs['old_leiden']='nan'
- supercell=pd.read_csv('/wynton/group/ye/mtschmitz/macaquedevbrain/MouseAdultAggSupervised.txt')
- adata=adata[~adata.obs.index.duplicated(),:]
- supercell=supercell.loc[supercell['agg_supervised_name']!='nan',:]
- ind=adata.obs.index[adata.obs.index.isin(supercell['full_cellname'])]
- supercell.index=supercell['full_cellname']
- supercell=supercell.loc[~supercell.index.duplicated(),:]
- supercell=supercell.loc[ind,:]
- adata.obs.loc[ind,'agg_supervised_name']=supercell['agg_supervised_name']
- adata.obs.loc[ind,'old_leiden']=supercell['leiden']
- adata.obs['agg_supervised_name']=adata.obs['agg_supervised_name'].astype(str)
- adata.obs['old_leiden']=adata.obs['old_leiden'].astype(str)
- #adata.obs['agg_supervised_name']=adata.obs['agg_supervised_name']+"___"+adata.obs['old_leiden']
- sc.pl.umap(adata,color=['agg_supervised_name'])
- SPNgenes=['ISL1','TAC1','PDYN','NRXN1','EBF1','NPY1R','PCP4','DRD1','DRD2','PENK','ADORA2A','GPR6','FOXP1','FOXP2','FOXP4','CASZ1','OTOF','OPRM1','PBX3']
- scanpy.pl.matrixplot(adata[adata.obs.agg_supervised_name.str.contains('FOXP|SPN'),:],groupby='agg_supervised_name',var_names=SPNgenes,cmap='coolwarm',dendrogram=True,use_raw=False,standard_scale='var',save='LGEonlyeSPNgenes')
- sc.tl.dendrogram(adata,groupby='agg_supervised_name')
- df_plot = adata.obs.groupby(['agg_supervised_name', 'region']).size().reset_index().pivot(columns='region', index='agg_supervised_name', values=0).apply(lambda g: g / g.sum(),1)
- df_plot=df_plot.loc[adata.uns["dendrogram_agg_supervised_name"]['categories_ordered'],:]
- these_colors=[region_color_dict[x] for x in df_plot.columns]
- ax = df_plot.plot(kind='bar', legend=False,stacked=True,color=these_colors)
- plt.legend(loc='center left', bbox_to_anchor=(1.0, 0.5))
- plt.ylabel('proportion of cells in region')
- ax.grid(False)
- ax.get_figure().savefig(os.path.join(sc.settings.figdir,'supervisedNameRegionsStackBar.pdf'), bbox_inches="tight")
- """
- hierarchy_key='agg_supervised_name'
- sufficient_cells=adata.obs[hierarchy_key].value_counts().index[adata.obs[hierarchy_key].value_counts()>10]
- adata=adata[adata.obs[hierarchy_key].isin(sufficient_cells),:]
- adata.obs[hierarchy_key].cat.remove_unused_categories(inplace=True)
- rgs=sc.tl.rank_genes_groups(adata,groupby=hierarchy_key,method='logreg',use_raw=False,copy=True).uns['rank_genes_groups']#,penalty='elasticnet',solver='saga')#or penalty='l1'
- result=rgs
- groups = result['names'].dtype.names
- df=pd.DataFrame({group + '_' + key[:1]: result[key][group] for group in groups for key in ['names', 'scores']})
- df.to_csv(os.path.join(sc.settings.figdir,"LogReg"+hierarchy_key+"Norm.csv"))
- topgenes=df.iloc[0:4,['_n' in x for x in df.columns]].T.values
- cols=df.columns[['_n' in x for x in df.columns]]
- cols=[re.sub('_n','',x) for x in cols]
- topdict=dict(zip(cols,topgenes))
- sc.tl.dendrogram(adata,groupby=hierarchy_key)
- var_dict=dict(zip(adata.uns["dendrogram_"+hierarchy_key]['categories_ordered'],[topdict[x] for x in adata.uns["dendrogram_"+hierarchy_key]['categories_ordered']]))
- sc.pl.matrixplot(adata,groupby=hierarchy_key,var_names=var_dict,save='top_degenes'+hierarchy_key,cmap='RdBu_r',use_raw=False,dendrogram=True)
- hierarchy_key='old_leiden'
- sufficient_cells=adata.obs[hierarchy_key].value_counts().index[adata.obs[hierarchy_key].value_counts()>10]
- adata=adata[adata.obs[hierarchy_key].isin(sufficient_cells),:]
- adata.obs[hierarchy_key].cat.remove_unused_categories(inplace=True)
- rgs=sc.tl.rank_genes_groups(adata,groupby=hierarchy_key,method='logreg',use_raw=False,copy=True).uns['rank_genes_groups']#,penalty='elasticnet',solver='saga')#or penalty='l1'
- result=rgs
- groups = result['names'].dtype.names
- df=pd.DataFrame({group + '_' + key[:1]: result[key][group] for group in groups for key in ['names', 'scores']})
- df.to_csv(os.path.join(sc.settings.figdir,"LogReg"+hierarchy_key+"Norm.csv"))
- topgenes=df.iloc[0:4,['_n' in x for x in df.columns]].T.values
- cols=df.columns[['_n' in x for x in df.columns]]
- cols=[re.sub('_n','',x) for x in cols]
- topdict=dict(zip(cols,topgenes))
- sc.tl.dendrogram(adata,groupby=hierarchy_key)
- var_dict=dict(zip(adata.uns["dendrogram_"+hierarchy_key]['categories_ordered'],[topdict[x] for x in adata.uns["dendrogram_"+hierarchy_key]['categories_ordered']]))
- sc.pl.matrixplot(adata,groupby=hierarchy_key,var_names=var_dict,save='top_degenes'+hierarchy_key,cmap='RdBu_r',use_raw=False,dendrogram=True)
- sc.pl.violin(adata, ['n_genes'],groupby='dataset_name',
- jitter=0.4, multi_panel=True,rotation=90,stripplot=False,save='QC')
- print('QC')
- print(adata)
- mouseMSNs=pd.read_csv('/wynton/group/ye/mtschmitz/macaquedevbrain/FOXTSHZ1mouseAdultStriatumMSNMarkers.txt',sep='\s')
- mouseMSNs.index=mouseMSNs['Class']
- mouseMSNs=mouseMSNs.iloc[:,3:]
- mouseMSNs=mouseMSNs.div(mouseMSNs.max(0),axis=1)
- mouseMSNs=mouseMSNs.loc[['Neuron_dSPN_Drd1','Neuron_iSPN_Adora2a','Neuron_SPN_BNST_Amygdala_Otof'],:]
- mouseMSNs.drop('Syt6',inplace=True,axis=1)
- scanpy.pl.matrixplot(adata[adata.obs.agg_supervised_name.str.contains('FOXP|SPN'),:],groupby='agg_supervised_name',var_names=[re.sub('\.1','',x.upper()) for x in mouseMSNs.columns],cmap='coolwarm',dendrogram=True,use_raw=False,standard_scale='var',save='LGEonlyeSPNgenes')
- """
- paldict={'CGE_NR2F2/PROX1': 'slategray',
- 'G1-phase_SLC1A3/ATP1A1': '#17344c',
- 'G2-M_UBE2C/ASPM': '#19122b',
- 'LGE_FOXP1/ISL1': 'cyan',
- 'LGE_FOXP1/PENK': 'navy',
- 'LGE_FOXP2/TSHZ1': 'goldenrod',
- 'LGE_MEIS2/PAX6': 'orangered',
- 'LGE_MEIS2/PAX6/SCGN': 'orange',
- 'LGE-OB_MEIS2/PAX6': 'red',
- 'MGE_CRABP1/MAF': 'indigo',
- 'MGE_CRABP1/TAC3': 'fuchsia',
- 'MGE_LHX6/MAF': 'darksalmon',
- 'MGE_LHX6/NPY': 'maroon',
- 'RMTW_ZIC1/RELN': 'yellow',
- 'S-phase_MCM4/H43C': 'lawngreen',
- 'Transition': '#3c7632',
- 'VMF_ZIC1/ZIC2': 'teal',
- 'VMF_CRABP1/LHX8':'skyblue',
- 'VMF_NR2F2/LHX6':'lightseagreen',
- 'VMF_LHX1/POU6F2':'seagreen',
- 'VMF_TMEM163/OTP':'lightsteelblue',
- 'VMF_PEG10/DLK1':'steelblue',
- 'LGE_FOXP1/ISL1/NPY1R':'mediumpurple',
- 'nan':'white',
- 'Str_LHX8/CHAT':'olivedrab',
- 'Amy/Hypo_HAP1/PEG10':'darkslateblue',
- 'GP_GBX1/GABRA1':'teal',
- 'vSTR_HAP1/ZIC1':'darkslategray',
- 'Excitatory':'whitesmoke',
- 'Ctx_PROX1/LAMP5':'darkgoldenrod',
- 'Ctx_LHX6/LAMP5':'rosybrown',
- 'OB-GC_RPRM':'palegoldenrod',
- 'OB-GC_STXBP6/PENK':'olive',
- 'OB-PGC_FOXP2/CALB1':'aquamarine',
- 'OB-PGC_TH/SCGN':'orange',
- 'OB-PGC_ZIC':'saddlebrown',
- 'Ctx_LHX6/PVALB':'hotpink',
- 'Ctx_PROX1/SNCG':'lightslategray',
- 'Ctx_LHX6/SST':'salmon',
- 'Ctx/BN_SST/CHODL':'maroon',
- 'Ctx_CCK/VIP':'tan',
- 'Ctx_NR2F2/PAX6':'sienna',
- 'Ctx_PVALB/VIPR2':'lightcoral',
- 'BN-eSPN_FOXP2/TSHZ1':'springgreen',
- 'Str-dSPN_FOXP1/ISL1':'cyan',
- 'Str-iSPN_FOXP1/PENK':'navy',
- 'vStr_DRD1/NPY1R':'violet',
- 'Str-IN_CRABP1/MAF':'black',
- 'Glia':'lightgoldenrodyellow',
- 'OB-GC NR2F2/PENK':'brown',
- 'Ctx_LAMP5/NDNF':'khaki',
- 'Ctx_SST/NDNF':'peachpuff',
- 'Ctx_CCK/DPY19L1':'dimgray'}
- sc.pl.umap(adata,color=['agg_supervised_name'])
- my_pal=[paldict[x] for x in adata.obs['agg_supervised_name'].cat.categories]
- sc.pl.umap(adata,color=['old_leiden'],legend_loc='on data',legend_fontsize=4,palette=my_pal,save='old_leiden')
- sc.pl.umap(adata,color=['agg_supervised_name'],legend_loc='on data',legend_fontsize=4,palette=my_pal,save='agg_supervised_adult')
- sc.pl.umap(adata,color='latent_time',save='_linear_latent_time',color_map=matplotlib.cm.RdYlBu_r)
- ingenes=['VIP','VIPR2','SNCG','CCK','LAMP5','PROX1','NR2F2','SLC17A6','SLC17A7','MEIS2','TSHZ1','DLX2','DLX6','GAD1','GAD2','PAX6','ETV1','SCGN','TH','TRH','FOXP1','FOXP2','ISL1','PENK','ZIC1','RPRM','CRH','CALB1','CALB2','LHX6','LHX8','MAF','CRABP1','PVALB','SST','NPY','NPY1R','CHODL','CORT']
- ingenes=[x for x in ingenes if x in adata.var.index]
- sc.pl.umap(adata,color=ingenes,save='_INgenes2',use_raw=False)
- ingenes=['VIP','VIPR2','SNCG','CCK','LAMP5','PROX1','NR2F2','SLC17A6','SLC17A7','MEIS2','TSHZ1','DLX2','DLX6','GAD1','GAD2','PAX6','ETV1','SCGN','TH','TRH','FOXP1','FOXP2','ISL1','PENK','ZIC1','RPRM','CRH','CALB1','CALB2','LHX6','LHX8','MAF','CRABP1','PVALB','SST','NPY','NPY1R','CHODL','CORT']
- ingenes=[x for x in ingenes if x in adata.var.index]
- sc.pl.umap(adata,color=ingenes,save='_INgenes',use_raw=False)
- transition_matrix=scv.utils.get_transition_matrix(adata,vkey='linear_velocity',self_transitions=True)
- transition_matrix=transition_matrix.astype(np.float64)
- #transition_matrix=(transition_matrix.T/transition_matrix.sum(1)).T
- transition_matrix[np.arange(0,transition_matrix.shape[0]),transition_matrix.argmax(1).A1]+=(1.0-transition_matrix.sum(1).A1)
- print(np.allclose(np.sum(transition_matrix, axis=1), 1.0))
- vk = cr.tl.kernels.PrecomputedKernel(transition_matrix,adata=adata)
- #vk = cr.tl.kernels.VelocityKernel(adata,vkey='linear_velocity')
- ck = cr.tl.kernels.ConnectivityKernel(adata)
- ck.compute_transition_matrix()
- vk.compute_transition_matrix()
- ckvk=vk+ck
- ckvk.compute_transition_matrix()
- d={}
- for c in adata.obs.agg_supervised_name.unique():
- if not any([x in c.upper() for x in ['MGE','RMTW','CGE','LGE','VMF','G2-M','S-PHASE','GLIA','NAN','TRANSITION','EXCITATORY']]):
- print(c)
- select_cells=adata.obs.agg_supervised_name.isin([c])
- d[c]=[adata.obs.index[i] for i in range(adata.shape[0]) if select_cells[i]]
- terminal_states=list(d.keys())#+['MGE_CRABP1/MAF']
- g=cr.tl.estimators.CFLARE(ckvk)
- g.compute_eigendecomposition()
- g.set_terminal_states(d,cluster_key='agg_supervised_name')
- #comment these two to go fast
- g.compute_absorption_probabilities(show_progress_bar=True)
- g.compute_lineage_drivers()
- l=[]
- for c in g.lineage_drivers.columns:
- print(c)
- col=g.lineage_drivers[c]
- srt=col.sort_values(ascending=False)
- l.append(srt.index)
- l.append(srt)
- df=pd.DataFrame(l,index=np.repeat(g.lineage_drivers.columns,2)).T
- df.to_csv(os.path.join(sc.settings.figdir,"lineage_drivers.csv"))
- probDF=pd.DataFrame(g.absorption_probabilities,columns=g.absorption_probabilities.names,index=adata.obs.index)
- probDF['supervised_name']=list(adata.obs['agg_supervised_name'])
- probDF.index=adata.obs.index
- adata.obs['Adult']=adata.obs.agg_supervised_name.isin(adata.uns['to_terminal_states_names']).fillna(value=False)
- probDF.loc[list(adata.obs['Adult']),:]=np.nan
- adata.obs['Adult']=adata.obs['Adult'].astype(str)
- #adata.obs['eSPN_prob']=probDF['eSPN']
- #adata.obs['Lamp5_prob']=probDF['Lamp5']
- #adata.obs['Pvalb_prob']=probDF['Pvalb']
- #adata.obs['Sst_prob']=probDF['Sst']
- #adata.obs['dSPN_prob']=probDF['dSPN']
- #adata.obs['iSPN_prob']=probDF['iSPN']
- """trim=0.05
- trimmedProbDF=probDF[(probDF<1-trim)]#& (probDF>trim)
- probDF=(probDF-trimmedProbDF.mean(0))/trimmedProbDF.std(0)
- """
- #adata.obs['predicted_end']=probDF.idxmax(1)
- #sc.pl.umap(adata,color=['eSPN_prob','Lamp5_prob','Pvalb_prob','Sst_prob','iSPN_prob','dSPN_prob'],use_raw=False,save='CFLARE_probabilities')
- #g.plot_absorption_probabilities(same_plot=False, size=50, lineages=terminal_states[0:min(18,len(terminal_states))],basis='X_umap',save='CFLARE_all_probabiliities')
- #sc.pl.umap(adata,color=['predicted_end'],use_raw=False,save='CFLARE_predicted_end')
- adata.obs.drop('terminal_states_probs',axis=1,inplace=True)
- adata.write('/wynton/home/ye/mschmitz1/CFLARE'+str(equalize)+'mouseAdult2.h5ad')
- qvmdata=sc.read('/wynton/group/ye/mtschmitz/macaquedevbrain/CAT202002_h5ad/KDCbProcessedQvMMotor.h5ad')
- nz0=qvmdata.uns['neighbors']['distances'].nonzero()[0]
- nz1=qvmdata.uns['neighbors']['distances'].nonzero()[1]
- nz0i=qvmdata.obs.index[nz0]
- nz1i=qvmdata.obs.index[nz1]
- results=[nz0,
- nz1,
- qvmdata.obs.loc[nz0i,'species'],
- qvmdata.obs.loc[nz1i,'species'],
- qvmdata.obs.loc[nz0i,'supervised_name'],
- qvmdata.obs.loc[nz1i,'supervised_name']]
- df=pd.DataFrame(results,index=['ind1','ind2','species1','species2','classname1','classname2']).T
- mat=df.groupby('ind1')['classname2'].value_counts(dropna=False).unstack('classname2').fillna(0)
- #mat=mat.loc[:,mat.columns!='nan']
- crossdf=df.loc[(df['species1']=='Macaque')&(df['species2']=='Mouse'),:]
- crossdf2=df.loc[(df['species2']=='Macaque')&(df['species1']=='Mouse'),:]
- #crossdf=crossdf.loc[:,['ind1','ind2','classname1','classname2']]
- #crossdf2=crossdf2.loc[:,['ind1','ind2','classname1','classname2']]
- crossdf2.columns=['ind2','ind1','species1','species2','classname1','classname2']
- mnndf=pd.concat([crossdf,crossdf2],)
- mnndf['combo']=mnndf['ind1'].astype(str)+'_'+mnndf['ind2'].astype(str)
- mnndf=mnndf.rename({'classname1':'classname2','classname2':'classname1'},axis=1)
- mnndf=mnndf.loc[~mnndf['classname1'].str.contains('phase|G2-M|Transition'),:]
- mnndf=mnndf.loc[~mnndf['classname2'].str.contains('phase|G2-M|Transition'),:]
- cdfsums=mnndf.loc[mnndf['combo'].duplicated(),:].groupby('classname1')['classname2'].value_counts(normalize=True)
- sankeydf=cdfsums.unstack().stack().reset_index()
- adata.obs['agg_supervised_name'].cat.remove_unused_categories(inplace=True)
- ##################Forwards
- """
- devclusters=[c for c in adata.obs.agg_supervised_name.unique() if any([x in str(c).upper() for x in ['MGE','RMTW','CGE','LGE','VMF','G2-M','S-PHASE','GLIA','NAN','TRANSITION','Excitatory']])]
- adata.obs['Adult']=adata.obs.dataset_name.str.contains('BICCN|OB|konopkka|adult')|~adata.obs.agg_supervised_name.isin(devclusters)
- adultframe=adata.obs.loc[~adata.obs['Adult'],:]
- adultframe['agg_supervised_name'].cat.remove_unused_categories(inplace=True)
- adultframesums=adultframe.groupby(['agg_supervised_name'])['predicted_end'].value_counts(normalize=True)
- adultsankeydf=adultframesums.unstack().stack().reset_index()"""
- ###################Backwards
- #print(adata.obs)
- #print(adata.obs.index)
- #print(probDF.sort_values(c,ascending = False))
- #print(adata.obs.index[probDF.sort_values(c,ascending = False).index[:500]])
- ##########Backwards top N mapping
- max_cells_in_category=1000
- vcs=probDF['supervised_name'].value_counts()
- print(vcs)
- for t in vcs.index:
- print(t)
- print(vcs[t])
- print(max(vcs[t]-max_cells_in_category,0))
- destroy=np.random.choice(probDF.index[probDF['supervised_name']==t],size=max(vcs[t]-max_cells_in_category,0),replace=False)
- probDF=probDF.loc[~probDF.index.isin(destroy),:]
- topinds={}
- for c in probDF.columns:
- topinds[c]=list(adata.obs.loc[probDF.sort_values(c,ascending = False).index[:100],'agg_supervised_name'])
- adultsankeydf=pd.DataFrame(topinds).apply(lambda x: x.value_counts(normalize=True)).stack().reset_index()
- adultsankeydf.columns=['agg_supervised_name','predicted_end',0]
- ##########Backwards mean absorbtion normalized
- """
- probDF['supervised_name']=list(adata.obs['supervised_name'])
- meanDF=probDF.fillna(np.inf).groupby(['supervised_name']).mean().replace(np.inf, 0)
- meanDF=meanDF/meanDF.sum(0)
- #meanDF=meanDF.loc[meanDF.index.str.contains('VMF|LGE|MGE|CGE|RMTW'),:]
- adultsankeydf=meanDF.stack().reset_index()
- adultsankeydf.columns=['agg_supervised_name','predicted_end',0]
- """
- adultsankeydf=adultsankeydf.loc[adultsankeydf['agg_supervised_name'].str.contains('MGE|CGE|VMF|LGE|RMTW'),:]
- adultsankeydf=adultsankeydf.loc[~adultsankeydf['agg_supervised_name'].str.contains('supervised'),:]
- adultsankeydf=adultsankeydf.loc[~adultsankeydf['predicted_end'].str.contains('supervised'),:]
- cn1dict=dict(zip(sankeydf['classname1'].unique(),range(len(sankeydf['classname1'].unique()))))
- cn1len=len(sankeydf['classname1'].unique())
- cn2dict=dict(zip(sankeydf['classname2'].unique(),np.array(range(len(sankeydf['classname2'].unique())))+cn1len))
- cn2len=len(sankeydf['classname2'].unique())
- cn3dict=dict(zip(adultsankeydf['predicted_end'].unique(),np.array(range(len(adultsankeydf['predicted_end'].unique())))+cn1len+cn2len))
- cn3len=len(adultsankeydf['predicted_end'].unique())
- overalldict=dict(zip(list(cn1dict.keys())+list(cn2dict.keys())+list(cn3dict.keys()),list(cn1dict.values())+list(cn2dict.values())+list(cn3dict.values())))
- paldict={'CGE_NR2F2/PROX1': 'slategray',
- 'G1-phase_SLC1A3/ATP1A1': '#17344c',
- 'G2-M_UBE2C/ASPM': '#19122b',
- 'LGE_FOXP1/ISL1': 'cyan',
- 'LGE_FOXP1/PENK': 'navy',
- 'LGE_FOXP2/TSHZ1': 'goldenrod',
- 'LGE_MEIS2/PAX6': 'orangered',
- 'LGE_MEIS2/PAX6/SCGN': 'orange',
- 'LGE-OB_MEIS2/PAX6': 'red',
- 'MGE_CRABP1/MAF': 'indigo',
- 'MGE_CRABP1/TAC3': 'fuchsia',
- 'MGE_LHX6/MAF': 'darksalmon',
- 'MGE_LHX6/NPY': 'maroon',
- 'RMTW_ZIC1/RELN': 'yellow',
- 'S-phase_MCM4/H43C': 'lawngreen',
- 'Transition': '#3c7632',
- 'VMF_ZIC1/ZIC2': 'teal',
- 'VMF_CRABP1/LHX8':'skyblue',
- 'VMF_NR2F2/LHX6':'lightseagreen',
- 'VMF_LHX1/POU6F2':'seagreen',
- 'VMF_TMEM163/OTP':'lightsteelblue',
- 'VMF_PEG10/DLK1':'steelblue',
- 'LGE_FOXP1/ISL1/NPY1R':'mediumpurple',
- 'nan':'white',
- 'Str_LHX8/CHAT':'olivedrab',
- 'Amy/Hypo_HAP1/PEG10':'darkslateblue',
- 'GP_GBX1/GABRA1':'teal',
- 'vSTR_HAP1/ZIC1':'darkslategray',
- 'Excitatory':'whitesmoke',
- 'Ctx_PROX1/LAMP5':'darkgoldenrod',
- 'Ctx_LHX6/LAMP5':'rosybrown',
- 'OB-GC_RPRM':'palegoldenrod',
- 'OB-GC_STXBP6/PENK':'olive',
- 'OB-PGC_FOXP2/CALB1':'aquamarine',
- 'OB-PGC_TH/SCGN':'orange',
- 'OB-PGC_ZIC':'saddlebrown',
- 'Ctx_LHX6/PVALB':'hotpink',
- 'Ctx_PROX1/SNCG':'lightslategray',
- 'Ctx_LHX6/SST':'salmon',
- 'Ctx/BN_SST/CHODL':'maroon',
- 'Ctx_CCK/VIP':'tan',
- 'Ctx_NR2F2/PAX6':'sienna',
- 'Ctx_PVALB/VIPR2':'lightcoral',
- 'BN-eSPN_FOXP2/TSHZ1':'springgreen',
- 'Str-dSPN_FOXP1/ISL1':'cyan',
- 'Str-iSPN_FOXP1/PENK':'navy',
- 'vStr_DRD1/NPY1R':'violet',
- 'Str-IN_CRABP1/MAF':'black',
- 'Glia':'lightgoldenrodyellow',
- 'OB-GC NR2F2/PENK':'brown',
- 'Ctx_LAMP5/NDNF':'khaki',
- 'Ctx_SST/NDNF':'peachpuff',
- 'Ctx_CCK/DPY19L1':'dimgray'}
- #my_pal=[paldict[x] for x in supercell['agg_supervised_name'].unique()]
- my_pal=[paldict[x] for x in adata.obs['agg_supervised_name'].cat.categories]
- nodenames=list(cn1dict.keys())+list(cn2dict.keys())+list(cn3dict.keys())
- nodecolors=[paldict[x] for x in nodenames]
- alphacolors=['rgba'+str(matplotlib.colors.to_rgba(paldict[x],alpha=.59999999999999)) for x in paldict.keys()]
- paldict=dict(zip(paldict.keys(),alphacolors))
- toclass=list(sankeydf['classname1'])+list(adultsankeydf['predicted_end'])
- fromclass=list(sankeydf['classname1'])+list(adultsankeydf['agg_supervised_name'])
- values=list(sankeydf[0])+list(adultsankeydf[0])
- color=[paldict[x] for x in toclass]
- #linkcolor=[paldict[y] for x,y in zip(sankeydf[0]**2,sankeydf['classname1'])]
- linkcolor=[re.sub('0.59999999999999','%.2f' %x ,paldict[y]) for x,y in zip(values,fromclass)]
- import plotly
- import plotly.graph_objects as go
- fig = go.Figure(data=[go.Sankey(
- node = dict(
- pad = 5,
- thickness = 30,
- line = dict(color = "black", width = 0.5),
- label = nodenames,
- color = nodecolors
- ),
- link = dict(
- source = [cn1dict[x] for x in sankeydf['classname1']]+[cn2dict[x] for x in adultsankeydf['agg_supervised_name']],
- target = [cn2dict[x] for x in sankeydf['classname2']]+[cn3dict[x] for x in adultsankeydf['predicted_end']],
- value = values,
- color=linkcolor
- #color=[paldict[x] for x in sankeydf['classname1']]
- ))])
- fig.update_layout(title_text="Cross Species MNN", font_size=20)
- import plotly.io as pio
- os.environ["PATH"] = os.environ["PATH"] +':/wynton/home/ye/mschmitz1/utils/miniconda3/envs/cellrank/bin/'
- pio.write_image(fig, os.path.join(sc.settings.figdir,'CFLARE_Sankey.pdf'),width=1200,height=1200)
- del adata.obsm['to_terminal_states']
- del adata.uns['to_terminal_states_names']
- del g
- #g=cr.tl.estimators.CFLARE(ck)
- g = cr.tl.estimators.GPCCA(ckvk)
- #g.compute_eigendecomposition()
- g.compute_schur(n_components=50)
- g.set_terminal_states(d,cluster_key='agg_supervised_name')
- g.compute_absorption_probabilities(show_progress_bar=True)
- probDF=pd.DataFrame(g.absorption_probabilities,columns=g.absorption_probabilities.names,index=adata.obs.index)
- g.plot_absorption_probabilities(same_plot=False, size=50, basis='X_umap',lineages=terminal_states[0:min(18,len(terminal_states))],save='GPCCA_all_probabiliities')
- probDF['supervised_name']=list(adata.obs['agg_supervised_name'])
- probDF.index=adata.obs.index
- adata.obs['Adult']=adata.obs.agg_supervised_name.isin(adata.uns['to_terminal_states_names']).fillna(value=False)
- probDF.loc[list(adata.obs['Adult']),:]=np.nan
- adata.obs['Adult']=adata.obs['Adult'].astype(str)
- #adata.obs['eSPN_prob']=probDF['eSPN']
- #adata.obs['Lamp5_prob']=probDF['Lamp5']
- #adata.obs['Pvalb_prob']=probDF['Pvalb']
- #adata.obs['Sst_prob']=probDF['Sst']
- #adata.obs['dSPN_prob']=probDF['dSPN']
- #adata.obs['iSPN_prob']=probDF['iSPN']
- """trim=0.05
- trimmedProbDF=probDF[(probDF<1-trim)]#& (probDF>trim)
- probDF=(probDF-trimmedProbDF.mean(0))/trimmedProbDF.std(0)
- """
- #adata.obs['predicted_end']=probDF.idxmax(1)
- #sc.pl.umap(adata,color=['eSPN_prob','Lamp5_prob','Pvalb_prob','Sst_prob','iSPN_prob','dSPN_prob'],use_raw=False,save='GPPCA_probabilities')
- #sc.pl.umap(adata,color=['predicted_end'],use_raw=False,save='GPPCA_predicted_end')
- adata.obs.drop('terminal_states_probs',axis=1,inplace=True)
- adata.write('/wynton/home/ye/mschmitz1/GPCCA'+str(equalize)+'mouseAdult2.h5ad')
- nz0=qvmdata.uns['neighbors']['distances'].nonzero()[0]
- nz1=qvmdata.uns['neighbors']['distances'].nonzero()[1]
- nz0i=qvmdata.obs.index[nz0]
- nz1i=qvmdata.obs.index[nz1]
- results=[nz0,
- nz1,
- qvmdata.obs.loc[nz0i,'species'],
- qvmdata.obs.loc[nz1i,'species'],
- qvmdata.obs.loc[nz0i,'supervised_name'],
- qvmdata.obs.loc[nz1i,'supervised_name']]
- df=pd.DataFrame(results,index=['ind1','ind2','species1','species2','classname1','classname2']).T
- mat=df.groupby('ind1')['classname2'].value_counts(dropna=False).unstack('classname2').fillna(0)
- #mat=mat.loc[:,mat.columns!='nan']
- crossdf=df.loc[(df['species1']=='Macaque')&(df['species2']=='Mouse'),:]
- crossdf2=df.loc[(df['species2']=='Macaque')&(df['species1']=='Mouse'),:]
- #crossdf=crossdf.loc[:,['ind1','ind2','classname1','classname2']]
- #crossdf2=crossdf2.loc[:,['ind1','ind2','classname1','classname2']]
- crossdf2.columns=['ind2','ind1','species1','species2','classname1','classname2']
- mnndf=pd.concat([crossdf,crossdf2],)
- mnndf['combo']=mnndf['ind1'].astype(str)+'_'+mnndf['ind2'].astype(str)
- mnndf=mnndf.rename({'classname1':'classname2','classname2':'classname1'},axis=1)
- mnndf=mnndf.loc[~mnndf['classname1'].str.contains('phase|G2-M|Transition'),:]
- mnndf=mnndf.loc[~mnndf['classname2'].str.contains('phase|G2-M|Transition'),:]
- cdfsums=mnndf.loc[mnndf['combo'].duplicated(),:].groupby('classname1')['classname2'].value_counts(normalize=True)
- sankeydf=cdfsums.unstack().stack().reset_index()
- adata.obs['agg_supervised_name'].cat.remove_unused_categories(inplace=True)
- ##################Forwards
- """
- devclusters=[c for c in adata.obs.agg_supervised_name.unique() if any([x in str(c).upper() for x in ['MGE','RMTW','CGE','LGE','VMF','G2-M','S-PHASE','GLIA','NAN','TRANSITION','Excitatory']])]
- adata.obs['Adult']=adata.obs.dataset_name.str.contains('BICCN|OB|konopkka|adult')|~adata.obs.agg_supervised_name.isin(devclusters)
- adultframe=adata.obs.loc[~adata.obs['Adult'],:]
- adultframe['agg_supervised_name'].cat.remove_unused_categories(inplace=True)
- adultframesums=adultframe.groupby(['agg_supervised_name'])['predicted_end'].value_counts(normalize=True)
- adultsankeydf=adultframesums.unstack().stack().reset_index()"""
- ###################Backwards
- max_cells_in_category=1000
- vcs=probDF['supervised_name'].value_counts()
- for t in vcs.index:
- print(t)
- print(vcs[t])
- print(max(vcs[t]-max_cells_in_category,0))
- destroy=np.random.choice(probDF.index[probDF['supervised_name']==t],size=max(vcs[t]-max_cells_in_category,0),replace=False)
- probDF=probDF.loc[~probDF.index.isin(destroy),:]
- topinds={}
- for c in probDF.columns:
- topinds[c]=list(adata.obs.loc[probDF.sort_values(c,ascending = False).index[:100],'agg_supervised_name'])
- adultsankeydf=pd.DataFrame(topinds).apply(lambda x: x.value_counts(normalize=True)).stack().reset_index()
- adultsankeydf.columns=['agg_supervised_name','predicted_end',0]
- ##########Backwards mean absorbtion normalized
- """
- probDF['supervised_name']=list(adata.obs['supervised_name'])
- meanDF=probDF.fillna(np.inf).groupby(['supervised_name']).mean().replace(np.inf, 0)
- meanDF=meanDF/meanDF.sum(0)
- #meanDF=meanDF.loc[meanDF.index.str.contains('VMF|LGE|MGE|CGE|RMTW'),:]
- adultsankeydf=meanDF.stack().reset_index()
- adultsankeydf.columns=['agg_supervised_name','predicted_end',0]
- """
- adultsankeydf=adultsankeydf.loc[adultsankeydf['agg_supervised_name'].str.contains('MGE|CGE|VMF|LGE|RMTW'),:]
- adultsankeydf=adultsankeydf.loc[~adultsankeydf['agg_supervised_name'].str.contains('supervised'),:]
- adultsankeydf=adultsankeydf.loc[~adultsankeydf['predicted_end'].str.contains('supervised'),:]
- cn1dict=dict(zip(sankeydf['classname1'].unique(),range(len(sankeydf['classname1'].unique()))))
- cn1len=len(sankeydf['classname1'].unique())
- cn2dict=dict(zip(sankeydf['classname2'].unique(),np.array(range(len(sankeydf['classname2'].unique())))+cn1len))
- cn2len=len(sankeydf['classname2'].unique())
- cn3dict=dict(zip(adultsankeydf['predicted_end'].unique(),np.array(range(len(adultsankeydf['predicted_end'].unique())))+cn1len+cn2len))
- cn3len=len(adultsankeydf['predicted_end'].unique())
- overalldict=dict(zip(list(cn1dict.keys())+list(cn2dict.keys())+list(cn3dict.keys()),list(cn1dict.values())+list(cn2dict.values())+list(cn3dict.values())))
- paldict={'CGE_NR2F2/PROX1': 'slategray',
- 'G1-phase_SLC1A3/ATP1A1': '#17344c',
- 'G2-M_UBE2C/ASPM': '#19122b',
- 'LGE_FOXP1/ISL1': 'cyan',
- 'LGE_FOXP1/PENK': 'navy',
- 'LGE_FOXP2/TSHZ1': 'goldenrod',
- 'LGE_MEIS2/PAX6': 'orangered',
- 'LGE_MEIS2/PAX6/SCGN': 'orange',
- 'LGE-OB_MEIS2/PAX6': 'red',
- 'MGE_CRABP1/MAF': 'indigo',
- 'MGE_CRABP1/TAC3': 'fuchsia',
- 'MGE_LHX6/MAF': 'darksalmon',
- 'MGE_LHX6/NPY': 'maroon',
- 'RMTW_ZIC1/RELN': 'yellow',
- 'S-phase_MCM4/H43C': 'lawngreen',
- 'Transition': '#3c7632',
- 'VMF_ZIC1/ZIC2': 'teal',
- 'VMF_CRABP1/LHX8':'skyblue',
- 'VMF_NR2F2/LHX6':'lightseagreen',
- 'VMF_LHX1/POU6F2':'seagreen',
- 'VMF_TMEM163/OTP':'lightsteelblue',
- 'VMF_PEG10/DLK1':'steelblue',
- 'LGE_FOXP1/ISL1/NPY1R':'mediumpurple',
- 'nan':'white',
- 'Str_LHX8/CHAT':'olivedrab',
- 'Amy/Hypo_HAP1/PEG10':'darkslateblue',
- 'GP_GBX1/GABRA1':'teal',
- 'vSTR_HAP1/ZIC1':'darkslategray',
- 'Excitatory':'whitesmoke',
- 'Ctx_PROX1/LAMP5':'darkgoldenrod',
- 'Ctx_LHX6/LAMP5':'rosybrown',
- 'OB-GC_RPRM':'palegoldenrod',
- 'OB-GC_STXBP6/PENK':'olive',
- 'OB-PGC_FOXP2/CALB1':'aquamarine',
- 'OB-PGC_TH/SCGN':'orange',
- 'OB-PGC_ZIC':'saddlebrown',
- 'Ctx_LHX6/PVALB':'hotpink',
- 'Ctx_PROX1/SNCG':'lightslategray',
- 'Ctx_LHX6/SST':'salmon',
- 'Ctx/BN_SST/CHODL':'maroon',
- 'Ctx_CCK/VIP':'tan',
- 'Ctx_NR2F2/PAX6':'sienna',
- 'Ctx_PVALB/VIPR2':'lightcoral',
- 'BN-eSPN_FOXP2/TSHZ1':'springgreen',
- 'Str-dSPN_FOXP1/ISL1':'cyan',
- 'Str-iSPN_FOXP1/PENK':'navy',
- 'vStr_DRD1/NPY1R':'violet',
- 'Str-IN_CRABP1/MAF':'black',
- 'Glia':'lightgoldenrodyellow',
- 'OB-GC NR2F2/PENK':'brown',
- 'Ctx_LAMP5/NDNF':'khaki',
- 'Ctx_SST/NDNF':'peachpuff',
- 'Ctx_CCK/DPY19L1':'dimgray'}
- #my_pal=[paldict[x] for x in supercell['agg_supervised_name'].unique()]
- my_pal=[paldict[x] for x in adata.obs['agg_supervised_name'].cat.categories]
- nodenames=list(cn1dict.keys())+list(cn2dict.keys())+list(cn3dict.keys())
- nodecolors=[paldict[x] for x in nodenames]
- alphacolors=['rgba'+str(matplotlib.colors.to_rgba(paldict[x],alpha=.59999999999999)) for x in paldict.keys()]
- paldict=dict(zip(paldict.keys(),alphacolors))
- toclass=list(sankeydf['classname1'])+list(adultsankeydf['predicted_end'])
- fromclass=list(sankeydf['classname1'])+list(adultsankeydf['agg_supervised_name'])
- values=list(sankeydf[0])+list(adultsankeydf[0])
- color=[paldict[x] for x in toclass]
- #linkcolor=[paldict[y] for x,y in zip(sankeydf[0]**2,sankeydf['classname1'])]
- linkcolor=[re.sub('0.59999999999999','%.2f' %x ,paldict[y]) for x,y in zip(values,fromclass)]
- import plotly
- import plotly.graph_objects as go
- fig = go.Figure(data=[go.Sankey(
- node = dict(
- pad = 5,
- thickness = 30,
- line = dict(color = "black", width = 0.5),
- label = nodenames,
- color = nodecolors
- ),
- link = dict(
- source = [cn1dict[x] for x in sankeydf['classname1']]+[cn2dict[x] for x in adultsankeydf['agg_supervised_name']],
- target = [cn2dict[x] for x in sankeydf['classname2']]+[cn3dict[x] for x in adultsankeydf['predicted_end']],
- value = values,
- color=linkcolor
- #color=[paldict[x] for x in sankeydf['classname1']]
- ))])
- fig.update_layout(title_text="Cross Species MNN", font_size=20)
- import plotly.io as pio
- os.environ["PATH"] = os.environ["PATH"] +':/wynton/home/ye/mschmitz1/utils/miniconda3/envs/cellrank/bin/'
- pio.write_image(fig, os.path.join(sc.settings.figdir,'GPCCA_Sankey.pdf'),width=1200,height=1200)
- del adata.obsm['to_terminal_states']
- del adata.uns['to_terminal_states_names']
- del g
- g = cr.tl.estimators.GPCCA(ckvk)
- #g.compute_eigendecomposition()
- g.compute_schur(n_components=100,method='krylov')
- print('Schur complete',flush=True)
- g.plot_spectrum(real_only=True,save='spectrum')
- g.compute_macrostates(n_states=50, n_cells=30,cluster_key="agg_supervised_name")
- print('Macrostates computed', flush=True)
- #adata.write('/wynton/home/ye/mschmitz1/GPCCAmacrostatesmouseAdult2.h5ad')
- adata.uns['macrostates']=list(g.macrostates.cat.categories)
- g.set_terminal_states_from_macrostates([y for y in adata.uns['macrostates'].unique() if any([x in y for x in terminal_states])])
- g.compute_absorption_probabilities()
- probDF=pd.DataFrame(g.absorption_probabilities,columns=g.absorption_probabilities.names,index=adata.obs.index)
- adata.obs['predicted_end']=probDF.idxmax(1)
- #sc.pl.umap(adata,color=['eSPN_prob','Lamp5_prob','Pvalb_prob','Sst_prob','iSPN_prob','dSPN_prob'],use_raw=False,save='GPCCA_macrostates_selected_probabilities')
- sc.pl.umap(adata,color=['predicted_end'],use_raw=False,save='GPCCA_macrostates_predicted_end')
- g.plot_absorption_probabilities(same_plot=False, size=50,lineages=terminal_states[0:min(18,len(terminal_states))], basis='X_umap',save='GPCCA_macrostates_all_probabiliities')
- cr.tl.initial_states(adata, cluster_key='agg_supervised_name')
- cr.pl.initial_states(adata, discrete=True,save='GPCCA_macrostates_initial states')
- adata.obs.drop('terminal_states_probs',axis=1,inplace=True)
- #adata.write('/wynton/home/ye/mschmitz1/GPCCAmacrostatesmouseAdult2.h5ad')
- del adata.obsm['to_terminal_states']
- del adata.uns['to_terminal_states_names']
- del g
MouseWbGeKDCbAdult4_cellrank.py at commit 616c738, no license · at the source
Overview
13 affiliations
- Neuroscience Institute Cavalieri Ottolenghi, Orbassano, Turin, Italy
- Department of Neurosciences “Rita Levi Montalcini”, University of Turin, Turin, Italy
- Department of Life Sciences and System Biology, University of Turin, Turin, Italy
- Centre for Developmental Neurobiology, Institute of Psychiatry, Psychology & Neuroscience, King’s College London, London, UK
- Institute of Physiological Chemistry, University Medical Center Johannes Gutenberg University, Mainz, Germany
- Molecular Biotechnology Center “Guido Tarone”, University of Turin, Turin, Italy
- Cologne Excellence Cluster on Cellular Stress Responses in Aging-Associated Diseases, University of Cologne, Cologne, Germany
- Center for Molecular Medicine, 50931 Cologne, Germany
- Institute of Genetics, University of Cologne, Cologne, Germany
- University of Cologne, Faculty of Medicine and University Hospital Cologne, Cologne, Germany
- Italian Institute for Genomic Medicine, Candiolo, Turin, Italy
- MRC Centre for Neurodevelopmental Disorders, Institute of Psychiatry, Psychology & Neuroscience, King’s College London, London, UK
- Focus Program Translational Neurosciences, Johannes Gutenberg University, Mainz, Germany
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 5 matches between paragraphs and lines of code.
bunbunet
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
mtvector/dev-and-evo-of-primate-inhibitory-neurons
616c7381a136fceec3da4e2d9f2710a0b664abf0, 8 November 2022Availability: 2 checks, the latest on 15 November 2026: the link answers
- 15 November 2026: the link answers
- 27 September 2026: the link answers
40 files
- imaging_preprocessing/
.ipynb_checkpoints/ , Jupyter, 373 linesCellCountingAnalysis-che ckpoint.ipynb - imaging_preprocessing/
CellCountingAnalysis.ipy , Jupyter, 373 linesnb - imaging_preprocessing/
CellCountingAnalysis.py , Python, 518 lines - imaging_preprocessing/
Counting.py , Python, 172 lines - imaging_preprocessing/
ImageStitching.py , Python, 560 lines - imaging_preprocessing/
ImageStitchingImageJ.py , Python, 439 lines - imaging_preprocessing/
Runallstitching.py , Python, 59 lines - imaging_preprocessing/
Runallstitching.sh , Shell, 16 lines - imaging_preprocessing/
SubtractBackground.js , JavaScript, 5 lines - imaging_preprocessing/
rolling_ball.py , Python, 211 lines - macaque/
.ipynb_checkpoints/ , Python, 248 linesMacaqueGeAllcortexKDCb1S ubset-checkpoint.py - macaque/
.ipynb_checkpoints/ , Python, 135 linesMacaqueGeAllcortexKDCbPa rt3RedoDynam-checkpoint. py - macaque/
.ipynb_checkpoints/ , Python, 406 linesMacaqueGeAllcortexKDCbPa rt3allGEs-checkpoint.py - macaque/
MacaqueGeAllcortexKDCb1S , Python, 248 linesubset.py - macaque/
MacaqueGeAllcortexKDCbPa , Python, 635 linesrt2.py - macaque/
MacaqueGeAllcortexKDCbPa , Python, 260 linesrt3.py - macaque/
MacaqueGeAllcortexKDCbPa , Python, 135 linesrt3RedoDynam.py - macaque/
MacaqueGeAllcortexKDCbPa , Python, 406 linesrt3allGEs.py - macaque/
MacaqueGeAllcortexKDCbPa , Python, 682 linesrt4.py - macaque/
MacaqueGeAllcortexKDCbPa , Python, 111 linesrt5BranchDE.py - macaque/
MacaqueGeAllcortexKDCbPa , Python, 204 linesrt6CorrelationGraphs.py - merge/
.ipynb_checkpoints/ , Python, 400 linesQvMWbGeKDCb-checkpoint.p y - merge/
QvMWbGeKDCb.py , Python, 400 lines, 1 match - mouse/
.ipynb_checkpoints/ , Python, 249 linesMouseWbGeKDCb1Subset-che ckpoint.py - mouse/
.ipynb_checkpoints/ , Python, 394 linesMouseWbGeKDCb2-checkpoin t.py - mouse/
.ipynb_checkpoints/ , Python, 172 linesMouseWbGeKDCb2_FixVeloci ty-checkpoint.py - mouse/
MouseWbGeKDCb1Subset.py , Python, 249 lines, 1 match - mouse/
MouseWbGeKDCb2.py , Python, 394 lines - mouse/
MouseWbGeKDCb2_FixVeloci , Python, 172 linesty.py - mouse/
MouseWbGeKDCb3_cellrank. , Python, 208 linespy - mouse/
MouseWbGeKDCb4_BranchDE. , Python, 135 linespy - mouse/
MouseWbGeKDCb5_Correlati , Python, 197 linesonGraphs.py - mouse/
MouseWbGeKDCbAdult.py , Python, 372 lines, 1 match - mouse/
MouseWbGeKDCbAdult2.py , Python, 248 lines, 1 match - mouse/
MouseWbGeKDCbAdult3_velo , Python, 278 linescity.py - mouse/
MouseWbGeKDCbAdult4_cell , Python, 703 lines, 1 matchrank.py - mouse/
MouseWbGeKDCbAdult5_sank , Python, 270 linesey.py - utils/
.ipynb_checkpoints/ , Python, 1,313 linesScanpyUtilsMT-checkpoint .py - utils/
ScanpyUtilsMT.py , Python, 1,313 lines - README.md, Text, 6 lines
The paper's code and data availability statement is in the Data section.
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;
- 39 scripts, each with its path and the digest of its content;
- 5 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
- geo:GSE303816, at NCBI GEO; found in “Data and code availability”
Code and data availability statement
The paper has a code and 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 a dataset: NCBI GEO GSE303816
- it points to the authors' code: bunbunet
Read it in the paper: doi.org/10.1016/j.stemcr.2026.103015.
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 2, 28 September 2026
- Authors: added F Luzzati (0000-0003-0648-9989); removed F Luzzati
- Funding: added Compagnia di San Paolo: S1618; Dipartimenti di Eccellenza: 2023-2027, 2018–2022; European Commission: 2018-2022, HORIZON2020, 874758; Deutsche Forschungsgemeinschaft: 2018-2022, 357058359; Ministero dell’Istruzione, dell’Università e della Ricerca: 2023/2027, 20182022; Università degli Studi di Torino; HORIZON EUROPE Framework Programme; Ministero dell'Istruzione e del Merito
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 15 authors, 10 keywords, 11 MeSH terms, 102 references, 33 RRIDs.
Cite
This paper
Nato, G., Fogli, M., Marichal, N., Cerrato, V., Turrini, G., Proserpio, V., Ghia, I., Zanotto, G., Molineris, I., Bergami, M., Oliviero, S., Peretto, P., Berninger, B., Buffo, A., & Luzzati, F. (2026). Brain injury reactivates a developmental program driving genesis and integration of transient LGE-class interneurons. Stem cell reports, 21(8), 103015. https://
BibTeX
@article{nato2026brain,
author = {Nato, G and Fogli, M and Marichal, N and Cerrato, V and Turrini, G and Proserpio, V and Ghia, I and Zanotto, G and Molineris, I and Bergami, M and Oliviero, S and Peretto, P and Berninger, B and Buffo, A and Luzzati, F},
title = {{Brain injury reactivates a developmental program driving genesis and integration of transient LGE-class interneurons}},
journal = {Stem cell reports},
year = {2026},
month = jul,
volume = {21},
number = {8},
pages = {103015},
publisher = {Elsevier},
issn = {2213-6711},
doi = {10.1016/
url = {https://
pmid = {42462713},
pmcid = {PMC13476880}
}
RIS
TY - JOUR
AU - Nato, G
AU - Fogli, M
AU - Marichal, N
AU - Cerrato, V
AU - Turrini, G
AU - Proserpio, V
AU - Ghia, I
AU - Zanotto, G
AU - Molineris, I
AU - Bergami, M
AU - Oliviero, S
AU - Peretto, P
AU - Berninger, B
AU - Buffo, A
AU - Luzzati, F
TI - Brain injury reactivates a developmental program driving genesis and integration of transient LGE-class interneurons
T2 - Stem cell reports
J2 - Stem Cell Reports
PY - 2026
DA - 2026/
VL - 21
IS - 8
SP - 103015
SN - 2213-6711
PB - Elsevier
DO - 10.1016/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1016/
"type": "article-journal",
"title": "Brain injury reactivates a developmental program driving genesis and integration of transient LGE-class interneurons",
"container-title": "Stem cell reports",
"author": [
{
"family": "Nato",
"given": "G"
},
{
"family": "Fogli",
"given": "M"
},
{
"family": "Marichal",
"given": "N"
},
{
"family": "Cerrato",
"given": "V"
},
{
"family": "Turrini",
"given": "G"
},
{
"family": "Proserpio",
"given": "V"
},
{
"family": "Ghia",
"given": "I"
},
{
"family": "Zanotto",
"given": "G"
},
{
"family": "Molineris",
"given": "I"
},
{
"family": "Bergami",
"given": "M"
},
{
"family": "Oliviero",
"given": "S"
},
{
"family": "Peretto",
"given": "P"
},
{
"family": "Berninger",
"given": "B"
},
{
"family": "Buffo",
"given": "A"
},
{
"family": "Luzzati",
"given": "F"
}
],
"container-title-short":
"volume": "21",
"issue": "8",
"page": "103015",
"DOI": "10.1016/
"PMID": "42462713",
"PMCID": "PMC13476880",
"ISSN": "2213-6711",
"publisher": "Elsevier",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
16
]
]
}
}
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.stemcr.2024.08.006 [code]
- Dynamic spatiotemporal activation of a pervasive neurogenic competence in striatal astrocytes supports continuous neurogenesis following injury.Journal: Stem cell reportsIn common: ImageJ / Fiji, mouse, 16 references, 2 authors
- [2] doi:10.1038/s41586-022-04510-w [code]
- The development and evolution of inhibitory neurons in primate cerebrum.Journal: NatureIn common: ImageJ / Fiji, scVelo, tifffile, 14 other tools, mouse, 6 references
- [3] 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: scVelo, tifffile, anndata, 12 other tools, 3 references
- [4] doi:10.1038/s41586-024-08453-2 [code]
- Mapping cells through time and space with moscot.Journal: NatureIn common: scVelo, anndata, Scanpy, 9 other tools, mouse, 5 references
- [5] doi:10.1038/s41467-025-62528-w [code]
- Cross-species comparison reveals therapeutic vulnerabilities halting glioblastoma progression.Journal: Nature communicationsIn common: anndata, Scanpy, seaborn, 5 other tools, mouse, 8 references
- [6] doi:10.1038/s41586-022-05246-3 [code]
- Embryo model completes gastrulation to neurulation and organogenesis.Journal: NatureIn common: scVelo, anndata, Scanpy, 10 other tools, mouse, 2 references
- [7] doi:10.1038/s41467-024-50414-w [code]
- Interneuron diversity in the human dorsal striatum.Journal: Nature communicationsIn common: tifffile, anndata, Scanpy, 7 other tools, mouse, 5 references
- [8] doi:10.1371/journal.pbio.3001563 [code]
- Pax6 limits the competence of developing cerebral cortical cells to respond to inductive intercellular signals.Journal: PLoS biologyIn common: scVelo, anndata, Scanpy, 8 other tools, 3 references
- [9] doi:10.1093/bib/bbae250 [code]
- Benchmarking mapping algorithms for cell-type annotating in mouse brain by integrating single-nucleus RNA-seq and Stereo-seq data.Journal: Briefings in bioinformaticsIn common: anndata, Scanpy, Numba, 9 other tools, mouse, 3 references
- [10] doi:10.1038/s41593-025-01987-2 [code]
- An expanded subventricular zone supports postnatal cortical interneuron migration in gyrencephalic brains.Journal: Nature neuroscienceIn common: scVelo, anndata, Scanpy, 3 other tools, mouse, 6 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, 39 scripts, and 5 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:1b142560544aed26…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1016/j.stemcr.2026.103015)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1016/j.stemcr.2026.103015.svg
:target: https://openscicode.org/badge/doi/10.1016/j.stemcr.2026.103015
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1016/j.stemcr.2026.103015"><img src="https://openscicode.org/badge/doi/10.1016/j.stemcr.2026.103015.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
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: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
