BetaII-spectrin gaps and patches emerge from the patterned assembly of the actin/spectrin membrane skeleton in human motor neuron axons.
The 1 match
- [1] § Materials and methods › MPS organization assessment › MPS organization assessment by ‘Gollum’ () ↔ ringfinder/ringFinder.py, lines 452 to 594 · score 0.50 · Pearson correlation coefficient, Gollum, tool · 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 · 676 lines · 29 KB · GPL-3.0 · 1 match
- # -*- coding: utf-8 -*-
- """
- Created on Fri Jul 15 12:25:40 2016
- @author: Luciano Masullo, Federico Barabas
- """
- import os
- import time
- import math
- import numpy as np
- from scipy import ndimage as ndi
- import tifffile as tiff
- from PIL import Image
- import pyqtgraph as pg
- from pyqtgraph.Qt import QtGui, QtCore
- import matplotlib.pyplot as plt
- import matplotlib.colors
- # from matplotlib import rc
- import ringfinder.utils as utils
- import ringfinder.tools as tools
- import ringfinder.pyqtsubclass as pyqtsub
- # rc('text', usetex=True)
- # rc('font', **{'family': 'serif', 'serif': ['Computer Modern'], 'size': 15})
- class Gollum(QtGui.QMainWindow):
- def __init__(self, *args, **kwargs):
- super().__init__(*args, **kwargs)
- self.i = 0
- self.testData = False
- self.setWindowTitle('Gollum: the Ring Finder')
- self.cwidget = QtGui.QWidget()
- self.setCentralWidget(self.cwidget)
- menubar = self.menuBar()
- fileMenu = menubar.addMenu('&Run')
- batchSTORMAct = QtGui.QAction('Analyze batch of STORM images...', self)
- batchSTEDAct = QtGui.QAction('Analyze batch of STED images...', self)
- batchSTORMAct.triggered.connect(self.batchSTORM)
- batchSTEDAct.triggered.connect(self.batchSTED)
- fileMenu.addAction(batchSTORMAct)
- fileMenu.addAction(batchSTEDAct)
- fileMenu.addSeparator()
- exitAction = QtGui.QAction(QtGui.QIcon('exit.png'), '&Exit', self)
- exitAction.setShortcut('Ctrl+Q')
- exitAction.setStatusTip('Exit application')
- exitAction.triggered.connect(QtGui.QApplication.closeAllWindows)
- fileMenu.addAction(exitAction)
- self.folderStatus = QtGui.QLabel('Ready', self)
- self.statusBar().addPermanentWidget(self.folderStatus, 1)
- self.fileStatus = QtGui.QLabel('Ready', self)
- self.statusBar().addPermanentWidget(self.fileStatus)
- # Main Widgets' layout
- self.mainLayout = QtGui.QGridLayout()
- self.cwidget.setLayout(self.mainLayout)
- # Image with correlation results
- self.corrImgWidget = pg.GraphicsLayoutWidget()
- self.corrImgItem = pg.ImageItem()
- self.corrVb = self.corrImgWidget.addViewBox(col=0, row=0)
- self.corrVb.setAspectLocked(True)
- self.corrVb.addItem(self.corrImgItem)
- self.corrImgHist = pg.HistogramLUTItem()
- self.corrImgHist.gradient.loadPreset('thermal')
- self.corrImgHist.setImageItem(self.corrImgItem)
- self.corrImgHist.vb.setLimits(yMin=0, yMax=20000)
- self.corrImgWidget.addItem(self.corrImgHist)
- self.corrResult = pg.ImageItem()
- self.corrVb.addItem(self.corrResult)
- # Image with ring results
- self.ringImgWidget = pg.GraphicsLayoutWidget()
- self.ringImgItem = pg.ImageItem()
- self.ringVb = self.ringImgWidget.addViewBox(col=0, row=0)
- self.ringVb.setAspectLocked(True)
- self.ringVb.addItem(self.ringImgItem)
- self.ringImgHist = pg.HistogramLUTItem()
- self.ringImgHist.gradient.loadPreset('thermal')
- self.ringImgHist.setImageItem(self.ringImgItem)
- self.ringImgHist.vb.setLimits(yMin=0, yMax=20000)
- self.ringImgWidget.addItem(self.ringImgHist)
- self.ringResult = pg.ImageItem()
- self.ringVb.addItem(self.ringResult)
- # Separate frame for loading controls
- loadTitle = QtGui.QLabel('<b><u>Load Image</u></b>')
- loadTitle.setTextFormat(QtCore.Qt.RichText)
- loadTitle.setAlignment(QtCore.Qt.AlignCenter)
- loadTitle.setStyleSheet("font-size:14px")
- self.STORMPxEdit = QtGui.QLineEdit()
- self.magnificationEdit = QtGui.QLineEdit()
- self.loadSTORMButton = QtGui.QPushButton('Load')
- self.loadSTORMButton.setSizePolicy(QtGui.QSizePolicy.Preferred,
- QtGui.QSizePolicy.Expanding)
- self.STEDPxEdit = QtGui.QLineEdit()
- self.loadSTEDButton = QtGui.QPushButton('Load')
- # Ring finding method settings frame
- self.intThrLabel = QtGui.QLabel('#sigmas threshold from mean')
- self.intThresEdit = QtGui.QLineEdit()
- self.sigmaEdit = QtGui.QLineEdit()
- self.lineLengthEdit = QtGui.QLineEdit()
- self.roiSizeEdit = QtGui.QLineEdit()
- self.corrSlider = QtGui.QSlider(QtCore.Qt.Horizontal, self)
- self.corrSlider.setMinimum(0)
- self.corrSlider.setMaximum(250) # Divide by 1000 to get corr value
- self.corrSlider.setValue(200)
- self.corrThresEdit = QtGui.QLineEdit()
- self.minAreaEdit = QtGui.QLineEdit()
- self.corrSlider.valueChanged[int].connect(self.sliderChange)
- self.showCorrMapCheck = QtGui.QCheckBox('Show coefficient map', self)
- self.thetaStepEdit = QtGui.QLineEdit()
- self.deltaThEdit = QtGui.QLineEdit()
- self.sinPowerEdit = QtGui.QLineEdit()
- self.corrButton = QtGui.QPushButton('Run analysis')
- self.corrButton.setCheckable(True)
- self.corrButton.setFixedHeight(28)
- settingsTitle = QtGui.QLabel('<b><u>Ring finding settings</u></b>')
- settingsTitle.setTextFormat(QtCore.Qt.RichText)
- settingsTitle.setAlignment(QtCore.Qt.AlignCenter)
- settingsTitle.setStyleSheet("font-size:14px")
- wvlenLabel = QtGui.QLabel('Rings periodicity [nm]')
- self.wvlenEdit = QtGui.QLineEdit()
- corrThresLabel = QtGui.QLabel('Discrimination threshold')
- # Load settings configuration and then connect the update
- try:
- tools.loadConfig(self)
- except:
- tools.saveDefaultConfig()
- tools.loadConfig(self)
- self.STORMPxEdit.editingFinished.connect(self.updateConfig)
- self.magnificationEdit.editingFinished.connect(self.updateConfig)
- self.STEDPxEdit.editingFinished.connect(self.updateConfig)
- self.roiSizeEdit.editingFinished.connect(self.updateConfig)
- self.sigmaEdit.editingFinished.connect(self.updateConfig)
- self.intThresEdit.editingFinished.connect(self.updateConfig)
- self.lineLengthEdit.editingFinished.connect(self.updateConfig)
- self.wvlenEdit.editingFinished.connect(self.updateConfig)
- self.sinPowerEdit.editingFinished.connect(self.updateConfig)
- self.thetaStepEdit.editingFinished.connect(self.updateConfig)
- self.deltaThEdit.editingFinished.connect(self.updateConfig)
- self.corrThresEdit.editingFinished.connect(self.updateConfig)
- self.buttonWidget = QtGui.QWidget()
- buttonsLayout = QtGui.QGridLayout()
- self.buttonWidget.setLayout(buttonsLayout)
- buttonsLayout.addWidget(loadTitle, 0, 0, 1, 3)
- buttonsLayout.addWidget(
- QtGui.QLabel('<b>STORM</b> pixel size [nm]'), 1, 0)
- buttonsLayout.addWidget(self.STORMPxEdit, 1, 1)
- buttonsLayout.addWidget(
- QtGui.QLabel('<b>STORM</b> magnification'), 2, 0)
- buttonsLayout.addWidget(self.magnificationEdit, 2, 1)
- buttonsLayout.addWidget(self.loadSTORMButton, 1, 2, 2, 1)
- buttonsLayout.addWidget(
- QtGui.QLabel('<b>STED</b> pixel size [nm]'), 3, 0)
- buttonsLayout.addWidget(self.STEDPxEdit, 3, 1)
- buttonsLayout.addWidget(self.loadSTEDButton, 3, 2)
- buttonsLayout.addWidget(settingsTitle, 5, 0, 1, 3)
- buttonsLayout.addWidget(wvlenLabel, 6, 0, 1, 2)
- buttonsLayout.addWidget(self.wvlenEdit, 6, 2)
- buttonsLayout.addWidget(corrThresLabel, 7, 0, 1, 2)
- buttonsLayout.addWidget(self.corrThresEdit, 7, 2)
- buttonsLayout.addWidget(self.corrSlider, 8, 0, 1, 3)
- buttonsLayout.addWidget(self.showCorrMapCheck, 9, 0, 1, 3)
- buttonsLayout.addWidget(self.corrButton, 10, 0, 1, 3)
- buttonsLayout.setRowMinimumHeight(4, 20)
- buttonsLayout.setColumnMinimumWidth(0, 140)
- self.buttonWidget.setFixedWidth(270)
- # layout of the three widgets
- self.mainLayout.addWidget(self.buttonWidget, 1, 0)
- corrLabel = QtGui.QLabel('Pearson coefficient')
- corrLabel.setAlignment(QtCore.Qt.AlignCenter | QtCore.Qt.AlignVCenter)
- self.mainLayout.addWidget(corrLabel, 0, 1)
- self.mainLayout.addWidget(self.corrImgWidget, 1, 1, 2, 1)
- ringLabel = QtGui.QLabel('Rings')
- ringLabel.setAlignment(QtCore.Qt.AlignCenter | QtCore.Qt.AlignVCenter)
- self.mainLayout.addWidget(ringLabel, 0, 2)
- self.mainLayout.addWidget(self.ringImgWidget, 1, 2, 2, 1)
- self.mainLayout.setColumnMinimumWidth(1, 600)
- self.mainLayout.setColumnMinimumWidth(2, 600)
- self.loadSTORMButton.clicked.connect(self.loadSTORM)
- self.loadSTEDButton.clicked.connect(self.loadSTED)
- self.sigmaEdit.textChanged.connect(self.updateMasks)
- self.corrButton.clicked.connect(self.ringFinder)
- # Load sample STED image
- folder = os.path.join(os.getcwd(), 'ringfinder')
- if os.path.exists(folder):
- self.folder = folder
- self.loadSTED(os.path.join(folder, 'spectrinSTED.tif'))
- else:
- self.folder = os.getcwd()
- self.loadSTED(os.path.join(os.getcwd(), 'spectrinSTED.tif'))
- def updateConfig(self):
- tools.saveConfig(self)
- def sliderChange(self, value):
- self.corrThresEdit.setText(str(np.round(0.001*value, 2)))
- self.corrEditChange(str(value/1000))
- def corrEditChange(self, text):
- self.corrSlider.setValue(1000*float(text))
- if self.analyzed:
- self.corrThres = float(text)
- self.ringsBig = np.nan_to_num(self.localCorrBig) > self.corrThres
- self.ringsBig = self.ringsBig.astype(float)
- self.ringResult.setImage(np.fliplr(np.transpose(self.ringsBig)))
- def loadSTED(self, filename=None):
- self.loadImage(np.float(self.STEDPxEdit.text()), 'STED',
- filename=filename)
- def loadSTORM(self, filename=None):
- # The STORM image has black borders because it's not possible to
- # localize molecules near the edge of the widefield image.
- # Therefore we need to crop those 3px borders before running the
- # analysis.
- mag = np.float(self.magnificationEdit.text())
- load = self.loadImage(np.float(self.STORMPxEdit.text()), 'STORM',
- crop=int(3*mag), filename=filename)
- if load:
- self.corrImgHist.setLevels(0, 3)
- self.ringImgHist.setLevels(0, 3)
- def loadImage(self, pxSize, tt, crop=0, filename=None):
- try:
- if not(isinstance(filename, str)):
- filetypes = ('Tiff file', '*.tif;*.tiff')
- self.filename = utils.getFilename('Load ' + tt + ' image',
- [filetypes], self.folder)
- else:
- self.filename = filename
- if self.filename is not None:
- self.corrButton.setChecked(False)
- self.analyzed = False
- self.folder = os.path.split(self.filename)[0]
- self.crop = np.int(crop)
- self.pxSize = pxSize
- self.corrVb.clear()
- self.corrResult.clear()
- self.ringVb.clear()
- self.ringResult.clear()
- im = Image.open(self.filename)
- self.inputData = np.array(im).astype(np.float64)
- self.initShape = self.inputData.shape
- bound = (np.array(self.initShape) - self.crop).astype(np.int)
- self.inputData = self.inputData[self.crop:bound[0],
- self.crop:bound[1]]
- self.shape = self.inputData.shape
- # We need 1um n-sized subimages
- self.subimgPxSize = int(1000/self.pxSize)
- self.n = (np.array(self.shape)/self.subimgPxSize).astype(int)
- # If n*subimgPxSize < shape, we crop the image
- self.remanent = np.array(self.shape) - self.n*self.subimgPxSize
- self.inputData = self.inputData[:self.n[0]*self.subimgPxSize,
- :self.n[1]*self.subimgPxSize]
- self.shape = self.inputData.shape
- self.nblocks = np.array(self.inputData.shape)/self.n
- self.blocksInput = tools.blockshaped(self.inputData,
- *self.nblocks)
- self.updateMasks()
- self.corrVb.addItem(self.corrImgItem)
- self.ringVb.addItem(self.ringImgItem)
- showIm = np.fliplr(np.transpose(self.inputData))
- self.corrImgItem.setImage(showIm)
- self.ringImgItem.setImage(showIm)
- self.grid = pyqtsub.Grid(self.corrVb, self.shape, self.n)
- self.corrVb.setLimits(xMin=-0.05*self.shape[0],
- xMax=1.05*self.shape[0], minXRange=4,
- yMin=-0.05*self.shape[1],
- yMax=1.05*self.shape[1], minYRange=4)
- self.ringVb.setLimits(xMin=-0.05*self.shape[0],
- xMax=1.05*self.shape[0], minXRange=4,
- yMin=-0.05*self.shape[1],
- yMax=1.05*self.shape[1], minYRange=4)
- self.dataMean = np.mean(self.inputData)
- self.dataStd = np.std(self.inputData)
- self.corrVb.addItem(self.corrResult)
- self.ringVb.addItem(self.ringResult)
- return True
- else:
- return False
- except OSError:
- self.fileStatus.setText('No file selected!')
- def updateMasks(self):
- """Binarization of image. """
- self.gaussSigma = np.float(self.sigmaEdit.text())/self.pxSize
- thr = np.float(self.intThresEdit.text())
- if self.testData:
- self.blocksInputS = [ndi.gaussian_filter(b, self.gaussSigma)
- for b in self.blocksInput]
- self.blocksInputS = np.array(self.blocksInputS)
- self.meanS = np.mean(self.blocksInputS, (1, 2))
- self.stdS = np.std(self.blocksInputS, (1, 2))
- thresholds = self.meanS + thr*self.stdS
- thresholds = thresholds.reshape(np.prod(self.n), 1, 1)
- mask = self.blocksInputS < thresholds
- self.blocksMask = np.array([bI < np.mean(bI) + thr*np.std(bI)
- for bI in self.blocksInputS])
- self.mask = tools.unblockshaped(mask, *self.inputData.shape)
- self.inputDataS = tools.unblockshaped(self.blocksInputS,
- *self.shape)
- else:
- self.inputDataS = ndi.gaussian_filter(self.inputData,
- self.gaussSigma)
- self.blocksInputS = tools.blockshaped(self.inputDataS,
- *self.nblocks)
- self.meanS = np.mean(self.inputDataS)
- self.stdS = np.std(self.inputDataS)
- self.mask = self.inputDataS < self.meanS + thr*self.stdS
- self.blocksMask = tools.blockshaped(self.mask, *self.nblocks)
- self.showImS = np.fliplr(np.transpose(self.inputDataS))
- self.showMask = np.fliplr(np.transpose(self.mask))
- def ringFinder(self, show=True, batch=False):
- """RingFinder handles the input data, and then evaluates every subimg
- using the given algorithm which decides if there are rings or not.
- Subsequently gives the output data and plots it"""
- if self.corrButton.isChecked() or batch:
- self.corrResult.clear()
- self.ringResult.clear()
- # for each subimg, we apply the correlation method for ring finding
- intThr = np.float(self.intThresEdit.text())
- minLen = np.float(self.lineLengthEdit.text())/self.pxSize
- thetaStep = np.float(self.thetaStepEdit.text())
- deltaTh = np.float(self.deltaThEdit.text())
- wvlen = np.float(self.wvlenEdit.text())/self.pxSize
- sinPow = np.float(self.sinPowerEdit.text())
- cArgs = minLen, thetaStep, deltaTh, wvlen, sinPow
- # Single-core code
- self.localCorr = np.zeros(len(self.blocksInput))
- thres = self.meanS + intThr*self.stdS
- if not(self.testData):
- thres = thres*np.ones(self.blocksInput.shape)
- for i in np.arange(len(self.blocksInput)):
- block = self.blocksInput[i]
- blockS = self.blocksInputS[i]
- mask = self.blocksMask[i]
- # Block may be excluded from the analysis for two reasons.
- # Firstly, because the intensity for all its pixels may be
- # too low. Secondly, because the part of the block that
- # belongs toa neuron may be below an arbitrary 20% of the
- # block. We apply intensity threshold to smoothed data so we
- # don't catch tiny bright spots outside neurons
- neuronFrac = 1 - np.sum(mask)/np.size(mask)
- areaThres = 0.01*float(self.minAreaEdit.text())
- if np.any(blockS > thres[i]) and neuronFrac > areaThres:
- output = tools.corrMethod(block, mask, *cArgs)
- angle, corrTheta, corrMax, theta, phase = output
- # Store results
- self.localCorr[i] = corrMax
- else:
- self.localCorr[i] = np.nan
- self.localCorr = self.localCorr.reshape(*self.n)
- self.updateGUI(self.localCorr)
- else:
- self.corrResult.clear()
- self.ringResult.clear()
- def updateGUI(self, localCorr):
- self.analyzed = True
- self.localCorr = localCorr
- # code for visualization of the output
- mag = np.array(self.inputData.shape)/self.n
- self.localCorrBig = np.repeat(self.localCorr, mag[0], 0)
- self.localCorrBig = np.repeat(self.localCorrBig, mag[1], 1)
- showIm = 100*np.fliplr(np.transpose(self.localCorrBig))
- self.corrResult.setImage(np.nan_to_num(showIm))
- self.corrResult.setZValue(10) # make sure this image is on top
- self.corrResult.setOpacity(0.5)
- self.corrThres = float(self.corrThresEdit.text())
- self.ringsBig = np.nan_to_num(self.localCorrBig) > self.corrThres
- self.ringsBig = self.ringsBig.astype(float)
- self.ringResult.setImage(np.fliplr(np.transpose(self.ringsBig)))
- self.ringResult.setZValue(10) # make sure this image is on top
- self.ringResult.setOpacity(0.5)
- if self.showCorrMapCheck.isChecked():
- plt.figure(figsize=(10, 8))
- data = self.localCorr.reshape(*self.n)
- data = np.flipud(data)
- maskedData = np.ma.array(data, mask=np.isnan(data))
- mx = np.max(maskedData)
- mn = np.min(maskedData)
- mp = (self.corrThres - mn)/(mx - mn)
- mp = np.min((mp, 1))
- mp = np.max((mp, 0))
- cmap = shiftedColorMap(matplotlib.cm.PuOr, midpoint=mp,
- name='shifted')
- heatmap = plt.pcolor(maskedData, cmap=cmap)
- for y in range(data.shape[0]):
- for x in range(data.shape[1]):
- plt.text(x + 0.5, y + 0.5, '%.2f' % data[y, x],
- horizontalalignment='center',
- verticalalignment='center',)
- plt.colorbar(heatmap)
- plt.gca().set_xticklabels([])
- plt.gca().set_yticklabels([])
- plt.show()
- def batch(self, function, tech):
- try:
- filenames = utils.getFilenames('Load ' + tech + ' images',
- [('Tiff file', '*.tif;*.tiff')],
- self.folder)
- nfiles = len(filenames)
- function(filenames[0])
- corrArray = np.zeros((nfiles, self.n[0], self.n[1]))
- # Expand correlation array so it matches data shape
- corrExp = np.empty((nfiles, self.initShape[0], self.initShape[1]),
- dtype=np.single)
- corrExp[:] = np.nan
- ringsExp = np.empty((nfiles, self.initShape[0], self.initShape[1]),
- dtype=np.single)
- ringsExp[:] = np.nan
- path = os.path.split(filenames[0])[0]
- folder = os.path.split(path)[1]
- self.folderStatus.setText('Processing folder ' + path)
- print('Processing folder', path)
- t0 = time.time()
- # Make results directory if it doesn't exist
- resultsDir = os.path.join(path, 'results')
- if not os.path.exists(resultsDir):
- os.makedirs(resultsDir)
- resNames = [utils.insertFolder(p, 'results') for p in filenames]
- for i in np.arange(nfiles):
- print(os.path.split(filenames[i])[1])
- self.fileStatus.setText(os.path.split(filenames[i])[1])
- function(filenames[i])
- self.ringFinder(False, batch=True)
- corrArray[i] = self.localCorr
- bound = (np.array(self.initShape) - self.crop).astype(np.int)
- edge = bound - self.remanent
- corrExp[i, self.crop:edge[0],
- self.crop:edge[1]] = self.localCorrBig
- # Save correlation values array
- corrName = utils.insertSuffix(resNames[i], '_correlation')
- tiff.imsave(corrName, corrExp[i], software='Gollum',
- imagej=True,
- resolution=(1000/self.pxSize, 1000/self.pxSize),
- metadata={'spacing': 1, 'unit': 'um'})
- # Saving ring images
- ringsExp[corrExp < self.corrThres] = 0
- ringsExp[corrExp >= self.corrThres] = 1
- for i in np.arange(nfiles):
- # Save correlation values array
- ringName = utils.insertSuffix(resNames[i], '_rings')
- tiff.imsave(ringName, ringsExp[i], software='Gollum',
- imagej=True,
- resolution=(1000/self.pxSize, 1000/self.pxSize),
- metadata={'spacing': 1, 'unit': 'um'})
- # save configuration file in the results folder
- tools.saveConfig(self, os.path.join(resultsDir, 'config'))
- # plot histogram of the correlation values
- hrange = (np.min(np.nan_to_num(corrArray)),
- np.max(np.nan_to_num(corrArray)))
- y, x, _ = plt.hist(corrArray.flatten(), bins=20, range=hrange)
- x = (x[1:] + x[:-1])/2
- # Save data array as txt
- corrArrayFlat = corrArray.flatten()
- validCorr = corrArrayFlat[~np.isnan(corrArrayFlat)]
- validArr = np.repeat(np.arange(nfiles), np.prod(self.n))
- validArr = validArr[~np.isnan(corrArrayFlat)]
- valuesTxt = os.path.join(resultsDir, folder + 'corr_values.txt')
- corrByN = np.stack((validCorr, validArr), 1)
- np.savetxt(valuesTxt, corrByN, fmt='%f\t%i')
- groupedCorr = [validCorr[np.where(validArr == i)]
- for i in np.arange(nfiles)]
- groupedCorr = [x for x in groupedCorr if len(x) > 0]
- nfiles = len(groupedCorr)
- meanCorrs = [np.mean(d) for d in groupedCorr]
- validCorrRing = validCorr[np.where(validCorr > self.corrThres)]
- validArrRing = validArr[np.where(validCorr > self.corrThres)]
- groupedCorrRing = [validCorrRing[np.where(validArrRing == i)]
- for i in np.arange(nfiles)]
- ringFracs = [len(groupedCorrRing[i])/len(groupedCorr[i])
- for i in np.arange(nfiles)]
- meanRingCorrs = np.array([np.mean(d) for d in groupedCorrRing])
- meanRingCorrs = meanRingCorrs[~np.isnan(meanRingCorrs)]
- n = corrArray.size - np.count_nonzero(np.isnan(corrArray))
- nring = np.sum(validCorr > self.corrThres)
- validRingCorr = validCorr[validCorr > self.corrThres]
- ringFrac = nring/n
- # Err estimation: stat err (binomial distribution, p=ringFrac)
- statVar = ringFrac*(1 - ringFrac)/n
- fracStd = math.sqrt(statVar)
- statCorrVar = np.var(validCorr)/n
- corrStd = math.sqrt(statCorrVar)
- statRingCorrVar = np.var(validRingCorr)/nring
- ringCorrStd = math.sqrt(statRingCorrVar)
- # Plotting
- plt.style.use('ggplot')
- plt.figure(figsize=(10, 7.5))
- plt.bar(x, y, align='center', width=(x[1] - x[0]), color="#3F5D7D")
- plt.plot((self.corrThres, self.corrThres), (0, np.max(y)), '--',
- color='r', linewidth=2)
- text = ('Pearson coefficient threshold = {0:.2f} \n'
- 'n = {1}; nrings = {2} \n'
- 'PSS fraction = {3:.2f} $\pm$ {4:.2f} \n'
- 'mean coefficient = {5:.3f} $\pm$ {6:.3f}\n'
- 'mean ring coefficient = {7:.3f} $\pm$ {8:.3f}')
- text = text.format(self.corrThres, n, nring,
- np.mean(ringFracs), fracStd,
- np.mean(meanCorrs), corrStd,
- np.mean(meanRingCorrs), ringCorrStd)
- plt.text(0.75*plt.axis()[1], 0.83*plt.axis()[3], text,
- horizontalalignment='center', verticalalignment='center',
- bbox=dict(facecolor='white'), fontsize=20)
- plt.xlabel('Pearson correlation coefficient', fontsize=35)
- plt.tick_params(axis='both', labelsize=25)
- plt.grid()
- plt.tight_layout()
- plt.savefig(os.path.join(resultsDir, folder + 'corr_hist.pdf'),
- dpi=300)
- plt.savefig(os.path.join(resultsDir, folder + 'corr_hist.png'),
- dpi=300)
- plt.close()
- folder = os.path.split(path)[1]
- text = 'Folder ' + folder + ' done in {0:.0f} seconds'
- print(text.format(time.time() - t0))
- self.folderStatus.setText(text.format(time.time() - t0))
- self.fileStatus.setText(' ')
- except IndexError:
- self.fileStatus.setText('No file selected!')
- def batchSTORM(self):
- self.batch(self.loadSTORM, 'STORM')
- def batchSTED(self):
- self.batch(self.loadSTED, 'STED')
- def shiftedColorMap(cmap, start=0, midpoint=0.5, stop=1.0, name='shiftedcmap'):
- '''
- Function to offset the "center" of a colormap. Useful for
- data with a negative min and positive max and you want the
- middle of the colormap's dynamic range to be at zero
- Input
- -----
- cmap : The matplotlib colormap to be altered
- start : Offset from lowest point in the colormap's range.
- Defaults to 0.0 (no lower ofset). Should be between
- 0.0 and `midpoint`.
- midpoint : The new center of the colormap. Defaults to
- 0.5 (no shift). Should be between 0.0 and 1.0. In
- general, this should be 1 - vmax/(vmax + abs(vmin))
- For example if your data range from -15.0 to +5.0 and
- you want the center of the colormap at 0.0, `midpoint`
- should be set to 1 - 5/(5 + 15)) or 0.75
- stop : Offset from highets point in the colormap's range.
- Defaults to 1.0 (no upper ofset). Should be between
- `midpoint` and 1.0.
- http://stackoverflow.com/questions/7404116/
- defining-the-midpoint-of-a-colormap-in-matplotlib
- '''
- if midpoint == stop:
- newcmap = truncate_colormap(cmap, 0, 0.5)
- elif midpoint == start:
- newcmap = truncate_colormap(cmap, 0.5, 1)
- else:
- cdict = {
- 'red': [],
- 'green': [],
- 'blue': [],
- 'alpha': []
- }
- # regular index to compute the colors
- reg_index = np.linspace(start, stop, 257)
- # shifted index to match the data
- shift_index = np.hstack([
- np.linspace(0.0, midpoint, 128, endpoint=False),
- np.linspace(midpoint, 1.0, 129, endpoint=True)
- ])
- for ri, si in zip(reg_index, shift_index):
- r, g, b, a = cmap(ri)
- cdict['red'].append((si, r, r))
- cdict['green'].append((si, g, g))
- cdict['blue'].append((si, b, b))
- cdict['alpha'].append((si, a, a))
- newcmap = matplotlib.colors.LinearSegmentedColormap(name, cdict)
- plt.register_cmap(cmap=newcmap)
- return newcmap
- def truncate_colormap(cmap, minval=0.0, maxval=1.0, n=256):
- new_cmap = matplotlib.colors.LinearSegmentedColormap.from_list(
- 'trunc({n},{a:.2f},{b:.2f})'.format(n=cmap.name, a=minval, b=maxval),
- cmap(np.linspace(minval, maxval, n)))
- return new_cmap
- if __name__ == '__main__':
- app = QtGui.QApplication([])
- win = Gollum()
- win.show()
- app.exec_()
ringFinder.py at commit b97868c, under GPL-3.0 · at the source
Overview
- Instituto de Investigación Médica Mercedes y Martín Ferreyra (INIMEC), Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET), Universidad Nacional de Córdoba Córdoba Argentina
- Early Drug Discovery Unit (EDDU), The Neuro-Montreal Neurological Institute and Hospital, Department of Neurology and Neurosurgery, McGill University Montreal Canada
- Faculty of Medicine and Health Sciences, McGill University Montreal Canada
- Centro de Investigaciones en Bionanociencias (CIBION), Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET) Ciudad Autónoma de Buenos Aires Argentina
- Departamento de Física, Facultad de Ciencias Exactas y Naturales, Universidad de Buenos Aires Ciudad Autónoma de Buenos Aires Argentina
- Instituto Universitario de Ciencias Biomédicas de Córdoba (IUCBC) Córdoba Argentina
- Facultad de Ciencias Exactas, Físicas y Naturales, Universidad Nacional de Córdoba Córdoba Argentina
- Institute of Zoology, Biocenter Cologne, University of Cologne Cologne Germany
Abstract
The actin/
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above, with 1 match between paragraphs and lines of code.
cibion-conicet/Gollum
b97868cff590ccdf6df0dfe61a939f85cf83a47d, 7 February 2018Availability: 1 check, the latest on 26 September 2026: the link answers
- 26 September 2026: the link answers
15 files
- bin/
__init__.py , Python, 1 line - bin/
ringFinder.py , Python, 16 lines - bin/
ringFinderDeveloper.py , Python, 16 lines - bin/
testdata_maker.py , Python, 13 lines - ringfinder/
__init__.py , Python, 1 line - ringfinder/
neurosimulations.py , Python, 76 lines - ringfinder/
pyqtsubclass.py , Python, 137 lines - ringfinder/
ringFinder.py , Python, 676 lines, 1 match - ringfinder/
ringFinderDeveloper.py , Python, 609 lines - ringfinder/
ringFinderThreads.py , Python, 755 lines - ringfinder/
testdata_maker.py , Python, 208 lines - ringfinder/
tools.py , Python, 541 lines - ringfinder/
utils.py , Python, 42 lines - LICENSE, License, 674 lines
- README.rst, Text, 155 lines
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:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 13 scripts, each with its path and the digest of its content;
- 1 match 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
No dataset and no data link were found in the paper.
Data availability
All data generated or analyzed during this study are included in this published article. The raw data used in this article has been deposited in the following domain: http://
The following dataset was generated:
AnastasiaA BisbalM UnsainN 2026Raw microscopy images from cultured human-derived motor neurons stained for b2-spectrin and other cytoskeletal proteins and registered by confocal and STED microsocypy: the whole set was used to produce the publication entitled "BetaII-Spectrin Gaps and Patches Emerge from the Patterned Assembly of the Actin/
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, pages, dates, 15 authors, 10 keywords, 7 MeSH terms, 3 funders, 60 references.
Cite
This paper
Gazal, N. G., Castellanos-Montiel, M. J., Bruno, G., Franco-Flores, A. K., Lépine, S., Gursu, L., Haghi, G., Maussion, G., Reintsch, W. E., Stefani, F. D., Anastasía, A., Bisbal, M., Gorostiza, E. A., Durcan, T. M., & Unsain, N. (2026). BetaII-spectrin gaps and patches emerge from the patterned assembly of the actin/
BibTeX
@article{gazal2026betaii
author = {Gazal, Nahir Guadalupe and Castellanos-Montiel, Maria Jose and Bruno, Guillermina and Franco-Flores, Anna Kristina and Lépine, Sarah and Gursu, Lale and Haghi, Ghazal and Maussion, Gilles and Reintsch, Wolfgang E and Stefani, Fernando D and Anastasía, Agustín and Bisbal, Mariano and Gorostiza, Ezequiel Axel and Durcan, Thomas M and Unsain, Nicolás},
title = {{BetaII-spectrin gaps and patches emerge from the patterned assembly of the actin/
journal = {eLife},
year = {2026},
month = sep,
volume = {14},
pages = {RP108021},
publisher = {eLife Sciences Publications, Ltd},
issn = {2050-084X},
doi = {10.7554/
url = {https://
pmid = {42708447},
pmcid = {PMC13553066}
}
RIS
TY - JOUR
AU - Gazal, Nahir Guadalupe
AU - Castellanos-Montiel, Maria Jose
AU - Bruno, Guillermina
AU - Franco-Flores, Anna Kristina
AU - Lépine, Sarah
AU - Gursu, Lale
AU - Haghi, Ghazal
AU - Maussion, Gilles
AU - Reintsch, Wolfgang E
AU - Stefani, Fernando D
AU - Anastasía, Agustín
AU - Bisbal, Mariano
AU - Gorostiza, Ezequiel Axel
AU - Durcan, Thomas M
AU - Unsain, Nicolás
TI - BetaII-spectrin gaps and patches emerge from the patterned assembly of the actin/
T2 - eLife
J2 - eLife
PY - 2026
DA - 2026/
VL - 14
SP - RP108021
SN - 2050-084X
PB - eLife Sciences Publications, Ltd
DO - 10.7554/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.7554/
"type": "article-journal",
"title": "BetaII-spectrin gaps and patches emerge from the patterned assembly of the actin/
"container-title": "eLife",
"author": [
{
"family": "Gazal",
"given": "Nahir Guadalupe"
},
{
"family": "Castellanos-Montiel",
"given": "Maria Jose"
},
{
"family": "Bruno",
"given": "Guillermina"
},
{
"family": "Franco-Flores",
"given": "Anna Kristina"
},
{
"family": "Lépine",
"given": "Sarah"
},
{
"family": "Gursu",
"given": "Lale"
},
{
"family": "Haghi",
"given": "Ghazal"
},
{
"family": "Maussion",
"given": "Gilles"
},
{
"family": "Reintsch",
"given": "Wolfgang E"
},
{
"family": "Stefani",
"given": "Fernando D"
},
{
"family": "Anastasía",
"given": "Agustín"
},
{
"family": "Bisbal",
"given": "Mariano"
},
{
"family": "Gorostiza",
"given": "Ezequiel Axel"
},
{
"family": "Durcan",
"given": "Thomas M"
},
{
"family": "Unsain",
"given": "Nicolás"
}
],
"container-title-short":
"volume": "14",
"page": "RP108021",
"DOI": "10.7554/
"PMID": "42708447",
"PMCID": "PMC13553066",
"ISSN": "2050-084X",
"publisher": "eLife Sciences Publications, Ltd",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
9,
8
]
]
}
}
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.1038/s41467-022-30720-x [code]
- Proteomic and functional analyses of the periodic membrane skeleton in neurons.Journal: Nature communicationsIn common: tifffile, Pillow, SciPy, 2 other tools, cellular / molecular, 16 references
- [2] doi:10.1126/sciadv.aeb0803 [code]
- Membrane-associated periodic skeleton regulates major forms of endocytosis in neurons through a signaling-driven positive feedback loop.Journal: Science advancesIn common: tifffile, Pillow, SciPy, 2 other tools, mouse, cellular / molecular, 13 references
- [3] doi:10.1016/j.isci.2025.114454
- Spectrin condensates provide a nidus for assembling the axonal membrane-associated periodic skeleton.Journal: iScienceIn common: cellular / molecular, 16 references
- [4] doi:10.1126/sciadv.adt3724
- Paralemmin-1 controls the nanoarchitecture of the neuronal submembrane cytoskeleton.Journal: Science advancesIn common: mouse, cellular / molecular, 11 references
- [5] doi:10.1016/j.isci.2024.109166 [code]
- Homozygous ALS-linked mutations in TARDBP/
TDP-43 lead to hypoactivity and synaptic abnormalities in human iPSC-derived motor neurons. Journal: iScienceIn common: SciPy, Matplotlib, NumPy, cellular / molecular, 5 references, author Thomas M Durcan - [6] doi:10.3390/ijms241914926 [code]
- Transcriptional Dysregulation and Impaired Neuronal Activity in <i>FMR1</
i> Knock-Out and Fragile X Patients' iPSC-Derived Models. Journal: International journal of molecular sciencesIn common: mouse, cellular / molecular, 2 references, 2 authors - [7] doi:10.1016/j.cub.2026.03.053
- External mechanical force drives axonal cytoskeletal rearrangements.Journal: Current biology : CBIn common: cellular / molecular, 8 references
- [8] doi:10.3390/cells12040545 [code]
- An Optimized Workflow to Generate and Characterize iPSC-Derived Motor Neuron (MN) Spheroids.Journal: CellsIn common: cellular / molecular, 4 references, author Thomas M Durcan
- [9] doi:10.1073/pnas.2310120121 [code]
- An ankyrin G-binding motif mediates TRAAK periodic localization at axon initial segments of hippocampal pyramidal neurons.Journal: Proceedings of the National Academy of Sciences of the United States of AmericaIn common: scikit-image, SciPy, Matplotlib, 1 other tool, cellular / molecular, 4 references
- [10] doi:10.1038/s41467-025-60709-1 [code]
- Structural Repetition Detector for multi-scale quantitative mapping of molecular complexes through microscopy.Journal: Nature communicationsIn common: tifffile, SciPy, Matplotlib, 1 other tool, cellular / molecular, 4 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: 1 repository of the authors' code, each at its verified commit and with its license, 13 scripts, and 1 match 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:de8fbdae597b4879…
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.7554/elife.108021)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.7554/elife.108021.svg
:target: https://openscicode.org/badge/doi/10.7554/elife.108021
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.7554/elife.108021"><img src="https://openscicode.org/badge/doi/10.7554/elife.108021.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.
