import numpy as np
import pandas as pd
The metadata file has information about each Patch-seq cell, including its different identifiers and assigned cell types.
metadata = pd.read_csv("downloads/20200711_patchseq_metadata_mouse.csv")
metadata.head()
project | cell_specimen_id | cell_specimen_name | hemisphere | structure | donor_id | donor_name | biological_sex | age | ethnicity | ... | apical_dendrite_status | neuron_reconstruction_type | cell_soma_normalized_depth | depth_from_pia_um | ephys_session_id | transcriptomics_sample_id | transcriptomics_batch | T-type Accession ID | T-type Label | MET-type Label | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | mIVSCC-MET | 601506507 | Vip-IRES-Cre;Ai14-331294.04.01.01 | left | VISpm4 | 331294 | Vip-IRES-Cre;Ai14-331294 | M | P55 | NaN | ... | NaN | full | 0.361015 | NaN | 601506492 | PS0810_E1-50_S88 | BT035 | CS180626100018 | Vip Gpc3 Slc18a3 | Vip-MET-2 |
1 | mIVSCC-MET | 601790961 | Sst-IRES-Cre;Ai14-331663.04.01.01 | left | VISpm5 | 331663 | Sst-IRES-Cre;Ai14-331663 | F | P57 | NaN | ... | NaN | full | 0.621829 | NaN | 601790945 | PS0817_E1-50_S19 | BT036 | CS180626100041 | Sst Tac2 Myh4 | NaN |
2 | mIVSCC-MET | 601803754 | Sst-IRES-Cre;Ai14-331663.04.02.02 | right | VISp2/3 | 331663 | Sst-IRES-Cre;Ai14-331663 | F | P57 | NaN | ... | NaN | full | 0.164240 | NaN | 601803733 | PS0817_E1-50_S25 | BT036 | CS180626100035 | Sst Calb2 Pdlim5 | Sst-MET-3 |
3 | mIVSCC-MET | 601808698 | Sst-IRES-Cre;Ai14-331663.04.02.03 | right | VISp5 | 331663 | Sst-IRES-Cre;Ai14-331663 | F | P57 | NaN | ... | NaN | full | 0.483030 | NaN | 601808619 | PS0817_E1-50_S26 | BT036 | CS180626100043 | Sst Hpse Cbln4 | Sst-MET-8 |
4 | mIVSCC-MET | 601810307 | Sst-IRES-Cre;Ai14-331663.04.02.04 | right | VISp2/3 | 331663 | Sst-IRES-Cre;Ai14-331663 | F | P57 | NaN | ... | NaN | full | 0.295656 | NaN | 601810292 | PS0817_E1-50_S27 | BT036 | CS180626100034 | Sst Calb2 Necab1 | Sst-MET-3 |
5 rows × 23 columns
The file manifest contains URLs for the different data files associated with the Patch-seq cells that are located in various archives.
file_manifest = pd.read_csv("downloads/2020-07-08_mouse_file_manifest.csv")
file_manifest.head()
file_id | file_name | file_size | sha256_checksum | md5_checksum | technique | file_type | archive | archive_uri | project | cell_specimen_id | |
---|---|---|---|---|---|---|---|---|---|---|---|
0 | 601506507 | 601506507.marker | 268 | 305938ce75d55c3f43fbbe2d1d57e203139fa0c357bd73... | ecf2285ccbf5274af7d6a31a855ce950 | morphology | marker_swc | BIL | ftp://download.brainlib.org:8811/biccn/zeng/ps... | mIVSCC-MET | 601506507.0 |
1 | 601506507 | 601506507_raw.swc | 160503 | 6c82f5f974e4f6d2336a3606d4955823edd3c0173da60d... | 7cc7ccdd627ef83fe54fcbf0feac79c2 | morphology | raw_swc | BIL | ftp://download.brainlib.org:8811/biccn/zeng/ps... | mIVSCC-MET | 601506507.0 |
2 | 601506507 | 601506507_transformed.swc | 271764 | bad13a99c8f7f8a375e43109d80fd23d7028555a7dc42b... | f6a365d86ff65370af26439f0f16caaf | morphology | transformed_swc | BIL | ftp://download.brainlib.org:8811/biccn/zeng/ps... | mIVSCC-MET | 601506507.0 |
3 | 601506492 | sub-599387254_ses-601506492_icephys.nwb | 17881801 | 54003c5b599fa8081938713e8c7c3b69d1883b31b3ada1... | d854a21668f5f2229024d8cf0975de54 | intracellular_electrophysiology | nwb | DANDI | https://girder.dandiarchive.org/api/v1/item/5e... | mIVSCC-MET | 601506507.0 |
4 | 690250345 | ar_687622505_STAR_Aligned.sortedByCoord.out.bam | 106552715 | 015e535e886e4acbec4e37fd1db40576846ade5e1411bc... | bd83904f8ca2f61c7071becf0181ad9f | transcriptomics | bam_file | NEMO | http://data.nemoarchive.org/other/grant/AIBS_p... | mIVSCC-MET | 601506507.0 |
Here, we have already downloaded the (large) transcriptomic expression data file. In that file, expression is quantified as counts-per-million (cpm), and each row is a gene and each column is a cell.
gene_data = pd.read_csv(
"downloads/20200513_Mouse_PatchSeq_Release_cpm.v2.csv",
index_col=0,
)
gene_data
PS0810_E1-50_S88 | PS0817_E1-50_S19 | PS0817_E1-50_S25 | PS0817_E1-50_S26 | PS0817_E1-50_S27 | PS0817_E1-50_S28 | PS0817_E1-50_S46 | PS0817_E1-50_S52 | PS0830_E1-50_S17 | PS0830_E1-50_S19 | ... | SM-J39ZH_S561_E1-50 | SM-J39ZH_S562_E1-50 | SM-J39ZH_S565_E1-50 | SM-J39ZH_S566_E1-50 | SM-J39ZH_S571_E1-50 | SM-J39ZH_S576_E1-50 | SM-J3A1L_S592_E1-50 | SM-J3A1L_S593_E1-50 | SM-J3A1L_S603_E1-50 | SM-J3A1L_S604_E1-50 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0610005C13Rik | 0.0 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.00000 | 0.000000 | ... | 0.000000 | 0.0 | 0.000000 | 0.00000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
0610006L08Rik | 0.0 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.00000 | 0.000000 | ... | 0.000000 | 0.0 | 0.000000 | 0.00000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
0610007P14Rik | 0.0 | 0.0 | 0.000000 | 152.239614 | 165.312294 | 58.189895 | 0.000000 | 0.000000 | 551.71563 | 109.361330 | ... | 0.000000 | 0.0 | 32.223984 | 0.00000 | 24.467996 | 0.000000 | 51.366477 | 91.617703 | 82.706145 | 116.083588 |
0610009B22Rik | 0.0 | 0.0 | 69.658825 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 57.335504 | 0.00000 | 78.641855 | ... | 52.858114 | 0.0 | 27.620558 | 27.46475 | 40.197422 | 70.429453 | 0.000000 | 0.000000 | 0.000000 | 111.937746 |
0610009E02Rik | 0.0 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 1.662568 | 33.786897 | 0.000000 | 0.00000 | 0.000000 | ... | 0.000000 | 0.0 | 20.715418 | 0.00000 | 1.747714 | 0.000000 | 0.000000 | 31.342899 | 0.000000 | 103.646061 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
n-R5s142 | 0.0 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.00000 | 0.000000 | ... | 0.000000 | 0.0 | 0.000000 | 0.00000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
n-R5s143 | 0.0 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.00000 | 0.000000 | ... | 0.000000 | 0.0 | 0.000000 | 0.00000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
n-R5s144 | 0.0 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.00000 | 0.000000 | ... | 0.000000 | 0.0 | 0.000000 | 0.00000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
n-R5s146 | 0.0 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.00000 | 0.000000 | ... | 0.000000 | 0.0 | 0.000000 | 0.00000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
n-R5s149 | 0.0 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.00000 | 0.000000 | ... | 0.000000 | 0.0 | 0.000000 | 0.00000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
45768 rows × 4435 columns
Let's create a 2D projection of the data using the transcriptomic data to see the structure of the different subclasses and types. We will transform the data, then use the UMAP algorithm to create a nonlinear embedding of a subset of the differentially expressed genes.
import umap
marker_genes_for_umap = pd.read_csv("select_markers.csv", index_col=0)
embedding = umap.UMAP(n_neighbors=25).fit_transform(
np.log2(gene_data.loc[marker_genes_for_umap["Gene"], :].values.T + 1)
)
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
plt.figure(figsize=(8, 8))
plt.scatter(*embedding.T, s=1, edgecolor="none")
sns.despine()
We can see where specific types fall in this embedding by using the metadata to identify specific cells.
# Identify the cells from a particular t-type (Lamp5 Plch2 Dock5)
my_ttype_metadata = metadata.loc[metadata["T-type Label"] == "Lamp5 Plch2 Dock5", :]
my_ttype_metadata
project | cell_specimen_id | cell_specimen_name | hemisphere | structure | donor_id | donor_name | biological_sex | age | ethnicity | ... | apical_dendrite_status | neuron_reconstruction_type | cell_soma_normalized_depth | depth_from_pia_um | ephys_session_id | transcriptomics_sample_id | transcriptomics_batch | T-type Accession ID | T-type Label | MET-type Label | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
128 | mIVSCC-MET | 640319052 | Oxtr-T2A-Cre;Ai14-351472.04.01.02 | left | VISp1 | 351472 | Oxtr-T2A-Cre;Ai14-351472 | F | P49 | NaN | ... | NaN | NaN | NaN | NaN | 640318956 | SM-GE65C_S142_E1-50 | RSC-126 | CS180626100005 | Lamp5 Plch2 Dock5 | NaN |
140 | mIVSCC-MET | 642442513 | Ndnf-IRES2-dgCre;Ai14-353735.03.02.01 | right | VISp1 | 353735 | Ndnf-IRES2-dgCre;Ai14-353735 | M | P39 | NaN | ... | NaN | NaN | NaN | NaN | 642442471 | SM-GE65C_S188_E1-50 | RSC-126 | CS180626100005 | Lamp5 Plch2 Dock5 | NaN |
143 | mIVSCC-MET | 642496703 | Gad2-IRES-Cre;Ai14-352686.03.02.01 | right | VISp1 | 352686 | Gad2-IRES-Cre;Ai14-352686 | M | P45 | NaN | ... | NaN | NaN | NaN | NaN | 642496688 | SM-GE65C_S189_E1-50 | RSC-126 | CS180626100005 | Lamp5 Plch2 Dock5 | NaN |
153 | mIVSCC-MET | 642833509 | Ndnf-IRES2-dgCre;Ai14-353737.04.02.01 | right | VISp1 | 353737 | Ndnf-IRES2-dgCre;Ai14-353737 | M | P40 | NaN | ... | NaN | NaN | NaN | NaN | 642833493 | SM-GE652_S154_E1-50 | RSC-127 | CS180626100005 | Lamp5 Plch2 Dock5 | NaN |
154 | mIVSCC-MET | 642842839 | Ndnf-IRES2-dgCre;Ai14-353737.04.01.01 | left | VISp2/3 | 353737 | Ndnf-IRES2-dgCre;Ai14-353737 | M | P40 | NaN | ... | NaN | NaN | NaN | NaN | 642842794 | SM-GE652_S164_E1-50 | RSC-127 | CS180626100005 | Lamp5 Plch2 Dock5 | NaN |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
4104 | mIVSCC-MET | 891514933 | Ndnf-IRES2-dgCre;Ai14-470196.04.01.02 | left | VISp1 | 470196 | Ndnf-IRES2-dgCre;Ai14-470196 | F | P55 | NaN | ... | NaN | NaN | NaN | NaN | 891514675 | SM-GE4Y5_S168_E1-50 | RSC-217 | CS180626100005 | Lamp5 Plch2 Dock5 | NaN |
4108 | mIVSCC-MET | 891652412 | Ndnf-IRES2-dgCre;Ai14-470196.03.01.02 | left | VISp1 | 470196 | Ndnf-IRES2-dgCre;Ai14-470196 | F | P55 | NaN | ... | NaN | NaN | NaN | NaN | 891651975 | SM-GE4Y5_S184_E1-50 | RSC-217 | CS180626100005 | Lamp5 Plch2 Dock5 | NaN |
4109 | mIVSCC-MET | 891664096 | Ndnf-IRES2-dgCre;Ai14-470196.05.01.01 | left | VISp2/3 | 470196 | Ndnf-IRES2-dgCre;Ai14-470196 | F | P55 | NaN | ... | NaN | NaN | NaN | NaN | 891663833 | SM-GE4Y5_S179_E1-50 | RSC-217 | CS180626100005 | Lamp5 Plch2 Dock5 | NaN |
4168 | mIVSCC-MET | 901179274 | Gad2-IRES-Cre;Ai14-473098.03.01.02 | left | VISp2/3 | 473098 | Gad2-IRES-Cre;Ai14-473098 | F | P56 | NaN | ... | NaN | NaN | NaN | NaN | 901178941 | SM-GE4WN_S087_E1-50 | RSC-219 | CS180626100005 | Lamp5 Plch2 Dock5 | NaN |
4286 | mIVSCC-MET | 934799128 | Oxtr-T2A-Cre;Ai14-484066.03.01.01 | left | VISp2/3 | 484066 | Oxtr-T2A-Cre;Ai14-484066 | M | P55 | NaN | ... | NaN | NaN | NaN | NaN | 934798929 | SM-GE4Q2_S125_E1-50 | RSC-226 | CS180626100005 | Lamp5 Plch2 Dock5 | NaN |
150 rows × 23 columns
my_ttype_mask = gene_data.columns.isin(my_ttype_metadata["transcriptomics_sample_id"].tolist())
plt.figure(figsize=(8, 8))
plt.scatter(*embedding.T, s=1, edgecolor="none")
plt.scatter(*embedding[my_ttype_mask, :].T, s=2, edgecolor="none")
sns.despine()
We can also look at how expression of a particular gene varies across types in this embedding.
plt.figure(figsize=(8, 8))
plt.scatter(
*embedding.T,
s=1,
c=gene_data.loc["Npy", :].values,
vmin=0,
vmax=5e3,
cmap="viridis",
edgecolor="none"
)
<matplotlib.collections.PathCollection at 0x7f595f2d7850>
All the cells in the public data set have both transcriptomic and electrophysiology data, but only some of them have morphological reconstructions.
my_ttype_with_recon_metadata = metadata.loc[
(metadata["T-type Label"] == "Lamp5 Plch2 Dock5") &
(metadata["neuron_reconstruction_type"].isin(["full"])),
:]
my_ttype_with_recon_metadata.iloc[0, :]
project mIVSCC-MET cell_specimen_id 645169930 cell_specimen_name Ndnf-IRES2-dgCre;Ai14-355228.04.01.01 hemisphere left structure VISp1 donor_id 355228 donor_name Ndnf-IRES2-dgCre;Ai14-355228 biological_sex F age P49 ethnicity NaN medical_conditions NaN full_genotype Ndnf-IRES2-dgCre/wt;Ai14(RCL-tdT)/wt dendrite_type aspiny apical_dendrite_status NaN neuron_reconstruction_type full cell_soma_normalized_depth 0.0658506 depth_from_pia_um NaN ephys_session_id 645169915 transcriptomics_sample_id SM-GE643_S145_E1-50 transcriptomics_batch RSC-131 T-type Accession ID CS180626100005 T-type Label Lamp5 Plch2 Dock5 MET-type Label Lamp5-MET-1 Name: 226, dtype: object
Let's get the NWB file that has the electrophysiology data for this cell and use the IPFX library to process it.
my_specimen_id = my_ttype_with_recon_metadata.iloc[0, :]["cell_specimen_id"]
nwb_urls = file_manifest.loc[
(file_manifest["cell_specimen_id"] == float(my_specimen_id)) &
(file_manifest["file_type"] == "nwb"),
:
]
nwb_urls["archive_uri"].values[0]
'https://girder.dandiarchive.org/api/v1/item/5edb30e22dace54b6f9b4051/download'
!dandi download https://girder.dandiarchive.org/api/v1/item/5edb30e22dace54b6f9b4051/download
2021-02-24 10:28:34,524 [ WARNING] A newer version (0.10.0) of dandi/dandi-cli is available. You are using 0.9.0 PATH SIZE DONE DONE% CHECKSUM STATUS MESSAGE sub-643830424_ses-645169915_icephys.nwb 15.1 MB 15.1 MB 100% ok done Summary: 15.1 MB 15.1 MB 1 done 100.00%
nwb_path = nwb_urls["file_name"].values[0]
nwb_path
'sub-643830424_ses-645169915_icephys.nwb'
from ipfx.dataset.create import create_ephys_data_set
from ipfx.data_set_features import extract_data_set_features
from ipfx.utilities import drop_failed_sweeps
data_set = create_ephys_data_set(nwb_file=nwb_path)
drop_failed_sweeps(data_set)
cell_features, sweep_features, cell_record, sweep_records, _, _ = \
extract_data_set_features(data_set, subthresh_min_amp=-100.0)
/local1/anaconda3/envs/ps-demo/lib/python3.7/site-packages/hdmf/spec/namespace.py:485: UserWarning: Ignoring cached namespace 'hdmf-common' version 1.1.3 because version 1.3.0 is already loaded. % (ns['name'], ns['version'], self.__namespaces.get(ns['name'])['version'])) 2021-02-24 10:29:26,251 root INFO sweep 23 skipping vrest criteria on ramp 2021-02-24 10:29:26,253 root INFO sweep 24 skipping vrest criteria on ramp 2021-02-24 10:29:26,254 root INFO 2021-02-24 10:29:26,255 root INFO ***** ***** ***** Analyzing cell features: ***** ***** ***** 2021-02-24 10:29:26,257 root INFO ------------------------------------------------------------ 2021-02-24 10:29:26,257 root INFO 2021-02-24 10:29:26,258 root INFO 2021-02-24 10:29:26,259 root INFO ***** ***** ***** Long Squares: ***** ***** ***** 2021-02-24 10:29:26,259 root INFO ------------------------------------------------- 2021-02-24 10:29:26,260 root INFO 2021-02-24 10:29:27,103 root INFO 2021-02-24 10:29:27,104 root INFO ***** ***** ***** Short Squares: ***** ***** ***** 2021-02-24 10:29:27,106 root INFO -------------------------------------------------- 2021-02-24 10:29:27,107 root INFO 2021-02-24 10:29:27,499 root INFO 2021-02-24 10:29:27,499 root INFO ***** ***** ***** Ramps: ***** ***** ***** 2021-02-24 10:29:27,500 root INFO ------------------------------------------ 2021-02-24 10:29:27,501 root INFO 2021-02-24 10:29:28,013 root INFO 2021-02-24 10:29:28,014 root INFO ***** ***** ***** Analyzing sweep features: ***** ***** ***** 2021-02-24 10:29:28,014 root INFO ------------------------------------------------------------- 2021-02-24 10:29:28,016 root INFO
cell_features.keys()
dict_keys(['long_squares', 'short_squares', 'ramps'])
cell_features["long_squares"].keys()
dict_keys(['sweeps', 'v_baseline', 'rheobase_i', 'rheobase_sweep', 'spiking_sweeps', 'fi_fit_slope', 'hero_sweep', 'sag', 'vm_for_sag', 'subthreshold_sweeps', 'subthreshold_membrane_property_sweeps', 'input_resistance', 'tau'])
cell_features["long_squares"]["rheobase_sweep"]
{'avg_rate': 5.000000000000001, 'peak_deflect': (19.000002, 93400), 'stim_amp': 260.0, 'v_baseline': -69.02718353271484, 'sag': -9.049047470092773, 'adapt': -0.08286998815056433, 'latency': 0.5081, 'isi_cv': 0.3435623028567409, 'mean_isi': 0.11080499999999999, 'median_isi': 0.09931000000000001, 'first_isi': 0.1734199999999999, 'index': 4, 'spikes': [{'threshold_index': 76405, 'clipped': False, 'threshold_t': 1.0081, 'threshold_v': -30.875001907348633, 'threshold_i': 260, 'peak_index': 76432, 'peak_t': 1.00864, 'peak_v': 18.875001907348633, 'peak_i': 260, 'trough_index': 76720, 'trough_t': 1.0144, 'trough_v': -46.937503814697266, 'trough_i': 260, 'upstroke_index': 76420, 'upstroke': 195.88039484902075, 'upstroke_t': 1.0084, 'upstroke_v': -5.031250476837158, 'downstroke_index': 76452, 'downstroke': -60.155100900715404, 'downstroke_t': 1.00904, 'downstroke_v': 2.718750238418579, 'isi_type': 'detour', 'fast_trough_index': 76582, 'fast_trough_t': 1.0116399999999999, 'fast_trough_v': -45.78125, 'fast_trough_i': 260, 'adp_index': nan, 'adp_t': nan, 'adp_v': nan, 'adp_i': nan, 'slow_trough_index': 76720.0, 'slow_trough_t': 1.0144, 'slow_trough_v': -46.937503814697266, 'slow_trough_i': 260.0, 'width': 0.0009799999999999809, 'upstroke_downstroke_ratio': 3.2562557774163956}, {'threshold_index': 85076, 'clipped': False, 'threshold_t': 1.18152, 'threshold_v': -31.25, 'threshold_i': 260, 'peak_index': 85106, 'peak_t': 1.18212, 'peak_v': 17.562501907348633, 'peak_i': 260, 'trough_index': 85437, 'trough_t': 1.18874, 'trough_v': -47.093753814697266, 'trough_i': 260, 'upstroke_index': 85094, 'upstroke': 165.72213467870418, 'upstroke_t': 1.18188, 'upstroke_v': -2.34375, 'downstroke_index': 85141, 'downstroke': -49.95692608657477, 'downstroke_t': 1.18282, 'downstroke_v': -10.46875, 'isi_type': 'detour', 'fast_trough_index': 85280, 'fast_trough_t': 1.1856, 'fast_trough_v': -45.500003814697266, 'fast_trough_i': 260, 'adp_index': nan, 'adp_t': nan, 'adp_v': nan, 'adp_i': nan, 'slow_trough_index': 85437.0, 'slow_trough_t': 1.18874, 'slow_trough_v': -47.093753814697266, 'slow_trough_i': 260.0, 'width': 0.001100000000000101, 'upstroke_downstroke_ratio': 3.3173004758441236}, {'threshold_index': 89813, 'clipped': False, 'threshold_t': 1.27626, 'threshold_v': -30.250001907348633, 'threshold_i': 260, 'peak_index': 89840, 'peak_t': 1.2768, 'peak_v': 18.5, 'peak_i': 260, 'trough_index': 90198, 'trough_t': 1.28396, 'trough_v': -46.562503814697266, 'trough_i': 260, 'upstroke_index': 89829, 'upstroke': 182.5993702185684, 'upstroke_t': 1.27658, 'upstroke_v': -2.031250238418579, 'downstroke_index': 89873, 'downstroke': -51.58705426100653, 'downstroke_t': 1.27746, 'downstroke_v': -8.687500953674316, 'isi_type': 'detour', 'fast_trough_index': 90006, 'fast_trough_t': 1.28012, 'fast_trough_v': -44.781253814697266, 'fast_trough_i': 260, 'adp_index': nan, 'adp_t': nan, 'adp_v': nan, 'adp_i': nan, 'slow_trough_index': 90198.0, 'slow_trough_t': 1.28396, 'slow_trough_v': -46.562503814697266, 'slow_trough_i': 260.0, 'width': 0.001060000000000061, 'upstroke_downstroke_ratio': 3.539635531323429}, {'threshold_index': 93372, 'clipped': False, 'threshold_t': 1.34744, 'threshold_v': -31.65625, 'threshold_i': 260, 'peak_index': 93400, 'peak_t': 1.348, 'peak_v': 19.000001907348633, 'peak_i': 260, 'trough_index': 93726, 'trough_t': 1.35452, 'trough_v': -47.093753814697266, 'trough_i': 260, 'upstroke_index': 93388, 'upstroke': 192.6202654248003, 'upstroke_t': 1.34776, 'upstroke_v': -3.781250238418579, 'downstroke_index': 93420, 'downstroke': -58.92077508269481, 'downstroke_t': 1.3484, 'downstroke_v': 2.875000238418579, 'isi_type': 'detour', 'fast_trough_index': 93587, 'fast_trough_t': 1.35174, 'fast_trough_v': -45.9375, 'fast_trough_i': 260, 'adp_index': nan, 'adp_t': nan, 'adp_v': nan, 'adp_i': nan, 'slow_trough_index': 93726.0, 'slow_trough_t': 1.35452, 'slow_trough_v': -47.093753814697266, 'slow_trough_i': 260.0, 'width': 0.001000000000000112, 'upstroke_downstroke_ratio': 3.269140047028563}, {'threshold_index': 98566, 'clipped': False, 'threshold_t': 1.45132, 'threshold_v': -28.781251907348633, 'threshold_i': 260, 'peak_index': 98593, 'peak_t': 1.45186, 'peak_v': 17.65625, 'peak_i': 260, 'trough_index': 98976, 'trough_t': 1.45952, 'trough_v': -46.65625, 'trough_i': 260, 'upstroke_index': 98581, 'upstroke': 171.18150678617957, 'upstroke_t': 1.45162, 'upstroke_v': -2.500000238418579, 'downstroke_index': 98619, 'downstroke': -53.039970180617686, 'downstroke_t': 1.45238, 'downstroke_v': -2.65625, 'isi_type': 'detour', 'fast_trough_index': 98775, 'fast_trough_t': 1.4555, 'fast_trough_v': -44.625003814697266, 'fast_trough_i': 260, 'adp_index': nan, 'adp_t': nan, 'adp_v': nan, 'adp_i': nan, 'slow_trough_index': nan, 'slow_trough_t': nan, 'slow_trough_v': nan, 'slow_trough_i': nan, 'width': 0.0010599999999998388, 'upstroke_downstroke_ratio': 3.227405788563851}], 'sweep_number': 10}
cell_features["long_squares"]["rheobase_sweep"]["latency"]
0.5081
We can also plot the particular sweep that we've been seeing the features of.
swp = data_set.sweep(cell_features["long_squares"]["rheobase_sweep"]["sweep_number"])
plt.figure(figsize=(10, 6))
plt.plot(swp.t, swp.v)
plt.xlabel("time (s)", fontsize=16)
plt.ylabel("membrane potential (mV)", fontsize=16)
sns.despine()
Now we'll get the SWC file that has the morphological reconstruction of this cell and use the neuron_morphology library to process it.
swc_urls = file_manifest.loc[
(file_manifest["cell_specimen_id"] == float(my_specimen_id)) &
(file_manifest["file_type"] == "transformed_swc"),
:
]
swc_urls["archive_uri"].values[0]
'ftp://download.brainlib.org:8811/biccn/zeng/pseq/morph/200526/645169930_transformed.swc'
!wget ftp://download.brainlib.org:8811/biccn/zeng/pseq/morph/200526/645169930_transformed.swc
--2021-02-24 10:31:25-- ftp://download.brainlib.org:8811/biccn/zeng/pseq/morph/200526/645169930_transformed.swc => ‘645169930_transformed.swc’ Resolving download.brainlib.org (download.brainlib.org)... 192.231.243.62, 192.231.243.61 Connecting to download.brainlib.org (download.brainlib.org)|192.231.243.62|:8811... connected. Logging in as anonymous ... Logged in! ==> SYST ... done. ==> PWD ... done. ==> TYPE I ... done. ==> CWD (1) /bil/data/biccn/zeng/pseq/morph/200526 ... done. ==> SIZE 645169930_transformed.swc ... 949094 ==> PASV ... done. ==> RETR 645169930_transformed.swc ... done. Length: 949094 (927K) (unauthoritative) 100%[======================================>] 949,094 1.89MB/s in 0.5s 2021-02-24 10:31:27 (1.89 MB/s) - ‘645169930_transformed.swc’ saved [949094]
swc_path = swc_urls["file_name"].values[0]
swc_path
'645169930_transformed.swc'
from neuron_morphology.swc_io import morphology_from_swc
from neuron_morphology.constants import AXON, BASAL_DENDRITE, SOMA
morph = morphology_from_swc(swc_path)
We can make a quick plot of the reconstruction.
axon_nodes = morph.get_node_by_types([AXON])
dend_nodes = morph.get_node_by_types([BASAL_DENDRITE])
soma_nodes = morph.get_node_by_types([SOMA])
axon_x = [node['x'] for node in axon_nodes]
axon_y = [node['y'] for node in axon_nodes]
dend_x = [node['x'] for node in dend_nodes]
dend_y = [node['y'] for node in dend_nodes]
soma_x = [node['x'] for node in soma_nodes]
soma_y = [node['y'] for node in soma_nodes]
plt.figure(figsize=(10, 10))
plt.scatter(axon_x, axon_y, s=1, edgecolor="none")
plt.scatter(dend_x, dend_y, s=1, edgecolor="none")
plt.scatter(soma_x, soma_y, s=20, c="black", edgecolor="none")
plt.gca().set(xticks=[], yticks=[])
plt.gca().set_aspect("equal")
sns.despine(left=True, bottom=True)
Then we can calculate a set of morphological features.
from neuron_morphology.feature_extractor.data import Data
from neuron_morphology.feature_extractor.feature_extractor import FeatureExtractor
from neuron_morphology.features.default_features import default_features
fe = FeatureExtractor()
fe.register_features(default_features)
feature_extraction_run = fe.extract(Data(morph))
2021-02-24 10:32:28,873 root INFO skipping mark (validation failed): type 2021-02-24 10:32:28,892 root INFO skipping mark (validation failed): type 2021-02-24 10:32:28,899 root INFO skipping mark (validation failed): type 2021-02-24 10:32:28,901 root INFO selected marks: <bound method FeatureExtractionRun.select_marks of <neuron_morphology.feature_extractor.feature_extraction_run.FeatureExtractionRun object at 0x7f597eb37450>> 2021-02-24 10:32:28,903 root INFO skipping feature: apical_dendrite.tip.dimension. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,904 root INFO skipping feature: apical_dendrite.bifurcation.dimension. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,905 root INFO skipping feature: apical_dendrite.compartment.dimension. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,906 root INFO skipping feature: apical_dendrite.node.dimension. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,907 root INFO skipping feature: apical_dendrite.num_nodes. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,908 root INFO skipping feature: apical_dendrite.num_branches. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,910 root INFO skipping feature: apical_dendrite.num_tips. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,911 root INFO skipping feature: apical_dendrite.mean_fragmentation. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,912 root INFO skipping feature: apical_dendrite.max_branch_order. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,913 root INFO skipping feature: apical_dendrite.num_outer_bifurcations. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,914 root INFO skipping feature: apical_dendrite.mean_bifurcation_angle_local. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,915 root INFO skipping feature: apical_dendrite.mean_bifurcation_angle_remote. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,916 root INFO skipping feature: apical_dendrite.total_length. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,916 root INFO skipping feature: apical_dendrite.total_surface_area. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,918 root INFO skipping feature: apical_dendrite.total_volume. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,922 root INFO skipping feature: apical_dendrite.mean_diameter. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,923 root INFO skipping feature: apical_dendrite.mean_parent_daughter_ratio. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,924 root INFO skipping feature: apical_dendrite.max_euclidean_distance. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,925 root INFO skipping feature: apical_dendrite.dendrite.overlap. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,927 root INFO skipping feature: apical_dendrite.apical_dendrite.overlap. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,928 root INFO skipping feature: basal_dendrite.apical_dendrite.overlap. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,929 root INFO skipping feature: dendrite.apical_dendrite.overlap. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,930 root INFO skipping feature: axon.apical_dendrite.overlap. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,931 root INFO skipping feature: apical_dendrite.basal_dendrite.overlap. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,932 root INFO skipping feature: apical_dendrite.axon.overlap. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,933 root INFO skipping feature: apical_dendrite.tip.moments. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,934 root INFO skipping feature: apical_dendrite.bifurcation.moments. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,935 root INFO skipping feature: apical_dendrite.compartment.moments. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,935 root INFO skipping feature: apical_dendrite.node.moments. Found extra marks: ['RequiresApical'] 2021-02-24 10:32:28,936 root INFO skipping feature: all_neurites.normalized_depth_histogram. Found extra marks: ['RequiresReferenceLayerDepths', 'RequiresLayeredPointDepths'] 2021-02-24 10:32:28,937 root INFO skipping feature: axon.normalized_depth_histogram. Found extra marks: ['RequiresReferenceLayerDepths', 'RequiresLayeredPointDepths'] 2021-02-24 10:32:28,938 root INFO skipping feature: basal_dendrite.normalized_depth_histogram. Found extra marks: ['RequiresReferenceLayerDepths', 'RequiresLayeredPointDepths'] 2021-02-24 10:32:28,939 root INFO skipping feature: apical_dendrite.normalized_depth_histogram. Found extra marks: ['RequiresApical', 'RequiresReferenceLayerDepths', 'RequiresLayeredPointDepths'] 2021-02-24 10:32:28,940 root INFO skipping feature: dendrite.normalized_depth_histogram. Found extra marks: ['RequiresReferenceLayerDepths', 'RequiresLayeredPointDepths'] 2021-02-24 10:32:28,941 root INFO skipping feature: apical_dendrite.dendrite.earth_movers_distance. Found extra marks: ['RequiresApical', 'RequiresReferenceLayerDepths', 'RequiresLayeredPointDepths'] 2021-02-24 10:32:28,942 root INFO skipping feature: basal_dendrite.dendrite.earth_movers_distance. Found extra marks: ['RequiresReferenceLayerDepths', 'RequiresLayeredPointDepths'] 2021-02-24 10:32:28,943 root INFO skipping feature: dendrite.dendrite.earth_movers_distance. Found extra marks: ['RequiresReferenceLayerDepths', 'RequiresLayeredPointDepths'] 2021-02-24 10:32:28,943 root INFO skipping feature: axon.dendrite.earth_movers_distance. Found extra marks: ['RequiresReferenceLayerDepths', 'RequiresLayeredPointDepths'] 2021-02-24 10:32:28,944 root INFO skipping feature: apical_dendrite.apical_dendrite.earth_movers_distance. Found extra marks: ['RequiresApical', 'RequiresReferenceLayerDepths', 'RequiresLayeredPointDepths'] 2021-02-24 10:32:28,945 root INFO skipping feature: basal_dendrite.apical_dendrite.earth_movers_distance. Found extra marks: ['RequiresApical', 'RequiresReferenceLayerDepths', 'RequiresLayeredPointDepths'] 2021-02-24 10:32:28,946 root INFO skipping feature: dendrite.apical_dendrite.earth_movers_distance. Found extra marks: ['RequiresApical', 'RequiresReferenceLayerDepths', 'RequiresLayeredPointDepths'] 2021-02-24 10:32:28,947 root INFO skipping feature: axon.apical_dendrite.earth_movers_distance. Found extra marks: ['RequiresApical', 'RequiresReferenceLayerDepths', 'RequiresLayeredPointDepths'] 2021-02-24 10:32:28,948 root INFO skipping feature: apical_dendrite.basal_dendrite.earth_movers_distance. Found extra marks: ['RequiresApical', 'RequiresReferenceLayerDepths', 'RequiresLayeredPointDepths'] 2021-02-24 10:32:28,948 root INFO skipping feature: basal_dendrite.basal_dendrite.earth_movers_distance. Found extra marks: ['RequiresReferenceLayerDepths', 'RequiresLayeredPointDepths'] 2021-02-24 10:32:28,949 root INFO skipping feature: dendrite.basal_dendrite.earth_movers_distance. Found extra marks: ['RequiresReferenceLayerDepths', 'RequiresLayeredPointDepths'] 2021-02-24 10:32:28,950 root INFO skipping feature: axon.basal_dendrite.earth_movers_distance. Found extra marks: ['RequiresReferenceLayerDepths', 'RequiresLayeredPointDepths'] 2021-02-24 10:32:28,954 root INFO skipping feature: apical_dendrite.axon.earth_movers_distance. Found extra marks: ['RequiresApical', 'RequiresReferenceLayerDepths', 'RequiresLayeredPointDepths'] 2021-02-24 10:32:28,955 root INFO skipping feature: basal_dendrite.axon.earth_movers_distance. Found extra marks: ['RequiresReferenceLayerDepths', 'RequiresLayeredPointDepths'] 2021-02-24 10:32:28,958 root INFO skipping feature: dendrite.axon.earth_movers_distance. Found extra marks: ['RequiresReferenceLayerDepths', 'RequiresLayeredPointDepths'] 2021-02-24 10:32:28,959 root INFO skipping feature: axon.axon.earth_movers_distance. Found extra marks: ['RequiresReferenceLayerDepths', 'RequiresLayeredPointDepths'] 2021-02-24 10:32:28,960 root INFO selected features: ['all_neurites.tip.dimension', 'axon.tip.dimension', 'basal_dendrite.tip.dimension', 'dendrite.tip.dimension', 'all_neurites.bifurcation.dimension', 'axon.bifurcation.dimension', 'basal_dendrite.bifurcation.dimension', 'dendrite.bifurcation.dimension', 'all_neurites.compartment.dimension', 'axon.compartment.dimension', 'basal_dendrite.compartment.dimension', 'dendrite.compartment.dimension', 'all_neurites.node.dimension', 'axon.node.dimension', 'basal_dendrite.node.dimension', 'dendrite.node.dimension', 'all_neurites.num_nodes', 'axon.num_nodes', 'basal_dendrite.num_nodes', 'dendrite.num_nodes', 'all_neurites.num_branches', 'axon.num_branches', 'basal_dendrite.num_branches', 'dendrite.num_branches', 'all_neurites.num_tips', 'axon.num_tips', 'basal_dendrite.num_tips', 'dendrite.num_tips', 'all_neurites.mean_fragmentation', 'axon.mean_fragmentation', 'basal_dendrite.mean_fragmentation', 'dendrite.mean_fragmentation', 'all_neurites.max_branch_order', 'axon.max_branch_order', 'basal_dendrite.max_branch_order', 'dendrite.max_branch_order', 'all_neurites.num_outer_bifurcations', 'axon.num_outer_bifurcations', 'basal_dendrite.num_outer_bifurcations', 'dendrite.num_outer_bifurcations', 'all_neurites.mean_bifurcation_angle_local', 'axon.mean_bifurcation_angle_local', 'basal_dendrite.mean_bifurcation_angle_local', 'dendrite.mean_bifurcation_angle_local', 'all_neurites.mean_bifurcation_angle_remote', 'axon.mean_bifurcation_angle_remote', 'basal_dendrite.mean_bifurcation_angle_remote', 'dendrite.mean_bifurcation_angle_remote', 'all_neurites.total_length', 'axon.total_length', 'basal_dendrite.total_length', 'dendrite.total_length', 'all_neurites.total_surface_area', 'axon.total_surface_area', 'basal_dendrite.total_surface_area', 'dendrite.total_surface_area', 'all_neurites.total_volume', 'axon.total_volume', 'basal_dendrite.total_volume', 'dendrite.total_volume', 'all_neurites.mean_diameter', 'axon.mean_diameter', 'basal_dendrite.mean_diameter', 'dendrite.mean_diameter', 'all_neurites.mean_parent_daughter_ratio', 'axon.mean_parent_daughter_ratio', 'basal_dendrite.mean_parent_daughter_ratio', 'dendrite.mean_parent_daughter_ratio', 'all_neurites.max_euclidean_distance', 'axon.max_euclidean_distance', 'basal_dendrite.max_euclidean_distance', 'dendrite.max_euclidean_distance', 'max_path_distance', 'early_branch_path', 'mean_contraction', 'basal_dendrite.dendrite.overlap', 'dendrite.dendrite.overlap', 'axon.dendrite.overlap', 'basal_dendrite.basal_dendrite.overlap', 'dendrite.basal_dendrite.overlap', 'axon.basal_dendrite.overlap', 'basal_dendrite.axon.overlap', 'dendrite.axon.overlap', 'axon.axon.overlap', 'all_neurites.tip.moments', 'axon.tip.moments', 'basal_dendrite.tip.moments', 'dendrite.tip.moments', 'all_neurites.bifurcation.moments', 'axon.bifurcation.moments', 'basal_dendrite.bifurcation.moments', 'dendrite.bifurcation.moments', 'all_neurites.compartment.moments', 'axon.compartment.moments', 'basal_dendrite.compartment.moments', 'dendrite.compartment.moments', 'all_neurites.node.moments', 'axon.node.moments', 'basal_dendrite.node.moments', 'dendrite.node.moments']
feature_extraction_run.results
{'all_neurites.tip.dimension': {'width': 749.7866746783784, 'height': 266.8131293186376, 'depth': 348.4693544674146, 'min_xyz': array([-346.43802996, -185.410335 , -38.56081 ]), 'max_xyz': array([403.34864472, 81.40279432, 309.90854446]), 'bias_xyz': array([ 56.91061475, 104.00754068, 271.34773446])}, 'axon.tip.dimension': {'width': 749.7866746783784, 'height': 266.8131293186376, 'depth': 348.4693544674146, 'min_xyz': array([-346.43802996, -185.410335 , -38.56081 ]), 'max_xyz': array([403.34864472, 81.40279432, 309.90854446]), 'bias_xyz': array([ 56.91061475, 104.00754068, 271.34773446])}, 'basal_dendrite.tip.dimension': {'width': 160.04351419243892, 'height': 170.45021761579912, 'depth': 124.17364049387336, 'min_xyz': array([ -69.90063599, -115.67997622, -36.53199587]), 'max_xyz': array([90.1428782 , 54.77024139, 87.64164462]), 'bias_xyz': array([20.24224221, 60.90973483, 51.10964874])}, 'dendrite.tip.dimension': {'width': 160.04351419243892, 'height': 170.45021761579912, 'depth': 124.17364049387336, 'min_xyz': array([ -69.90063599, -115.67997622, -36.53199587]), 'max_xyz': array([90.1428782 , 54.77024139, 87.64164462]), 'bias_xyz': array([20.24224221, 60.90973483, 51.10964874])}, 'all_neurites.bifurcation.dimension': {'width': 636.3707997033264, 'height': 138.50738030869223, 'depth': 288.43478853575857, 'min_xyz': array([-286.22899059, -65.98864488, -30.87585723]), 'max_xyz': array([350.14180911, 72.51873543, 257.55893131]), 'bias_xyz': array([ 63.91281853, 6.53009055, 226.68307408])}, 'axon.bifurcation.dimension': {'width': 636.3707997033264, 'height': 138.50738030869223, 'depth': 288.43478853575857, 'min_xyz': array([-286.22899059, -65.98864488, -30.87585723]), 'max_xyz': array([350.14180911, 72.51873543, 257.55893131]), 'bias_xyz': array([ 63.91281853, 6.53009055, 226.68307408])}, 'basal_dendrite.bifurcation.dimension': {'width': 80.27259121837159, 'height': 72.48094989884794, 'depth': 39.44104628804529, 'min_xyz': array([-33.12364491, -35.49587155, -23.06368008]), 'max_xyz': array([47.14894631, 36.98507835, 16.37736621]), 'bias_xyz': array([14.02530139, 1.48920681, 6.68631386])}, 'dendrite.bifurcation.dimension': {'width': 80.27259121837159, 'height': 72.48094989884794, 'depth': 39.44104628804529, 'min_xyz': array([-33.12364491, -35.49587155, -23.06368008]), 'max_xyz': array([47.14894631, 36.98507835, 16.37736621]), 'bias_xyz': array([14.02530139, 1.48920681, 6.68631386])}, 'all_neurites.compartment.dimension': {'width': 748.6712308294434, 'height': 268.1468330566796, 'depth': 347.8384853563372, 'min_xyz': array([-345.88986685, -184.96425257, -37.43907789]), 'max_xyz': array([402.78136398, 83.18258048, 310.39940747]), 'bias_xyz': array([ 56.89149713, 101.78167209, 272.96032958])}, 'axon.compartment.dimension': {'width': 748.6712308294434, 'height': 268.1468330566796, 'depth': 347.8384853563372, 'min_xyz': array([-345.88986685, -184.96425257, -37.43907789]), 'max_xyz': array([402.78136398, 83.18258048, 310.39940747]), 'bias_xyz': array([ 56.89149713, 101.78167209, 272.96032958])}, 'basal_dendrite.compartment.dimension': {'width': 748.6712308294434, 'height': 268.1468330566796, 'depth': 347.8384853563372, 'min_xyz': array([-345.88986685, -184.96425257, -37.43907789]), 'max_xyz': array([402.78136398, 83.18258048, 310.39940747]), 'bias_xyz': array([ 56.89149713, 101.78167209, 272.96032958])}, 'dendrite.compartment.dimension': {'width': 748.6712308294434, 'height': 268.1468330566796, 'depth': 347.8384853563372, 'min_xyz': array([-345.88986685, -184.96425257, -37.43907789]), 'max_xyz': array([402.78136398, 83.18258048, 310.39940747]), 'bias_xyz': array([ 56.89149713, 101.78167209, 272.96032958])}, 'all_neurites.node.dimension': {'width': 749.7866746783784, 'height': 268.6190622789789, 'depth': 348.986413225511, 'min_xyz': array([-346.43802996, -185.410335 , -38.56081 ]), 'max_xyz': array([403.34864472, 83.20872728, 310.42560322]), 'bias_xyz': array([ 56.91061475, 102.20160772, 271.86479322])}, 'axon.node.dimension': {'width': 749.7866746783784, 'height': 268.6190622789789, 'depth': 348.986413225511, 'min_xyz': array([-346.43802996, -185.410335 , -38.56081 ]), 'max_xyz': array([403.34864472, 83.20872728, 310.42560322]), 'bias_xyz': array([ 56.91061475, 102.20160772, 271.86479322])}, 'basal_dendrite.node.dimension': {'width': 160.04351419243892, 'height': 170.92363127673545, 'depth': 124.17364049387336, 'min_xyz': array([ -69.90063599, -116.15338989, -36.53199587]), 'max_xyz': array([90.1428782 , 54.77024139, 87.64164462]), 'bias_xyz': array([20.24224221, 61.38314849, 51.10964874])}, 'dendrite.node.dimension': {'width': 160.04351419243892, 'height': 170.92363127673545, 'depth': 124.17364049387336, 'min_xyz': array([ -69.90063599, -116.15338989, -36.53199587]), 'max_xyz': array([90.1428782 , 54.77024139, 87.64164462]), 'bias_xyz': array([20.24224221, 61.38314849, 51.10964874])}, 'all_neurites.num_nodes': 12755, 'axon.num_nodes': 11157, 'basal_dendrite.num_nodes': 1597, 'dendrite.num_nodes': 1597, 'all_neurites.num_branches': 396, 'axon.num_branches': 327, 'basal_dendrite.num_branches': 63, 'dendrite.num_branches': 63, 'all_neurites.num_tips': 199, 'axon.num_tips': 164, 'basal_dendrite.num_tips': 35, 'dendrite.num_tips': 35, 'all_neurites.mean_fragmentation': 32.22222222222222, 'axon.mean_fragmentation': 34.11926605504587, 'basal_dendrite.mean_fragmentation': 23.558823529411764, 'dendrite.mean_fragmentation': 23.558823529411764, 'all_neurites.max_branch_order': 17, 'axon.max_branch_order': 17, 'basal_dendrite.max_branch_order': 5, 'dendrite.max_branch_order': 5, 'all_neurites.num_outer_bifurcations': 9, 'axon.num_outer_bifurcations': 9, 'basal_dendrite.num_outer_bifurcations': 0, 'dendrite.num_outer_bifurcations': 0, 'all_neurites.mean_bifurcation_angle_local': 1.3569986904250544, 'axon.mean_bifurcation_angle_local': 1.3655438592520177, 'basal_dendrite.mean_bifurcation_angle_local': 1.3072536004680917, 'dendrite.mean_bifurcation_angle_local': 1.3072536004680917, 'all_neurites.mean_bifurcation_angle_remote': 1.4200143260193663, 'axon.mean_bifurcation_angle_remote': 1.4353635898418622, 'basal_dendrite.mean_bifurcation_angle_remote': 1.3306596830526922, 'dendrite.mean_bifurcation_angle_remote': 1.3306596830526922, 'all_neurites.total_length': 18760.542863889685, 'axon.total_length': 16656.744824345344, 'basal_dendrite.total_length': 2103.7980395443205, 'dendrite.total_length': 2103.7980395443205, 'all_neurites.total_surface_area': 16756.227456602548, 'axon.total_surface_area': 11973.337379852555, 'basal_dendrite.total_surface_area': 3372.6044170027603, 'dendrite.total_surface_area': 3372.6044170027603, 'all_neurites.total_volume': 3287.49336427227, 'axon.total_volume': 684.9164275089337, 'basal_dendrite.total_volume': 467.8096587531732, 'dendrite.total_volume': 467.8096587531732, 'all_neurites.mean_diameter': 0.26496000000000003, 'axon.mean_diameter': 0.22881154432195036, 'basal_dendrite.mean_diameter': 0.511210770194114, 'dendrite.mean_diameter': 0.511210770194114, 'all_neurites.mean_parent_daughter_ratio': 1.0097576457425315, 'axon.mean_parent_daughter_ratio': 1.000050460475344, 'basal_dendrite.mean_parent_daughter_ratio': 1.007962228536164, 'dendrite.mean_parent_daughter_ratio': 1.007962228536164, 'all_neurites.max_euclidean_distance': 420.5583251306083, 'axon.max_euclidean_distance': 420.5583251306083, 'basal_dendrite.max_euclidean_distance': 135.08360469803026, 'dendrite.max_euclidean_distance': 135.08360469803026, 'max_path_distance': 606.0596411814414, 'early_branch_path': 0.8764521042382784, 'mean_contraction': 0.8009361610523765, 'basal_dendrite.dendrite.overlap': {'above': 0.0, 'overlap': 1.0, 'below': 0.0}, 'dendrite.dendrite.overlap': {'above': 0.0, 'overlap': 1.0, 'below': 0.0}, 'axon.dendrite.overlap': {'above': 0.0, 'overlap': 1.0, 'below': 0.0}, 'basal_dendrite.basal_dendrite.overlap': {'above': 0.0, 'overlap': 1.0, 'below': 0.0}, 'dendrite.basal_dendrite.overlap': {'above': 0.0, 'overlap': 1.0, 'below': 0.0}, 'axon.basal_dendrite.overlap': {'above': 0.0, 'overlap': 1.0, 'below': 0.0}, 'basal_dendrite.axon.overlap': {'above': 0.14197364883033073, 'overlap': 0.8515730034955633, 'below': 0.006453347674105943}, 'dendrite.axon.overlap': {'above': 0.14197364883033073, 'overlap': 0.8515730034955633, 'below': 0.006453347674105943}, 'axon.axon.overlap': {'above': 0.0, 'overlap': 1.0, 'below': 0.0}, 'all_neurites.tip.moments': {'mean': array([389.82372309, 348.88729309, 83.71767202]), 'std': array([115.74138931, 38.27306887, 78.91192105]), 'var': array([13396.06919944, 1464.82780107, 6227.09128317]), 'skew': array([ 0.32331903, -1.18533534, 1.12598265]), 'kurt': array([1.12248839, 3.46986233, 0.86665464])}, 'axon.tip.moments': {'mean': array([389.12180478, 352.81894898, 93.1198556 ]), 'std': array([125.84091262, 37.03591891, 82.91145378]), 'var': array([15835.93528956, 1371.65928981, 6874.30916826]), 'skew': array([ 0.31965618, -1.34227129, 0.90285376]), 'kurt': array([0.58674689, 4.8100245 , 0.31496669])}, 'basal_dendrite.tip.moments': {'mean': array([393.11271174, 330.46467693, 39.66172611]), 'std': array([45.60212767, 39.12333225, 29.7150603 ]), 'var': array([2079.55404769, 1530.63512639, 882.98480864]), 'skew': array([ 0.07178201, -0.79535141, 0.99416707]), 'kurt': array([-0.90266879, 0.62165608, 0.55440506])}, 'dendrite.tip.moments': {'mean': array([393.11271174, 330.46467693, 39.66172611]), 'std': array([45.60212767, 39.12333225, 29.7150603 ]), 'var': array([2079.55404769, 1530.63512639, 882.98480864]), 'skew': array([ 0.07178201, -0.79535141, 0.99416707]), 'kurt': array([-0.90266879, 0.62165608, 0.55440506])}, 'all_neurites.bifurcation.moments': {'mean': array([388.55855553, 345.24944793, 81.03807554]), 'std': array([78.59936479, 28.73308828, 56.09126445]), 'var': array([6177.86014573, 825.59036238, 3146.2299472 ]), 'skew': array([ 0.64147157, -0.49741759, 1.38113356]), 'kurt': array([ 2.94996389, -0.04360701, 2.27866112])}, 'axon.bifurcation.moments': {'mean': array([388.07036867, 348.57089745, 88.452092 ]), 'std': array([84.65672605, 29.1479067 , 57.36063837]), 'var': array([7166.76126622, 849.60046517, 3290.24283458]), 'skew': array([ 0.61778158, -0.75828984, 1.2135647 ]), 'kurt': array([2.2026247 , 0.35070527, 1.85593134])}, 'basal_dendrite.bifurcation.moments': {'mean': array([391.40050048, 325.9138668 , 37.87790832]), 'std': array([21.52785373, 16.05599181, 11.62090147]), 'var': array([463.44848614, 257.79487307, 135.04535087]), 'skew': array([0.32477966, 0.23180366, 0.0025201 ]), 'kurt': array([-0.95870064, -0.0806142 , -1.15001275])}, 'dendrite.bifurcation.moments': {'mean': array([391.40050048, 325.9138668 , 37.87790832]), 'std': array([21.52785373, 16.05599181, 11.62090147]), 'var': array([463.44848614, 257.79487307, 135.04535087]), 'skew': array([0.32477966, 0.23180366, 0.0025201 ]), 'kurt': array([-0.95870064, -0.0806142 , -1.15001275])}, 'all_neurites.compartment.moments': {'mean': array([386.7267636 , 343.40498466, 91.40757948]), 'std': array([112.00564813, 35.91778852, 65.94494938]), 'var': array([12545.26521305, 1290.08753184, 4348.7363489 ]), 'skew': array([ 0.32969097, -1.06132336, 1.24973741]), 'kurt': array([0.74238392, 2.46791361, 1.89636957])}, 'axon.compartment.moments': {'mean': array([386.7267636 , 343.40498466, 91.40757948]), 'std': array([112.00564813, 35.91778852, 65.94494938]), 'var': array([12545.26521305, 1290.08753184, 4348.7363489 ]), 'skew': array([ 0.32969097, -1.06132336, 1.24973741]), 'kurt': array([0.74238392, 2.46791361, 1.89636957])}, 'basal_dendrite.compartment.moments': {'mean': array([386.7267636 , 343.40498466, 91.40757948]), 'std': array([112.00564813, 35.91778852, 65.94494938]), 'var': array([12545.26521305, 1290.08753184, 4348.7363489 ]), 'skew': array([ 0.32969097, -1.06132336, 1.24973741]), 'kurt': array([0.74238392, 2.46791361, 1.89636957])}, 'dendrite.compartment.moments': {'mean': array([386.7267636 , 343.40498466, 91.40757948]), 'std': array([112.00564813, 35.91778852, 65.94494938]), 'var': array([12545.26521305, 1290.08753184, 4348.7363489 ]), 'skew': array([ 0.32969097, -1.06132336, 1.24973741]), 'kurt': array([0.74238392, 2.46791361, 1.89636957])}, 'all_neurites.node.moments': {'mean': array([386.73703172, 343.43753508, 91.43719142]), 'std': array([112.26090462, 35.99259949, 66.12618666]), 'var': array([12602.51070669, 1295.46721813, 4372.67256248]), 'skew': array([ 0.32875932, -1.06321539, 1.2455017 ]), 'kurt': array([0.7337745 , 2.4763935 , 1.87850195])}, 'axon.node.moments': {'mean': array([385.94110878, 345.83754318, 98.79662517]), 'std': array([119.30032428, 36.23199138, 67.13421024]), 'var': array([14232.56737217, 1312.75719945, 4507.00218471]), 'skew': array([ 0.33065145, -1.16645259, 1.12135911]), 'kurt': array([0.35276708, 2.78994021, 1.59621964])}, 'basal_dendrite.node.moments': {'mean': array([392.29706645, 326.68012818, 40.05439879]), 'std': array([34.48022466, 29.23755138, 20.42311822]), 'var': array([1188.88589292, 854.83441065, 417.10375784]), 'skew': array([ 0.24569733, -1.07401827, 0.9440347 ]), 'kurt': array([-0.65157761, 2.18555955, 1.57217495])}, 'dendrite.node.moments': {'mean': array([392.29706645, 326.68012818, 40.05439879]), 'std': array([34.48022466, 29.23755138, 20.42311822]), 'var': array([1188.88589292, 854.83441065, 417.10375784]), 'skew': array([ 0.24569733, -1.07401827, 0.9440347 ]), 'kurt': array([-0.65157761, 2.18555955, 1.57217495])}}
width = feature_extraction_run.results["axon.node.dimension"]["width"]
height = feature_extraction_run.results["axon.node.dimension"]["height"]
wh_ratio = width / height
print(width, height, wh_ratio)
749.7866746783784 268.6190622789789 2.791263837782572