bluecellulab 2.6.63__py3-none-any.whl → 2.6.64__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of bluecellulab might be problematic. Click here for more details.
- bluecellulab/analysis/analysis.py +20 -16
- {bluecellulab-2.6.63.dist-info → bluecellulab-2.6.64.dist-info}/METADATA +1 -1
- {bluecellulab-2.6.63.dist-info → bluecellulab-2.6.64.dist-info}/RECORD +7 -7
- {bluecellulab-2.6.63.dist-info → bluecellulab-2.6.64.dist-info}/WHEEL +0 -0
- {bluecellulab-2.6.63.dist-info → bluecellulab-2.6.64.dist-info}/licenses/AUTHORS.txt +0 -0
- {bluecellulab-2.6.63.dist-info → bluecellulab-2.6.64.dist-info}/licenses/LICENSE +0 -0
- {bluecellulab-2.6.63.dist-info → bluecellulab-2.6.64.dist-info}/top_level.txt +0 -0
|
@@ -351,29 +351,32 @@ class BPAP:
|
|
|
351
351
|
return soma_amp, dend_amps, dend_dist, apic_amps, apic_dist
|
|
352
352
|
|
|
353
353
|
@staticmethod
|
|
354
|
-
def fit(soma_amp,
|
|
354
|
+
def fit(soma_amp, branch_amps, branch_dist):
|
|
355
355
|
"""Fit the amplitudes vs distances to an exponential decay function."""
|
|
356
356
|
from scipy.optimize import curve_fit
|
|
357
357
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
amps = soma_amp + apic_amps # add soma amplitude
|
|
368
|
-
popt_apic, _ = curve_fit(exp_decay, dist, amps)
|
|
369
|
-
|
|
370
|
-
return popt_dend, popt_apic
|
|
358
|
+
if not branch_amps or not branch_dist or len(branch_amps) != len(branch_dist):
|
|
359
|
+
return None, False
|
|
360
|
+
try:
|
|
361
|
+
dist = [0] + branch_dist
|
|
362
|
+
amps = soma_amp + branch_amps
|
|
363
|
+
popt, _ = curve_fit(exp_decay, dist, amps)
|
|
364
|
+
return popt, False
|
|
365
|
+
except RuntimeError:
|
|
366
|
+
return None, True
|
|
371
367
|
|
|
372
368
|
def validate(self, soma_amp, dend_amps, dend_dist, apic_amps, apic_dist):
|
|
373
369
|
"""Check that the exponential fit is decaying."""
|
|
374
370
|
validated = True
|
|
375
371
|
notes = ""
|
|
376
|
-
popt_dend,
|
|
372
|
+
popt_dend, dend_fit_error = self.fit(soma_amp, dend_amps, dend_dist)
|
|
373
|
+
popt_apic, apic_fit_error = self.fit(soma_amp, apic_amps, apic_dist)
|
|
374
|
+
if dend_fit_error or apic_fit_error:
|
|
375
|
+
logger.debug("Fitting error occurred.")
|
|
376
|
+
validated = False
|
|
377
|
+
notes += "Validation failed: Fitting error occurred.\n"
|
|
378
|
+
return validated, notes
|
|
379
|
+
|
|
377
380
|
if dend_amps is not None:
|
|
378
381
|
plt.cla()
|
|
379
382
|
plt.plot([0], soma_amp, '.')
|
|
@@ -415,7 +418,8 @@ class BPAP:
|
|
|
415
418
|
output_fname="bpap.pdf",
|
|
416
419
|
):
|
|
417
420
|
"""Plot the results of the BPAP analysis."""
|
|
418
|
-
popt_dend,
|
|
421
|
+
popt_dend, _ = self.fit(soma_amp, dend_amps, dend_dist)
|
|
422
|
+
popt_apic, _ = self.fit(soma_amp, apic_amps, apic_dist)
|
|
419
423
|
|
|
420
424
|
outpath = pathlib.Path(output_dir) / output_fname
|
|
421
425
|
fig, ax1 = plt.subplots(figsize=(10, 6))
|
|
@@ -15,7 +15,7 @@ bluecellulab/type_aliases.py,sha256=DvgjERv2Ztdw_sW63JrZTQGpJ0x5uMTFB5hcBHDb0WA,
|
|
|
15
15
|
bluecellulab/utils.py,sha256=0NhwlzyLnSi8kziSfDsQf7pokO4qDkMJVAO33kSX4O0,2227
|
|
16
16
|
bluecellulab/verbosity.py,sha256=T0IgX7DrRo19faxrT4Xzb27gqxzoILQ8FzYKxvUeaPM,1342
|
|
17
17
|
bluecellulab/analysis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
-
bluecellulab/analysis/analysis.py,sha256=
|
|
18
|
+
bluecellulab/analysis/analysis.py,sha256=_ggribmdjerotj8u3qJYUojP7Y2IfKpGLZRBzFX8vdE,22596
|
|
19
19
|
bluecellulab/analysis/inject_sequence.py,sha256=bpi_C1oz_G5cZv_CvvZG8SnGYaKIlDsIFHdkOAkDm-E,12666
|
|
20
20
|
bluecellulab/analysis/plotting.py,sha256=PqRoaZz33ULMw8A9YnZXXrxcUd84M_dwlYMTFhG7YT4,3999
|
|
21
21
|
bluecellulab/analysis/utils.py,sha256=eMirP557D11BuedgSqjripDxOq1haIldNbnYNetV1bg,121
|
|
@@ -75,9 +75,9 @@ bluecellulab/synapse/__init__.py,sha256=RW8XoAMXOvK7OG1nHl_q8jSEKLj9ZN4oWf2nY9HA
|
|
|
75
75
|
bluecellulab/synapse/synapse_factory.py,sha256=NHwRMYMrnRVm_sHmyKTJ1bdoNmWZNU4UPOGu7FCi-PE,6987
|
|
76
76
|
bluecellulab/synapse/synapse_types.py,sha256=zs_yBvGTH4QrbQF3nEViidyq1WM_ZcTSFdjUxB3khW0,16871
|
|
77
77
|
bluecellulab/validation/validation.py,sha256=csy1xKOOWdlo3NYHdknePPxb7KBRTjoUV-81ZmWo2CM,20041
|
|
78
|
-
bluecellulab-2.6.
|
|
79
|
-
bluecellulab-2.6.
|
|
80
|
-
bluecellulab-2.6.
|
|
81
|
-
bluecellulab-2.6.
|
|
82
|
-
bluecellulab-2.6.
|
|
83
|
-
bluecellulab-2.6.
|
|
78
|
+
bluecellulab-2.6.64.dist-info/licenses/AUTHORS.txt,sha256=EDs3H-2HXBojbma10psixk3C2rFiOCTIREi2ZAbXYNQ,179
|
|
79
|
+
bluecellulab-2.6.64.dist-info/licenses/LICENSE,sha256=dAMAR2Sud4Nead1wGFleKiwTZfkTNZbzmuGfcTKb3kg,11335
|
|
80
|
+
bluecellulab-2.6.64.dist-info/METADATA,sha256=M0-DelNxsIVqo8IMQOWMS9ASkzME8YKJfvPAvJYMoHE,8259
|
|
81
|
+
bluecellulab-2.6.64.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
82
|
+
bluecellulab-2.6.64.dist-info/top_level.txt,sha256=VSyEP8w9l3pXdRkyP_goeMwiNA8KWwitfAqUkveJkdQ,13
|
|
83
|
+
bluecellulab-2.6.64.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|