stephlj / slopey

Quantification of single-molecule FRET trajectories containing fast, non-instantaneous transitions
1 stars 0 forks source link

no Analyze_Slopey.sh #21

Open morenoat opened 4 years ago

morenoat commented 4 years ago

Hi,

I compiled the code using python setup.py build_ext --inplace

I then generated the global params.yml using the matlab script ConvertGoodTracesToYAML() When I try to run Analyze_Slopey.sh I get the bash error no such file or directory when I search for the file it is not present do you have any suggestions

stephlj commented 4 years ago

hi @morenoat, could you attach a screenshot or text file of all of the commands you ran and the outputs you got?

The ConvertGoodTracesToYAML() function won't generate the global params.yml file, only trace-specific params files based on the output of the pyhsmm-based package that's part of Traces. Thanks for flagging that that's not clear in the README, I reworded that section via commit ec17624.

To generate the global params.yml file, make a copy of the sample file and edit as appropriate for your data. Save this file in the same directory as the .mat files you want to analyze with Slopey.

morenoat commented 4 years ago

Hi @stephlj,

Thanks for the reply! I realized I mis-stated what I did. I used the sample data you provided with Traces to test out the script

  1. After downloading slopey in terminal I ran the command python setup.py build_ext --inplace
  2. I then copied the global params.yml file to the folder containing the output from Traces
  3. I then opened the matlab file ConvertGoodtracesToYAML.m and changed the path to data directory (line 15) dirname=fullfile('/Users/andrewmoreno/Data/NHEJ/smData/Test_SM_analysis/TracesSampleData/testHMM/output',dirname);
  4. I ran the ConvertGoodtracesToYAML script providing folder name of data files as an input ConvertGoodtracesToYAML('SNF2h51nMATP1mM') I did not get any errors and this generated parms.yml for the traces to ignore discard: true
  5. I next opened the matlab script named RunSlopeyAnalysis.m and changed the following paths: a) line 28 I set the path to the folder containing input data maindir=fullfile('/Users/andrewmoreno/Data/NHEJ/smData/Test_SM_analysis/TracesSampleData/testHMM/output',datadir_to_analyze); b) line 31 I set the path for output, I assumed symdir referred to simulation output symdir='/Users/andrewmoreno/Data/NHEJ/smData/Test_SM_analysis/TracesSampleData/testHMM/HMM_analysis_Slopey'; c)line 34 I set the PYTHONPATH to folder with slopey scripts setenv('PYTHONPATH', ['/Users/andrewmoreno/CodePy/slopey:', getenv('PYTHONPATH')]); d) line 35 I set the PATH for python setenv('PATH', ['/opt/anaconda3/envs/smPy27/bin/:', getenv('PATH')]);
  6. I tried running the matlab script RunSlopeyAnalysis with the input set to folder containing the traces RunSlopeyAnalysis('SNF2h51nMATP1mM')

I got the following error: /bin/bash: ./Analyze_Slopey.sh: No such file or directory

I assume I need to make a bash script ./Analyze_Slopey.sh what should this script contain?

-Thanks Andrew

stephlj commented 4 years ago

Hi Andrew,

Got it, I think I see now.

You're right, you do also need Analyze_Slopey.sh--I'll add an example to the repo (thanks for catching that!), but the contents are pretty short:

#!/bin/bash -e
cd $1
shift
make $@ -f ~/Documents/symlink/HMM_analysis_Slopey/slopey/Makefile

(You'll need to edit the path to the Makefile, of course; it's been a while since I've looked at the Makefile, but some paths in there may need editing too.)

symdir actually refers to a symbolic links directory--you may have noticed the good-natured back-and-forth between me and my collaborator in the README about directory paths having spaces, which mine do. In the README section Running Steph's Matlab code there are instructions for creating symbolic links to data directories so that paths to data directories can be passed to bash without needing to handle spaces.

So line 34 symdir='~/Documents/symlink/HMM_analysis_Slopey' is actually a path to a symbolic link (to avoid directories with spaces!) to a directory that contains both Analyze_Slopey.sh, and a subdirectory Symlinks_Data. Inside Symlinks_Data are more symbolic links, this time to each data_dir_to_analyze that I call via the Matlab script.

If you don't have spaces in your paths (which is the better way to do things, and looks like what you're doing :)) you don't need a symlinks directory. Try setting symdir = '/Users/andrewmoreno/Data/NHEJ/smData/Test_SM_analysis/TracesSampleData/testHMM' in line 34, and then change lines 42-44 to:

cd(symdir)
system(strcat(fullfile('MATLAB=1 ./Analyze_Slopey.sh output',datadir_to_analyze),' -j2'));
cd(codedir)

Analyze_Slopey.sh will need to be in /Users/andrewmoreno/Data/NHEJ/smData/Test_SM_analysis/TracesSampleData/testHMM.

Let me know if that doesn't work, it's been a while since I looked at this code and I may not understand your directory structure quite right.

-Stephanie