Package: autoballs
Pipeline for analysis of ex vivo explantsInstallationWhile writing this package I tried my best not to reinvent the wheel for that reason there are a number of dependencies onFiji. When installing the package please ensure that you create a conda env with relatventopenjdk8andMaven. Furthermore, due to constant updates of Fuji please useget_fiji_version.shscript to download the working version.git clone git@github.com:rg314/autoballs.gitGo into the autoballs firectory get the working Fiji versionsource scripts/get_fiji_version.shCreate conda envconda create -n autoballs python=3.8Install autoballs in editable modepip install -e .For training you might need to install pytorch CUDA otherwise for general useage segmentation will be fine on CPU. However, for CUDA runconda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorchor for the latest version check out PyTorchPyTorchFile structurePlease note you will need to follow the following file conventions for this to work properly. I’ve not yet included the AFM section but I’m planning on adding this part in as well so there will be a later dependency.├── 20210226 Cam Franze
│   ├── afm
│   │   ├── data
│   │   │   ├── e01_nt_fg1_1force-save-2021.02.27-11.46.03.003.jpk-force
│   │   │   ├── ...
│   │   │   └── ve1_fg1_1force-save-2021.02.27-11.34.31.418.jpk-force
│   │   ├── datatxt
│   │   │   ├── e01_nt_fg1_1force-save-2021.02.27-11.46.03.003.txt
│   │   │   ├── ...
│   │   │   └── ve1_fg1_1force-save-2021.02.27-11.34.31.418.txt
│   │   └── run.py
│   ├── e01_nt_fg1_1
│   │   └── series.nd2
│   ├── e01_nt_fg2_1
│   │   └── series.nd2
│   └── metadata.txtMetadataYou will need to have a metadata file that store info about the frogs and gels for example{
'gel': 
{
'e01':'Elastic 100 Pa',
'e1':'Elastic 1 kPa',
've1':'Viscoelastic 1 kPa',
'glass':'Glass',
},
'frog': 
{
'fg1':'Upstairs outside box 176b 13:30 17/20',
'fg2':'Downstairs inside box 176b 13:30 17/20',
'fg3':'Downstairs outside box 182b 13:30 17/20',
'fg4':'Upstairs inside box 176b 13:30 17/20',
}
}Note the subfolders need to have the same naming convention i.e. ife01_nt_fg1_1is processed the frog and gel metadata will be identified asUpstairs outside box 176b 13:30 17/20Elastic 100 PaUsageCheck that the config is set-up correctly inscripts/pipeline_cnn.pyYou'll need to ensure that the path is pointing to the correct folder where each subdir has the file structure outlined above.def config():
    configs = dict()

    if sys.platform == "linux" or sys.platform == "linux2":
        path = '/media/ryan/9684408684406AB7/Users/ryan/Google Drive/TFM Cambridge/2021/Frogs'
    elif sys.platform == "win32":
        path = 'C:\\Users\\ryan\\Google Drive\\TFM Cambridge\\2021\\Frogs'
    elif sys.platform == 'darwin':
        path = '/Users/ryan/Google Drive/TFM Cambridge/2021/Frogs'


    configs['path'] = path
    configs['sample'] = '20210305 Cam Franze' #'20210226 Cam Franze'
    configs['metadata_file'] = f"{configs['path']}/{configs['sample']}{os.sep}metadata.txt"
    configs['metadata'] = biometa(configs['metadata_file'])
    configs['frog_metadata'] = configs['metadata']['frog']
    configs['gel_metadata'] = configs['metadata']['gel']
    configs['sholl'] = True
    configs['create_results'] = True
    configs['results_path'] = 'results' + os.sep + configs['sample'] + '_results'
    configs['seg'] = True
    configs['headless'] = True
    configs['step_size'] = 5
    configs['device'] = 'cuda'
    configs['best_model'] = './best_model_1.pth'If you have all path envs and file structures set up correctly you can run the pipeline aspython scripts/pipeline_cnn.pyA resuls folder will created and stats will be performed on the sample i.e.(autoballs) ryan@ryan:~/Documents/GitHub/autoballs$ python scripts/pipeline_cnn.py 
           Multiple Comparison of Means - Tukey HSD, FWER=0.05            
==========================================================================
    group1           group2       meandiff p-adj   lower    upper   reject
--------------------------------------------------------------------------
 Elastic 1 kPa     Elastic 100 Pa -43.0119 0.0031 -74.6687 -11.3551   True
 Elastic 1 kPa              Glass -15.4829 0.4857 -43.6976  12.7318  False
 Elastic 1 kPa Viscoelastic 1 kPa -17.8286 0.7525 -66.5802  30.9231  False
Elastic 100 Pa              Glass   27.529 0.0466   0.2912  54.7668   True
Elastic 100 Pa Viscoelastic 1 kPa  25.1833 0.5246 -23.0095  73.3762  False
         Glass Viscoelastic 1 kPa  -2.3457    0.9 -48.3508  43.6594  False
--------------------------------------------------------------------------
           Multiple Comparison of Means - Tukey HSD, FWER=0.05            
==========================================================================
    group1           group2       meandiff p-adj   lower    upper   reject
--------------------------------------------------------------------------
 Elastic 1 kPa     Elastic 100 Pa -43.0119 0.0031 -74.6687 -11.3551   True
 Elastic 1 kPa              Glass -15.4829 0.4857 -43.6976  12.7318  False
 Elastic 1 kPa Viscoelastic 1 kPa -17.8286 0.7525 -66.5802  30.9231  False
Elastic 100 Pa              Glass   27.529 0.0466   0.2912  54.7668   True
Elastic 100 Pa Viscoelastic 1 kPa  25.1833 0.5246 -23.0095  73.3762  False
         Glass Viscoelastic 1 kPa  -2.3457    0.9 -48.3508  43.6594  False
--------------------------------------------------------------------------Example