owned this note
owned this note
Published
Linked with GitHub
# breakout group 1 - RMR solver
Let's code some matlab...
code repo:
https://github.com/ComputationalBiomechanicsLab/rmr-solver
preprint:
https://www.biorxiv.org/content/10.1101/2023.07.11.548542v1
FIgures to reproduce
figure 3 - code?
figure 4 - left panels
figure 5
table 1 - numbers should be reproducible.
table 2 - code present, but takes long run time, so perhaps skip for now.
figure 6 - code takes >> 1 hour to run, so probably not reproducible for now.
ideally, like to see a "manifest", which is what code generates each figure.
Figure 6 and Table 2 have a source of randomness.
# getting dependencies
Needed a free account to get opensim 4.3.
Downloaded opensim (this is a matlab toolbox)
spm1d -- make sure to set up path correctly.
github repository downloaded - rmrsolver
## getting extra data
needed the opensim account.
Question: is it easier to download the other repository, or copy just the data required? Pros and cons to both approaches.
Copy the data to the github folder in the right place!
cp /Users/stephen/Downloads/ThoracoscapularShoulderPaperMaterials/ExperimentalData/EMG/* /Users/stephen/live2/rmr-solver/ExperimentalData/EMG
cp /Users/stephen/Downloads/ThoracoscapularShoulderPaperMaterials/ExperimentalData/Markers/* /Users/stephen/live2/rmr-solver/ExperimentalData/Markers
# running the code
## Figure 3 and Table 1
Code\Image Generation\PlotResults.m
Error:
```
Error using cd
Unable to change current folder to '/Users/stephen/live2/rmr-solver/Code/Image
Generation/..\..\' (Name is nonexistent or not a folder).
Error in PlotResults (line 13)
cd '..\..\'
>>
```
code asks for parameters:
flx 2kg
100hz
100hz
next error
```
onsidering CMC results
Error using textscan
Invalid file identifier. Use fopen to generate a valid file identifier.
Error in PlotResults (line 294)
CMCflx21=textscan(fileID,format_CMC,'headerlines',7);
>> file(10,:)
ans =
'/Users/stephen/live2/rmr-solver/Results/CMC analysis/flx21/ThoracoscapularShoulderCMC_states.sto '
>>
```
Where are the spaces at the end of the file coming from?
Italo: matlab 2021b on windows
SJE: 2023b
Solution: change to cell array
Next error:
```
butter requires one of the following:
DSP System Toolbox
Signal Processing Toolbox
Error in EMG_CMC_RMR_plot (line 38)
[b_h,a_h]=butter(4,fc/(fs/2),'high');
Error in PlotResults (line 334)
[MAE_flx2kg_CMC, MAE_flx2kg_RMR_GH, MAE_flx2kg_RMR_noGH, corr_flx2kg_CMC, corr_flx2kg_RMR_GH, corr_flx2kg_RMR_noGH]=EMG_CMC_RMR_plot(CMCflx21,CMCflx22,CMCflx23,EMGflx21,EMGflx22,EMGflx23,indsflx21,indendflx21,indmaxflx21,indsflx22,indendflx22,indmaxflx22,indsflx23,indendflx23,indmaxflx23,muscle_CMC(i),muscle_EMG(i),MVC(i),muscle_Name(i), path_RMR_GH, path_RMR_noGH, muscle_RMR(i), task);
```
next error:
Warning: Integer operands are required for colon operator when used as index.
> In EMG_CMC_RMR_plot (line 55)
In PlotResults (line 334)
Error using load
Unable to find file or directory 'Results\timings_matrix_experiments.mat'.
Error in evaluate_mean_std_RMR (line 22)
load('Results\timings_matrix_experiments.mat')
Error in EMG_CMC_RMR_plot (line 93)
[RMR_GH_average,RMR_GH_stdup,RMR_GH_stdlow, target_RMR_GH] = evaluate_mean_std_RMR(path_RMR_GH, muscle_RMR, task, 0);
Error in PlotResults (line 334)
[MAE_flx2kg_CMC, MAE_flx2kg_RMR_GH, MAE_flx2kg_RMR_noGH, corr_flx2kg_CMC, corr_flx2kg_RMR_GH, corr_flx2kg_RMR_noGH]=EMG_CMC_RMR_plot(CMCflx21,CMCflx22,CMCflx23,EMGflx21,EMGflx22,EMGflx23,indsflx21,indendflx21,indmaxflx21,indsflx22,indendflx22,indmaxflx22,indsflx23,indendflx23,indmaxflx23,muscle_CMC(i),muscle_EMG(i),MVC(i),muscle_Name(i), path_RMR_GH, path_RMR_noGH, muscle_RMR(i), task);
### Success!
(Captured to desktop -- too big to upload!)
Screenshot 2023-09-18 art 13.57.17.png
### Table 1 (partial)
output from command line matches what is put into the table 1
```
Task considered: FLX_2kg
Considering RMR results at 100 Hz (with GH constraint)
Considering RMR results at 100 Hz (without GH constraint)
Considering CMC results
Warning: Integer operands are required for colon operator when used as index.
> In EMG_CMC_RMR_plot (line 55)
In PlotResults (line 334)
MAE_flx2kg
{'Trapezius, scapula middle'}
CMC: 0.03 [MAE] ,0.97 [xcorr]
RMR (GH): 0.04 [MAE] ,0.94 [xcorr]
RMR (no GH): 0.04 [MAE] ,0.94 [xcorr]
Warning: Integer operands are required for colon operator when used as index.
> In EMG_CMC_RMR_plot (line 55)
In PlotResults (line 334)
MAE_flx2kg
{'Trapezius, scapula superior'}
CMC: 0.06 [MAE] ,0.94 [xcorr]
RMR (GH): 0.08 [MAE] ,0.92 [xcorr]
RMR (no GH): 0.08 [MAE] ,0.92 [xcorr]
Warning: Integer operands are required for colon operator when used as index.
> In EMG_CMC_RMR_plot (line 55)
In PlotResults (line 334)
MAE_flx2kg
{'Trapezius, scapula inferior'}
CMC: 0.02 [MAE] ,0.94 [xcorr]
RMR (GH): 0.02 [MAE] ,0.9 [xcorr]
RMR (no GH): 0.02 [MAE] ,0.9 [xcorr]
Warning: Integer operands are required for colon operator when used as index.
> In EMG_CMC_RMR_plot (line 55)
In PlotResults (line 334)
MAE_flx2kg
{'Deltoid anterior'}
CMC: 0.05 [MAE] ,0.96 [xcorr]
RMR (GH): 0.05 [MAE] ,0.94 [xcorr]
RMR (no GH): 0.04 [MAE] ,0.95 [xcorr]
Warning: Integer operands are required for colon operator when used as index.
> In EMG_CMC_RMR_plot (line 55)
In PlotResults (line 334)
MAE_flx2kg
{'Deltoid posterior'}
CMC: 0.06 [MAE] ,0.44 [xcorr]
RMR (GH): 0.07 [MAE] ,0.14 [xcorr]
RMR (no GH): 0.07 [MAE] ,0.16 [xcorr]
Warning: Integer operands are required for colon operator when used as index.
> In EMG_CMC_RMR_plot (line 55)
In PlotResults (line 334)
MAE_flx2kg
{'Deltoid middle'}
CMC: 0.06 [MAE] ,0.94 [xcorr]
RMR (GH): 0.04 [MAE] ,0.97 [xcorr]
RMR (no GH): 0.05 [MAE] ,0.95 [xcorr]
Warning: Integer operands are required for colon operator when used as index.
> In EMG_CMC_RMR_plot (line 55)
In PlotResults (line 334)
MAE_flx2kg
{'Pectoralis major clavical'}
CMC: 0.04 [MAE] ,0.94 [xcorr]
RMR (GH): 0.04 [MAE] ,0.88 [xcorr]
RMR (no GH): 0.02 [MAE] ,0.91 [xcorr]
Warning: Integer operands are required for colon operator when used as index.
> In EMG_CMC_RMR_plot (line 55)
In PlotResults (line 334)
MAE_flx2kg
{'Serratus anterior'}
CMC: 0.06 [MAE] ,0.93 [xcorr]
RMR (GH): 0.06 [MAE] ,0.92 [xcorr]
RMR (no GH): 0.06 [MAE] ,0.92 [xcorr]
Warning: Integer operands are required for colon operator when used as index.
> In EMG_CMC_RMR_plot (line 55)
In PlotResults (line 334)
MAE_flx2kg
{'Infraspinatus (Superior)'}
CMC: 0.02 [MAE] ,0.93 [xcorr]
RMR (GH): 0.02 [MAE] ,0.73 [xcorr]
RMR (no GH): 0.04 [MAE] ,0.56 [xcorr]
Warning: Integer operands are required for colon operator when used as index.
> In EMG_CMC_RMR_plot (line 55)
In PlotResults (line 334)
MAE_flx2kg
{'Latissimus Dorsi (Medialis)'}
CMC: 0.15 [MAE] ,0.84 [xcorr]
RMR (GH): 0.16 [MAE] ,0.52 [xcorr]
RMR (no GH): 0.16 [MAE] ,0.55 [xcorr]
Warning: Integer operands are required for colon operator when used as index.
> In EMG_CMC_RMR_plot (line 55)
In PlotResults (line 334)
MAE_flx2kg
{'Teres major'}
CMC: 0.09 [MAE] ,0.4 [xcorr]
RMR (GH): 0.11 [MAE] ,0.06 [xcorr]
RMR (no GH): 0.1 [MAE] ,0.05 [xcorr]
>>
```