Earlier findings of pelot-2020-01, checked on the versions of pelot-2020-02¶

This notebook belongs to the reconcile step of attempt pelot-2020-02 (docs/protocol.md, "Repeat attempts"). It checks the findings of the earlier attempt, pelot-2020-01 (made on sparc-60 version 5), that pelot-2020-02 did not report, on the versions pelot-2020-02 pins: sparc-60 version 5, sparc-64 version 4, sparc-65 version 8, sparc-89 version 1, sparc-16 version 5, sparc-61 version 3 and sparc-82 version 1. Both findings checked here are about sparc-60. The files are read with pelot.py, at the object versions of each version's manifest.

Earlier findings 1, 3, 5, 6, 7, 8 and 9 are reported again by pelot-2020-02 (its findings 1, 5, 11, 9 and 10) and are not checked here.

In [1]:
import numpy as np
import pandas as pd
import pelot

pd.set_option("display.width", 200)
pd.set_option("display.max_colwidth", 120)

Earlier finding 2¶

The code folder's RatVNMorphology_OutputMetrics.mat keeps only 7 of the 22 rat perineurium thicknesses (thkperi_um is overwritten per sex and level category in DataPlotting_v4.m), so the thicknesses behind the rat perineurium fit are recoverable only by re-measuring the traces.

The values in the file's thkperi_um are counted and set against the number of rat perineurial rings measured from the traces of version 5.

In [2]:
om = pelot.read_mat("sparc-60", "files/code/RatVNMorphology_OutputMetrics.mat")
print("variables:", sorted(k for k in om if not k.startswith("__")))
print("samples in the file:", len(om["sub_sam"]))
thk = np.concatenate([np.atleast_1d(x).ravel().astype(float) for x in np.atleast_1d(om["thkperi_um"])])
print("thkperi_um: %d entries, %d values:" % (len(np.atleast_1d(om["thkperi_um"])), len(thk)), np.round(thk, 3))

rows = []
for s in om["sub_sam"]:
    sub, sam = (int(x) for x in s[1:].split("-"))
    r = pelot.analyse_rat(sub, sam)
    rows.append(dict(sample=s, rings=len(r["fasc"]), thk_mean_um=r["fasc"].thk.mean() if "thk" in r["fasc"] else np.nan))
rat = pd.DataFrame(rows)
print(rat.round(3).to_string(index=False))
print("perineurial rings measured from the traces:", rat.rings.sum())
variables: ['NFasc', 'dFasc_um', 'dNerve_um', 'laterality', 'level', 'sex', 'sub_sam', 'thkperi_um']
samples in the file: 18
thkperi_um: 4 entries, 7 values: [4.591 4.34  2.602 3.563 1.632 2.253 2.153]
sample  rings  thk_mean_um
 R16-3      1        5.362
 R17-3      1        4.543
 R20-3      1        5.006
 R23-3      1        4.467
 R25-3      1        4.591
 R21-3      1        4.559
 R22-3      1        4.231
 R24-3      1        3.807
 R18-1      1        4.340
 R16-1      2        2.380
 R17-1      1        2.608
 R25-1      1        2.438
 R23-1      2        3.646
 R20-1      1        2.602
 R21-1      1        5.142
 R26-1      1        2.993
 R24-1      1        2.715
 R22-1      3        2.012
perineurial rings measured from the traces: 22

Earlier finding 4¶

samples.xlsx describes the subdiaphragmatic samples as 'subdiaphragmatic vagus nerve' without saying they are the anterior trunk, which only the readme and the code's file names give. R17-1 has a NerveMask although it is monofascicular, and nothing says whether it is meant to be used.

The sample sheet's locations, the places that say "anterior", the NerveMask files and R17-1's rings are listed.

In [3]:
smp = pelot.read_excel("sparc-60", "files/samples.xlsx")
loc = smp["specimen anatomical location"].str.split(";").str[0]
print(pd.crosstab(loc, "samples"))
print("rows of samples.xlsx that say anterior:", int(smp.astype(str).apply(lambda c: c.str.contains("nterior")).any(axis=1).sum()))

fs = pelot.files("sparc-60")
print("files whose name says Anterior:", sorted(p.split("/")[-1] for p in fs if "Anterior" in p))
readme = pelot.read_bytes("sparc-60", "readme.md").decode("utf8")
print("readme:", [l.strip()[:160] for l in readme.splitlines() if "anterior" in l.lower()])

nerve = sorted(p for p in fs if p.endswith("NerveMask.tif"))
print("NerveMask files:", [p.split("/")[-1] for p in nerve])
for sub, sam in [(16, 1), (17, 1), (22, 1), (23, 1)]:
    r = pelot.analyse_rat(sub, sam)
    print("R%d-%d: %d perineurial ring(s), NerveMask effective diameter %.1f um" % (sub, sam, len(r["fasc"]), r["ct_d"]))
texts = {p: pelot.read_bytes("sparc-60", p).decode("utf8", "replace")
         for p in ["readme.md", "files/code/README.txt", "files/derivative/README.txt", "files/docs/Readme", "files/protocol/Readme"]}
print("text files that mention NerveMask:", [p for p, t in texts.items() if "NerveMask" in t])
col_0                         samples
specimen anatomical location         
left cervical vagus nerve           9
subdiaphragmatic vagus nerve        9
rows of samples.xlsx that say anterior: 0
files whose name says Anterior: ['RAbdominalAnteriorFemale.xlsx', 'RAbdominalAnteriorMale.xlsx', 'sub-16_sam-1_Anterior_R16-1Slide2p1MT20x.jp2', 'sub-17_sam-1_Anterior_R17-1slide2p1MT20x.jp2', 'sub-20_sam-1_Anterior_R20-1Slide2p3MT20x.jp2', 'sub-21_sam-1_Anterior_R21-1Slide2p1MT20x.jp2', 'sub-22_sam-1_Anterior_R22-1Slide14p1.jp2', 'sub-23_sam-1_Anterior_R23-1Slide2P1MT20x.jp2', 'sub-24_sam-1_Anterior_R24-1Slide2P1MT20x.jp2', 'sub-25_sam-1_Anterior_R25-1Slide1P1MT20x.jp2', 'sub-26_sam-1_Anterior_R26-1Slide2P4MT20x.jp2']
readme: ['**Data Collection:** Using micrographs of rat vagus nerve cross sections that were stained with Masson’s trichrome, we quantified effective nerve and fascicle d', '**Experimental Design:** We segmented Masson’s trichrome micrographs of 9 left cervical and 9 anterior subdiaphragmatic rat vagus nerves using Nikon’s NIS-Eleme']
NerveMask files: ['sub-16_sam-1_R16-1NerveMask.tif', 'sub-17_sam-1_R17-1NerveMask.tif', 'sub-22_sam-1_R22-1NerveMask.tif', 'sub-23_sam-1_R23-1NerveMask.tif']
R16-1: 2 perineurial ring(s), NerveMask effective diameter 215.7 um
R17-1: 1 perineurial ring(s), NerveMask effective diameter 126.9 um
R22-1: 3 perineurial ring(s), NerveMask effective diameter 219.6 um
R23-1: 2 perineurial ring(s), NerveMask effective diameter 321.2 um
text files that mention NerveMask: []