Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Dealing with files with sweeps within a run of continuous files #275

Open
KyraBrandeis opened this issue Apr 26, 2023 · 4 comments
Open
Assignees
Labels
bug something is broken

Comments

@KyraBrandeis
Copy link

crabsort crashed if I had files of different protocols within the same folder (i.e. I would be recording continuously and then do some current or voltage clamp sweeps). I solved the problem going into "loadfile.m" and adding the following lines of code at line 197.

if length(size(self.raw_data))>2
    loadFile(self,src);

end

This pice of code checks to see if there are multiple sweeps (which adds a third dimension to raw_data), and if it finds it, it reloads the next file. This continues until a file with the format of a single sweep is encountered. It seems to be working pretty well so far

@sg-s
Copy link
Owner

sg-s commented Apr 26, 2023

@KyraBrandeis do you want to send me a pull request?

@KyraBrandeis
Copy link
Author

KyraBrandeis commented Apr 26, 2023

I'm not really sure how to do that. Like, I see a button, but I don't see how to connect it with the code from my computer. I'm not that good at github and I'm not really set up to have my code save to a repository here. I mostly just download what I need from github to my local computer and then tinker with it. So I'm not really sure how to push/pull my code to you...

@sg-s
Copy link
Owner

sg-s commented Apr 26, 2023

ok, we can do one of two things:

  1. you describe the patch and i'll fix it
  2. i can guide you through the process of creating a pull request

@KyraBrandeis
Copy link
Author

I think me describing the patch is easiest. I am still tinkering a little but the two things I did:

  1. in loadFile.m line 107 I added a pause before the end (one line after "self.checkABFFiles". This gives the use time to address the popup that warns that some of the files are a different shape.
    2). in loadFile.m after line 197 (after the try S = load_file+handle(self)' bit, but before the catch) I added the following:

    if length(size(self.raw_data))>2
    self.raw_data_size = [size(self.raw_data,1)*size(self.raw_data,3),size(self.raw_data,2)];
    loadFile(self,src);
    end

This bit of code will skip files of the wrong size (i.e. have sweeps, rather than continuous data), and will make the raw_data_size property have row number equal to the number of samples taken across all the sweeps, so that the total time this file took is accounted for when going through crabsort files later.

@sg-s sg-s self-assigned this May 31, 2023
@sg-s sg-s added the bug something is broken label May 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug something is broken
Projects
None yet
Development

No branches or pull requests

2 participants