Skip to content

Instantly share code, notes, and snippets.

View paulbrodersen's full-sized avatar

Paul Brodersen paulbrodersen

View GitHub Profile
@paulbrodersen
paulbrodersen / synaptic_inputs.py
Last active December 4, 2024 16:04
Find synaptic inputs in voltage or current traces
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""This program identifies synaptic inputs in voltage and current
electrophysiological recordings.
Copyright (C) 2024 Gemma Gothard, Paul Brodersen
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
@paulbrodersen
paulbrodersen / dynamic_opacity.py
Created August 14, 2024 11:51
Create a scatter plot with dynamic opacity.
"""Scatter plots with dynamic opacities.
Inspired by:
https://observablehq.com/@rreusser/selecting-the-right-opacity-for-2d-point-clouds.
Copyright (C) 2024 by Paul Brodersen.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@paulbrodersen
paulbrodersen / extract_sioyek_highlights.py
Created June 20, 2024 12:23
Extract Sioyek highlights to a text file.
"""Export highlights made with the Sioyek PDF viewer
(https://github.com/ahrm/sioyek/) as a text document.
Copyright (C) 2024 by Paul Brodersen.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version. This program is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
@paulbrodersen
paulbrodersen / svg2tiff
Created January 15, 2024 11:43 — forked from matsen/svg2tiff
A script to convert SVG to a TIFF acceptable to PLOS
#!/bin/sh
# Convert all arguments (assumed SVG) to a TIFF acceptable to PLOS
# Requires Inkscape and ImageMagick 6.8 (doesn't work with 6.6.9)
for i in $@; do
BN=$(basename $i .svg)
inkscape --without-gui --export-png="$BN.png" --export-dpi 300 $i
convert -compress LZW -alpha remove $BN.png $BN.tiff
mogrify -alpha off $BN.tiff
@paulbrodersen
paulbrodersen / burman_et_al_2023_neuropixel_data_analysis.py
Last active June 12, 2023 15:49
Code to reproduce analysis of Claar et al (2023) neuropixel data in Burman et al. (2023)
#!/usr/bin/env python
# -*- coding: utf-8 -*
""" Extract data from Claar et al. (2023) & compute for each unit its
- evoked firing rate,
- peri-stimulus histogram entropy, and
- synchrony.
The dataset is available at:
@paulbrodersen
paulbrodersen / burman_et_al_2023_neuronal_network_simulation.py
Last active June 12, 2023 15:48
Code to reproduce neuronal network simulations in Burman et al. (2023).
#!/usr/bin/env python
# -*- coding: utf-8 -*
"""Simulate a LIF neuronal network with variable EGABA and structured inputs.
Copyright (C) 2023 by Paul Brodersen.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
@paulbrodersen
paulbrodersen / alfonsa_2020_neuronal_network_simulation.py
Last active January 8, 2024 11:59
Code to run neuronal network simulation in Alfonsa et al (2020)
#!/usr/bin/env python
# -*- coding: utf-8 -*
"""
Determine the effect of changes in the GABA reversal potential in
pyramidal neurons on their ability to synchronize.
Copyright (C) 2020 by Paul Brodersen.
This program is free software: you can redistribute it and/or modify