Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/schmidtlab-northwestern/Contreras-2023-M2-Phototransduction
30 November 2023, 15:42:18 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/main
    • 08b85bafe51e5fc3bca8ef8ccffe350af1201db7
    No releases to show
  • acc0a7b
  • /
  • photocurrent.m
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge Iframe embedding
swh:1:cnt:5a21d82fcd819b2c7662e89b601f30fff49e0085
origin badgedirectory badge Iframe embedding
swh:1:dir:acc0a7bfb0f36daf98f012a385d87fd4a1ae4721
origin badgerevision badge
swh:1:rev:08b85bafe51e5fc3bca8ef8ccffe350af1201db7
origin badgesnapshot badge
swh:1:snp:f0233b1446c2d99f25a9badb74ef17beb41df8b1
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 08b85bafe51e5fc3bca8ef8ccffe350af1201db7 authored by schmidtlab-northwestern on 16 October 2023, 21:22:05 UTC
Add files via upload
Tip revision: 08b85ba
photocurrent.m
% This code plots the intrinsic photocurrent and calculates the maximum,
% early, intermediate, and late components. 

% This makes use of the abfload function created by Harald Hentschke 
% https://www.mathworks.com/matlabcentral/fileexchange/6190-abfload


clear all; close all;

%% Plotting 50ms light stimulation responses

filename_array = xlsread('Path_to_file'); %load data
filename_array = num2str(filename_array); 

ymin = -150;
ymax = 50;
trace_color = 'k';

%% Open abf files
number_of_traces = size(filename_array,1); 
current_array = [];

for x = 1:number_of_traces
    filename = filename_array(x,:);
try
[temp_samples,period,f] = abfload(filename);

catch    
    [temp_samples,period,f] = abfload([filename(1:6) '_' filename(7:end) '.abf']); 
end

temp_samples = transpose(temp_samples);
temp_samples = temp_samples(1,:);

temp_samples = movmean(temp_samples, 100);

temp_baseline = mean(temp_samples(1:40000)); 
baseline_subtracted = temp_samples - temp_baseline;

current_array = [current_array; baseline_subtracted];

end

fsamp = 1/(period/1000000); 

%% Loop that will be used to actually plot all the files on top of each other
figure(); hold on;

for y = 1:number_of_traces
    
    plot(current_array(y,:));
    
end

hold off;
ylim([ymin ymax]);

%% Average trace
average_current_array = mean(current_array);
std_current_array = std(current_array);
time = (1:length(average_current_array))/fsamp;

figure();

plot(average_current_array);

ylim([ymin ymax]);

%% Analysis  
%Maximum amplitude the greatest change from the baseline 

%Light ONSET: 5987.6 ms MEASUREMENTS ARE AFTER LIGHT ONSET
%Early (141.7-440.4 ms)
%Intermediate: (2857.7-6598.2 ms)
%Late (9062.3-14062.3 ms) 

peak_amp = [];
amplitude_early = [];
amplitude_int = [];
amplitude_late = [];

for p = 1:number_of_traces
    
    temp_array =  current_array(p,:);
    temp_early = mean(temp_array(61293:64280));
    temp_int = mean(temp_array(88453:125862));
    temp_late = mean(temp_array(150000:200000));
    
    
    amplitude_early = [amplitude_early; temp_early];
    amplitude_int = [amplitude_int; temp_int];
    amplitude_late = [amplitude_late; temp_late];
    
    
    temp_baseline = mean(temp_array(16303:36649));
    temp_trace = min(temp_array(59876:600000));
 
    temp_peak = temp_baseline - temp_trace;
    peak_amp = [peak_amp; temp_peak];

end

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API

back to top