AllenInstitute/drcme

Do not find electrophysiology clustering code

Closed this issue · 5 comments

Hi, I am looking for the code you used to perform the clustering only on electrophysiological data. I looked into the drame package, and I only found the code to perform the Morpho-electro clustering . Can you indicate me where to find the code for the clustering in electrophysiological data please? or do I have to enter empty morphology data in the ME-clustering code?

Also, I read in your Methods from Gouwens et al., 2019, that after performing the sPCA, you fitted the results to multiple Gaussian Mixture Models. Do you have a specific script for this step or is it done internally by another function?

thank you very much for your help!
Best
Julien

Hi - sorry for the delayed response!

The documentation describes the Python scripts used for electrophysiology-only clustering and also describes a bash script that runs the electrophysiology-only clustering procedure. The bash script (as well as the scripts it calls in turn) is found in the bin directory of the repository. Those scripts include the ones that perform the Gaussian mixture model fits (which was done in R).

Hi,

thank you for your return. However I have a problem when trying to run the bash script. I downloaded the drcme-master as presented on your GitHub.
I created a json file as presented on the documentation:

{
"components_file": "/Users/julienballbe/My_Work/Clustering/output_directory_test_202305605/sparse_pca_components_my_test.csv",
"tau_file": "/Users/julienballbe/My_Work/Clustering/output_directory_test_202305605/tau_file.csv",
"labels_file": "/Users/julienballbe/My_Work/Clustering/output_directory_test_202305605/labels_file.csv",
"bic_file": "/Users/julienballbe/My_Work/Clustering/output_directory_test_202305605/bic_file.csv",
"merge_info_file":"/Users/julienballbe/My_Work/Clustering/output_directory_test_202305605/merge_info_file.json",
"post_merge_tau_file":"/Users/julienballbe/My_Work/Clustering/output_directory_test_202305605/post_merge_tau_file.csv",
"post_merge_labels_file":"/Users/julienballbe/My_Work/Clustering/output_directory_test_202305605/post_merge_labels_file.csv",
"jaccard_file":"/Users/julienballbe/My_Work/Clustering/output_directory_test_202305605/jaccard_file.csv",
"etypes_file":"/Users/julienballbe/My_Work/Clustering/output_directory_test_202305605/etypes_file.csv",
"post_merge_proba_file":"/Users/julienballbe/My_Work/Clustering/output_directory_test_202305605/post_merge_proba_file.csv",
"merge_unstable_info_file":"/Users/julienballbe/My_Work/Clustering/output_directory_test_202305605/merge_unstable_info_file.csv",
"entropy_piecewise_components":2,
"outliers": []
}

I then go into the Terminal, in the bin folder, and run the following command: (Allen) julienballbe@pclnrs202 bin % sh run_ephys_clustering.sh /Users/julienballbe/My_Work/Clustering/output_directory_test_202305605/input_bash_script.json

And I get the following error
Traceback (most recent call last): File "run_post_r_merging.py", line 12, in <module> import drcme.post_gmm_merging as pgm ModuleNotFoundError: No module named 'drcme'

I am not sure why I get this error, since the 'drcme' folder in correctly installed.
Do you have an idea of my mistake?

Let me know if this is not clear, and thank you for any help you can give me!
Best,

Julien

I wonder if the python that's being called by your bash script isn't the same Python that you have drcme installed into?

You could try running a bash script that's just:

#!/usr/bin/env bash
which python

and see which one it reports. Depending on how you have things installed, you may have to do something like activate a particular Anaconda environment or something in the Terminal session in which you run that script.

You could also open python and try to import drcme in the same place to make sure it's installed as you think it is - something like:

% python
Python 3.7.4 (default, Aug 13 2019, 15:17:50) 
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import drcme

and see if that works.

Also - just to be clear, downloading the drcme directory on your machine won't automatically make it available to Python everywhere.

You need to go into the top-level drcme folder and run:

pip install -e .

to make sure it's installed for your Python environment.

Hi,

You need to go into the top-level drcme folder and run:
pip install -e .
to make sure it's installed for your Python environment.

I did as you said and it worked perfectly!
Thank you very much!
Julien