Repository: azazellochg/MDCatch (language: python)

Issue:
2.1
adding back log and cryolo pickers


Discussion / hints:

Fix patch:
diff --git a/CHANGES.txt b/CHANGES.txt
index 8f91de9..c450d0d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,10 @@
+2.1:
+    - Cryolo / LoGpicker added back as an option
+    - Watcher mode not tested yet
+2.0:
+    - Relion 4.0 support with the new scheduler, old Schedules removed
+    - Topaz / 2D cls selection is now run by Relion
+    - tif/mrc parsers updated, add EER support
 1.1: fix installer
 1.0:
     - separate mdoc parser, enable bigtiff header parser
diff --git a/README.rst b/README.rst
index eeb7957..2706c25 100644
--- a/README.rst
+++ b/README.rst
@@ -1,9 +1,9 @@
 MDCatch
 =======
 
-A simple app to fetch acquisition metadata from a running EPU session or SerialEM.
-It parses the first found xml/mrc (EPU) or mdoc/tif file (SerialEM) associated with a
-data collection session and launches Relion or Scipion pipeline.
+A simple app to fetch acquisition metadata from a EPU session or SerialEM.
+It parses the first found xml/mdoc/mrc/tif/eer file (from EPU/SerialEM) associated with a
+data collection session and launches Relion 4 or Scipion 3 pipeline.
 
 Installation
 ------------
@@ -19,9 +19,10 @@ Dependencies are installed by pip automatically:
 
  * python3
  * pyqt5 (GUI)
- * numpy (to parse MRC header)
- * emtable (for Relion schedules scripts)
+ * mrcfile (to parse MRC header)
+ * tifffile (to parse TIF header)
  * watchdog (watch a folder when running in daemon mode)
+ * emtable (STAR file parser)
 
 .. raw:: html
 
@@ -68,10 +69,10 @@ You have two options:
 Screenshots
 -----------
 
-.. image:: https://user-images.githubusercontent.com/6952870/93343573-8c08f900-f828-11ea-9554-65cebe8414ae.png
+.. image:: https://user-images.githubusercontent.com/6952870/120499027-a0415600-c3b7-11eb-98a0-fcb444d4507d.png
    :width: 640 px
 
-.. image:: https://user-images.githubusercontent.com/6952870/93343678-afcc3f00-f828-11ea-9cc7-a5848f5d1ee6.png
+.. image:: https://user-images.githubusercontent.com/6952870/120499078-ab948180-c3b7-11eb-90ea-6c17e49c2072.png
    :width: 640 px
 
 
@@ -81,6 +82,8 @@ Running
 To run with a GUI simply type **mdcatch**.
 If you want to run in daemon mode, run **mdcatch --watch** (see the details in the user guide below)
 
+.. important:: Make sure the dose per frame is correct! The reported dose is measured directly from an image (at the camera level), so it is usually lower due to sample thickness, obj. aperture and energy filtering. If you are using EER, the reported dose is per EER frame! EER movies will be fractionated such that final frames will have 1 e/A\ :sup:`2`.
+
 User guide
 ----------
 
@@ -94,13 +97,20 @@ Here you can find information about how the app works and how to configure it fo
 The app is installed on a pre-processing server with GPU(s).
 The server requires the following software installed:
 
-    - `RELION 3.1 <https://www3.mrc-lmb.cam.ac.uk/relion//index.php/Main_Page>`_ or/and `Scipion 3 <http://scipion.i2pc.es/>`_
+    - `RELION 4.0 <https://www3.mrc-lmb.cam.ac.uk/relion//index.php/Main_Page>`_ or/and `Scipion 3 <http://scipion.i2pc.es/>`_
     - `CTFFIND4 <https://grigoriefflab.umassmed.edu/ctffind4>`_
-    - `crYOLO <https://cryolo.readthedocs.io/>`_ or/and `Topaz <https://github.com/tbepler/topaz>`_ (installed in a conda environment)
-    - `2dassess <https://github.com/cianfrocco-lab/Automatic-cryoEM-preprocessing>`_ or/and `Cinderella <https://sphire.mpg.de/wiki/doku.php?id=auto_2d_class_selection>`_ (installed in a conda environment)
-    - ypmatch (part of NIS client, only used to match a folder name with username from a NIS database)
+    - `Topaz <https://github.com/tbepler/topaz>`_ or `crYOLO <https://cryolo.readthedocs.io/>`_ (installed in a conda environment)
+
+Relion and/or Scipion should be available from your shell **PATH**. For Ctffind make sure you have **RELION_CTFFIND_EXECUTABLE** variable defined.
+For Relion class ranker provide a path to Python with Torch using **RELION_PYTHON** (e.g. Python from Topaz env).
+For Topaz define e.g. **RELION_TOPAZ_EXECUTABLE=topaz** variable, where *topaz* is a bash script like this:
+
+.. code-block:: bash
+
+    #!/bin/bash
+    source /home/gsharov/soft/miniconda3/bin/activate topaz-0.2.4
+    topaz $@
 
-Relion and Scipion should be available from your shell **PATH**. For Ctffind make sure you have **RELION_CTFFIND_EXECUTABLE** variable defined.
 Also, this server needs access to both EPU session folder (with metadata files) and
 raw movies folder. In our case both storage systems are mounted via NFSv4.
 
@@ -110,31 +120,30 @@ raw movies folder. In our case both storage systems are mounted via NFSv4.
    <details>
    <summary><a>Configuration</a></summary>
 
-Most of configuration is done in **config.py**. As explained in the next section, the app can run in either interactive (GUI) or daemon mode.
+Most of the configuration is done in **config.py**. As explained in the next section, the app can run in either interactive (GUI) or daemon mode.
 For the very first run it is useful to set **DEBUG=1** to see additional output and make sure it all works as expected.
 
 Important points to mention:
 
     * camera names in the SCOPE_DICT must match the names in EPU_MOVIES_DICT, GAIN_DICT and MTF_DICT
     * since in EPU Falcon cameras are called "BM-Falcon" and Gatan cameras are called "EF-CCD", MOVIE_PATH_DICT keys should not be changed, only the values
-    * you will also need to modify **Schedules/external_job_....py**, updating the path to conda environments and training models
-    * Relion schedules use **/work** as the scratch (SSD) folder, you might want to change this
-    * Relion schedules also use two GPUs: 0 and 1
+    * Relion schemes use **/ssd** as the scratch (SSD) folder, you might want to change this
+    * Relion schemes also use two GPUs: 0 and 1
 
-Below is an example of folders setup on our server. Data points to movies storage, while Metadata is for EPU sessions.
+Below is an example of the folders setup on our server. Data points to movies storage, while Metadata is for EPU sessions.
 
 .. code-block:: bash
 
     /mnt
     ├── Data
     │   ├── Krios1
-    │   │   ├── Falcon
+    │   │   ├── Falcon3
     │   │   └── K2
     │   ├── Krios2
-    │   │   ├── Falcon
+    │   │   ├── Falcon4
     │   │   └── K2
     │   └── Krios3
-    │       ├── Falcon
+    │       ├── Falcon3
     │       └── K3
     └── MetaData
         ├── Krios1
@@ -155,18 +164,16 @@ GUI mode
   1. find and parse the first metadata file, getting all acquisition metadata
   2. create a Relion/Scipion project folder ``username_microscope_date_time`` inside PROJECT_PATH (or inside Scipion default projects folder)
   3. create symlink for movies folder; copy gain reference, defects file, MTF into the project folder
-  4. modify existing Relion Schedules/Scipion templates, copy them to the project folder then launch Relion/Scipion on-the-fly processing
-  5. ACL Linux commands (setfacl) are executed for the project folder (so that uid has *rwx* permissions), where uid is obtained from DEF_USER
+  4. save found acquisition params in a text file (e.g. ``EPU_session_params``), save Relion params in ``relion_it_options.py``
+  5. modify existing Relion Schemes/Scipion template, copy them to the project folder then launch Relion/Scipion on-the-fly processing
 
 Daemon mode
 ###########
 
 From version 0.9.7 onwards it's possible to run the app in fully automatic mode. It will run in the background recursively watching for new directories (directory name should start with PREFIX, e.g. lmb_username_myEpuSession) inside METADATA_PATH.
-Once an xml/mrc (EPU) or a mdoc/tif (SerialEM) file is created in such folder, the default pipeline will launch. All subsequent steps are equivalent to the GUI mode (except uid which is obtained from username).
+Once an xml/mrc (EPU) or a mdoc/tif (SerialEM) file is created in such folder, the default pipeline will launch. All subsequent steps are equivalent to the GUI mode.
 
-Make sure you have set in **config.py**: DEF_USER, DEF_PICKER, DEF_SOFTWARE, DEF_PIPELINE, DEF_PREFIX, METATADA_PATH.
-
-Though all three pickers can be run fully automatically, Topaz and LogPicker will most likely require particle size / threshold adjustment, so crYOLO is preferred over other pickers.
+Make sure you have set in **config.py**: DEF_SOFTWARE, DEF_PIPELINE, DEF_PICKER, DEF_PREFIX, METATADA_PATH.
 
 We usually setup a daily cron job for **mdcatch --watch** that starts only if mdcatch and Relion/Scipion are not already running.
 This prevents launching pre-processing on the data twice and/or concurrently.
@@ -183,7 +190,7 @@ In case of SerialEM, the movies and metadata (mdoc file) are expected to be in t
 RELION vs Scipion
 #################
 
-So far RELION cases are more tested than Scipion. With the app we only provide a single **template.json**,
+So far RELION cases are more tested than Scipion. In the latter case, the app provides a single **template.json**,
 so irrespective of particle picker choice crYOLO will always be used. Particle size is also ignored.
 Have a look into the json file to see what pipeline will be launched.
 
@@ -193,33 +200,32 @@ Scipion project will be created in the default Scipion projects folder.
 
    </details>
    <details>
-   <summary><a>Relion schedules description</a></summary>
-
-There are two schedules: *preprocess-xxx* (where xxx is cryolo, topaz or logpicker) and *class2d*. Both are launched at the same time.
-
-    1. Preprocess includes 5 jobs that run in a loop, processing batches of 5 movies:
-
-        * import movies
-        * motion correction (relion motioncor)
-        * ctffind4-4.1.14
-        * picking (crYOLO, Topaz or Relion LogPicker)
-        * extraction
+   <summary><a>Relion schemes description</a></summary>
 
-        The schedule will terminate if no new mics were processed by Ctffind for 240 consecutive (!) loops (~ 4h in our case).
-        This helps in case a user pauses EPU session for some reason and then continues.
+There are two schemes: *prep* and *proc*. Both are launched at the same time and will run for 12 hours
 
-        .. tip:: Picking results from crYOLO or Topaz can be visualized immediately (without saving settings for Manual picking job).
+1. The prep scheme includes 3 jobs that run in a loop, processing batches of 15 movies each time:
 
-    2. Class2D includes 2 jobs:
+    a) import movies
+    b) motion correction (relion motioncor)
+    c) ctffind4-4.1.14
 
-        * 2D classification
-        * sorting 2D class averages (cryoassess)
+.. important:: The movie frames will be grouped if the dose per frame is < 0.8 e/A\ :sup:`2`. EER movies are fractionated such that final frames have 1 e/A\ :sup:`2`.
 
-        Classification starts (with 20 classes) once 5000 particles have been extracted. This class2d job will be repeated continuously, overwriting the results each time until 20000 particles is reached. Once this threshold is reached, a separate class2d job is launched with 50 classes. Then cryoassess is launched. Once that job is finished, the schedule stops.
+2. The proc scheme starts once ctffind results are available. Proc includes multiple jobs:
 
-        .. tip:: You can display the selected classes by opening the last iteration's results of the Class2D/job007 (with 20000 particles).
+    a) micrograph selection (CTF resolution < 6A)
+    b) particle picking (Cryolo or Topaz or Logpicker)
+    c) particle extraction (round 1)
+    d) 2D classification with 25 classes (round 1) once you have > 10000 particles
+    e) auto-selection of good 2D classes
+    f) using particles from good 2D classes to re-train Cryolo or Topaz
+    g) pick micrographs using new Cryolo or Topaz trained model (round 2, 3, ...). First time it re-picks all micrographs from scratch
+    h) particle extraction (round 2, 3, ...)
+    i) 2D classification with 50 classes (round 2, 3, ...)
+    k) auto-selection of good 2D classes (round 2, 3, ...)
 
-        .. important:: Both schedules produce output log files: *schedules_preprocess.log* and *schedules_class2d.log*
+The last two steps are always executed as new jobs (not overwriting previous results).
 
 .. raw:: html
 
@@ -227,8 +233,7 @@ There are two schedules: *preprocess-xxx* (where xxx is cryolo, topaz or logpick
    <details>
    <summary><a>Testing installation</a></summary>
 
-The test only checks if the parsers are working correctly using files from *Metadata-examples* folder.
-You need to define PATTERN_EPU and PATTERN_SEM in the **config.py** and then run:
+The test only checks if the parsers are working correctly using files from *tests/testdata* folder.
 
 .. code-block:: python
 
@@ -241,7 +246,7 @@ You need to define PATTERN_EPU and PATTERN_SEM in the **config.py** and then run
 How to cite
 -----------
 
-Please cite the code repository DOI: `10.5281/zenodo.4319193 <https://zenodo.org/record/4319193>`_
+Please cite the code repository DOI: `10.5281/zenodo.4383190 <http://doi.org/10.5281/zenodo.4383190>`_
 
 Feedback
 --------
diff --git a/mdcatch/Metadata-examples/EPU/K3/Images-Disc1/GridSquare_20098949/Data/FoilHole_20122410_Data_20102772_20102774_20200320_232538.xml b/mdcatch/Metadata-examples/EPU/K3/Images-Disc1/GridSquare_20098949/Data/FoilHole_20122410_Data_20102772_20102774_20200320_232538.xml
deleted file mode 100755
index e996cc5..0000000
--- a/mdcatch/Metadata-examples/EPU/K3/Images-Disc1/GridSquare_20098949/Data/FoilHole_20122410_Data_20102772_20102774_20200320_232538.xml
+++ /dev/null
@@ -1,1 +0,0 @@
-<MicroscopeImage xmlns="http://schemas.datacontract.org/2004/07/Fei.SharedObjects" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><name>Empty</name><uniqueID>f69439b3-74e8-4bac-9963-a028576f9fef</uniqueID><CustomData xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><a:KeyValueOfstringanyType><a:Key>DoseOnCamera</a:Key><a:Value i:type="b:double" xmlns:b="http://www.w3.org/2001/XMLSchema">43.234484675959365</a:Value></a:KeyValueOfstringanyType><a:KeyValueOfstringanyType><a:Key>Dose</a:Key><a:Value i:type="b:double" xmlns:b="http://www.w3.org/2001/XMLSchema">3.5581551914582745E+21</a:Value></a:KeyValueOfstringanyType><a:KeyValueOfstringanyType><a:Key>PhasePlateUsed</a:Key><a:Value i:type="b:boolean" xmlns:b="http://www.w3.org/2001/XMLSchema">true</a:Value></a:KeyValueOfstringanyType><a:KeyValueOfstringanyType><a:Key>PhasePlateApertureName</a:Key><a:Value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">Ph P5</a:Value></a:KeyValueOfstringanyType><a:KeyValueOfstringanyType><a:Key>PhasePlatePosition</a:Key><a:Value i:type="b:int" xmlns:b="http://www.w3.org/2001/XMLSchema">26</a:Value></a:KeyValueOfstringanyType><a:KeyValueOfstringanyType><a:Key>BinaryResult.Detector</a:Key><a:Value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">EF-CCD</a:Value></a:KeyValueOfstringanyType><a:KeyValueOfstringanyType><a:Key>AppliedDefocus</a:Key><a:Value i:type="b:double" xmlns:b="http://www.w3.org/2001/XMLSchema">-6E-07</a:Value></a:KeyValueOfstringanyType></CustomData><IntensityScale i:nil="true"/><ReferenceTransformation><matrix xmlns:a="http://schemas.datacontract.org/2004/07/System.Windows.Media"><a:_m11>-1.0986706649228553E-10</a:_m11><a:_m12>-8.9466205617550278E-12</a:_m12><a:_m21>-8.9466205617550342E-12</a:_m21><a:_m22>1.0986706649228553E-10</a:_m22><a:_offsetX>0</a:_offsetX><a:_offsetY>0</a:_offsetY><a:_padding>0</a:_padding><a:_type>TRANSFORM_IS_UNKNOWN</a:_type></matrix><unit xmlns:a="http://schemas.datacontract.org/2004/07/Fei.Common.Types"><a:_x003C_PrefixExponent_x003E_k__BackingField>1</a:_x003C_PrefixExponent_x003E_k__BackingField><a:_x003C_Symbol_x003E_k__BackingField>m</a:_x003C_Symbol_x003E_k__BackingField></unit></ReferenceTransformation><SpatialScale><offset><x><numericValue>0</numericValue><unit xmlns:a="http://schemas.datacontract.org/2004/07/Fei.Common.Types"><a:_x003C_PrefixExponent_x003E_k__BackingField>1</a:_x003C_PrefixExponent_x003E_k__BackingField><a:_x003C_Symbol_x003E_k__BackingField>m</a:_x003C_Symbol_x003E_k__BackingField></unit></x><y><numericValue>0</numericValue><unit xmlns:a="http://schemas.datacontract.org/2004/07/Fei.Common.Types"><a:_x003C_PrefixExponent_x003E_k__BackingField>1</a:_x003C_PrefixExponent_x003E_k__BackingField><a:_x003C_Symbol_x003E_k__BackingField>m</a:_x003C_Symbol_x003E_k__BackingField></unit></y></offset><pixelSize><x><numericValue>1.1023073426263963E-10</numericValue><unit xmlns:a="http://schemas.datacontract.org/2004/07/Fei.Common.Types"><a:_x003C_PrefixExponent_x003E_k__BackingField>1</a:_x003C_PrefixExponent_x003E_k__BackingField><a:_x003C_Symbol_x003E_k__BackingField>m</a:_x003C_Symbol_x003E_k__BackingField></unit></x><y><numericValue>1.1023073426263963E-10</numericValue><unit xmlns:a="http://schemas.datacontract.org/2004/07/Fei.Common.Types"><a:_x003C_PrefixExponent_x003E_k__BackingField>1</a:_x003C_PrefixExponent_x003E_k__BackingField><a:_x003C_Symbol_x003E_k__BackingField>m</a:_x003C_Symbol_x003E_k__BackingField></unit></y></pixelSize></SpatialScale><microscopeData><acquisition><acquisitionDateTime>2020-03-20T23:25:46.2524843+00:00</acquisitionDateTime><analyticalDetectors/><camera><Binning xmlns:a="http://schemas.datacontract.org/2004/07/System.Drawing"><a:x>1</a:x><a:y>1</a:y></Binning><CameraLocation>EnergyFilter</CameraLocation><CameraSpecificInput xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><a:KeyValueOfstringanyType><a:Key>ElectronCountingEnabled</a:Key><a:Value i:type="b:boolean" xmlns:b="http://www.w3.org/2001/XMLSchema">true</a:Value></a:KeyValueOfstringanyType><a:KeyValueOfstringanyType><a:Key>AlignIntegratedImageEnabled</a:Key><a:Value i:type="b:boolean" xmlns:b="http://www.w3.org/2001/XMLSchema">false</a:Value></a:KeyValueOfstringanyType><a:KeyValueOfstringanyType><a:Key>SuperResolutionFactor</a:Key><a:Value i:type="b:int" xmlns:b="http://www.w3.org/2001/XMLSchema">1</a:Value></a:KeyValueOfstringanyType><a:KeyValueOfstringanyType><a:Key>FractionationSettings</a:Key><a:Value i:type="b:EquidistantFractionation" xmlns:b="http://schemas.datacontract.org/2004/07/Fei.Applications.Common.Omp.Interface"><b:NumberOffractions>40</b:NumberOffractions></a:Value></a:KeyValueOfstringanyType><a:KeyValueOfstringanyType><a:Key>CetaFramesSummed</a:Key><a:Value i:type="b:int" xmlns:b="http://www.w3.org/2001/XMLSchema">1</a:Value></a:KeyValueOfstringanyType><a:KeyValueOfstringanyType><a:Key>CetaNoiseReductionEnabled</a:Key><a:Value i:type="b:boolean" xmlns:b="http://www.w3.org/2001/XMLSchema">false</a:Value></a:KeyValueOfstringanyType></CameraSpecificInput><DarkGainCorrection>None</DarkGainCorrection><ExposureTime>2</ExposureTime><Inserted>true</Inserted><Name>EF-CCD</Name><PreExposurePauseTime>0</PreExposurePauseTime><PreExposureSupported>false</PreExposureSupported><PreExposureTime>0</PreExposureTime><ReadoutArea xmlns:a="http://schemas.datacontract.org/2004/07/System.Drawing"><a:height>4092</a:height><a:width>5760</a:width><a:x>0</a:x><a:y>0</a:y></ReadoutArea><Shutter>PreSpecimen</Shutter></camera><plateCamera><ExposureTime>0</ExposureTime><Use>false</Use></plateCamera><scanSettings><DwellTime>0</DwellTime><ReducedArea i:nil="true" xmlns:a="http://schemas.datacontract.org/2004/07/System.Drawing"/><Resolution xmlns:a="http://schemas.datacontract.org/2004/07/System.Drawing"><a:height>0</a:height><a:width>0</a:width></Resolution><ScanArea xmlns:a="http://schemas.datacontract.org/2004/07/System.Drawing"><a:height>0</a:height><a:width>0</a:width><a:x>0</a:x><a:y>0</a:y></ScanArea><ScanRotation>0</ScanRotation></scanSettings><scanningDetector><DetectorType>SecondaryElectrons</DetectorType><Gain i:nil="true"/><Inserted>false</Inserted><Name i:nil="true"/><Offset i:nil="true"/></scanningDetector></acquisition><core><ApplicationSoftware>EPU</ApplicationSoftware><ApplicationSoftwareVersion>2.6.1.69</ApplicationSoftwareVersion><Guid>90b9db82-2102-4702-b345-70103c5e3972</Guid></core><gun><AccelerationVoltage>300000</AccelerationVoltage><ExtractorVoltage>4100</ExtractorVoltage><Filament i:nil="true"/><GunLens>4</GunLens><Sourcetype>FieldEmission</Sourcetype><WehneltBias i:nil="true"/></gun><instrument><AcquisitionSoftware i:nil="true"/><AcquisitionSoftwareVersion i:nil="true"/><ComputerName>TITAN52335930</ComputerName><InstrumentID>3593</InstrumentID><InstrumentModel>TITAN52335930</InstrumentModel></instrument><optics><Apertures i:nil="true"/><BeamConvergence i:nil="true"/><BeamDiameter>1.2040378547234353E-06</BeamDiameter><BeamShift xmlns:a="http://schemas.datacontract.org/2004/07/Fei.Types"><a:_x>-0.02631455659866333</a:_x><a:_y>-0.0083182379603385925</a:_y></BeamShift><BeamTilt xmlns:a="http://schemas.datacontract.org/2004/07/Fei.Types"><a:_x>-0.032141201198101044</a:_x><a:_y>0.019893782213330269</a:_y></BeamTilt><Cameralength>0</Cameralength><ColumnOperatingMode>TEM</ColumnOperatingMode><ColumnOperatingTemSubMode>BrightField</ColumnOperatingTemSubMode><CondenserStigmator xmlns:a="http://schemas.datacontract.org/2004/07/Fei.Types"><a:_x>0</a:_x><a:_y>0</a:_y></CondenserStigmator><Defocus>1.8469013987753596E-06</Defocus><DiffractionFocus>0</DiffractionFocus><DiffractionShift xmlns:a="http://schemas.datacontract.org/2004/07/Fei.Types"><a:_x>0</a:_x><a:_y>0</a:_y></DiffractionShift><DiffractionStigmator xmlns:a="http://schemas.datacontract.org/2004/07/Fei.Types"><a:_x>0</a:_x><a:_y>0</a:_y></DiffractionStigmator><EFTEMOn>true</EFTEMOn><EnergyFilter><AccelerationVoltageOffset>0</AccelerationVoltageOffset><DriftTubeVoltage>0</DriftTubeVoltage><EnergySelectionSlitInserted>true</EnergySelectionSlitInserted><EnergySelectionSlitWidth>20</EnergySelectionSlitWidth><EnergyShift>-0</EnergyShift><EntranceApertureDiameter i:nil="true"/><EntranceApertureType i:nil="true"/></EnergyFilter><Focus>0.00065585987172420439</Focus><GunStigmator i:nil="true" xmlns:a="http://schemas.datacontract.org/2004/07/Fei.Types"/><IlluminationMode>Parallel</IlluminationMode><IlluminationProbeSubMode i:nil="true"/><ImageShift xmlns:a="http://schemas.datacontract.org/2004/07/Fei.Types"><a:_x>0</a:_x><a:_y>0</a:_y></ImageShift><Intensity>0.43989219209876568</Intensity><ObjectiveLensMode>HM</ObjectiveLensMode><ObjectiveStigmator xmlns:a="http://schemas.datacontract.org/2004/07/Fei.Types"><a:_x>0</a:_x><a:_y>0</a:_y></ObjectiveStigmator><ProbeMode>NanoProbe</ProbeMode><ProjectorMode>Imaging</ProjectorMode><SpotIndex>3</SpotIndex><StemDefocus>0</StemDefocus><StemFieldOfView i:nil="true"/><StemMagnification i:nil="true"/><TemMagnification><NominalMagnification>81000</NominalMagnification></TemMagnification></optics><sample><Description i:nil="true"/><ID i:nil="true"/></sample><stage><Holder>Unspecified</Holder><Position><A>-0.00021779237374000375</A><B>0</B><X>1.713611760000001E-05</X><Y>-0.000399320032</Y><Z>1.6558607993600022E-05</Z></Position><SampleLoader>None</SampleLoader></stage><vacuum><ProjectionChamberPressure>0</ProjectionChamberPressure><SamplePressure>0</SamplePressure><VacuumMode>Ready</VacuumMode></vacuum></microscopeData></MicroscopeImage>
\ No newline at end of file
diff --git a/mdcatch/Schedules/class2d/class2d_first/run.job b/mdcatch/Schedules/class2d/class2d_first/run.job
deleted file mode 100644
index 2a4f5e3..0000000
--- a/mdcatch/Schedules/class2d/class2d_first/run.job
+++ /dev/null
@@ -1,38 +0,0 @@
-job_type == 8
-is_continue == false
-Ignore CTFs until first peak? == No
-Do bimodal angular searches? == Yes
-Combine iterations through disc? == No
-Do CTF-correction? == Yes
-Use fast subsets (for large data sets)? == No
-Classify 2D helical segments? == No
-Use parallel disc I/O? == Yes
-Pre-read all particles into RAM? == No
-Submit to queue? == No
-Restrict helical offsets to rise: == Yes
-Mask individual particles with zeros? == Yes
-Perform image alignment? == Yes
-Continue from here:  == 
-Input images STAR file: == Work/particles_batch.star
-Which GPUs to use: == 0:1
-Helical rise (A): == 4.75
-Tube diameter (A):  == 200
-Limit resolution E-step to (A):  == -1
-Minimum dedicated cores per node: == 24
-Number of classes: == $$nr_cls1
-Number of iterations: == 20
-Number of MPI procs: == 3
-Number of pooled particles: == 30
-Number of threads: == 8
-Offset search range (pix): == 5
-Offset search step (pix): == 1
-Additional arguments: == --free_gpu_memory 3000
-Mask diameter (A): == $$mask_diam
-In-plane angular sampling: == 6
-Queue submit command: == qsub
-Standard submission script: == /public/EM/RELION/relion/bin/relion_qsub.csh
-Queue name:  == openmpi
-Angular search range - psi (deg): == 6
-Copy particles to scratch directory: == /work
-Regularisation parameter T: == 2
-Use GPU acceleration? == Yes
diff --git a/mdcatch/Schedules/class2d/class2d_last/run.job b/mdcatch/Schedules/class2d/class2d_last/run.job
deleted file mode 100644
index 83ba8a4..0000000
--- a/mdcatch/Schedules/class2d/class2d_last/run.job
+++ /dev/null
@@ -1,38 +0,0 @@
-job_type == 8
-is_continue == false
-Ignore CTFs until first peak? == No
-Do bimodal angular searches? == Yes
-Combine iterations through disc? == No
-Do CTF-correction? == Yes
-Use fast subsets (for large data sets)? == No
-Classify 2D helical segments? == No
-Use parallel disc I/O? == Yes
-Pre-read all particles into RAM? == No
-Submit to queue? == No
-Restrict helical offsets to rise: == Yes
-Mask individual particles with zeros? == Yes
-Perform image alignment? == Yes
-Continue from here:  == 
-Input images STAR file: == Work/particles_batch.star
-Which GPUs to use: == 0:1
-Helical rise (A): == 4.75
-Tube diameter (A):  == 200
-Limit resolution E-step to (A):  == -1
-Minimum dedicated cores per node: == 24
-Number of classes: == $$nr_cls2
-Number of iterations: == 20
-Number of MPI procs: == 3
-Number of pooled particles: == 30
-Number of threads: == 8
-Offset search range (pix): == 5
-Offset search step (pix): == 1
-Additional arguments: == --free_gpu_memory 2000
-Mask diameter (A): == $$mask_diam
-In-plane angular sampling: == 6
-Queue submit command: == qsub
-Standard submission script: == /public/EM/RELION/relion/bin/relion_qsub.csh
-Queue name:  == openmpi
-Angular search range - psi (deg): == 6
-Copy particles to scratch directory: == /work
-Regularisation parameter T: == 2
-Use GPU acceleration? == Yes
diff --git a/mdcatch/Schedules/class2d/schedule.star b/mdcatch/Schedules/class2d/schedule.star
deleted file mode 100644
index 8292ee9..0000000
--- a/mdcatch/Schedules/class2d/schedule.star
+++ /dev/null
@@ -1,107 +0,0 @@
-
-# version 30001
-
-data_schedule_general
-
-_rlnScheduleName                       Schedules/class2d/
-_rlnScheduleCurrentNodeName            WAIT_wait_sec
- 
-
-# version 30001
-
-data_schedule_floats
-
-loop_ 
-_rlnScheduleFloatVariableName #1 
-_rlnScheduleFloatVariableValue #2 
-_rlnScheduleFloatVariableResetValue #3
-count_parts    0.000000    0.000000
-batch_min  5000.000000 5000.000000
-batch_max 20000.000000 20000.000000
- mask_diam   0.000000   0.000000
-nr_cls1    20.000000    20.000000
-nr_cls2    50.000000    50.000000
-  wait_sec    60.000000   60.000000
-   zero     0.000000     0.000000
- 
-
-# version 30001
-
-data_schedule_bools
-
-loop_ 
-_rlnScheduleBooleanVariableName #1 
-_rlnScheduleBooleanVariableValue #2 
-_rlnScheduleBooleanVariableResetValue #3
-batch_exists            0            0
-batch_ready            0            0
-batch_complete         0            0
-size_provided          0            0
-
-
-# version 30001
-
-data_schedule_strings
-
-loop_ 
-_rlnScheduleStringVariableName #1 
-_rlnScheduleStringVariableValue #2 
-_rlnScheduleStringVariableResetValue #3 
-partdiam Work/picker_params.star,picker,rlnParticleDiameter Work/picker_params.star,picker,rlnParticleDiameter
-extracted_batch Work/particles_batch.star Work/particles_batch.star
-
-
-# version 30001
-
-data_schedule_operators
-
-loop_ 
-_rlnScheduleOperatorName #1 
-_rlnScheduleOperatorType #2 
-_rlnScheduleOperatorOutput #3 
-_rlnScheduleOperatorInput1 #4 
-_rlnScheduleOperatorInput2 #5 
-WAIT_wait_sec       wait  undefined   wait_sec  undefined
-batch_exists=EXISTS_extracted_batch bool=file_exists batch_exists extracted_batch  undefined
-batch_ready=count_parts_GT_batch_min bool=gt batch_ready count_parts batch_min
-batch_complete=count_parts_GE_batch_max bool=ge batch_complete count_parts batch_max
-count_parts=COUNT_IMGS_extracted_batch_undefined float=count_images count_parts extracted_batch undefined
-size_provided=mask_diam_GT_zero bool=gt size_provided mask_diam zero
-mask_diam=STAR_partdiam_zero float=read_star  mask_diam partdiam       zero
-EXIT exit undefined undefined undefined
-
-
-# version 30001
-
-data_schedule_jobs
-
-loop_ 
-_rlnScheduleJobNameOriginal #1 
-_rlnScheduleJobName #2 
-_rlnScheduleJobMode #3 
-_rlnScheduleJobHasStarted #4 
-class2d_first class2d_first overwrite     0
-class2d_last class2d_last new     0
-sort_cls2d sort_cls2d continue 0
-
-
-# version 30001
-
-data_schedule_edges
-
-loop_ 
-_rlnScheduleEdgeInputNodeName #1 
-_rlnScheduleEdgeOutputNodeName #2 
-_rlnScheduleEdgeIsFork #3 
-_rlnScheduleEdgeOutputNodeNameIfTrue #4 
-_rlnScheduleEdgeBooleanVariable #5 
-WAIT_wait_sec batch_exists=EXISTS_extracted_batch 0 undefined  undefined
-batch_exists=EXISTS_extracted_batch WAIT_wait_sec 1 count_parts=COUNT_IMGS_extracted_batch_undefined batch_exists
-count_parts=COUNT_IMGS_extracted_batch_undefined batch_ready=count_parts_GT_batch_min 0 undefined undefined
-batch_ready=count_parts_GT_batch_min WAIT_wait_sec 1 size_provided=mask_diam_GT_zero batch_ready
-size_provided=mask_diam_GT_zero mask_diam=STAR_partdiam_zero 1 batch_complete=count_parts_GE_batch_max size_provided
-mask_diam=STAR_partdiam_zero batch_complete=count_parts_GE_batch_max 0 undefined  undefined
-batch_complete=count_parts_GE_batch_max class2d_first 1 class2d_last batch_complete
-class2d_first WAIT_wait_sec 0  undefined  undefined
-class2d_last sort_cls2d 0  undefined  undefined
-sort_cls2d EXIT 0 undefined undefined
diff --git a/mdcatch/Schedules/class2d/schedule_pipeline.star b/mdcatch/Schedules/class2d/schedule_pipeline.star
deleted file mode 100644
index 3186be1..0000000
--- a/mdcatch/Schedules/class2d/schedule_pipeline.star
+++ /dev/null
@@ -1,60 +0,0 @@
-# version 30001
-
-data_pipeline_general
-
-_rlnPipeLineJobCounter                       1
- 
-
-# version 30001
-
-data_pipeline_processes
-
-loop_ 
-_rlnPipeLineProcessName #1 
-_rlnPipeLineProcessAlias #2 
-_rlnPipeLineProcessType #3 
-_rlnPipeLineProcessStatus #4 
-Schedules/class2d/class2d_first/       Schedules/class2d/Class2D_run1            8            1
-Schedules/class2d/class2d_last/       Schedules/class2d/Class2D_run2            8            1
-Schedules/class2d/sort_cls2d/       Schedules/class2d/2D_assess           99            1
-
-
-# version 30001
-
-data_pipeline_nodes
-
-loop_
-_rlnPipeLineNodeName #1
-_rlnPipeLineNodeType #2
-Schedules/preprocess-cryolo/extract/particles.star            3
-Schedules/class2d/class2d_first/run_it020_data.star            3
-Schedules/class2d/class2d_first/run_it020_model.star            8
-Schedules/class2d/class2d_last/run_it020_data.star            3
-Schedules/class2d/class2d_last/run_it020_model.star            8
-Schedules/class2d/sort_cls2d/particles_for_training.star            3
-
-
-# version 30001
-
-data_pipeline_input_edges
-
-loop_
-_rlnPipeLineEdgeFromNode #1
-_rlnPipeLineEdgeProcess #2
-Schedules/preprocess-cryolo/extract/particles.star Schedules/class2d/class2d_first/
-Schedules/preprocess-cryolo/extract/particles.star Schedules/class2d/class2d_last/
-Schedules/class2d/class2d_last/run_it020_data.star Schedules/class2d/sort_cls2d/
-
-
-# version 30001
-
-data_pipeline_output_edges
-
-loop_
-_rlnPipeLineEdgeProcess #1
-_rlnPipeLineEdgeToNode #2
-Schedules/class2d/class2d_first/ Schedules/class2d/class2d_first/run_it020_data.star
-Schedules/class2d/class2d_first/ Schedules/class2d/class2d_first/run_it020_model.star
-Schedules/class2d/class2d_last/ Schedules/class2d/class2d_last/run_it020_data.star
-Schedules/class2d/class2d_last/ Schedules/class2d/class2d_last/run_it020_model.star
-Schedules/class2d/sort_cls2d/ Schedules/class2d/sort_cls2d/particles_for_training.star
diff --git a/mdcatch/Schedules/external_job_cinderella.py b/mdcatch/Schedules/external_job_cinderella.py
deleted file mode 100755
index de97b5c..0000000
--- a/mdcatch/Schedules/external_job_cinderella.py
+++ /dev/null
@@ -1,158 +0,0 @@
-#!/usr/bin/env python3
-
-""" Based on https://github.com/DiamondLightSource/python-relion-yolo-it by
-Sjors H.W. Scheres, Takanori Nakane, Colin M. Palmer, Donovan Webb"""
-
-import argparse
-import os
-import time
-import subprocess
-from emtable import Table
-
-
-RELION_JOB_FAILURE_FILENAME = "RELION_JOB_EXIT_FAILURE"
-RELION_JOB_SUCCESS_FILENAME = "RELION_JOB_EXIT_SUCCESS"
-CONDA_ENV = ". /home/gsharov/rc/conda.rc && conda activate cinderella-0.7.0"
-CINDERELLA_PREDICT = "sp_cinderella_predict.py"
-CINDERELLA_GEN_MODEL = "/home/gsharov/soft/cryolo/relion_lmb_cl2d_model_based_on_cinderella.h5"
-DEBUG = 0
-
-
-def run_job(project_dir, args):
-    start = time.time()
-    in_parts = args.in_parts
-    job_dir = args.out_dir
-    thresh = args.threshold
-    model = args.model
-    gpus = args.gpu
-
-    getPath = lambda *arglist: os.path.join(project_dir, *arglist)
-
-    if model == "None":
-        model = CINDERELLA_GEN_MODEL
-    else:
-        model = getPath(model)
-
-    # Reading the model star file from relion
-    modelstar = in_parts.replace("_data.star", "_model.star")
-    refstable = Table(fileName=getPath(modelstar), tableName='model_classes')
-    refstack = refstable[0].rlnReferenceImage.split("@")[-1]
-    nrCls = int(refstable[-1].rlnReferenceImage.split("@")[0])
-
-    if DEBUG:
-        print("Found input class averages stack: %s" % refstack)
-
-    # Launching cinderella
-    args_dict = {
-        '-i': getPath(refstack),
-        '-o': 'output',
-        '-w': model,
-        '--gpu': gpus,
-        '-t': thresh,
-    }
-    cmd = "%s && %s " % (CONDA_ENV, CINDERELLA_PREDICT)
-    cmd += " ".join(['%s %s' % (k, v) for k, v in args_dict.items()])
-
-    print("Running command:\n{}".format(cmd))
-    proc = subprocess.Popen(cmd, shell=True)
-    proc.communicate()
-
-    if proc.returncode:
-        raise Exception("Command failed with return code %d" % proc.returncode)
-
-    # Parse output to get good classes IDs
-    outfn = os.path.basename(refstack.replace(".mrcs", "_index_confidence.txt"))
-    outpath = getPath(job_dir, "output", outfn)
-    goodcls = []
-    with open(outpath, "r") as f:
-        for line in f:
-            if float(line.split()[1]) > thresh:
-                goodcls.append(int(line.split()[0]) + 1)
-            else:
-                break
-
-    if DEBUG:
-        print("Parsing output file: %s\nGood classes: %s" % (outpath, goodcls))
-
-    if len(goodcls) == 0:
-        print("No good classes found. Job stopped.")
-        end = time.time()
-        diff = end - start
-        print("Job duration = %dh %dmin %dsec \n" % (diff // 3600, diff // 60 % 60, diff % 60))
-        open(RELION_JOB_FAILURE_FILENAME, "w").close()
-        exit(1)
-
-    # Create output star file for Relion to use
-    optics = Table(fileName=getPath(in_parts), tableName='optics')
-    ptcls = Table(fileName=getPath(in_parts), tableName='particles')
-    cols = ptcls.getColumnNames()
-    out_ptcls = Table(columns=cols)
-    
-    for row in ptcls:
-        if row.rlnClassNumber in goodcls:
-            out_ptcls.addRow(*row)
-
-    if DEBUG:
-        print("Input particles: %d\nOutput particles: %d" % 
-              (len(ptcls), len(out_ptcls)))
-
-    out_star = getPath(job_dir, "particles_for_training.star")
-    with open(out_star, "w") as f:
-        optics.writeStar(f, tableName="optics")
-        out_ptcls.writeStar(f, tableName="particles")
-
-    # Create backup_selection.star for results visualization
-    sel = Table(columns=['rlnSelected'])
-    for i in range(1, nrCls + 1):
-        sel.addRow(1 if i in goodcls else 0)
-    with open(getPath("backup_selection.star"), "w") as f:
-        sel.writeStar(f, tableName="")
-
-    end = time.time()
-    diff = end - start
-    print("Job duration = %dh %dmin %dsec \n" % (diff//3600, diff//60 % 60, diff % 60))
-
-
-def main():
-    """Change to the job working directory, then call run_job()"""
-    help = """
-External job for calling cinderella within Relion 3.1.0. Run it in the main Relion project directory, e.g.:
-    external_job_cinderella.py --o External/cinderella_bestclasses2d --in_parts Class2D/job004/run_it025_data.star --threshold 0.7
-"""
-    parser = argparse.ArgumentParser(usage=help)
-    parser.add_argument("--in_parts", help="Input data STAR file from Class2D job")
-    parser.add_argument("--o", dest="out_dir", help="Output directory name")
-    parser.add_argument("--threshold", help="Confidence threshold (default = 0.7)", type=float, default=0.7)
-    parser.add_argument("--model", help="Cinderella prediction model (if not specified general is used)", default="None")
-    parser.add_argument("--gpu", help='GPUs to use (e.g. "0 1 2 3")', default="0")
-    parser.add_argument("--pipeline_control", help="Not used here. Required by relion")
-    parser.add_argument("--j", dest="threads", help="Not used here. Required by relion")
-
-    args = parser.parse_args()
-
-    if args.in_parts is None or args.out_dir is None:
-        print("Error: --in_parts and --o are required params!")
-        exit(1)
-
-    if not args.in_parts.endswith("_data.star"):
-        print("Error: --in_parts must point to a data STAR file")
-        exit(1)
-
-    project_dir = os.getcwd()
-    os.makedirs(args.out_dir, exist_ok=True)
-    os.chdir(args.out_dir)
-    if os.path.isfile(RELION_JOB_FAILURE_FILENAME):
-        os.remove(RELION_JOB_FAILURE_FILENAME)
-    if os.path.isfile(RELION_JOB_SUCCESS_FILENAME):
-        os.remove(RELION_JOB_SUCCESS_FILENAME)
-    try:
-        run_job(project_dir, args)
-    except:
-        open(RELION_JOB_FAILURE_FILENAME, "w").close()
-        raise
-    else:
-        open(RELION_JOB_SUCCESS_FILENAME, "w").close()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/mdcatch/Schedules/external_job_cryoassess.py b/mdcatch/Schedules/external_job_cryoassess.py
deleted file mode 100755
index 4a80732..0000000
--- a/mdcatch/Schedules/external_job_cryoassess.py
+++ /dev/null
@@ -1,153 +0,0 @@
-#!/usr/bin/env python3
-
-""" Based on https://github.com/DiamondLightSource/python-relion-yolo-it by
-Sjors H.W. Scheres, Takanori Nakane, Colin M. Palmer, Donovan Webb"""
-
-import argparse
-import os
-import re
-from glob import glob
-import time
-import subprocess
-from emtable import Table
-
-
-RELION_JOB_FAILURE_FILENAME = "RELION_JOB_EXIT_FAILURE"
-RELION_JOB_SUCCESS_FILENAME = "RELION_JOB_EXIT_SUCCESS"
-CONDA_ENV = ". /home/gsharov/rc/conda.rc && conda activate cryoassess-0.1.0"
-CRYOASSESS_2D = "2dassess"
-CRYOASSESS_2D_MODEL = "/home/gsharov/soft/cryoassess-models/2dassess_062119.h5"
-DEBUG = 0
-
-
-def run_job(project_dir, args):
-    start = time.time()
-    in_parts = args.in_parts
-    job_dir = args.out_dir
-    batch = args.batch_size
-    gpu = args.gpu
-
-    getPath = lambda *arglist: os.path.join(project_dir, *arglist)
-
-    # Reading the model star file from relion
-    modelstar = in_parts.replace("_data.star", "_model.star")
-    refstable = Table(fileName=getPath(modelstar), tableName='model_classes')
-    refstack = refstable[0].rlnReferenceImage.split("@")[-1]
-    nrCls = int(refstable[-1].rlnReferenceImage.split("@")[0])
-
-    if DEBUG:
-        print("Found input class averages stack: %s" % refstack)
-
-    # Launching cryoassess
-    args_dict = {
-        '-i': getPath(refstack),
-        '-o': getPath(job_dir, 'output'),
-        '-b': batch,
-        '-m': CRYOASSESS_2D_MODEL,
-    }
-    cmd = "%s && CUDA_VISIBLE_DEVICES=%s %s " % (CONDA_ENV, gpu, CRYOASSESS_2D)
-    cmd += " ".join(['%s %s' % (k, v) for k, v in args_dict.items()])
-
-    print("Running command:\n{}".format(cmd))
-    proc = subprocess.Popen(cmd, shell=True)
-    proc.communicate()
-
-    if proc.returncode:
-        raise Exception("Command failed with return code %d" % proc.returncode)
-
-    # Parse output to get good classes IDs
-    goodTemplate = getPath(job_dir, "output/Good/particle_*.jpg")
-    regex = re.compile('particle_(\d*)\.jpg')
-    goodcls = []
-    files = glob(goodTemplate)
-    if files:
-        for i in files:
-            s = regex.search(i)
-            goodcls.append(int(s.group(1)))
-
-    if DEBUG:
-        print("Parsing output files: %s\nGood classes: %s" % (goodTemplate, goodcls))
-
-    if len(goodcls) == 0:
-        print("No good classes found. Job stopped.")
-        end = time.time()
-        diff = end - start
-        print("Job duration = %dh %dmin %dsec \n" % (diff // 3600, diff // 60 % 60, diff % 60))
-        open(RELION_JOB_FAILURE_FILENAME, "w").close()
-        exit(1)
-
-    # Create output star file for Relion to use
-    optics = Table(fileName=getPath(in_parts), tableName='optics')
-    ptcls = Table(fileName=getPath(in_parts), tableName='particles')
-    cols = ptcls.getColumnNames()
-    out_ptcls = Table(columns=cols)
-
-    for row in ptcls:
-        if row.rlnClassNumber in goodcls:
-            out_ptcls.addRow(*row)
-
-    if DEBUG:
-        print("Input particles: %d\nOutput particles: %d" %
-              (len(ptcls), len(out_ptcls)))
-
-    out_star = getPath(job_dir, "particles_for_training.star")
-    with open(out_star, "w") as f:
-        optics.writeStar(f, tableName="optics")
-        out_ptcls.writeStar(f, tableName="particles")
-
-    # Create backup_selection.star for results visualization
-    sel = Table(columns=['rlnSelected'])
-    for i in range(1, nrCls+1):
-        sel.addRow(1 if i in goodcls else 0)
-    with open(getPath("backup_selection.star"), "w") as f:
-        sel.writeStar(f, tableName="")
-
-    end = time.time()
-    diff = end - start
-    print("Job duration = %dh %dmin %dsec \n" % (diff // 3600, diff // 60 % 60, diff % 60))
-
-
-def main():
-    """Change to the job working directory, then call run_job()"""
-    help = """
-External job for calling cryoassess within Relion 3.1.0. Run it in the main Relion project directory, e.g.:
-    external_job_cryoassess.py --o External/cryoassess_bestclasses2d --in_parts Class2D/job004/run_it025_data.star
-"""
-    parser = argparse.ArgumentParser(usage=help)
-    parser.add_argument("--in_parts", help="Input data STAR file from Class2D job")
-    parser.add_argument("--o", dest="out_dir", help="Output directory name")
-    parser.add_argument("--batch_size", help="Batch size used in prediction. Default is 32. If "
-                        "memory error/warning appears, try lower this number to "
-                        "16, 8, or even lower", default=32)
-    parser.add_argument("--gpu", help='GPU to use', default='0')
-    parser.add_argument("--pipeline_control", help="Not used here. Required by relion")
-    parser.add_argument("--j", dest="threads", help="Not used here. Required by relion")
-
-    args = parser.parse_args()
-
-    if args.in_parts is None or args.out_dir is None:
-        print("Error: --in_parts and --o are required params!")
-        exit(1)
-
-    if not args.in_parts.endswith("_data.star"):
-        print("Error: --in_parts must point to a data STAR file")
-        exit(1)
-
-    project_dir = os.getcwd()
-    os.makedirs(args.out_dir, exist_ok=True)
-    os.chdir(args.out_dir)
-    if os.path.isfile(RELION_JOB_FAILURE_FILENAME):
-        os.remove(RELION_JOB_FAILURE_FILENAME)
-    if os.path.isfile(RELION_JOB_SUCCESS_FILENAME):
-        os.remove(RELION_JOB_SUCCESS_FILENAME)
-    try:
-        run_job(project_dir, args)
-    except:
-        open(RELION_JOB_FAILURE_FILENAME, "w").close()
-        raise
-    else:
-        open(RELION_JOB_SUCCESS_FILENAME, "w").close()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/mdcatch/Schedules/external_job_sortcl2d.py b/mdcatch/Schedules/external_job_sortcl2d.py
deleted file mode 100755
index d5a0a2d..0000000
--- a/mdcatch/Schedules/external_job_sortcl2d.py
+++ /dev/null
@@ -1,113 +0,0 @@
-#!/usr/bin/env python3
-
-""" Based on https://github.com/diamondlightsource/python-relion-yolo-it by
-Sjors H.W. Scheres, Takanori Nakane, Colin M. Palmer, Donovan Webb"""
-
-import os
-import time
-import argparse
-from emtable import Table  # requires pip install emtable
-
-
-RELION_JOB_FAILURE_FILENAME = "RELION_JOB_EXIT_FAILURE"
-RELION_JOB_SUCCESS_FILENAME = "RELION_JOB_EXIT_SUCCESS"
-DEBUG = 0
-
-
-def run_job(project_dir, args):
-    start = time.time()
-    in_parts = args.in_parts
-    job_dir = args.out_dir
-
-    getPath = lambda *arglist: os.path.join(project_dir, *arglist)
-
-    # Reading the model star file from relion
-    model = in_parts.replace("_data.star", "_model.star")
-    clstable = Table(fileName=getPath(model), tableName='model_classes')
-    nrCls = int(clstable[-1].rlnReferenceImage.split("@")[0])
-
-    # Find classes with >= 5% particles, accuracy < 10deg, < 10A
-    good_cls = []
-    for row in clstable:
-        if (row.rlnClassDistribution >= 0.05 and
-                row.rlnAccuracyRotations < 10 and
-                row.rlnAccuracyTranslationsAngst < 10):
-            good_cls.append(int(row.rlnReferenceImage.split("@")[0]))
-    if DEBUG:
-        print("Classes selected: ", good_cls)
-
-    if len(good_cls) == 0:
-        open(RELION_JOB_FAILURE_FILENAME, "w").close()
-        exit(1)
-
-    optics = Table(fileName=getPath(in_parts), tableName='optics')
-    ptcls = Table(fileName=getPath(in_parts), tableName='particles')
-    cols = ptcls.getColumnNames()
-    out_ptcls = Table(columns=cols)
-    
-    for row in ptcls:
-        if row.rlnClassNumber in good_cls:
-            out_ptcls.addRow(*row)
-
-    if DEBUG:
-        print("Input particles: %d\nOutput particles: %d" % 
-              (len(ptcls), len(out_ptcls)))
-
-    out_star = getPath(job_dir, "particles_for_training.star")
-    with open(out_star, "w") as f:
-        optics.writeStar(f, tableName="optics")
-        out_ptcls.writeStar(f, tableName="particles")
-
-    # Create backup_selection.star for results visualization
-    sel = Table(columns=['rlnSelected'])
-    for i in range(1, nrCls + 1):
-        sel.addRow(1 if i in good_cls else 0)
-    with open(getPath("backup_selection.star"), "w") as f:
-        sel.writeStar(f, tableName="")
-
-    end = time.time()
-    diff = end - start
-    print("Job duration = %dh %dmin %dsec \n" % (diff//3600, diff//60 % 60, diff % 60))
-
-
-def main():
-    """Change to the job working directory, then call run_job()"""
-    help = """
-External job to parse *_data.star from Class2D job and save particles with rlnClassDistribution >=0.05:
-    external_job_sortcl2d.py --o External/best_cl2d --in_parts Class2D/job004/run_it020_data.star
-"""
-    parser = argparse.ArgumentParser(usage=help)
-    parser.add_argument("--in_parts", help="Input *_data.star STAR file from Class2D job")
-    parser.add_argument("--o", dest="out_dir", help="Output directory name")
-    parser.add_argument("--j", dest="threads", help="Not used here. Required by relion")
-    parser.add_argument("--pipeline_control", help="Not used here. Required by relion")
-
-    args = parser.parse_args()
-
-    if args.in_parts is None or args.out_dir is None:
-        print("Error: --in_parts and --o are required params!")
-        exit(1)
-
-    if not args.in_parts.endswith("_data.star"):
-        print("Error: --in_parts must point to a *_data.star file")
-        exit(1)
-
-    project_dir = os.getcwd()
-    os.makedirs(args.out_dir, exist_ok=True)
-    os.chdir(args.out_dir)
-    if os.path.isfile(RELION_JOB_FAILURE_FILENAME):
-        os.remove(RELION_JOB_FAILURE_FILENAME)
-    if os.path.isfile(RELION_JOB_SUCCESS_FILENAME):
-        os.remove(RELION_JOB_SUCCESS_FILENAME)
-    try:
-        run_job(project_dir, args)
-    except:
-        open(RELION_JOB_FAILURE_FILENAME, "w").close()
-        raise
-    else:
-        open(RELION_JOB_SUCCESS_FILENAME, "w").close()
-
-
-if __name__ == "__main__":
-    main()
-
diff --git a/mdcatch/Schedules/external_job_topaz.py b/mdcatch/Schedules/external_job_topaz.py
deleted file mode 100755
index 24df27e..0000000
--- a/mdcatch/Schedules/external_job_topaz.py
+++ /dev/null
@@ -1,320 +0,0 @@
-#!/usr/bin/env python3
-
-""" Based on https://github.com/DiamondLightSource/python-relion-yolo-it by
-Sjors H.W. Scheres, Takanori Nakane, Colin M. Palmer, Donovan Webb"""
-
-import argparse
-import os
-import shutil
-import time
-from glob import glob
-import subprocess
-import math
-from emtable import Table  # requires pip install emtable
-
-
-RELION_JOB_FAILURE_FILENAME = "RELION_JOB_EXIT_FAILURE"
-RELION_JOB_SUCCESS_FILENAME = "RELION_JOB_EXIT_SUCCESS"
-DONE_MICS = "done_mics.txt"
-CONDA_ENV = ". /home/gsharov/rc/conda.rc && conda activate topaz-0.2.4"
-TOPAZ_PREPROCESS = "topaz preprocess"
-TOPAZ_EXTRACT = "topaz extract"
-TOPAZ_CONVERT = "topaz convert"
-TOPAZ_SPLIT = "topaz split"
-DEBUG = 0
-
-
-def run_job(project_dir, args):
-    start = time.time()
-    in_mics = args.in_mics
-    job_dir = args.out_dir
-    thresh = args.threshold
-    diam = args.diam
-    model = args.model
-    gpu = args.gpu
-    threads = args.threads
-    workers = args.workers
-
-    getPath = lambda *arglist: os.path.join(project_dir, *arglist)
-
-    if model != "None":
-        model = getPath(model)
-
-    # Reading the micrographs star file from relion
-    optics = Table(fileName=getPath(in_mics), tableName='optics')
-    angpix = float(optics[0].rlnMicrographPixelSize)
-    mictable = Table(fileName=getPath(in_mics), tableName='micrographs')
-
-    # calculate downscale factor to get to 4-8 A/px
-    for scale in range(2, 20):
-        angpix_bin = angpix * scale
-        if diam < 300 and (4.0 <= angpix_bin <= 6.0 or angpix > 6.0):
-            break
-        elif diam >= 300 and (6.0 <= angpix_bin <= 8.0 or angpix > 8.0):
-            break
-
-    print("Using downscale factor %d to get %0.2f A/pix for %d A particle" % (
-        scale, angpix_bin, diam))
-
-    # Arranging files for topaz: making symlinks for mics
-    done_mics = []
-    mic_dirs = []
-    if os.path.exists(DONE_MICS):
-        with open(DONE_MICS, "r") as f:
-            done_mics.extend(f.read().splitlines())
-    if DEBUG:
-        print("Current done_mics: ", done_mics)
-
-    mic_fns = mictable.getColumnValues("rlnMicrographName")
-    mic_ext = os.path.splitext(mic_fns[0])[1]
-    input_job = "/".join(mic_fns[0].split("/")[:2])
-    keys = ["/".join(i.split("/")[2:]) for i in mic_fns]  # remove JobType/jobXXX
-    values = [os.path.splitext(i)[0] + "_topaz.star" for i in keys]  # _topaz.star
-    mic_dict = {k: v for k, v in zip(keys, values) if k not in done_mics}
-
-    for mic in mic_dict:
-        if DEBUG:
-            print("Processing mic: ", mic)
-        mic_dir = os.path.dirname(mic)
-        # create folder for micrograph links for topaz job
-        if not os.path.isdir(mic_dir):
-            os.makedirs(mic_dir)
-        if mic_dir not in mic_dirs:
-            mic_dirs.append(mic_dir)
-            if DEBUG:
-                print("Added folder %s to the mic_dirs" % mic_dir)
-        inputfn = getPath(input_job, mic)
-        outfn = getPath(job_dir, mic)
-        os.symlink(inputfn, outfn)
-        if DEBUG:
-            print("Link %s --> %s" % (inputfn, outfn))
-
-    if len(mic_dict.keys()) == 0:
-        print("All mics picked! Nothing to do.")
-        open(RELION_JOB_SUCCESS_FILENAME, "w").close()
-        exit(0)
-
-    # Launching topaz preprocess
-    args_dict = {
-        '--scale': scale,
-        '--destdir': 'preprocessed',
-        '--num-workers': workers,
-        '--num-threads': threads
-    }
-    cmd = "%s && %s " % (CONDA_ENV, TOPAZ_PREPROCESS)
-    cmd += " ".join(['%s %s' % (k, v) for k, v in args_dict.items()])
-    for i in mic_dirs:
-        if len(glob("%s/*%s" % (i, mic_ext))):  # skip folders with no mics
-            cmd += " %s/*%s" % (i, mic_ext)
-
-    print("Running command:\n{}".format(cmd))
-    proc = subprocess.Popen(cmd, shell=True)
-    proc.communicate()
-
-    if proc.returncode:
-        raise Exception("Command failed with return code %d" % proc.returncode)
-
-    # Launching topaz extract
-    args_dict = {
-        '--radius': int(diam / angpix_bin // 2),
-        '--up-scale': scale,
-        '--threshold': thresh,
-        '--output': 'output/coords.txt',
-        '--num-workers': workers,
-        '--num-threads': threads,
-        '--device': gpu
-    }
-
-    if model != "None":
-        args_dict.update({'--model': model})
-
-    cmd = "%s && %s " % (CONDA_ENV, TOPAZ_EXTRACT)
-    cmd += " ".join(['%s %s' % (k, v) for k, v in args_dict.items()])
-    cmd += " preprocessed/*.mrc"
-    os.makedirs("output", exist_ok=True)
-
-    print("Running command:\n{}".format(cmd))
-    proc = subprocess.Popen(cmd, shell=True)
-    proc.communicate()
-
-    if proc.returncode:
-        raise Exception("Command failed with return code %d" % proc.returncode)
-
-    # clean preprocessed dir
-    shutil.rmtree("preprocessed")
-
-    # Launching topaz convert
-    cmd = "%s && %s " % (CONDA_ENV, TOPAZ_CONVERT)
-    cmd += " -o output/coords.star output/coords.txt"
-    print("Running command:\n{}".format(cmd))
-    proc = subprocess.Popen(cmd, shell=True)
-    proc.communicate()
-
-    if proc.returncode:
-        raise Exception("Command failed with return code %d" % proc.returncode)
-
-    # Launching topaz split
-    cmd = "%s && %s " % (CONDA_ENV, TOPAZ_SPLIT)
-    cmd += " --output output output/coords.star"
-    print("Running command:\n{}".format(cmd))
-    proc = subprocess.Popen(cmd, shell=True)
-    proc.communicate()
-
-    if proc.returncode:
-        raise Exception("Command failed with return code %d" % proc.returncode)
-
-    # Move output star files for Relion to use
-    with open(DONE_MICS, "a+") as f:
-        for mic in mic_dict:
-            f.write("%s\n" % mic)
-            mic_base = os.path.basename(mic)
-            os.remove(mic)  # clean up
-            coord_topaz = "output/" + os.path.splitext(mic_base)[0] + ".star"
-            coord_relion = mic_dict[mic]
-            if os.path.exists(coord_topaz):
-                os.rename(coord_topaz, getPath(job_dir, coord_relion))
-                if DEBUG:
-                    print("Moved %s to %s" % (coord_topaz, getPath(job_dir, coord_relion)))
-
-    # clean output dir
-    shutil.rmtree("output")
-
-    # Required output mics star file
-    with open("coords_suffix_topaz.star", "w") as mics_star:
-        mics_star.write(in_mics)
-
-    # Required output nodes star file
-    nodes = Table(columns=['rlnPipeLineNodeName', 'rlnPipeLineNodeType'])
-    nodes.addRow(os.path.join(job_dir, "coords_suffix_topaz.star"), "2")
-    with open("RELION_OUTPUT_NODES.star", "w") as nodes_star:
-        nodes.writeStar(nodes_star, tableName="output_nodes")
-
-    outputFn = getPath(job_dir, "output_for_relion.star")
-    if not os.path.exists(outputFn):
-        # calculate diameter, original (boxSize) and downsampled (boxSizeSmall) box
-        optics = Table(fileName=getPath(in_mics), tableName='optics')
-        angpix = float(optics[0].rlnMicrographPixelSize)
-        # use +10% for box size, make it even
-        boxSize = math.ceil(diam * 1.1 / angpix / 2.) * 2
-
-        # from relion_it.py script
-        # Authors: Sjors H.W. Scheres, Takanori Nakane & Colin M. Palmer
-        boxSizeSmall = None
-        for box in (32, 48, 64, 96, 128, 160, 192, 256, 288, 300, 320,
-                    360, 384, 400, 420, 450, 480, 512, 640, 768,
-                    896, 1024):
-            # Don't go larger than the original box
-            if box > boxSize:
-                boxSizeSmall = boxSize
-                break
-            # If Nyquist freq. is better than 8.5 A, use this
-            # downscaled box, otherwise continue to next size up
-            small_box_angpix = angpix * boxSize / box
-            if small_box_angpix < 4.25:
-                boxSizeSmall = box
-                break
-
-        print("\nEstimated parameters:\n\tDiameter (A): %d\n\tBox size (px): %d\n"
-              "\tBox size binned (px): %d" % (diam, boxSize, boxSizeSmall))
-
-        # output all params into a star file
-        tableTopaz = Table(columns=['rlnParticleDiameter',
-                                    'rlnOriginalImageSize',
-                                    'rlnImageSize'])
-        tableTopaz.addRow(diam, boxSize, boxSizeSmall)
-        with open(outputFn, "w") as f:
-            tableTopaz.writeStar(f, tableName='picker')
-
-        # create .gui_manualpickjob.star for easy display
-        starString = """
-# version 30001
-
-data_job
-
-_rlnJobType                             3
-_rlnJobIsContinue                       0
-
-
-# version 30001
-
-data_joboptions_values
-
-loop_
-_rlnJobOptionVariable #1
-_rlnJobOptionValue #2
-    angpix         -1
- black_val          0
-blue_value          0
-color_label rlnParticleSelectZScore
-  ctfscale          1
-  diameter         %d
-  do_color         No
-  do_queue         No
-do_startend        No
-  fn_color         ""
-     fn_in         ""
-  highpass         -1
-   lowpass         20
-  micscale        0.2
-min_dedicated       1
-other_args         ""
-      qsub       qsub
-qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh
- queuename    openmpi
- red_value          2
-sigma_contrast      3
- white_val          0
-"""
-        with open(getPath(".gui_manualpickjob.star"), "w") as f:
-            f.write(starString % diam)
-
-    end = time.time()
-    diff = end - start
-    print("Job duration = %dh %dmin %dsec \n" % (diff//3600, diff//60 % 60, diff % 60))
-
-
-def main():
-    """Change to the job working directory, then call run_job()"""
-    help = """
-External job for calling topaz within Relion 3.1.0. Run it in the main Relion project directory, e.g.:
-    external_job_topaz.py --o External/topaz_picking --in_mics CtfFind/job004/micrographs_ctf.star --diam 120 --threshold 0 --gpu 0
-"""
-    parser = argparse.ArgumentParser(usage=help)
-    parser.add_argument("--in_mics", help="Input micrographs STAR file")
-    parser.add_argument("--o", dest="out_dir", help="Output directory name")
-    parser.add_argument("--j", dest="threads", help="Number of CPU threads (default = 1)", type=int, default=1)
-    parser.add_argument("--workers", dest="workers", help="Number of worker processes (default = 1)", type=int, default=1)
-    parser.add_argument("--diam", help="Particle diameter in A (default = 120)", type=int, default=120)
-    parser.add_argument("--threshold", help="Threshold for picking (default = -6)", type=float, default=-6)
-    parser.add_argument("--model", help="Topaz training model (if not specified default is used)", default="None")
-    parser.add_argument("--gpu", help='GPU to use (default = 0)', default="0")
-    parser.add_argument("--pipeline_control", help="Not used here. Required by relion")
-
-    args = parser.parse_args()
-
-    if args.in_mics is None or args.out_dir is None:
-        print("Error: --in_mics and --o are required params!")
-        exit(1)
-
-    if not args.in_mics.endswith(".star"):
-        print("Error: --in_mics must point to a micrographs star file")
-        exit(1)
-
-    project_dir = os.getcwd()
-    os.makedirs(args.out_dir, exist_ok=True)
-    os.chdir(args.out_dir)
-    if os.path.isfile(RELION_JOB_FAILURE_FILENAME):
-        os.remove(RELION_JOB_FAILURE_FILENAME)
-    if os.path.isfile(RELION_JOB_SUCCESS_FILENAME):
-        os.remove(RELION_JOB_SUCCESS_FILENAME)
-    try:
-        run_job(project_dir, args)
-    except:
-        open(RELION_JOB_FAILURE_FILENAME, "w").close()
-        raise
-    else:
-        open(RELION_JOB_SUCCESS_FILENAME, "w").close()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/mdcatch/Schedules/preprocess-cryolo/cryolopicker/job.star b/mdcatch/Schedules/preprocess-cryolo/cryolopicker/job.star
deleted file mode 100644
index b4b59c7..0000000
--- a/mdcatch/Schedules/preprocess-cryolo/cryolopicker/job.star
+++ /dev/null
@@ -1,51 +0,0 @@
-
-# version 30001
-
-data_job
-
-_rlnJobType                            99
-_rlnJobIsContinue                       0
- 
-
-# version 30001
-
-data_joboptions_values
-
-loop_ 
-_rlnJobOptionVariable #1 
-_rlnJobOptionValue #2 
-  do_queue         No 
-    fn_exe         Schedules/external_job_cryolo.py 
-  in_3dref         "" 
- in_coords         "" 
-   in_mask         "" 
-    in_mic         Schedules/preprocess-cryolo/ctffind/micrographs_ctf.star
-    in_mov         "" 
-   in_part         "" 
-min_dedicated          1 
-nr_threads          1 
-other_args         "" 
-param10_label         "" 
-param10_value         "" 
-param1_label         gpu 
-param1_value         1 
-param2_label         threshold 
-param2_value         $$cryolo_thresh 
-param3_label         box_size
-param3_value         $$box_size
-param4_label         ""
-param4_value         ""
-param5_label         "" 
-param5_value         "" 
-param6_label         "" 
-param6_value         "" 
-param7_label         "" 
-param7_value         "" 
-param8_label         "" 
-param8_value         "" 
-param9_label         "" 
-param9_value         "" 
-      qsub       qsub 
-qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
- queuename    openmpi 
- 
diff --git a/mdcatch/Schedules/preprocess-cryolo/ctffind/job.star b/mdcatch/Schedules/preprocess-cryolo/ctffind/job.star
deleted file mode 100644
index 442ceb1..0000000
--- a/mdcatch/Schedules/preprocess-cryolo/ctffind/job.star
+++ /dev/null
@@ -1,48 +0,0 @@
-
-# version 30001
-
-data_job
-
-_rlnJobType                             2
-_rlnJobIsContinue                       0
- 
-
-# version 30001
-
-data_joboptions_values
-
-loop_ 
-_rlnJobOptionVariable #1 
-_rlnJobOptionValue #2 
-       box        512 
-   ctf_win         -1 
-      dast        100 
-     dfmax      50000 
-     dfmin       5000 
-    dfstep        500 
-    do_EPA         No 
-do_ignore_ctffind_params        Yes 
-do_phaseshift   $$is_VPP 
-  do_queue         No 
-fn_ctffind_exe $RELION_CTFFIND_EXECUTABLE
-fn_gctf_exe $RELION_GCTF_EXECUTABLE
-   gpu_ids         "" 
-input_star_mics Schedules/preprocess-cryolo/motioncorr/corrected_micrographs.star
-min_dedicated         24 
-    nr_mpi         5
-other_args         "" 
-other_gctf_args         "" 
- phase_max        180 
- phase_min          0 
-phase_step         10 
-      qsub       qsub 
-qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
- queuename    openmpi 
-    resmax          5 
-    resmin         30 
-slow_search         No 
-use_ctffind4        Yes 
-  use_gctf         No 
-use_given_ps        Yes 
-  use_noDW        No 
- 
diff --git a/mdcatch/Schedules/preprocess-cryolo/ctffind/run.job b/mdcatch/Schedules/preprocess-cryolo/ctffind/run.job
deleted file mode 100644
index 7ba7441..0000000
--- a/mdcatch/Schedules/preprocess-cryolo/ctffind/run.job
+++ /dev/null
@@ -1,33 +0,0 @@
-job_type == 2
-is_continue == false
-FFT box size (pix): == 512
-Estimate CTF on window size (pix)  == -1
-Amount of astigmatism (A): == 100
-Maximum defocus value (A): == 50000
-Minimum defocus value (A): == 5000
-Defocus step size (A): == 500
-Perform equi-phase averaging? == No
-Ignore 'Searches' parameters? == Yes
-Estimate phase shifts? == $$is_VPP
-Submit to queue? == No
-CTFFIND-4.1 executable: == $RELION_CTFFIND_EXECUTABLE
-Gctf executable: == $RELION_GCTF_EXECUTABLE
-Which GPUs to use: == 
-Input micrographs STAR file: == Schedules/preprocess-cryolo/motioncorr/corrected_micrographs.star
-Minimum dedicated cores per node: == 24
-Number of MPI procs: == 5
-Additional arguments: == 
-Other Gctf options: == 
-Phase shift (deg) - Max: == 180
-Phase shift (deg) - Min: == 0
-Phase shift (deg) - Step: == 10
-Queue submit command: == qsub
-Standard submission script: == /public/EM/RELION/relion/bin/relion_qsub.csh
-Queue name:  == openmpi
-Maximum resolution (A): == 5
-Minimum resolution (A): == 30
-Use exhaustive search? == No
-Use CTFFIND-4.1? == Yes
-Use Gctf instead? == No
-Use power spectra from MotionCorr job? == Yes
-Use micrograph without dose-weighting? == No
diff --git a/mdcatch/Schedules/preprocess-cryolo/extract/run.job b/mdcatch/Schedules/preprocess-cryolo/extract/run.job
deleted file mode 100644
index 6339da9..0000000
--- a/mdcatch/Schedules/preprocess-cryolo/extract/run.job
+++ /dev/null
@@ -1,35 +0,0 @@
-job_type == 5
-is_continue == false
-Pixel size (A) == 1
-Diameter background circle (pix):  == $$mask_diam_px
-Stddev for black dust removal:  == -1
-Input coordinates:  == Schedules/preprocess-cryolo/cryolopicker/coords_suffix_cryolo.star
-Cut helical tubes into segments? == Yes
-Coordinates are start-end only? == Yes
-Extract helical segments? == No
-Invert contrast? == Yes
-Normalize particles? == Yes
-Submit to queue? == No
-OR: re-center refined coordinates?  == No
-OR re-extract refined particles?  == No
-Rescale particles? == Yes
-Reset the refined offsets to zero?  == No
-Manually set pixel size?  == No
-Particle box size (pix): == $$box_size
-Refined particles STAR file:  == 
-Use bimodal angular priors? == Yes
-Number of unique asymmetrical units: == 1
-Helical rise (A): == 1
-Tube diameter (A):  == 200
-Minimum dedicated cores per node: == 24
-Number of MPI procs: == 5
-Additional arguments: == 
-Queue submit command: == qsub
-Standard submission script: == /public/EM/RELION/relion/bin/relion_qsub.csh
-Queue name:  == openmpi
-Re-center on X-coordinate (in pix):  == 0
-Re-center on Y-coordinate (in pix):  == 0
-Re-center on Z-coordinate (in pix):  == 0
-Re-scaled size (pixels):  == $$box_size_bin
-micrograph STAR file:  == Schedules/preprocess-cryolo/ctffind/micrographs_ctf.star
-Stddev for white dust removal:  == -1
diff --git a/mdcatch/Schedules/preprocess-cryolo/importmovies/job.star b/mdcatch/Schedules/preprocess-cryolo/importmovies/job.star
deleted file mode 100644
index 2a32d41..0000000
--- a/mdcatch/Schedules/preprocess-cryolo/importmovies/job.star
+++ /dev/null
@@ -1,38 +0,0 @@
-
-# version 30001
-
-data_job
-
-_rlnJobType                             0
-_rlnJobIsContinue                       0
- 
-
-# version 30001
-
-data_joboptions_values
-
-loop_ 
-_rlnJobOptionVariable #1 
-_rlnJobOptionValue #2 
-        Cs       $$Cs 
-        Q0        0.1 
-    angpix   $$angpix 
-beamtilt_x          0 
-beamtilt_y          0 
-  do_other         No 
-  do_queue         No 
-    do_raw        Yes 
-fn_in_other    ref.mrc 
- fn_in_raw $$movies_wildcard 
-    fn_mtf $$mtf_file 
-is_multiframe        Yes 
-        kV  $$voltage 
-min_dedicated         24 
- node_type "Particle coordinates (*.box, *_pick.star)" 
-optics_group_name $$optics_group 
-optics_group_particles         "" 
-other_args "--do_at_most $$do_at_most" 
-      qsub       qsub 
-qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
- queuename    openmpi 
- 
diff --git a/mdcatch/Schedules/preprocess-cryolo/importmovies/run.job b/mdcatch/Schedules/preprocess-cryolo/importmovies/run.job
deleted file mode 100644
index 155b2a5..0000000
--- a/mdcatch/Schedules/preprocess-cryolo/importmovies/run.job
+++ /dev/null
@@ -1,23 +0,0 @@
-job_type == 0
-is_continue == false
-Spherical aberration (mm): == $$Cs
-Amplitude contrast: == 0.1
-Pixel size (Angstrom): == $$angpix
-Beamtilt in X (mrad): == 0
-Beamtilt in Y (mrad): == 0
-Import other node types? == No
-Submit to queue? == No
-Import raw movies/micrographs? == Yes
-Input file: == ref.mrc
-Raw input files: == $$movies_wildcard
-MTF of the detector: == $$mtf_file
-Are these multi-frame movies? == Yes
-Voltage (kV): == $$voltage
-Minimum dedicated cores per node: == 24
-Node type: == Particle coordinates (*.box, *_pick.star)
-Optics group name: == $$optics_group
-Rename optics group for particles: == 
-Additional arguments: == --do_at_most $$do_at_most
-Queue submit command: == qsub
-Standard submission script: == /public/EM/RELION/relion/bin/relion_qsub.csh
-Queue name:  == openmpi
diff --git a/mdcatch/Schedules/preprocess-cryolo/motioncorr/job.star b/mdcatch/Schedules/preprocess-cryolo/motioncorr/job.star
deleted file mode 100644
index 5456da2..0000000
--- a/mdcatch/Schedules/preprocess-cryolo/motioncorr/job.star
+++ /dev/null
@@ -1,47 +0,0 @@
-
-# version 30001
-
-data_job
-
-_rlnJobType                             1
-_rlnJobIsContinue                       0
- 
-
-# version 30001
-
-data_joboptions_values
-
-loop_ 
-_rlnJobOptionVariable #1 
-_rlnJobOptionValue #2 
-   bfactor        150 
-bin_factor $$motioncorr_bin 
-do_dose_weighting        Yes 
-do_own_motioncor        Yes 
-do_save_ps        Yes 
-do_save_noDW         No 
-  do_queue         No 
-dose_per_frame $$dose_rate 
-first_frame_sum          1 
- fn_defect         $$defect_file 
-fn_gain_ref  $$gainref 
-fn_motioncor2_exe /public/EM/MOTIONCOR2/MotionCor2 
- gain_flip "No flipping (0)" 
-  gain_rot "No rotation (0)" 
-   gpu_ids        0:1 
-group_for_ps          4 
-group_frames          $$group_frames
-input_star_mics Schedules/preprocess-cryolo/importmovies/movies.star
-last_frame_sum         -1 
-min_dedicated         24 
-    nr_mpi         5 
-nr_threads         10
-other_args "--do_at_most $$do_at_most" 
-other_motioncor2_args         "" 
-   patch_x          5 
-   patch_y          5 
-pre_exposure          0 
-      qsub       qsub 
-qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
- queuename    openmpi 
- 
diff --git a/mdcatch/Schedules/preprocess-cryolo/motioncorr/run.job b/mdcatch/Schedules/preprocess-cryolo/motioncorr/run.job
deleted file mode 100644
index dfb9086..0000000
--- a/mdcatch/Schedules/preprocess-cryolo/motioncorr/run.job
+++ /dev/null
@@ -1,32 +0,0 @@
-job_type == 1
-is_continue == false
-Bfactor: == 150
-Binning factor: == $$motioncorr_bin
-Do dose-weighting? == Yes
-Use RELION's own implementation? == Yes
-Submit to queue? == No
-Dose per frame (e/A2): == $$dose_rate
-First frame for corrected sum: == 1
-Defect file: == 
-Gain-reference image: == $$gainref
-MOTIONCOR2 executable: == /public/EM/MOTIONCOR2/MotionCor2
-Gain flip: == No flipping (0)
-Gain rotation: == No rotation (0)
-Which GPUs to use: == 0:1
-Sum power spectra every e/A2: == 4
-Group frames: == $$group_frames
-Input movies STAR file: == Schedules/preprocess-cryolo/importmovies/movies.star
-Last frame for corrected sum: == -1
-Minimum dedicated cores per node: == 24
-Number of MPI procs: == 5
-Number of threads: == 10
-Additional arguments: == --do_at_most $$do_at_most
-Other MOTIONCOR2 arguments == 
-Number of patches X: == 5
-Number of patches Y: == 5
-Pre-exposure (e/A2): == 0
-Queue submit command: == qsub
-Standard submission script: == /public/EM/RELION/relion/bin/relion_qsub.csh
-Queue name:  == openmpi
-Save non-dose weighted as well? == No
-Save sum of power spectra? == Yes
diff --git a/mdcatch/Schedules/preprocess-cryolo/schedule.star b/mdcatch/Schedules/preprocess-cryolo/schedule.star
deleted file mode 100644
index 1bfcb6e..0000000
--- a/mdcatch/Schedules/preprocess-cryolo/schedule.star
+++ /dev/null
@@ -1,159 +0,0 @@
-
-# version 30001
-
-data_schedule_general
-
-_rlnScheduleName                       Schedules/preprocess-cryolo/
-_rlnScheduleCurrentNodeName            importmovies
- 
-
-# version 30001
-
-data_schedule_floats
-
-loop_ 
-_rlnScheduleFloatVariableName #1 
-_rlnScheduleFloatVariableValue #2 
-_rlnScheduleFloatVariableResetValue #3 
-        Cs     2.700000     2.700000
-    angpix     1.000000     1.000000
-  size_min  0.000000   0.000000
-  size_max  0.000000   0.000000
-  box_size   0.000000   0.000000
-box_size_bin    64.000000    64.000000 
-cryolo_thresh     0.300000     0.300000
-do_at_most     5.000000    5.000000
-count_mics    0.000000     0.000000
-count_mics_curr    0.000000     0.000000
-count_parts    0.000000    0.000000
- dose_rate     1.000000     1.000000
- mask_diam   200.000000   200.000000 
- mask_diam_px  200.000000   200.000000 
-motioncorr_bin     1.000000     1.000000
-group_frames       1.000000     1.000000
-   voltage   300.000000   200.000000
-       one     1.000000     1.000000
- wait_count   0.000000     0.000000
- max_wait_count  240.000000  240.000000
-      tmp     0.000000     0.000000
-     zero     0.000000     0.000000
-
-
-# version 30001
-
-data_schedule_bools
-
-loop_ 
-_rlnScheduleBooleanVariableName #1 
-_rlnScheduleBooleanVariableValue #2 
-_rlnScheduleBooleanVariableResetValue #3 
-has_copied_cryolostar   0            0
-    is_VPP            0            0
-    end               0            0
-    no_new_input      0            0
-    size_provided     0            0
- 
-
-# version 30001
-
-data_schedule_strings
-
-loop_ 
-_rlnScheduleStringVariableName #1 
-_rlnScheduleStringVariableValue #2 
-_rlnScheduleStringVariableResetValue #3 
- cryolobox Schedules/preprocess-cryolo/cryolopicker/output_for_relion.star,picker,rlnOriginalImageSize Schedules/preprocess-cryolo/cryolopicker/output_for_relion.star,picker,rlnOriginalImageSize
-cryoloboxbinned Schedules/preprocess-cryolo/cryolopicker/output_for_relion.star,picker,rlnImageSize Schedules/preprocess-cryolo/cryolopicker/output_for_relion.star,picker,rlnImageSize
-cryolodiam Schedules/preprocess-cryolo/cryolopicker/output_for_relion.star,picker,rlnParticleDiameter Schedules/preprocess-cryolo/cryolopicker/output_for_relion.star,picker,rlnParticleDiameter
-cryolostar Schedules/preprocess-cryolo/cryolopicker/output_for_relion.star Schedules/preprocess-cryolo/cryolopicker/output_for_relion.star
-cryolostar_copy Work/picker_params.star Work/picker_params.star
-defect_file         ""         "" 
-extracted_batch Work/particles_batch.star Work/particles_batch.star
-extracted_star Schedules/preprocess-cryolo/extract/particles.star Schedules/preprocess-cryolo/extract/particles.star
-   gainref Movies/gain.mrc Movies/gain.mrc 
-mics_to_pick_dst Work/micrographs_ctf.star Work/micrographs_ctf.star 
-mics_to_pick_src Schedules/preprocess-cryolo/ctffind/micrographs_ctf.star Schedules/preprocess-cryolo/ctffind/micrographs_ctf.star
-movies_wildcard Movies/*.tiff Movies/*.tiff 
-  mtf_file mtf_K3_300kv_nocds.star mtf_K3_300kv_nocds.star
-optics_group  opticsGroup1  opticsGroup1
-micrographs micrographs micrographs
-
-
-# version 30001
-
-data_schedule_operators
-
-loop_ 
-_rlnScheduleOperatorName #1 
-_rlnScheduleOperatorType #2 
-_rlnScheduleOperatorOutput #3 
-_rlnScheduleOperatorInput1 #4 
-_rlnScheduleOperatorInput2 #5
-has_copied_cryolostar=EXISTS_cryolostar_copy bool=file_exists has_copied_cryolostar cryolostar_copy  undefined
-COPY_cryolostar_TO_cryolostar_copy  copy_file  undefined cryolostar cryolostar_copy 
-COPY_extracted_star_TO_extracted_batch  copy_file  undefined extracted_star extracted_batch
-COPY_mics_to_pick_src_TO_mics_to_pick_dst  copy_file  undefined mics_to_pick_src mics_to_pick_dst
-size_provided=box_size_GT_zero bool=gt size_provided box_size zero
-box_size=STAR_cryolobox_zero float=read_star   box_size  cryolobox       zero
-box_size_bin=STAR_cryoloboxbinned_zero float=read_star box_size_bin cryoloboxbinned       zero
-mask_diam=STAR_cryolodiam_zero float=read_star  mask_diam cryolodiam       zero
-tmp=DIVIDE_mask_diam_angpix float=divide  tmp mask_diam  angpix 
-mask_diam_px=DIVIDE_tmp_motioncorr_bin float=divide mask_diam_px tmp motioncorr_bin
-count_parts=COUNT_IMGS_extracted_star_undefined float=count_images count_parts extracted_star undefined
-count_mics=SET_count_mics_curr float=set count_mics count_mics_curr undefined
-count_mics_curr=COUNT_IMGS_mics_to_pick_src_micrographs float=count_images count_mics_curr mics_to_pick_src micrographs
-EXIT exit  undefined  undefined  undefined
-end=wait_count_GT_max_wait_count    bool=gt        end wait_count max_wait_count
-no_new_input=count_mics_curr_EQ_count_mics    bool=eq no_new_input count_mics_curr count_mics
-wait_count=wait_count_PLUS_one float=plus wait_count wait_count        one
-wait_count=SET_zero float=set wait_count zero undefined
-
-
-# version 30001
-
-data_schedule_jobs
-
-loop_ 
-_rlnScheduleJobNameOriginal #1 
-_rlnScheduleJobName #2 
-_rlnScheduleJobMode #3 
-_rlnScheduleJobHasStarted #4
-importmovies importmovies   continue            0 
-motioncorr motioncorr   continue            0
-   ctffind    ctffind   continue            0
- cryolopicker cryolopicker   continue            0
-   extract    extract   continue            0
-
-
-# version 30001
-
-data_schedule_edges
-
-loop_ 
-_rlnScheduleEdgeInputNodeName #1 
-_rlnScheduleEdgeOutputNodeName #2 
-_rlnScheduleEdgeIsFork #3 
-_rlnScheduleEdgeOutputNodeNameIfTrue #4 
-_rlnScheduleEdgeBooleanVariable #5 
-importmovies motioncorr            0  undefined  undefined
-motioncorr    ctffind            0  undefined  undefined 
-ctffind count_mics_curr=COUNT_IMGS_mics_to_pick_src_micrographs 0 undefined undefined
-count_mics_curr=COUNT_IMGS_mics_to_pick_src_micrographs no_new_input=count_mics_curr_EQ_count_mics 0 undefined undefined
-no_new_input=count_mics_curr_EQ_count_mics count_mics=SET_count_mics_curr            1 wait_count=wait_count_PLUS_one no_new_input
-count_mics=SET_count_mics_curr wait_count=SET_zero 0 undefined undefined
-wait_count=SET_zero COPY_mics_to_pick_src_TO_mics_to_pick_dst            0  undefined  undefined
-COPY_mics_to_pick_src_TO_mics_to_pick_dst cryolopicker 0 undefined undefined
-cryolopicker size_provided=box_size_GT_zero 0 undefined undefined
-size_provided=box_size_GT_zero has_copied_cryolostar=EXISTS_cryolostar_copy 1 extract size_provided
-has_copied_cryolostar=EXISTS_cryolostar_copy COPY_cryolostar_TO_cryolostar_copy  1  extract  has_copied_cryolostar
-COPY_cryolostar_TO_cryolostar_copy mask_diam=STAR_cryolodiam_zero 0 undefined undefined
-mask_diam=STAR_cryolodiam_zero tmp=DIVIDE_mask_diam_angpix 0  undefined  undefined
-tmp=DIVIDE_mask_diam_angpix mask_diam_px=DIVIDE_tmp_motioncorr_bin   0  undefined  undefined
-mask_diam_px=DIVIDE_tmp_motioncorr_bin box_size=STAR_cryolobox_zero   0  undefined  undefined
-box_size=STAR_cryolobox_zero box_size_bin=STAR_cryoloboxbinned_zero   0  undefined  undefined
-box_size_bin=STAR_cryoloboxbinned_zero extract 0  undefined  undefined
-extract count_parts=COUNT_IMGS_extracted_star_undefined   0  undefined  undefined
-count_parts=COUNT_IMGS_extracted_star_undefined COPY_extracted_star_TO_extracted_batch 0  undefined  undefined
-COPY_extracted_star_TO_extracted_batch importmovies 0  undefined  undefined
-wait_count=wait_count_PLUS_one end=wait_count_GT_max_wait_count            0  undefined  undefined
-end=wait_count_GT_max_wait_count importmovies            1       EXIT        end
diff --git a/mdcatch/Schedules/preprocess-cryolo/schedule_pipeline.star b/mdcatch/Schedules/preprocess-cryolo/schedule_pipeline.star
deleted file mode 100644
index 1d1cf58..0000000
--- a/mdcatch/Schedules/preprocess-cryolo/schedule_pipeline.star
+++ /dev/null
@@ -1,68 +0,0 @@
-
-# version 30001
-
-data_pipeline_general
-
-_rlnPipeLineJobCounter                       1
- 
-
-# version 30001
-
-data_pipeline_processes
-
-loop_ 
-_rlnPipeLineProcessName #1 
-_rlnPipeLineProcessAlias #2 
-_rlnPipeLineProcessType #3 
-_rlnPipeLineProcessStatus #4 
-Schedules/preprocess-cryolo/importmovies/       None            0            1
-Schedules/preprocess-cryolo/motioncorr/       None            1            1
-Schedules/preprocess-cryolo/ctffind/       None            2            1
-Schedules/preprocess-cryolo/cryolopicker/       Schedules/preprocess-cryolo/Autopick_cryolo           99            1
-Schedules/preprocess-cryolo/extract/       None            5            1
- 
-
-# version 30001
-
-data_pipeline_nodes
-
-loop_ 
-_rlnPipeLineNodeName #1 
-_rlnPipeLineNodeType #2 
-Schedules/preprocess-cryolo/importmovies/movies.star            0
-Schedules/preprocess-cryolo/motioncorr/corrected_micrographs.star            1
-Schedules/preprocess-cryolo/motioncorr/logfile.pdf           13
-Schedules/preprocess-cryolo/ctffind/micrographs_ctf.star            1
-Schedules/preprocess-cryolo/ctffind/logfile.pdf           13
-Schedules/preprocess-cryolo/cryolopicker/coords_suffix_cryolo.star            2
-Schedules/preprocess-cryolo/extract/particles.star            3
- 
-
-# version 30001
-
-data_pipeline_input_edges
-
-loop_ 
-_rlnPipeLineEdgeFromNode #1 
-_rlnPipeLineEdgeProcess #2 
-Schedules/preprocess-cryolo/importmovies/movies.star Schedules/preprocess-cryolo/motioncorr/
-Schedules/preprocess-cryolo/motioncorr/corrected_micrographs.star Schedules/preprocess-cryolo/ctffind/
-Schedules/preprocess-cryolo/ctffind/micrographs_ctf.star Schedules/preprocess-cryolo/cryolopicker/
-Schedules/preprocess-cryolo/ctffind/micrographs_ctf.star Schedules/preprocess-cryolo/extract/
-Schedules/preprocess-cryolo/cryolopicker/coords_suffix_cryolo.star Schedules/preprocess-cryolo/extract/
- 
-
-# version 30001
-
-data_pipeline_output_edges
-
-loop_ 
-_rlnPipeLineEdgeProcess #1 
-_rlnPipeLineEdgeToNode #2 
-Schedules/preprocess-cryolo/importmovies/ Schedules/preprocess-cryolo/importmovies/movies.star
-Schedules/preprocess-cryolo/motioncorr/ Schedules/preprocess-cryolo/motioncorr/corrected_micrographs.star
-Schedules/preprocess-cryolo/ctffind/ Schedules/preprocess-cryolo/ctffind/micrographs_ctf.star
-Schedules/preprocess-cryolo/ctffind/ Schedules/preprocess-cryolo/ctffind/logfile.pdf
-Schedules/preprocess-cryolo/cryolopicker/ Schedules/preprocess-cryolo/cryolopicker/coords_suffix_cryolo.star
-Schedules/preprocess-cryolo/extract/ Schedules/preprocess-cryolo/extract/particles.star
- 
diff --git a/mdcatch/Schedules/preprocess-logpicker/ctffind/run.job b/mdcatch/Schedules/preprocess-logpicker/ctffind/run.job
deleted file mode 100644
index 09c2d6e..0000000
--- a/mdcatch/Schedules/preprocess-logpicker/ctffind/run.job
+++ /dev/null
@@ -1,33 +0,0 @@
-job_type == 2
-is_continue == false
-FFT box size (pix): == 512
-Estimate CTF on window size (pix)  == -1
-Amount of astigmatism (A): == 100
-Maximum defocus value (A): == 50000
-Minimum defocus value (A): == 5000
-Defocus step size (A): == 500
-Perform equi-phase averaging? == No
-Ignore 'Searches' parameters? == Yes
-Estimate phase shifts? == $$is_VPP
-Submit to queue? == No
-CTFFIND-4.1 executable: == $RELION_CTFFIND_EXECUTABLE
-Gctf executable: == $RELION_GCTF_EXECUTABLE
-Which GPUs to use: == 
-Input micrographs STAR file: == Schedules/preprocess-logpicker/motioncorr/corrected_micrographs.star
-Minimum dedicated cores per node: == 24
-Number of MPI procs: == 5
-Additional arguments: == 
-Other Gctf options: == 
-Phase shift (deg) - Max: == 180
-Phase shift (deg) - Min: == 0
-Phase shift (deg) - Step: == 10
-Queue submit command: == qsub
-Standard submission script: == /public/EM/RELION/relion/bin/relion_qsub.csh
-Queue name:  == openmpi
-Maximum resolution (A): == 5
-Minimum resolution (A): == 30
-Use exhaustive search? == No
-Use CTFFIND-4.1? == Yes
-Use Gctf instead? == No
-Use power spectra from MotionCorr job? == Yes
-Use micrograph without dose-weighting? == No
diff --git a/mdcatch/Schedules/preprocess-logpicker/extract/run.job b/mdcatch/Schedules/preprocess-logpicker/extract/run.job
deleted file mode 100644
index 213bb8c..0000000
--- a/mdcatch/Schedules/preprocess-logpicker/extract/run.job
+++ /dev/null
@@ -1,35 +0,0 @@
-job_type == 5
-is_continue == false
-Pixel size (A) == 1
-Diameter background circle (pix):  == $$mask_diam_px
-Stddev for black dust removal:  == -1
-Input coordinates:  == Schedules/preprocess-logpicker/logpicker/coords_suffix_autopick.star
-Cut helical tubes into segments? == Yes
-Coordinates are start-end only? == Yes
-Extract helical segments? == No
-Invert contrast? == Yes
-Normalize particles? == Yes
-Submit to queue? == No
-OR: re-center refined coordinates?  == No
-OR re-extract refined particles?  == No
-Rescale particles? == Yes
-Reset the refined offsets to zero?  == No
-Manually set pixel size?  == No
-Particle box size (pix): == $$box_size
-Refined particles STAR file:  == 
-Use bimodal angular priors? == Yes
-Number of unique asymmetrical units: == 1
-Helical rise (A): == 1
-Tube diameter (A):  == 200
-Minimum dedicated cores per node: == 24
-Number of MPI procs: == 1
-Additional arguments: == 
-Queue submit command: == qsub
-Standard submission script: == /public/EM/RELION/relion/bin/relion_qsub.csh
-Queue name:  == openmpi
-Re-center on X-coordinate (in pix):  == 0
-Re-center on Y-coordinate (in pix):  == 0
-Re-center on Z-coordinate (in pix):  == 0
-Re-scaled size (pixels):  == $$box_size_bin
-micrograph STAR file:  == Schedules/preprocess-logpicker/ctffind/micrographs_ctf.star
-Stddev for white dust removal:  == -1
diff --git a/mdcatch/Schedules/preprocess-logpicker/importmovies/job.star b/mdcatch/Schedules/preprocess-logpicker/importmovies/job.star
deleted file mode 100644
index 2a32d41..0000000
--- a/mdcatch/Schedules/preprocess-logpicker/importmovies/job.star
+++ /dev/null
@@ -1,38 +0,0 @@
-
-# version 30001
-
-data_job
-
-_rlnJobType                             0
-_rlnJobIsContinue                       0
- 
-
-# version 30001
-
-data_joboptions_values
-
-loop_ 
-_rlnJobOptionVariable #1 
-_rlnJobOptionValue #2 
-        Cs       $$Cs 
-        Q0        0.1 
-    angpix   $$angpix 
-beamtilt_x          0 
-beamtilt_y          0 
-  do_other         No 
-  do_queue         No 
-    do_raw        Yes 
-fn_in_other    ref.mrc 
- fn_in_raw $$movies_wildcard 
-    fn_mtf $$mtf_file 
-is_multiframe        Yes 
-        kV  $$voltage 
-min_dedicated         24 
- node_type "Particle coordinates (*.box, *_pick.star)" 
-optics_group_name $$optics_group 
-optics_group_particles         "" 
-other_args "--do_at_most $$do_at_most" 
-      qsub       qsub 
-qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
- queuename    openmpi 
- 
diff --git a/mdcatch/Schedules/preprocess-logpicker/importmovies/run.job b/mdcatch/Schedules/preprocess-logpicker/importmovies/run.job
deleted file mode 100644
index 155b2a5..0000000
--- a/mdcatch/Schedules/preprocess-logpicker/importmovies/run.job
+++ /dev/null
@@ -1,23 +0,0 @@
-job_type == 0
-is_continue == false
-Spherical aberration (mm): == $$Cs
-Amplitude contrast: == 0.1
-Pixel size (Angstrom): == $$angpix
-Beamtilt in X (mrad): == 0
-Beamtilt in Y (mrad): == 0
-Import other node types? == No
-Submit to queue? == No
-Import raw movies/micrographs? == Yes
-Input file: == ref.mrc
-Raw input files: == $$movies_wildcard
-MTF of the detector: == $$mtf_file
-Are these multi-frame movies? == Yes
-Voltage (kV): == $$voltage
-Minimum dedicated cores per node: == 24
-Node type: == Particle coordinates (*.box, *_pick.star)
-Optics group name: == $$optics_group
-Rename optics group for particles: == 
-Additional arguments: == --do_at_most $$do_at_most
-Queue submit command: == qsub
-Standard submission script: == /public/EM/RELION/relion/bin/relion_qsub.csh
-Queue name:  == openmpi
diff --git a/mdcatch/Schedules/preprocess-logpicker/logpicker/job.star b/mdcatch/Schedules/preprocess-logpicker/logpicker/job.star
deleted file mode 100644
index ffcd447..0000000
--- a/mdcatch/Schedules/preprocess-logpicker/logpicker/job.star
+++ /dev/null
@@ -1,62 +0,0 @@
-
-# version 30001
-
-data_job
-
-_rlnJobType                             4
-_rlnJobIsContinue                       0
-
-
-# version 30001
-
-data_joboptions_values
-
-loop_
-_rlnJobOptionVariable #1
-_rlnJobOptionValue #2
-    angpix         -1
-angpix_ref         -1
-do_amyloid         No
-do_ctf_autopick        Yes
-do_ignore_first_ctfpeak_autopick         No
-do_invert_refs        Yes
-    do_log        Yes
-do_pick_helical_segments         No
-  do_queue         No
-do_read_fom_maps         No
-  do_ref3d         No
-do_write_fom_maps         No
-fn_input_autopick Schedules/preprocess-logpicker/ctffind/micrographs_ctf.star
-fn_ref3d_autopick         ""
-fn_refs_autopick         ""
-   gpu_ids         ""
-helical_nr_asu          1
-helical_rise         -1
-helical_tube_kappa_max        0.1
-helical_tube_length_min         -1
-helical_tube_outer_diameter        200
-  highpass         -1
-log_adjust_thr $$log_thresh
-log_diam_max $$size_max
-log_diam_min $$size_min
-log_invert         No
-log_maxres         20
-log_upper_thr        999
-   lowpass         20
-maxstddevnoise_autopick        1.1
-min_dedicated         24
-minavgnoise_autopick       -999
-mindist_autopick        100
-    nr_mpi          1
-other_args         ""
-particle_diameter         -1
-psi_sampling_autopick          5
-      qsub       qsub
-qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh
- queuename    openmpi
-ref3d_sampling "30 degrees"
-ref3d_symmetry         C1
-    shrink          0
-threshold_autopick       0.05
-   use_gpu         No
- 
diff --git a/mdcatch/Schedules/preprocess-logpicker/logpicker/run.job b/mdcatch/Schedules/preprocess-logpicker/logpicker/run.job
deleted file mode 100644
index b27e02a..0000000
--- a/mdcatch/Schedules/preprocess-logpicker/logpicker/run.job
+++ /dev/null
@@ -1,47 +0,0 @@
-job_type == 4
-is_continue == false
-Pixel size in micrographs (A) == -1
-Pixel size in references (A) == -1
-Pick amyloid segments? == No
-Are References CTF corrected? == Yes
-Ignore CTFs until first peak? == No
-References have inverted contrast? == Yes
-OR: use Laplacian-of-Gaussian? == Yes
-Pick 2D helical segments? == No
-Submit to queue? == No
-Read FOM maps? == No
-OR: provide a 3D reference? == No
-Write FOM maps? == No
-Input micrographs for autopick: == Schedules/preprocess-logpicker/ctffind/micrographs_ctf.star
-3D reference: == 
-2D references: == 
-Which GPUs to use: == 
-Number of unique asymmetrical units: == 1
-Helical rise (A): == -1
-Maximum curvature (kappa):  == 0.1
-Minimum length (A):  == -1
-Tube diameter (A):  == 200
-Highpass filter (A) == -1
-Adjust default threshold (stddev): == $$log_thresh
-Max. diameter for LoG filter (A) == $$size_max
-Min. diameter for LoG filter (A) == $$size_min
-Are the particles white? == No
-Maximum resolution to consider (A) == 20
-Upper threshold (stddev): == 999
-Lowpass filter references (A) == 20
-Maximum stddev noise: == 1.1
-Minimum dedicated cores per node: == 24
-Minimum avg noise: == -999
-Minimum inter-particle distance (A): == 100
-Number of MPI procs: == 1
-Additional arguments: == 
-Mask diameter (A) == -1
-In-plane angular sampling (deg) == 5
-Queue submit command: == qsub
-Standard submission script: == /public/EM/RELION/relion/bin/relion_qsub.csh
-Queue name:  == openmpi
-3D angular sampling: == 30 degrees
-Symmetry: == C1
-Shrink factor: == 0
-Picking threshold: == 0.05
-Use GPU acceleration? == No
diff --git a/mdcatch/Schedules/preprocess-logpicker/motioncorr/job.star b/mdcatch/Schedules/preprocess-logpicker/motioncorr/job.star
deleted file mode 100644
index 8ca682d..0000000
--- a/mdcatch/Schedules/preprocess-logpicker/motioncorr/job.star
+++ /dev/null
@@ -1,47 +0,0 @@
-
-# version 30001
-
-data_job
-
-_rlnJobType                             1
-_rlnJobIsContinue                       0
- 
-
-# version 30001
-
-data_joboptions_values
-
-loop_ 
-_rlnJobOptionVariable #1 
-_rlnJobOptionValue #2 
-   bfactor        150 
-bin_factor $$motioncorr_bin 
-do_dose_weighting        Yes 
-do_own_motioncor        Yes 
-do_save_ps        Yes 
-do_save_noDW         No 
-  do_queue         No 
-dose_per_frame $$dose_rate 
-first_frame_sum          1 
- fn_defect         $$defect_file 
-fn_gain_ref  $$gainref 
-fn_motioncor2_exe /public/EM/MOTIONCOR2/MotionCor2 
- gain_flip "No flipping (0)" 
-  gain_rot "No rotation (0)" 
-   gpu_ids        0:1 
-group_for_ps          4 
-group_frames          $$group_frames
-input_star_mics Schedules/preprocess-logpicker/importmovies/movies.star
-last_frame_sum         -1 
-min_dedicated         24 
-    nr_mpi         5 
-nr_threads         12 
-other_args "--do_at_most $$do_at_most" 
-other_motioncor2_args         "" 
-   patch_x          5 
-   patch_y          5 
-pre_exposure          0 
-      qsub       qsub 
-qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
- queuename    openmpi 
- 
diff --git a/mdcatch/Schedules/preprocess-logpicker/motioncorr/run.job b/mdcatch/Schedules/preprocess-logpicker/motioncorr/run.job
deleted file mode 100644
index 23cd305..0000000
--- a/mdcatch/Schedules/preprocess-logpicker/motioncorr/run.job
+++ /dev/null
@@ -1,32 +0,0 @@
-job_type == 1
-is_continue == false
-Bfactor: == 150
-Binning factor: == $$motioncorr_bin
-Do dose-weighting? == Yes
-Use RELION's own implementation? == Yes
-Submit to queue? == No
-Dose per frame (e/A2): == $$dose_rate
-First frame for corrected sum: == 1
-Defect file: == 
-Gain-reference image: == $$gainref
-MOTIONCOR2 executable: == /public/EM/MOTIONCOR2/MotionCor2
-Gain flip: == No flipping (0)
-Gain rotation: == No rotation (0)
-Which GPUs to use: == 0:1
-Sum power spectra every e/A2: == 4
-Group frames: == $$group_frames
-Input movies STAR file: == Schedules/preprocess-logpicker/importmovies/movies.star
-Last frame for corrected sum: == -1
-Minimum dedicated cores per node: == 24
-Number of MPI procs: == 5
-Number of threads: == 12
-Additional arguments: == --do_at_most $$do_at_most
-Other MOTIONCOR2 arguments == 
-Number of patches X: == 5
-Number of patches Y: == 5
-Pre-exposure (e/A2): == 0
-Queue submit command: == qsub
-Standard submission script: == /public/EM/RELION/relion/bin/relion_qsub.csh
-Queue name:  == openmpi
-Save non-dose weighted as well? == No
-Save sum of power spectra? == Yes
diff --git a/mdcatch/Schedules/preprocess-logpicker/schedule.star b/mdcatch/Schedules/preprocess-logpicker/schedule.star
deleted file mode 100644
index ff322aa..0000000
--- a/mdcatch/Schedules/preprocess-logpicker/schedule.star
+++ /dev/null
@@ -1,136 +0,0 @@
-
-# version 30001
-
-data_schedule_general
-
-_rlnScheduleName                       Schedules/preprocess-logpicker/
-_rlnScheduleCurrentNodeName            importmovies
- 
-
-# version 30001
-
-data_schedule_floats
-
-loop_ 
-_rlnScheduleFloatVariableName #1 
-_rlnScheduleFloatVariableValue #2 
-_rlnScheduleFloatVariableResetValue #3 
-        Cs     2.700000     2.700000
-    angpix     1.000000     1.000000
-  size_min  0.000000   0.000000
-  size_max  0.000000   0.000000
-  box_size   0.000000   0.000000
-box_size_bin    64.000000    64.000000 
-log_thresh     0.000000     0.000000
-do_at_most     5.000000    5.000000
-count_mics    0.000000     0.000000
-count_mics_curr    0.000000     0.000000
-count_parts    0.000000    0.000000
- dose_rate     1.000000     1.000000
- mask_diam   200.000000   200.000000 
- mask_diam_px  200.000000   200.000000 
-motioncorr_bin     1.000000     1.000000
-group_frames       1.000000     1.000000
-   voltage   300.000000   200.000000
-      one     1.000000     1.000000
- wait_count   0.000000     0.000000
- max_wait_count  240.000000  240.000000
-      tmp     0.000000     0.000000
-     zero     0.000000     0.000000
-
-
-# version 30001
-
-data_schedule_bools
-
-loop_ 
-_rlnScheduleBooleanVariableName #1 
-_rlnScheduleBooleanVariableValue #2 
-_rlnScheduleBooleanVariableResetValue #3 
-    is_VPP            0            0
-    end               0            0
-    no_new_input      0            0
-
-
-# version 30001
-
-data_schedule_strings
-
-loop_ 
-_rlnScheduleStringVariableName #1 
-_rlnScheduleStringVariableValue #2 
-_rlnScheduleStringVariableResetValue #3 
-defect_file         ""         ""
-extracted_batch Work/particles_batch.star Work/particles_batch.star
-extracted_star Schedules/preprocess-logpicker/extract/particles.star Schedules/preprocess-logpicker/extract/particles.star
-   gainref Movies/gain.mrc Movies/gain.mrc 
-mics_to_pick_dst Work/micrographs_ctf.star Work/micrographs_ctf.star 
-mics_to_pick_src Schedules/preprocess-logpicker/ctffind/micrographs_ctf.star Schedules/preprocess-logpicker/ctffind/micrographs_ctf.star
-movies_wildcard Movies/*.tiff Movies/*.tiff 
-  mtf_file mtf_K3_300kv_nocds.star mtf_K3_300kv_nocds.star
-optics_group  opticsGroup1  opticsGroup1
-micrographs micrographs micrographs
-
-
-# version 30001
-
-data_schedule_operators
-
-loop_ 
-_rlnScheduleOperatorName #1 
-_rlnScheduleOperatorType #2 
-_rlnScheduleOperatorOutput #3 
-_rlnScheduleOperatorInput1 #4 
-_rlnScheduleOperatorInput2 #5
-COPY_extracted_star_TO_extracted_batch  copy_file  undefined extracted_star extracted_batch
-COPY_mics_to_pick_src_TO_mics_to_pick_dst  copy_file  undefined mics_to_pick_src mics_to_pick_dst
-count_mics=SET_count_mics_curr float=set count_mics count_mics_curr undefined
-count_mics_curr=COUNT_IMGS_mics_to_pick_src_micrographs float=count_images count_mics_curr mics_to_pick_src micrographs
-EXIT exit  undefined  undefined  undefined
-end=wait_count_GT_max_wait_count    bool=gt        end wait_count max_wait_count
-no_new_input=count_mics_curr_EQ_count_mics    bool=eq no_new_input count_mics_curr count_mics
-wait_count=wait_count_PLUS_one float=plus wait_count wait_count        one
-wait_count=SET_zero float=set wait_count zero undefined
-count_parts=COUNT_IMGS_extracted_star_undefined float=count_images count_parts extracted_star undefined
-
-
-# version 30001
-
-data_schedule_jobs
-
-loop_ 
-_rlnScheduleJobNameOriginal #1 
-_rlnScheduleJobName #2 
-_rlnScheduleJobMode #3 
-_rlnScheduleJobHasStarted #4
-importmovies importmovies   continue            0 
-motioncorr motioncorr   continue            0
-   ctffind    ctffind   continue            0
- logpicker logpicker   continue            0
-   extract    extract   continue            0
-
-
-# version 30001
-
-data_schedule_edges
-
-loop_ 
-_rlnScheduleEdgeInputNodeName #1 
-_rlnScheduleEdgeOutputNodeName #2 
-_rlnScheduleEdgeIsFork #3 
-_rlnScheduleEdgeOutputNodeNameIfTrue #4 
-_rlnScheduleEdgeBooleanVariable #5 
-importmovies motioncorr            0  undefined  undefined
-motioncorr    ctffind            0  undefined  undefined 
-ctffind count_mics_curr=COUNT_IMGS_mics_to_pick_src_micrographs 0 undefined undefined
-count_mics_curr=COUNT_IMGS_mics_to_pick_src_micrographs no_new_input=count_mics_curr_EQ_count_mics 0 undefined undefined
-no_new_input=count_mics_curr_EQ_count_mics count_mics=SET_count_mics_curr            1 wait_count=wait_count_PLUS_one no_new_input
-count_mics=SET_count_mics_curr wait_count=SET_zero 0 undefined undefined
-wait_count=SET_zero COPY_mics_to_pick_src_TO_mics_to_pick_dst            0  undefined  undefined
-COPY_mics_to_pick_src_TO_mics_to_pick_dst logpicker 0 undefined undefined
-logpicker extract 0  undefined  undefined
-extract count_parts=COUNT_IMGS_extracted_star_undefined   0  undefined  undefined
-count_parts=COUNT_IMGS_extracted_star_undefined COPY_extracted_star_TO_extracted_batch 0  undefined  undefined
-COPY_extracted_star_TO_extracted_batch importmovies 0  undefined  undefined
-wait_count=wait_count_PLUS_one end=wait_count_GT_max_wait_count            0  undefined  undefined
-end=wait_count_GT_max_wait_count importmovies            1       EXIT        end
diff --git a/mdcatch/Schedules/preprocess-logpicker/schedule_pipeline.star b/mdcatch/Schedules/preprocess-logpicker/schedule_pipeline.star
deleted file mode 100644
index 1765bdc..0000000
--- a/mdcatch/Schedules/preprocess-logpicker/schedule_pipeline.star
+++ /dev/null
@@ -1,69 +0,0 @@
-
-# version 30001
-
-data_pipeline_general
-
-_rlnPipeLineJobCounter                       1
- 
-
-# version 30001
-
-data_pipeline_processes
-
-loop_ 
-_rlnPipeLineProcessName #1 
-_rlnPipeLineProcessAlias #2 
-_rlnPipeLineProcessType #3 
-_rlnPipeLineProcessStatus #4 
-Schedules/preprocess-logpicker/importmovies/       None            0            1
-Schedules/preprocess-logpicker/motioncorr/       None            1            1
-Schedules/preprocess-logpicker/ctffind/       None            2            1
-Schedules/preprocess-logpicker/logpicker/       None           4            1
-Schedules/preprocess-logpicker/extract/       None            5            1
- 
-
-# version 30001
-
-data_pipeline_nodes
-
-loop_ 
-_rlnPipeLineNodeName #1 
-_rlnPipeLineNodeType #2 
-Schedules/preprocess-logpicker/importmovies/movies.star            0
-Schedules/preprocess-logpicker/motioncorr/corrected_micrographs.star            1
-Schedules/preprocess-logpicker/motioncorr/logfile.pdf           13
-Schedules/preprocess-logpicker/ctffind/micrographs_ctf.star            1
-Schedules/preprocess-logpicker/ctffind/logfile.pdf           13
-Schedules/preprocess-logpicker/logpicker/coords_suffix_autopick.star            2
-Schedules/preprocess-logpicker/logpicker/logfile.pdf           13
-Schedules/preprocess-logpicker/extract/particles.star            3
- 
-
-# version 30001
-
-data_pipeline_input_edges
-
-loop_ 
-_rlnPipeLineEdgeFromNode #1 
-_rlnPipeLineEdgeProcess #2 
-Schedules/preprocess-logpicker/importmovies/movies.star Schedules/preprocess-logpicker/motioncorr/
-Schedules/preprocess-logpicker/motioncorr/corrected_micrographs.star Schedules/preprocess-logpicker/ctffind/
-Schedules/preprocess-logpicker/ctffind/micrographs_ctf.star Schedules/preprocess-logpicker/logpicker/
-Schedules/preprocess-logpicker/ctffind/micrographs_ctf.star Schedules/preprocess-logpicker/extract/
-Schedules/preprocess-logpicker/logpicker/coords_suffix_autopick.star Schedules/preprocess-logpicker/extract/
- 
-
-# version 30001
-
-data_pipeline_output_edges
-
-loop_ 
-_rlnPipeLineEdgeProcess #1 
-_rlnPipeLineEdgeToNode #2 
-Schedules/preprocess-logpicker/importmovies/ Schedules/preprocess-logpicker/importmovies/movies.star
-Schedules/preprocess-logpicker/motioncorr/ Schedules/preprocess-logpicker/motioncorr/corrected_micrographs.star
-Schedules/preprocess-logpicker/ctffind/ Schedules/preprocess-logpicker/ctffind/micrographs_ctf.star
-Schedules/preprocess-logpicker/ctffind/ Schedules/preprocess-logpicker/ctffind/logfile.pdf
-Schedules/preprocess-logpicker/logpicker/ Schedules/preprocess-logpicker/logpicker/coords_suffix_autopick.star
-Schedules/preprocess-logpicker/logpicker/ Schedules/preprocess-logpicker/logpicker/logfile.pdf
-Schedules/preprocess-logpicker/extract/ Schedules/preprocess-logpicker/extract/particles.star
diff --git a/mdcatch/Schedules/preprocess-topaz/ctffind/job.star b/mdcatch/Schedules/preprocess-topaz/ctffind/job.star
deleted file mode 100644
index b772859..0000000
--- a/mdcatch/Schedules/preprocess-topaz/ctffind/job.star
+++ /dev/null
@@ -1,48 +0,0 @@
-
-# version 30001
-
-data_job
-
-_rlnJobType                             2
-_rlnJobIsContinue                       0
- 
-
-# version 30001
-
-data_joboptions_values
-
-loop_ 
-_rlnJobOptionVariable #1 
-_rlnJobOptionValue #2 
-       box        512 
-   ctf_win         -1 
-      dast        100 
-     dfmax      50000 
-     dfmin       5000 
-    dfstep        500 
-    do_EPA         No 
-do_ignore_ctffind_params        Yes 
-do_phaseshift   $$is_VPP 
-  do_queue         No 
-fn_ctffind_exe $RELION_CTFFIND_EXECUTABLE
-fn_gctf_exe $RELION_GCTF_EXECUTABLE
-   gpu_ids         "" 
-input_star_mics Schedules/preprocess-topaz/motioncorr/corrected_micrographs.star
-min_dedicated         24 
-    nr_mpi         5
-other_args         "" 
-other_gctf_args         "" 
- phase_max        180 
- phase_min          0 
-phase_step         10 
-      qsub       qsub 
-qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
- queuename    openmpi 
-    resmax          5 
-    resmin         30 
-slow_search         No 
-use_ctffind4        Yes 
-  use_gctf         No 
-use_given_ps        Yes 
-  use_noDW        No 
- 
diff --git a/mdcatch/Schedules/preprocess-topaz/ctffind/run.job b/mdcatch/Schedules/preprocess-topaz/ctffind/run.job
deleted file mode 100644
index 206c2ed..0000000
--- a/mdcatch/Schedules/preprocess-topaz/ctffind/run.job
+++ /dev/null
@@ -1,33 +0,0 @@
-job_type == 2
-is_continue == false
-FFT box size (pix): == 512
-Estimate CTF on window size (pix)  == -1
-Amount of astigmatism (A): == 100
-Maximum defocus value (A): == 50000
-Minimum defocus value (A): == 5000
-Defocus step size (A): == 500
-Perform equi-phase averaging? == No
-Ignore 'Searches' parameters? == Yes
-Estimate phase shifts? == $$is_VPP
-Submit to queue? == No
-CTFFIND-4.1 executable: == $RELION_CTFFIND_EXECUTABLE
-Gctf executable: == $RELION_GCTF_EXECUTABLE
-Which GPUs to use: == 
-Input micrographs STAR file: == Schedules/preprocess-topaz/motioncorr/corrected_micrographs.star
-Minimum dedicated cores per node: == 24
-Number of MPI procs: == 5
-Additional arguments: == 
-Other Gctf options: == 
-Phase shift (deg) - Max: == 180
-Phase shift (deg) - Min: == 0
-Phase shift (deg) - Step: == 10
-Queue submit command: == qsub
-Standard submission script: == /public/EM/RELION/relion/bin/relion_qsub.csh
-Queue name:  == openmpi
-Maximum resolution (A): == 5
-Minimum resolution (A): == 30
-Use exhaustive search? == No
-Use CTFFIND-4.1? == Yes
-Use Gctf instead? == No
-Use power spectra from MotionCorr job? == Yes
-Use micrograph without dose-weighting? == No
diff --git a/mdcatch/Schedules/preprocess-topaz/extract/run.job b/mdcatch/Schedules/preprocess-topaz/extract/run.job
deleted file mode 100644
index 513ca3f..0000000
--- a/mdcatch/Schedules/preprocess-topaz/extract/run.job
+++ /dev/null
@@ -1,35 +0,0 @@
-job_type == 5
-is_continue == false
-Pixel size (A) == 1
-Diameter background circle (pix):  == $$mask_diam_px
-Stddev for black dust removal:  == -1
-Input coordinates:  == Schedules/preprocess-topaz/topazpicker/coords_suffix_topaz.star
-Cut helical tubes into segments? == Yes
-Coordinates are start-end only? == Yes
-Extract helical segments? == No
-Invert contrast? == Yes
-Normalize particles? == Yes
-Submit to queue? == No
-OR: re-center refined coordinates?  == No
-OR re-extract refined particles?  == No
-Rescale particles? == Yes
-Reset the refined offsets to zero?  == No
-Manually set pixel size?  == No
-Particle box size (pix): == $$box_size
-Refined particles STAR file:  == 
-Use bimodal angular priors? == Yes
-Number of unique asymmetrical units: == 1
-Helical rise (A): == 1
-Tube diameter (A):  == 200
-Minimum dedicated cores per node: == 24
-Number of MPI procs: == 1
-Additional arguments: == 
-Queue submit command: == qsub
-Standard submission script: == /public/EM/RELION/relion/bin/relion_qsub.csh
-Queue name:  == openmpi
-Re-center on X-coordinate (in pix):  == 0
-Re-center on Y-coordinate (in pix):  == 0
-Re-center on Z-coordinate (in pix):  == 0
-Re-scaled size (pixels):  == $$box_size_bin
-micrograph STAR file:  == Schedules/preprocess-topaz/ctffind/micrographs_ctf.star
-Stddev for white dust removal:  == -1
diff --git a/mdcatch/Schedules/preprocess-topaz/importmovies/run.job b/mdcatch/Schedules/preprocess-topaz/importmovies/run.job
deleted file mode 100644
index 155b2a5..0000000
--- a/mdcatch/Schedules/preprocess-topaz/importmovies/run.job
+++ /dev/null
@@ -1,23 +0,0 @@
-job_type == 0
-is_continue == false
-Spherical aberration (mm): == $$Cs
-Amplitude contrast: == 0.1
-Pixel size (Angstrom): == $$angpix
-Beamtilt in X (mrad): == 0
-Beamtilt in Y (mrad): == 0
-Import other node types? == No
-Submit to queue? == No
-Import raw movies/micrographs? == Yes
-Input file: == ref.mrc
-Raw input files: == $$movies_wildcard
-MTF of the detector: == $$mtf_file
-Are these multi-frame movies? == Yes
-Voltage (kV): == $$voltage
-Minimum dedicated cores per node: == 24
-Node type: == Particle coordinates (*.box, *_pick.star)
-Optics group name: == $$optics_group
-Rename optics group for particles: == 
-Additional arguments: == --do_at_most $$do_at_most
-Queue submit command: == qsub
-Standard submission script: == /public/EM/RELION/relion/bin/relion_qsub.csh
-Queue name:  == openmpi
diff --git a/mdcatch/Schedules/preprocess-topaz/motioncorr/run.job b/mdcatch/Schedules/preprocess-topaz/motioncorr/run.job
deleted file mode 100644
index 1753bd4..0000000
--- a/mdcatch/Schedules/preprocess-topaz/motioncorr/run.job
+++ /dev/null
@@ -1,32 +0,0 @@
-job_type == 1
-is_continue == false
-Bfactor: == 150
-Binning factor: == $$motioncorr_bin
-Do dose-weighting? == Yes
-Use RELION's own implementation? == Yes
-Submit to queue? == No
-Dose per frame (e/A2): == $$dose_rate
-First frame for corrected sum: == 1
-Defect file: == 
-Gain-reference image: == $$gainref
-MOTIONCOR2 executable: == /public/EM/MOTIONCOR2/MotionCor2
-Gain flip: == No flipping (0)
-Gain rotation: == No rotation (0)
-Which GPUs to use: == 0:1
-Sum power spectra every e/A2: == 4
-Group frames: == $$group_frames
-Input movies STAR file: == Schedules/preprocess-topaz/importmovies/movies.star
-Last frame for corrected sum: == -1
-Minimum dedicated cores per node: == 24
-Number of MPI procs: == 5
-Number of threads: == 12
-Additional arguments: == --do_at_most $$do_at_most
-Other MOTIONCOR2 arguments == 
-Number of patches X: == 5
-Number of patches Y: == 5
-Pre-exposure (e/A2): == 0
-Queue submit command: == qsub
-Standard submission script: == /public/EM/RELION/relion/bin/relion_qsub.csh
-Queue name:  == openmpi
-Save non-dose weighted as well? == No
-Save sum of power spectra? == Yes
diff --git a/mdcatch/Schedules/preprocess-topaz/schedule.star b/mdcatch/Schedules/preprocess-topaz/schedule.star
deleted file mode 100644
index bf996f3..0000000
--- a/mdcatch/Schedules/preprocess-topaz/schedule.star
+++ /dev/null
@@ -1,143 +0,0 @@
-
-# version 30001
-
-data_schedule_general
-
-_rlnScheduleName                       Schedules/preprocess-topaz/
-_rlnScheduleCurrentNodeName            importmovies
- 
-
-# version 30001
-
-data_schedule_floats
-
-loop_ 
-_rlnScheduleFloatVariableName #1 
-_rlnScheduleFloatVariableValue #2 
-_rlnScheduleFloatVariableResetValue #3 
-        Cs     2.700000     2.700000
-    angpix     1.000000     1.000000
-  size_min  0.000000   0.000000
-  size_max  0.000000   0.000000
-  box_size   0.000000   0.000000
-box_size_bin    64.000000    64.000000 
-topaz_thresh     0.000000     0.000000
-do_at_most     5.000000    5.000000
-count_parts    0.000000    0.000000
-count_mics    0.000000     0.000000
-count_mics_curr    0.000000     0.000000
- dose_rate     1.000000     1.000000
- mask_diam   200.000000   200.000000 
- mask_diam_px  200.000000   200.000000 
-motioncorr_bin     1.000000     1.000000
-group_frames       1.000000     1.000000
-   voltage   300.000000   200.000000
-      one     1.000000     1.000000
- wait_count   0.000000     0.000000
- max_wait_count  240.000000  240.000000
-      tmp     0.000000     0.000000
-     zero     0.000000     0.000000
-
-
-# version 30001
-
-data_schedule_bools
-
-loop_ 
-_rlnScheduleBooleanVariableName #1 
-_rlnScheduleBooleanVariableValue #2 
-_rlnScheduleBooleanVariableResetValue #3 
-has_copied_topazstar   0            0
-    is_VPP            0            0
-    end               0            0
-    no_new_input      0            0
-
-
-# version 30001
-
-data_schedule_strings
-
-loop_ 
-_rlnScheduleStringVariableName #1 
-_rlnScheduleStringVariableValue #2 
-_rlnScheduleStringVariableResetValue #3 
-topazstar Schedules/preprocess-topaz/topazpicker/output_for_relion.star Schedules/preprocess-topaz/topazpicker/output_for_relion.star
-topazstar_copy Work/picker_params.star Work/picker_params.star
-defect_file         ""         "" 
-extracted_batch Work/particles_batch.star Work/particles_batch.star
-extracted_star Schedules/preprocess-topaz/extract/particles.star Schedules/preprocess-topaz/extract/particles.star
-   gainref Movies/gain.mrc Movies/gain.mrc 
-mics_to_pick_dst Work/micrographs_ctf.star Work/micrographs_ctf.star 
-mics_to_pick_src Schedules/preprocess-topaz/ctffind/micrographs_ctf.star Schedules/preprocess-topaz/ctffind/micrographs_ctf.star
-movies_wildcard Movies/*.tiff Movies/*.tiff 
-  mtf_file mtf_K3_300kv_nocds.star mtf_K3_300kv_nocds.star
-optics_group  opticsGroup1  opticsGroup1
-micrographs micrographs micrographs
-
-
-# version 30001
-
-data_schedule_operators
-
-loop_ 
-_rlnScheduleOperatorName #1 
-_rlnScheduleOperatorType #2 
-_rlnScheduleOperatorOutput #3 
-_rlnScheduleOperatorInput1 #4 
-_rlnScheduleOperatorInput2 #5
-has_copied_topazstar=EXISTS_topazstar_copy bool=file_exists has_copied_topazstar topazstar_copy  undefined
-COPY_topazstar_TO_topazstar_copy  copy_file  undefined topazstar topazstar_copy 
-COPY_extracted_star_TO_extracted_batch  copy_file  undefined extracted_star extracted_batch
-COPY_mics_to_pick_src_TO_mics_to_pick_dst  copy_file  undefined mics_to_pick_src mics_to_pick_dst
-count_mics=SET_count_mics_curr float=set count_mics count_mics_curr undefined
-count_mics_curr=COUNT_IMGS_mics_to_pick_src_micrographs float=count_images count_mics_curr mics_to_pick_src micrographs
-EXIT exit  undefined  undefined  undefined
-end=wait_count_GT_max_wait_count    bool=gt        end wait_count max_wait_count
-no_new_input=count_mics_curr_EQ_count_mics    bool=eq no_new_input count_mics_curr count_mics
-wait_count=wait_count_PLUS_one float=plus wait_count wait_count        one
-wait_count=SET_zero float=set wait_count zero undefined
-count_parts=COUNT_IMGS_extracted_star_undefined float=count_images count_parts extracted_star undefined
-
-
-# version 30001
-
-data_schedule_jobs
-
-loop_ 
-_rlnScheduleJobNameOriginal #1 
-_rlnScheduleJobName #2 
-_rlnScheduleJobMode #3 
-_rlnScheduleJobHasStarted #4
-importmovies importmovies   continue            0 
-motioncorr motioncorr   continue            0
-   ctffind    ctffind   continue            0
- topazpicker topazpicker   continue            0
-   extract    extract   continue            0
-
-
-# version 30001
-
-data_schedule_edges
-
-loop_ 
-_rlnScheduleEdgeInputNodeName #1 
-_rlnScheduleEdgeOutputNodeName #2 
-_rlnScheduleEdgeIsFork #3 
-_rlnScheduleEdgeOutputNodeNameIfTrue #4 
-_rlnScheduleEdgeBooleanVariable #5 
-importmovies motioncorr            0  undefined  undefined
-motioncorr    ctffind            0  undefined  undefined 
-ctffind count_mics_curr=COUNT_IMGS_mics_to_pick_src_micrographs 0 undefined undefined
-count_mics_curr=COUNT_IMGS_mics_to_pick_src_micrographs no_new_input=count_mics_curr_EQ_count_mics 0 undefined undefined
-no_new_input=count_mics_curr_EQ_count_mics count_mics=SET_count_mics_curr            1 wait_count=wait_count_PLUS_one no_new_input
-count_mics=SET_count_mics_curr wait_count=SET_zero 0 undefined undefined
-wait_count=SET_zero COPY_mics_to_pick_src_TO_mics_to_pick_dst            0  undefined  undefined
-COPY_mics_to_pick_src_TO_mics_to_pick_dst topazpicker 0 undefined undefined
-topazpicker has_copied_topazstar=EXISTS_topazstar_copy 0 undefined undefined
-has_copied_topazstar=EXISTS_topazstar_copy COPY_topazstar_TO_topazstar_copy  1  extract  has_copied_topazstar
-COPY_topazstar_TO_topazstar_copy extract 0  undefined  undefined
-extract count_parts=COUNT_IMGS_extracted_star_undefined   0  undefined  undefined
-count_parts=COUNT_IMGS_extracted_star_undefined COPY_extracted_star_TO_extracted_batch 0  undefined  undefined
-COPY_extracted_star_TO_extracted_batch importmovies 0  undefined  undefined
-wait_count=wait_count_PLUS_one end=wait_count_GT_max_wait_count            0  undefined  undefined
-end=wait_count_GT_max_wait_count importmovies            1       EXIT        end
diff --git a/mdcatch/Schedules/preprocess-topaz/schedule_pipeline.star b/mdcatch/Schedules/preprocess-topaz/schedule_pipeline.star
deleted file mode 100644
index 96ce9a7..0000000
--- a/mdcatch/Schedules/preprocess-topaz/schedule_pipeline.star
+++ /dev/null
@@ -1,68 +0,0 @@
-
-# version 30001
-
-data_pipeline_general
-
-_rlnPipeLineJobCounter                       1
- 
-
-# version 30001
-
-data_pipeline_processes
-
-loop_ 
-_rlnPipeLineProcessName #1 
-_rlnPipeLineProcessAlias #2 
-_rlnPipeLineProcessType #3 
-_rlnPipeLineProcessStatus #4 
-Schedules/preprocess-topaz/importmovies/       None            0            1
-Schedules/preprocess-topaz/motioncorr/       None            1            1
-Schedules/preprocess-topaz/ctffind/       None            2            1
-Schedules/preprocess-topaz/topazpicker/       Schedules/preprocess-topaz/Autopick_topaz           99            1
-Schedules/preprocess-topaz/extract/       None            5            1
- 
-
-# version 30001
-
-data_pipeline_nodes
-
-loop_ 
-_rlnPipeLineNodeName #1 
-_rlnPipeLineNodeType #2 
-Schedules/preprocess-topaz/importmovies/movies.star            0
-Schedules/preprocess-topaz/motioncorr/corrected_micrographs.star            1
-Schedules/preprocess-topaz/motioncorr/logfile.pdf           13
-Schedules/preprocess-topaz/ctffind/micrographs_ctf.star            1
-Schedules/preprocess-topaz/ctffind/logfile.pdf           13
-Schedules/preprocess-topaz/topazpicker/coords_suffix_topaz.star            2
-Schedules/preprocess-topaz/extract/particles.star            3
- 
-
-# version 30001
-
-data_pipeline_input_edges
-
-loop_ 
-_rlnPipeLineEdgeFromNode #1 
-_rlnPipeLineEdgeProcess #2 
-Schedules/preprocess-topaz/importmovies/movies.star Schedules/preprocess-topaz/motioncorr/
-Schedules/preprocess-topaz/motioncorr/corrected_micrographs.star Schedules/preprocess-topaz/ctffind/
-Schedules/preprocess-topaz/ctffind/micrographs_ctf.star Schedules/preprocess-topaz/topazpicker/
-Schedules/preprocess-topaz/ctffind/micrographs_ctf.star Schedules/preprocess-topaz/extract/
-Schedules/preprocess-topaz/topazpicker/coords_suffix_topaz.star Schedules/preprocess-topaz/extract/
- 
-
-# version 30001
-
-data_pipeline_output_edges
-
-loop_ 
-_rlnPipeLineEdgeProcess #1 
-_rlnPipeLineEdgeToNode #2 
-Schedules/preprocess-topaz/importmovies/ Schedules/preprocess-topaz/importmovies/movies.star
-Schedules/preprocess-topaz/motioncorr/ Schedules/preprocess-topaz/motioncorr/corrected_micrographs.star
-Schedules/preprocess-topaz/ctffind/ Schedules/preprocess-topaz/ctffind/micrographs_ctf.star
-Schedules/preprocess-topaz/ctffind/ Schedules/preprocess-topaz/ctffind/logfile.pdf
-Schedules/preprocess-topaz/topazpicker/ Schedules/preprocess-topaz/topazpicker/coords_suffix_topaz.star
-Schedules/preprocess-topaz/extract/ Schedules/preprocess-topaz/extract/particles.star
- 
diff --git a/mdcatch/Schedules/preprocess-topaz/topazpicker/job.star b/mdcatch/Schedules/preprocess-topaz/topazpicker/job.star
deleted file mode 100644
index ecff63f..0000000
--- a/mdcatch/Schedules/preprocess-topaz/topazpicker/job.star
+++ /dev/null
@@ -1,51 +0,0 @@
-
-# version 30001
-
-data_job
-
-_rlnJobType                            99
-_rlnJobIsContinue                       0
- 
-
-# version 30001
-
-data_joboptions_values
-
-loop_ 
-_rlnJobOptionVariable #1 
-_rlnJobOptionValue #2 
-  do_queue         No 
-    fn_exe         Schedules/external_job_topaz.py
-  in_3dref         "" 
- in_coords         "" 
-   in_mask         "" 
-    in_mic         Schedules/preprocess-topaz/ctffind/micrographs_ctf.star
-    in_mov         "" 
-   in_part         "" 
-min_dedicated          1 
-nr_threads          1 
-other_args         "" 
-param10_label         "" 
-param10_value         "" 
-param1_label         gpu 
-param1_value         1 
-param2_label         threshold 
-param2_value         $$topaz_thresh
-param3_label         diam
-param3_value         $$size_min
-param4_label         "" 
-param4_value         "" 
-param5_label         "" 
-param5_value         "" 
-param6_label         "" 
-param6_value         "" 
-param7_label         "" 
-param7_value         "" 
-param8_label         "" 
-param8_value         "" 
-param9_label         "" 
-param9_value         "" 
-      qsub       qsub 
-qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
- queuename    openmpi 
- 
diff --git a/mdcatch/Schedules/preprocess-logpicker/ctffind/job.star b/mdcatch/Schemes/prep/ctffind/job.star
similarity index 79%
rename from mdcatch/Schedules/preprocess-logpicker/ctffind/job.star
rename to mdcatch/Schemes/prep/ctffind/job.star
index b8e9df0..12870d3 100644
--- a/mdcatch/Schedules/preprocess-logpicker/ctffind/job.star
+++ b/mdcatch/Schemes/prep/ctffind/job.star
@@ -3,8 +3,9 @@
 
 data_job
 
-_rlnJobType                             2
+_rlnJobTypeLabel             relion.ctffind.ctffind4
 _rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
  
 
 # version 30001
@@ -20,16 +21,16 @@ _rlnJobOptionValue #2
      dfmax      50000 
      dfmin       5000 
     dfstep        500 
-    do_EPA         No 
+    do_EPA         Yes 
 do_ignore_ctffind_params        Yes 
-do_phaseshift   $$is_VPP 
+do_phaseshift         No 
   do_queue         No 
 fn_ctffind_exe $RELION_CTFFIND_EXECUTABLE
 fn_gctf_exe $RELION_GCTF_EXECUTABLE
    gpu_ids         "" 
-input_star_mics Schedules/preprocess-logpicker/motioncorr/corrected_micrographs.star
+input_star_mics Schemes/prep/motioncorr/corrected_micrographs.star
 min_dedicated         24 
-    nr_mpi         5
+    nr_mpi          5 
 other_args         "" 
 other_gctf_args         "" 
  phase_max        180 
diff --git a/mdcatch/Schedules/preprocess-topaz/importmovies/job.star b/mdcatch/Schemes/prep/importmovies/job.star
similarity index 69%
rename from mdcatch/Schedules/preprocess-topaz/importmovies/job.star
rename to mdcatch/Schemes/prep/importmovies/job.star
index 2a32d41..a33de4f 100644
--- a/mdcatch/Schedules/preprocess-topaz/importmovies/job.star
+++ b/mdcatch/Schemes/prep/importmovies/job.star
@@ -3,8 +3,9 @@
 
 data_job
 
-_rlnJobType                             0
+_rlnJobTypeLabel             relion.import.movies
 _rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
  
 
 # version 30001
@@ -14,24 +15,24 @@ data_joboptions_values
 loop_ 
 _rlnJobOptionVariable #1 
 _rlnJobOptionValue #2 
-        Cs       $$Cs 
+        Cs        2.7
         Q0        0.1 
-    angpix   $$angpix 
+    angpix      1.0
 beamtilt_x          0 
 beamtilt_y          0 
   do_other         No 
   do_queue         No 
     do_raw        Yes 
 fn_in_other    ref.mrc 
- fn_in_raw $$movies_wildcard 
-    fn_mtf $$mtf_file 
+ fn_in_raw Movies/*.tiff 
+    fn_mtf         "" 
 is_multiframe        Yes 
-        kV  $$voltage 
+        kV      300.0
 min_dedicated         24 
  node_type "Particle coordinates (*.box, *_pick.star)" 
-optics_group_name $$optics_group 
+optics_group_name opticsGroup1 
 optics_group_particles         "" 
-other_args "--do_at_most $$do_at_most" 
+other_args         "" 
       qsub       qsub 
 qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
  queuename    openmpi 
diff --git a/mdcatch/Schedules/preprocess-topaz/motioncorr/job.star b/mdcatch/Schemes/prep/motioncorr/job.star
similarity index 65%
rename from mdcatch/Schedules/preprocess-topaz/motioncorr/job.star
rename to mdcatch/Schemes/prep/motioncorr/job.star
index fd00ed2..1f37c6e 100644
--- a/mdcatch/Schedules/preprocess-topaz/motioncorr/job.star
+++ b/mdcatch/Schemes/prep/motioncorr/job.star
@@ -3,8 +3,9 @@
 
 data_job
 
-_rlnJobType                             1
+_rlnJobTypeLabel             relion.motioncorr.own
 _rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
  
 
 # version 30001
@@ -15,27 +16,29 @@ loop_
 _rlnJobOptionVariable #1 
 _rlnJobOptionValue #2 
    bfactor        150 
-bin_factor $$motioncorr_bin 
+bin_factor          1 
 do_dose_weighting        Yes 
+do_float16        Yes
 do_own_motioncor        Yes 
-do_save_ps        Yes 
-do_save_noDW         No 
   do_queue         No 
-dose_per_frame $$dose_rate 
+do_save_noDW        No 
+do_save_ps        Yes 
+dose_per_frame       1.0
+eer_grouping         32
 first_frame_sum          1 
- fn_defect         $$defect_file 
-fn_gain_ref  $$gainref 
+ fn_defect         "" 
+fn_gain_ref ""
 fn_motioncor2_exe /public/EM/MOTIONCOR2/MotionCor2 
  gain_flip "No flipping (0)" 
   gain_rot "No rotation (0)" 
-   gpu_ids        0:1 
+   gpu_ids          0 
 group_for_ps          4 
-group_frames          $$group_frames
-input_star_mics Schedules/preprocess-topaz/importmovies/movies.star
+group_frames          1 
+input_star_mics Schemes/prep/importmovies/movies.star
 last_frame_sum         -1 
 min_dedicated         24 
-    nr_mpi         5 
-nr_threads         12 
+    nr_mpi          5
+nr_threads          8
 other_args "--do_at_most $$do_at_most" 
 other_motioncor2_args         "" 
    patch_x          5 
diff --git a/mdcatch/Schemes/prep/scheme.star b/mdcatch/Schemes/prep/scheme.star
new file mode 100644
index 0000000..04272d4
--- /dev/null
+++ b/mdcatch/Schemes/prep/scheme.star
@@ -0,0 +1,66 @@
+
+# version 30001
+
+data_scheme_general
+
+_rlnSchemeName                       Schemes/prep/
+_rlnSchemeCurrentNodeName            WAIT
+ 
+
+# version 30001
+
+data_scheme_floats
+
+loop_ 
+_rlnSchemeFloatVariableName #1
+_rlnSchemeFloatVariableValue #2
+_rlnSchemeFloatVariableResetValue #3
+do_at_most   15.000000   15.000000
+maxtime_hr   12.000000   12.000000
+  wait_sec   0.000000   0.000000 
+ 
+
+# version 30001
+
+data_scheme_operators
+
+loop_ 
+_rlnSchemeOperatorName #1
+_rlnSchemeOperatorType #2
+_rlnSchemeOperatorOutput #3
+_rlnSchemeOperatorInput1 #4
+_rlnSchemeOperatorInput2 #5
+EXIT_maxtime exit_maxtime  undefined    maxtime_hr  undefined 
+WAIT       wait  undefined   wait_sec  undefined 
+ 
+
+# version 30001
+
+data_scheme_jobs
+
+loop_ 
+_rlnSchemeJobNameOriginal #1
+_rlnSchemeJobName #2
+_rlnSchemeJobMode #3
+_rlnSchemeJobHasStarted #4
+importmovies importmovies   continue            0 
+motioncorr motioncorr   continue            0 
+   ctffind    ctffind   continue            0 
+
+
+# version 30001
+
+data_scheme_edges
+
+loop_ 
+_rlnSchemeEdgeInputNodeName #1
+_rlnSchemeEdgeOutputNodeName #2
+_rlnSchemeEdgeIsFork #3
+_rlnSchemeEdgeOutputNodeNameIfTrue #4
+_rlnSchemeEdgeBooleanVariable #5
+      WAIT EXIT_maxtime            0  undefined  undefined 
+EXIT_maxtime importmovies            0  undefined  undefined 
+importmovies motioncorr            0  undefined  undefined 
+motioncorr    ctffind            0  undefined  undefined 
+   ctffind WAIT            0  undefined  undefined 
+  
diff --git a/mdcatch/Schedules/class2d/class2d_first/job.star b/mdcatch/Schemes/proc-cryolo/class2d_ini/job.star
similarity index 71%
rename from mdcatch/Schedules/class2d/class2d_first/job.star
rename to mdcatch/Schemes/proc-cryolo/class2d_ini/job.star
index 0fe72f1..ef70976 100644
--- a/mdcatch/Schedules/class2d/class2d_first/job.star
+++ b/mdcatch/Schemes/proc-cryolo/class2d_ini/job.star
@@ -3,8 +3,9 @@
 
 data_job
 
-_rlnJobType                             8
+_rlnJobTypeLabel             relion.class2d
 _rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
  
 
 # version 30001
@@ -14,12 +15,12 @@ data_joboptions_values
 loop_ 
 _rlnJobOptionVariable #1 
 _rlnJobOptionValue #2 
-allow_coarser        No
+allow_coarser         No 
 ctf_intact_first_peak         No 
 do_bimodal_psi        Yes 
 do_combine_thru_disc         No 
 do_ctf_correction        Yes 
-do_fast_subsets         No 
+   do_grad         No
   do_helix         No 
 do_parallel_discio        Yes 
 do_preread_images         No 
@@ -27,28 +28,28 @@ do_preread_images         No
 do_restrict_xoff        Yes 
 do_zero_mask        Yes 
 dont_skip_align        Yes 
-   fn_cont "" 
-    fn_img Work/particles_batch.star
-   gpu_ids        0:1 
+   fn_cont         "" 
+    fn_img $$ini_batch 
+   gpu_ids        "0:1" 
 helical_rise       4.75 
 helical_tube_outer_diameter        200 
 highres_limit         -1 
 min_dedicated         24 
-nr_classes $$nr_cls1
-   nr_iter         20 
+nr_classes        25
+   nr_iter        20 
     nr_mpi          3
    nr_pool         30 
-nr_threads          8 
+nr_threads         6
 offset_range          5 
 offset_step          1 
-other_args "--free_gpu_memory 3000"
-particle_diameter $$mask_diam 
+other_args         "" 
+particle_diameter      110.0 
 psi_sampling          6 
       qsub       qsub 
 qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
  queuename    openmpi 
  range_psi          6 
-scratch_dir       /work 
+scratch_dir         "/ssd"
  tau_fudge          2 
    use_gpu        Yes 
  
diff --git a/mdcatch/Schemes/proc-cryolo/class2d_rest/job.star b/mdcatch/Schemes/proc-cryolo/class2d_rest/job.star
new file mode 100644
index 0000000..11439ab
--- /dev/null
+++ b/mdcatch/Schemes/proc-cryolo/class2d_rest/job.star
@@ -0,0 +1,55 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.class2d
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+allow_coarser         No 
+ctf_intact_first_peak         No 
+do_bimodal_psi        Yes 
+do_combine_thru_disc         No 
+do_ctf_correction        Yes 
+   do_grad        Yes 
+  do_helix         No 
+do_parallel_discio        Yes 
+do_preread_images         No 
+  do_queue         No 
+do_restrict_xoff        Yes 
+do_zero_mask        Yes 
+dont_skip_align        Yes 
+   fn_cont         "" 
+    fn_img Schemes/proc-cryolo/extract_rest/particles.star
+   gpu_ids        "0,1"
+helical_rise       4.75 
+helical_tube_outer_diameter        200 
+highres_limit         -1 
+min_dedicated         24 
+nr_classes        50
+   nr_iter        100 
+    nr_mpi          1 
+   nr_pool         30 
+nr_threads         12 
+offset_range          5 
+offset_step          1 
+other_args         "" 
+particle_diameter      110.0 
+psi_sampling          6 
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+ range_psi          6 
+scratch_dir         "/ssd"
+ tau_fudge          2 
+   use_gpu        Yes 
+ 
diff --git a/mdcatch/Schedules/preprocess-logpicker/extract/job.star b/mdcatch/Schemes/proc-cryolo/extract_ini/job.star
similarity index 69%
rename from mdcatch/Schedules/preprocess-logpicker/extract/job.star
rename to mdcatch/Schemes/proc-cryolo/extract_ini/job.star
index 9e0eac9..c0de4ab 100644
--- a/mdcatch/Schedules/preprocess-logpicker/extract/job.star
+++ b/mdcatch/Schemes/proc-cryolo/extract_ini/job.star
@@ -3,8 +3,9 @@
 
 data_job
 
-_rlnJobType                             5
+_rlnJobTypeLabel             relion.extract
 _rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
  
 
 # version 30001
@@ -14,12 +15,14 @@ data_joboptions_values
 loop_ 
 _rlnJobOptionVariable #1 
 _rlnJobOptionValue #2 
-bg_diameter $$mask_diam_px 
+bg_diameter         -1 
 black_dust         -1 
-coords_suffix Schedules/preprocess-logpicker/logpicker/coords_suffix_autopick.star
+coords_suffix Schemes/proc-cryolo/inipicker/autopick.star
 do_cut_into_segments        Yes 
 do_extract_helical_tubes        Yes 
 do_extract_helix         No 
+do_float16        Yes
+do_fom_threshold         No 
  do_invert        Yes 
    do_norm        Yes 
   do_queue         No 
@@ -27,14 +30,15 @@ do_recenter         No
 do_reextract         No 
 do_rescale        Yes 
 do_reset_offsets         No 
-extract_size $$box_size 
+extract_size        166 
 fndata_reextract         "" 
 helical_bimodal_angular_priors        Yes 
 helical_nr_asu          1 
 helical_rise          1 
 helical_tube_outer_diameter        200 
 min_dedicated         24 
-    nr_mpi          5 
+minimum_pick_fom          0 
+    nr_mpi          5
 other_args         "" 
       qsub       qsub 
 qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
@@ -42,7 +46,7 @@ qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh
 recenter_x          0 
 recenter_y          0 
 recenter_z          0 
-   rescale $$box_size_bin 
- star_mics Schedules/preprocess-logpicker/ctffind/micrographs_ctf.star
+   rescale         48 
+ star_mics Schemes/proc-cryolo/select_mics/micrographs.star
 white_dust         -1 
  
diff --git a/mdcatch/Schemes/proc-cryolo/extract_rest/job.star b/mdcatch/Schemes/proc-cryolo/extract_rest/job.star
new file mode 100644
index 0000000..c5f1b11
--- /dev/null
+++ b/mdcatch/Schemes/proc-cryolo/extract_rest/job.star
@@ -0,0 +1,53 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             Extract
+_rlnJobTypeLabel             relion.extract
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+bg_diameter         -1 
+black_dust         -1 
+coords_suffix Schemes/proc-cryolo/restpicker/autopick.star
+do_cut_into_segments        Yes 
+do_extract_helical_tubes        Yes 
+do_extract_helix         No 
+do_float16        Yes
+do_fom_threshold        No
+ do_invert        Yes 
+   do_norm        Yes 
+  do_queue         No 
+do_recenter         No 
+do_reextract         No 
+do_rescale        Yes 
+do_reset_offsets         No 
+extract_size        166 
+fndata_reextract         "" 
+helical_bimodal_angular_priors        Yes 
+helical_nr_asu          1 
+helical_rise          1 
+helical_tube_outer_diameter        200 
+min_dedicated         24 
+minimum_pick_fom         -3 
+    nr_mpi          12
+other_args         "" 
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+recenter_x          0 
+recenter_y          0 
+recenter_z          0 
+   rescale         48 
+ star_mics Schemes/proc-cryolo/select_mics/micrographs.star
+white_dust         -1 
+ 
diff --git a/mdcatch/Schemes/proc-cryolo/inimodel3d/job.star b/mdcatch/Schemes/proc-cryolo/inimodel3d/job.star
new file mode 100644
index 0000000..686b29b
--- /dev/null
+++ b/mdcatch/Schemes/proc-cryolo/inimodel3d/job.star
@@ -0,0 +1,46 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.initialmodel
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+ctf_intact_first_peak         No 
+do_combine_thru_disc         No 
+do_ctf_correction        Yes 
+do_parallel_discio        Yes 
+do_preread_images         No 
+  do_queue         No 
+do_solvent        Yes 
+   fn_cont         "" 
+    fn_img Schemes/proc-cryolo/select_rest/particles.star
+   gpu_ids        0,1 
+min_dedicated         24 
+nr_classes          1 
+   nr_iter        100 
+    nr_mpi          1 
+   nr_pool         30 
+nr_threads         12 
+offset_range          6 
+offset_step          2 
+other_args         "" 
+particle_diameter        200 
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+  sampling "15 degrees" 
+scratch_dir       "/ssd"
+skip_gridding        Yes 
+  sym_name         C1
+   use_gpu        Yes 
+ 
diff --git a/mdcatch/Schemes/proc-cryolo/inipicker/job.star b/mdcatch/Schemes/proc-cryolo/inipicker/job.star
new file mode 100644
index 0000000..f8eff08
--- /dev/null
+++ b/mdcatch/Schemes/proc-cryolo/inipicker/job.star
@@ -0,0 +1,50 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.external
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+data_joboptions_values
+loop_
+_rlnJobOptionVariable #1
+_rlnJobOptionValue #2
+do_queue         No
+fn_exe ./external_job_cryolo.py
+in_3dref             ""
+in_coords            ""
+in_mask              ""
+in_mic Schemes/proc-cryolo/select_mics/micrographs.star
+in_mov               ""
+in_part              ""
+min_dedicated        24
+nr_threads            1
+other_args           ""
+param10_label        ""
+param10_value        ""
+param1_label        gpu
+param1_value        0,1
+param2_label   box_size
+param2_value          0
+param3_label         ""
+param3_value         ""
+param4_label         ""
+param4_value         ""
+param5_label         ""
+param5_value         ""
+param6_label         ""
+param6_value         ""
+param7_label         ""
+param7_value         ""
+param8_label         ""
+param8_value         ""
+param9_label         ""
+param9_value         ""
+qsub       qsub
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh
+queuename    openmpi
+
diff --git a/mdcatch/Schemes/proc-cryolo/refine3d/job.star b/mdcatch/Schemes/proc-cryolo/refine3d/job.star
new file mode 100644
index 0000000..693b4e6
--- /dev/null
+++ b/mdcatch/Schemes/proc-cryolo/refine3d/job.star
@@ -0,0 +1,73 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.refine3d
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+auto_faster        Yes 
+auto_local_sampling "1.8 degrees" 
+ctf_intact_first_peak         No 
+do_apply_helical_symmetry        Yes 
+do_combine_thru_disc         No 
+do_ctf_correction        Yes 
+  do_helix         No 
+do_local_search_helical_symmetry         No 
+   do_pad1         No 
+do_parallel_discio        Yes 
+do_preread_images         No 
+  do_queue         No 
+do_solvent_fsc         No 
+do_zero_mask        Yes 
+   fn_cont         "" 
+    fn_img Schemes/proc-cryolo/select_rest/particles.star
+   fn_mask         "" 
+    fn_ref $$myref
+   gpu_ids        0:1 
+helical_nr_asu          1 
+helical_range_distance         -1 
+helical_rise_inistep          0 
+helical_rise_initial          0 
+helical_rise_max          0 
+helical_rise_min          0 
+helical_tube_inner_diameter         -1 
+helical_tube_outer_diameter         -1 
+helical_twist_inistep          0 
+helical_twist_initial          0 
+helical_twist_max          0 
+helical_twist_min          0 
+helical_z_percentage         30 
+  ini_high         40 
+keep_tilt_prior_fixed        Yes 
+min_dedicated         24 
+    nr_mpi          3 
+   nr_pool         30 
+nr_threads         8 
+offset_range          5 
+offset_step          1 
+other_args         "" 
+particle_diameter        200 
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+ range_psi         10 
+ range_rot         -1 
+range_tilt         15 
+ref_correct_greyscale        Yes 
+ relax_sym         "" 
+  sampling "7.5 degrees" 
+scratch_dir       "/ssd"
+skip_gridding        Yes 
+  sym_name         C1
+   use_gpu        Yes 
+ 
diff --git a/mdcatch/Schemes/proc-cryolo/restpicker/job.star b/mdcatch/Schemes/proc-cryolo/restpicker/job.star
new file mode 100644
index 0000000..8ff2fc8
--- /dev/null
+++ b/mdcatch/Schemes/proc-cryolo/restpicker/job.star
@@ -0,0 +1,51 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.external
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_
+_rlnJobOptionVariable #1
+_rlnJobOptionValue #2
+do_queue         No
+fn_exe ./external_job_cryolo.py
+in_3dref             ""
+in_coords            ""
+in_mask              ""
+in_mic Schemes/proc-cryolo/select_mics/micrographs.star
+in_mov               ""
+in_part              ""
+min_dedicated        24
+nr_threads            1
+other_args           ""
+param10_label        ""
+param10_value        ""
+param1_label        gpu
+param1_value        0,1
+param2_label   box_size
+param2_value          0
+param3_label      model
+param3_value   $$cryolo_model
+param4_label         ""
+param4_value         ""
+param5_label         ""
+param5_value         ""
+param6_label         ""
+param6_value         ""
+param7_label         ""
+param7_value         ""
+param8_label         ""
+param8_value         ""
+param9_label         ""
+param9_value         ""
+qsub       qsub
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh
+queuename    openmpi
diff --git a/mdcatch/Schemes/proc-cryolo/scheme.star b/mdcatch/Schemes/proc-cryolo/scheme.star
new file mode 100644
index 0000000..63050b2
--- /dev/null
+++ b/mdcatch/Schemes/proc-cryolo/scheme.star
@@ -0,0 +1,145 @@
+
+
+# version 30001
+
+data_scheme_general
+
+_rlnSchemeName                       Schemes/proc-cryolo/
+_rlnSchemeCurrentNodeName            WAIT
+ 
+
+# version 30001
+
+data_scheme_floats
+
+loop_ 
+_rlnSchemeFloatVariableName #1
+_rlnSchemeFloatVariableValue #2
+_rlnSchemeFloatVariableResetValue #3
+current_ini_size     0.000000     0.000000 
+current_rest_size     0.000000     0.000000 
+inibatch_size 10000.000000 10000.000000 
+maxtime_hr    8.000000    8.000000
+prev_rest_size     0.000000     0.000000 
+wait_sec   60.000000   60.000000 
+ 
+
+# version 30001
+
+data_scheme_bools
+
+loop_ 
+_rlnSchemeBooleanVariableName #1
+_rlnSchemeBooleanVariableValue #2
+_rlnSchemeBooleanVariableResetValue #3
+has_ctffind 0 0
+do_prep 1 1 
+do_2d 1 1 
+do_3d 0 0 
+has_larger_rest_size            0            0 
+do_retrain_cryolo            1            1
+has_cryolo_model            0            0
+inibatch_big_enough            0            0
+has_iniref            0            0  
+ 
+
+# version 30001
+
+data_scheme_strings
+
+loop_ 
+_rlnSchemeStringVariableName #1
+_rlnSchemeStringVariableValue #2
+_rlnSchemeStringVariableResetValue #3
+ctffind_mics Schemes/prep/ctffind/micrographs_ctf.star Schemes/prep/ctffind/micrographs_ctf.star
+ini_batch Schemes/proc-cryolo/split_ini/particles_split1.star Schemes/proc-cryolo/split_ini/particles_split1.star
+particles  particles  particles 
+rest_batch Schemes/proc-cryolo/extract_rest/particles.star Schemes/proc-cryolo/extract_rest/particles.star
+cryolo_model Schemes/proc-cryolo/train_cryolo/fine_tuned_model.h5 Schemes/proc-cryolo/train_cryolo/fine_tuned_model.h5
+iniref None None
+myref undefined undefined
+inimodel_output Schemes/proc-cryolo/inimodel3d/initial_model.mrc Schemes/proc-cryolo/inimodel3d/initial_model.mrc
+
+# version 30001
+
+data_scheme_operators
+
+loop_ 
+_rlnSchemeOperatorName #1
+_rlnSchemeOperatorType #2
+_rlnSchemeOperatorOutput #3
+_rlnSchemeOperatorInput1 #4
+_rlnSchemeOperatorInput2 #5
+HAS_ctffind bool=file_exists has_ctffind ctffind_mics undefined
+CHECK_ini    bool=ge inibatch_big_enough current_ini_size inibatch_size
+CHECK_iniref  bool=file_exists has_iniref iniref  undefined 
+COUNT_ini float=count_images current_ini_size   ini_batch  particles 
+COUNT_restbatch float=count_images current_rest_size rest_batch  particles 
+EXIT_maxtime exit_maxtime  undefined    maxtime_hr  undefined 
+HAS_rest_increased    bool=gt has_larger_rest_size current_rest_size prev_rest_size 
+HAS_cryolo_model bool=file_exists has_cryolo_model cryolo_model  undefined
+SET_prev_rest_size  float=set prev_rest_size current_rest_size  undefined 
+SET_myref_user string=set myref iniref undefined
+SET_myref_inimodel string=set myref inimodel_output undefined
+WAIT       wait  undefined   wait_sec  undefined 
+ 
+
+# version 30001
+
+data_scheme_jobs
+
+loop_ 
+_rlnSchemeJobNameOriginal #1
+_rlnSchemeJobName #2
+_rlnSchemeJobMode #3
+_rlnSchemeJobHasStarted #4
+select_mics select_mics continue    0
+inipicker  inipicker   continue            0 
+extract_ini extract_ini   continue            0 
+split_ini split_ini   continue            0 
+class2d_ini class2d_ini        new            0 
+select_ini select_ini        new            0 
+train_cryolo train_cryolo        new            0
+restpicker restpicker   continue            0 
+extract_rest extract_rest   continue            0 
+class2d_rest class2d_rest        new            0 
+select_rest select_rest        new            0 
+inimodel3d inimodel3d        new            0 
+refine3d   refine3d        new            0 
+ 
+
+# version 30001
+
+data_scheme_edges
+
+loop_ 
+_rlnSchemeEdgeInputNodeName #1
+_rlnSchemeEdgeOutputNodeName #2
+_rlnSchemeEdgeIsFork #3
+_rlnSchemeEdgeOutputNodeNameIfTrue #4
+_rlnSchemeEdgeBooleanVariable #5
+WAIT HAS_ctffind              0  undefined  undefined 
+HAS_ctffind WAIT             1 EXIT_maxtime has_ctffind
+EXIT_maxtime select_mics              0  undefined  undefined 
+select_mics restpicker            1 HAS_cryolo_model do_retrain_cryolo
+HAS_cryolo_model  inipicker            1 restpicker has_cryolo_model
+inipicker extract_ini            0  undefined  undefined 
+extract_ini split_ini            0  undefined  undefined 
+split_ini COUNT_ini            0  undefined  undefined 
+COUNT_ini CHECK_ini            0  undefined  undefined 
+CHECK_ini       WAIT            1 class2d_ini inibatch_big_enough 
+class2d_ini select_ini            0  undefined  undefined 
+select_ini train_cryolo            0  undefined  undefined
+train_cryolo       WAIT            0  undefined  undefined
+restpicker extract_rest           0  undefined  undefined 
+extract_rest COUNT_restbatch       0  undefined  undefined 
+COUNT_restbatch HAS_rest_increased            0  undefined  undefined 
+HAS_rest_increased       WAIT            1 class2d_rest has_larger_rest_size 
+class2d_rest select_rest            0  undefined  undefined 
+select_rest   SET_prev_rest_size         0  undefined  undefined 
+SET_prev_rest_size  WAIT       1 CHECK_iniref  do_3d 
+CHECK_iniref inimodel3d 1 SET_myref_user has_iniref
+inimodel3d SET_myref_inimodel            0  undefined  undefined 
+SET_myref_inimodel   refine3d            0  undefined  undefined
+SET_myref_user refine3d            0  undefined  undefined 
+refine3d WAIT            0  undefined  undefined 
diff --git a/mdcatch/Schemes/proc-cryolo/select_ini/job.star b/mdcatch/Schemes/proc-cryolo/select_ini/job.star
new file mode 100644
index 0000000..304f347
--- /dev/null
+++ b/mdcatch/Schemes/proc-cryolo/select_ini/job.star
@@ -0,0 +1,47 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.select.class2dauto
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+discard_label rlnImageName 
+discard_sigma          4 
+do_class_ranker        Yes 
+do_discard         No 
+  do_queue         No 
+ do_random         No 
+do_recenter         No 
+do_regroup         No 
+do_remove_duplicates         No 
+do_select_values         No 
+  do_split         No 
+duplicate_threshold         30 
+   fn_data         "" 
+    fn_mic         "" 
+  fn_model Schemes/proc-cryolo/class2d_ini/run_it020_optimiser.star
+image_angpix         -1 
+min_dedicated         24 
+ nr_groups          1 
+  nr_split         -1 
+other_args         ""
+python_exe         $RELION_PYTHON
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+rank_threshold       0.35 
+select_label rlnCtfMaxResolution 
+select_maxval      9999. 
+select_minval     -9999. 
+split_size        100 
+ 
diff --git a/mdcatch/Schemes/proc-cryolo/select_mics/job.star b/mdcatch/Schemes/proc-cryolo/select_mics/job.star
new file mode 100644
index 0000000..d62f7b4
--- /dev/null
+++ b/mdcatch/Schemes/proc-cryolo/select_mics/job.star
@@ -0,0 +1,47 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.select.onvalue
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+discard_label rlnImageName 
+discard_sigma          4 
+do_class_ranker        No 
+do_discard         No 
+  do_queue         No 
+ do_random         No 
+do_recenter         No 
+do_regroup         No 
+do_remove_duplicates         No 
+do_select_values        Yes 
+  do_split         No 
+duplicate_threshold         30 
+   fn_data         "" 
+    fn_mic $$ctffind_mics
+  fn_model         "" 
+image_angpix         -1 
+min_dedicated         24 
+ nr_groups          1 
+  nr_split         -1 
+other_args         ""
+python_exe         ""
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+rank_threshold       0.35 
+select_label rlnCtfMaxResolution 
+select_maxval          6 
+select_minval     -9999. 
+split_size        100 
+ 
diff --git a/mdcatch/Schemes/proc-cryolo/select_rest/job.star b/mdcatch/Schemes/proc-cryolo/select_rest/job.star
new file mode 100644
index 0000000..46c2412
--- /dev/null
+++ b/mdcatch/Schemes/proc-cryolo/select_rest/job.star
@@ -0,0 +1,47 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.select.class2dauto
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+discard_label rlnImageName 
+discard_sigma          4 
+do_class_ranker        Yes 
+do_discard         No 
+  do_queue         No 
+ do_random         No 
+do_recenter         No 
+do_regroup         No 
+do_remove_duplicates         No 
+do_select_values         No 
+  do_split         No 
+duplicate_threshold         30 
+   fn_data         "" 
+    fn_mic         "" 
+  fn_model Schemes/proc-cryolo/class2d_rest/run_it100_optimiser.star
+image_angpix         -1 
+min_dedicated         24 
+ nr_groups          1 
+  nr_split         -1 
+other_args         ""
+python_exe         $RELION_PYTHON
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+rank_threshold       0.45 
+select_label rlnCtfMaxResolution 
+select_maxval      9999. 
+select_minval     -9999. 
+split_size        100 
+ 
diff --git a/mdcatch/Schemes/proc-cryolo/split_ini/job.star b/mdcatch/Schemes/proc-cryolo/split_ini/job.star
new file mode 100644
index 0000000..e2dd0c2
--- /dev/null
+++ b/mdcatch/Schemes/proc-cryolo/split_ini/job.star
@@ -0,0 +1,47 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.select.split
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+discard_label rlnImageName 
+discard_sigma          4 
+do_class_ranker         No 
+do_discard         No 
+  do_queue         No 
+ do_random         No 
+do_recenter         No 
+do_regroup         No 
+do_remove_duplicates         No 
+do_select_values         No 
+  do_split        Yes 
+duplicate_threshold         30 
+   fn_data Schemes/proc-cryolo/extract_ini/particles.star
+    fn_mic         "" 
+  fn_model         "" 
+image_angpix         -1 
+min_dedicated         24 
+ nr_groups          1 
+  nr_split         -1 
+other_args         ""
+python_exe         ""
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+rank_threshold        0.5 
+select_label rlnCtfFigureOfMerit 
+select_maxval      9999. 
+select_minval     -9999. 
+split_size      10000 
+ 
diff --git a/mdcatch/Schedules/class2d/sort_cls2d/job.star b/mdcatch/Schemes/proc-cryolo/train_cryolo/job.star
similarity index 50%
rename from mdcatch/Schedules/class2d/sort_cls2d/job.star
rename to mdcatch/Schemes/proc-cryolo/train_cryolo/job.star
index 3c8e23f..65dd914 100644
--- a/mdcatch/Schedules/class2d/sort_cls2d/job.star
+++ b/mdcatch/Schemes/proc-cryolo/train_cryolo/job.star
@@ -3,9 +3,9 @@
 
 data_job
 
-_rlnJobType                            99
-_rlnJobIsContinue                       0
-
+_rlnJobTypeLabel             relion.external
+_rlnJobIsTomo                           0
+ 
 
 # version 30001
 
@@ -14,21 +14,21 @@ data_joboptions_values
 loop_
 _rlnJobOptionVariable #1
 _rlnJobOptionValue #2
-  do_queue         No
-    fn_exe         Schedules/external_job_cryoassess.py
-  in_3dref         ""
- in_coords         ""
-   in_mask         ""
-    in_mic         ""
-    in_mov         ""
-   in_part         Schedules/class2d/class2d_last/run_it020_data.star
-min_dedicated          1
-nr_threads          1
-other_args         ""
-param10_label         ""
-param10_value         ""
-param1_label         gpu
-param1_value         1
+do_queue         No
+fn_exe ./external_job_cryolo_train.py
+in_3dref             ""
+in_coords            ""
+in_mask              ""
+in_mic               ""
+in_mov               ""
+in_part Schemes/proc-cryolo/select_ini/particles.star
+min_dedicated        24
+nr_threads            1
+other_args           ""
+param10_label        ""
+param10_value        ""
+param1_label        gpu
+param1_value        0,1
 param2_label         ""
 param2_value         ""
 param3_label         ""
@@ -45,6 +45,6 @@ param8_label         ""
 param8_value         ""
 param9_label         ""
 param9_value         ""
-      qsub       qsub
+qsub       qsub
 qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh
- queuename    openmpi
+queuename    openmpi
diff --git a/mdcatch/Schedules/class2d/class2d_last/job.star b/mdcatch/Schemes/proc-log/class2d_ini/job.star
similarity index 71%
rename from mdcatch/Schedules/class2d/class2d_last/job.star
rename to mdcatch/Schemes/proc-log/class2d_ini/job.star
index e13cfae..ef70976 100644
--- a/mdcatch/Schedules/class2d/class2d_last/job.star
+++ b/mdcatch/Schemes/proc-log/class2d_ini/job.star
@@ -3,8 +3,9 @@
 
 data_job
 
-_rlnJobType                             8
+_rlnJobTypeLabel             relion.class2d
 _rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
  
 
 # version 30001
@@ -14,12 +15,12 @@ data_joboptions_values
 loop_ 
 _rlnJobOptionVariable #1 
 _rlnJobOptionValue #2 
-allow_coarser        No
+allow_coarser         No 
 ctf_intact_first_peak         No 
 do_bimodal_psi        Yes 
 do_combine_thru_disc         No 
 do_ctf_correction        Yes 
-do_fast_subsets         No 
+   do_grad         No
   do_helix         No 
 do_parallel_discio        Yes 
 do_preread_images         No 
@@ -27,28 +28,28 @@ do_preread_images         No
 do_restrict_xoff        Yes 
 do_zero_mask        Yes 
 dont_skip_align        Yes 
-   fn_cont "" 
-    fn_img Work/particles_batch.star
-   gpu_ids        0:1 
+   fn_cont         "" 
+    fn_img $$ini_batch 
+   gpu_ids        "0:1" 
 helical_rise       4.75 
 helical_tube_outer_diameter        200 
 highres_limit         -1 
 min_dedicated         24 
-nr_classes $$nr_cls2
-   nr_iter         20 
+nr_classes        25
+   nr_iter        20 
     nr_mpi          3
    nr_pool         30 
-nr_threads          8 
+nr_threads         6
 offset_range          5 
 offset_step          1 
-other_args "--free_gpu_memory 2000"
-particle_diameter $$mask_diam 
+other_args         "" 
+particle_diameter      110.0 
 psi_sampling          6 
       qsub       qsub 
 qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
  queuename    openmpi 
  range_psi          6 
-scratch_dir       /work 
+scratch_dir         "/ssd"
  tau_fudge          2 
    use_gpu        Yes 
  
diff --git a/mdcatch/Schemes/proc-log/class2d_rest/job.star b/mdcatch/Schemes/proc-log/class2d_rest/job.star
new file mode 100644
index 0000000..777671f
--- /dev/null
+++ b/mdcatch/Schemes/proc-log/class2d_rest/job.star
@@ -0,0 +1,55 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.class2d
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+allow_coarser         No 
+ctf_intact_first_peak         No 
+do_bimodal_psi        Yes 
+do_combine_thru_disc         No 
+do_ctf_correction        Yes 
+   do_grad        Yes 
+  do_helix         No 
+do_parallel_discio        Yes 
+do_preread_images         No 
+  do_queue         No 
+do_restrict_xoff        Yes 
+do_zero_mask        Yes 
+dont_skip_align        Yes 
+   fn_cont         "" 
+    fn_img Schemes/proc-log/extract_rest/particles.star
+   gpu_ids        "0,1"
+helical_rise       4.75 
+helical_tube_outer_diameter        200 
+highres_limit         -1 
+min_dedicated         24 
+nr_classes        50
+   nr_iter        100 
+    nr_mpi          1 
+   nr_pool         30 
+nr_threads         12 
+offset_range          5 
+offset_step          1 
+other_args         "" 
+particle_diameter      110.0 
+psi_sampling          6 
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+ range_psi          6 
+scratch_dir         "/ssd"
+ tau_fudge          2 
+   use_gpu        Yes 
+ 
diff --git a/mdcatch/Schedules/preprocess-cryolo/extract/job.star b/mdcatch/Schemes/proc-log/extract_ini/job.star
similarity index 70%
rename from mdcatch/Schedules/preprocess-cryolo/extract/job.star
rename to mdcatch/Schemes/proc-log/extract_ini/job.star
index bbd907a..eccf66f 100644
--- a/mdcatch/Schedules/preprocess-cryolo/extract/job.star
+++ b/mdcatch/Schemes/proc-log/extract_ini/job.star
@@ -3,8 +3,9 @@
 
 data_job
 
-_rlnJobType                             5
+_rlnJobTypeLabel             relion.extract
 _rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
  
 
 # version 30001
@@ -14,12 +15,14 @@ data_joboptions_values
 loop_ 
 _rlnJobOptionVariable #1 
 _rlnJobOptionValue #2 
-bg_diameter $$mask_diam_px 
+bg_diameter         -1 
 black_dust         -1 
-coords_suffix Schedules/preprocess-cryolo/cryolopicker/coords_suffix_cryolo.star
+coords_suffix Schemes/proc-log/inipicker/autopick.star
 do_cut_into_segments        Yes 
 do_extract_helical_tubes        Yes 
 do_extract_helix         No 
+do_float16        Yes
+do_fom_threshold         No 
  do_invert        Yes 
    do_norm        Yes 
   do_queue         No 
@@ -27,14 +30,15 @@ do_recenter         No
 do_reextract         No 
 do_rescale        Yes 
 do_reset_offsets         No 
-extract_size $$box_size 
+extract_size        166 
 fndata_reextract         "" 
 helical_bimodal_angular_priors        Yes 
 helical_nr_asu          1 
 helical_rise          1 
 helical_tube_outer_diameter        200 
 min_dedicated         24 
-    nr_mpi          5 
+minimum_pick_fom          0 
+    nr_mpi          5
 other_args         "" 
       qsub       qsub 
 qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
@@ -42,7 +46,7 @@ qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh
 recenter_x          0 
 recenter_y          0 
 recenter_z          0 
-   rescale $$box_size_bin 
- star_mics Schedules/preprocess-cryolo/ctffind/micrographs_ctf.star
+   rescale         48 
+ star_mics Schemes/proc-log/select_mics/micrographs.star
 white_dust         -1 
  
diff --git a/mdcatch/Schemes/proc-log/extract_rest/job.star b/mdcatch/Schemes/proc-log/extract_rest/job.star
new file mode 100644
index 0000000..fff207a
--- /dev/null
+++ b/mdcatch/Schemes/proc-log/extract_rest/job.star
@@ -0,0 +1,53 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             Extract
+_rlnJobTypeLabel             relion.extract
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+bg_diameter         -1 
+black_dust         -1 
+coords_suffix Schemes/proc-log/restpicker/autopick.star
+do_cut_into_segments        Yes 
+do_extract_helical_tubes        Yes 
+do_extract_helix         No 
+do_float16        Yes
+do_fom_threshold        No
+ do_invert        Yes 
+   do_norm        Yes 
+  do_queue         No 
+do_recenter         No 
+do_reextract         No 
+do_rescale        Yes 
+do_reset_offsets         No 
+extract_size        166 
+fndata_reextract         "" 
+helical_bimodal_angular_priors        Yes 
+helical_nr_asu          1 
+helical_rise          1 
+helical_tube_outer_diameter        200 
+min_dedicated         24 
+minimum_pick_fom         -3 
+    nr_mpi          12
+other_args         "" 
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+recenter_x          0 
+recenter_y          0 
+recenter_z          0 
+   rescale         48 
+ star_mics Schemes/proc-log/select_mics/micrographs.star
+white_dust         -1 
+ 
diff --git a/mdcatch/Schemes/proc-log/inimodel3d/job.star b/mdcatch/Schemes/proc-log/inimodel3d/job.star
new file mode 100644
index 0000000..dde61ce
--- /dev/null
+++ b/mdcatch/Schemes/proc-log/inimodel3d/job.star
@@ -0,0 +1,46 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.initialmodel
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+ctf_intact_first_peak         No 
+do_combine_thru_disc         No 
+do_ctf_correction        Yes 
+do_parallel_discio        Yes 
+do_preread_images         No 
+  do_queue         No 
+do_solvent        Yes 
+   fn_cont         "" 
+    fn_img Schemes/proc-log/select_rest/particles.star
+   gpu_ids        0,1 
+min_dedicated         24 
+nr_classes          1 
+   nr_iter        100 
+    nr_mpi          1 
+   nr_pool         30 
+nr_threads         12 
+offset_range          6 
+offset_step          2 
+other_args         "" 
+particle_diameter        200 
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+  sampling "15 degrees" 
+scratch_dir       "/ssd"
+skip_gridding        Yes 
+  sym_name         C1
+   use_gpu        Yes 
+ 
diff --git a/mdcatch/Schemes/proc-log/inipicker/job.star b/mdcatch/Schemes/proc-log/inipicker/job.star
new file mode 100644
index 0000000..2214dff
--- /dev/null
+++ b/mdcatch/Schemes/proc-log/inipicker/job.star
@@ -0,0 +1,70 @@
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.autopick
+_rlnJobIsContinue                       0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+    angpix         -1 
+angpix_ref         -1 
+do_amyloid         No 
+do_ctf_autopick        Yes 
+do_ignore_first_ctfpeak_autopick         No 
+do_invert_refs        Yes 
+    do_log        Yes 
+do_pick_helical_segments         No 
+  do_queue         No 
+do_read_fom_maps         No 
+  do_ref3d         No 
+   do_refs         No 
+  do_topaz         No 
+do_topaz_pick         No 
+do_topaz_train         No 
+do_topaz_train_parts         No 
+do_write_fom_maps         No 
+fn_input_autopick Schemes/proc-log/select_mics/micrographs.star
+fn_ref3d_autopick         "" 
+fn_refs_autopick         "" 
+   gpu_ids         "" 
+helical_nr_asu          1 
+helical_rise         -1 
+helical_tube_kappa_max        0.1 
+helical_tube_length_min         -1 
+helical_tube_outer_diameter        200 
+  highpass         -1 
+log_adjust_thr        0.0 
+log_diam_max      100.0 
+log_diam_min       80.0 
+log_invert         No 
+log_maxres         20 
+log_upper_thr        999 
+   lowpass         20 
+maxstddevnoise_autopick         -1 
+min_dedicated         24 
+minavgnoise_autopick       -999 
+mindist_autopick        100 
+    nr_mpi          1 
+other_args         "" 
+psi_sampling_autopick          5 
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+ref3d_sampling "30 degrees" 
+ref3d_symmetry         C1 
+    shrink          0 
+threshold_autopick       0.05 
+topaz_model         "" 
+topaz_nr_particles         -1 
+topaz_other_args         "" 
+topaz_particle_diameter         -1 
+topaz_train_parts         "" 
+topaz_train_picks         "" 
+   use_gpu         No
diff --git a/mdcatch/Schemes/proc-log/refine3d/job.star b/mdcatch/Schemes/proc-log/refine3d/job.star
new file mode 100644
index 0000000..abdff5d
--- /dev/null
+++ b/mdcatch/Schemes/proc-log/refine3d/job.star
@@ -0,0 +1,73 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.refine3d
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+auto_faster        Yes 
+auto_local_sampling "1.8 degrees" 
+ctf_intact_first_peak         No 
+do_apply_helical_symmetry        Yes 
+do_combine_thru_disc         No 
+do_ctf_correction        Yes 
+  do_helix         No 
+do_local_search_helical_symmetry         No 
+   do_pad1         No 
+do_parallel_discio        Yes 
+do_preread_images         No 
+  do_queue         No 
+do_solvent_fsc         No 
+do_zero_mask        Yes 
+   fn_cont         "" 
+    fn_img Schemes/proc-log/select_rest/particles.star
+   fn_mask         "" 
+    fn_ref $$myref
+   gpu_ids        0:1 
+helical_nr_asu          1 
+helical_range_distance         -1 
+helical_rise_inistep          0 
+helical_rise_initial          0 
+helical_rise_max          0 
+helical_rise_min          0 
+helical_tube_inner_diameter         -1 
+helical_tube_outer_diameter         -1 
+helical_twist_inistep          0 
+helical_twist_initial          0 
+helical_twist_max          0 
+helical_twist_min          0 
+helical_z_percentage         30 
+  ini_high         40 
+keep_tilt_prior_fixed        Yes 
+min_dedicated         24 
+    nr_mpi          3 
+   nr_pool         30 
+nr_threads         8 
+offset_range          5 
+offset_step          1 
+other_args         "" 
+particle_diameter        200 
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+ range_psi         10 
+ range_rot         -1 
+range_tilt         15 
+ref_correct_greyscale        Yes 
+ relax_sym         "" 
+  sampling "7.5 degrees" 
+scratch_dir       "/ssd"
+skip_gridding        Yes 
+  sym_name         C1
+   use_gpu        Yes 
+ 
diff --git a/mdcatch/Schemes/proc-log/restpicker/job.star b/mdcatch/Schemes/proc-log/restpicker/job.star
new file mode 100644
index 0000000..0712d97
--- /dev/null
+++ b/mdcatch/Schemes/proc-log/restpicker/job.star
@@ -0,0 +1,73 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.autopick.topaz.pick
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+    angpix         -1 
+angpix_ref         -1 
+do_amyloid         No 
+do_ctf_autopick        Yes 
+do_ignore_first_ctfpeak_autopick         No 
+do_invert_refs        Yes 
+    do_log         No 
+do_pick_helical_segments         No 
+  do_queue         No 
+do_read_fom_maps         No 
+  do_ref3d        Yes 
+   do_refs         No 
+  do_topaz        Yes 
+do_topaz_pick        Yes 
+do_topaz_train         No 
+do_topaz_train_parts         No 
+do_write_fom_maps         No 
+fn_input_autopick Schemes/proc-log/select_mics/micrographs.star
+fn_ref3d_autopick         "" 
+fn_refs_autopick         "" 
+   gpu_ids          0
+helical_nr_asu          1 
+helical_rise         -1 
+helical_tube_kappa_max        0.1 
+helical_tube_length_min         -1 
+helical_tube_outer_diameter        200 
+  highpass         -1 
+log_adjust_thr          0 
+log_diam_max        180 
+log_diam_min        150 
+log_invert         No 
+log_maxres         20 
+log_upper_thr        999 
+   lowpass         20 
+maxstddevnoise_autopick         "" 
+min_dedicated         24 
+minavgnoise_autopick         "" 
+mindist_autopick         "" 
+    nr_mpi          1
+other_args         "" 
+psi_sampling_autopick          5 
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+ref3d_sampling "30 degrees" 
+ref3d_symmetry         "" 
+    shrink          0 
+threshold_autopick         "" 
+topaz_model $$topaz_model 
+topaz_nr_particles        300
+topaz_other_args         "--threshold 0" 
+topaz_particle_diameter      100.0 
+topaz_train_parts         "" 
+topaz_train_picks         "" 
+   use_gpu        Yes 
+ 
diff --git a/mdcatch/Schemes/proc-log/scheme.star b/mdcatch/Schemes/proc-log/scheme.star
new file mode 100644
index 0000000..4c611fc
--- /dev/null
+++ b/mdcatch/Schemes/proc-log/scheme.star
@@ -0,0 +1,145 @@
+
+
+# version 30001
+
+data_scheme_general
+
+_rlnSchemeName                       Schemes/proc-log/
+_rlnSchemeCurrentNodeName            WAIT
+ 
+
+# version 30001
+
+data_scheme_floats
+
+loop_ 
+_rlnSchemeFloatVariableName #1
+_rlnSchemeFloatVariableValue #2
+_rlnSchemeFloatVariableResetValue #3
+current_ini_size     0.000000     0.000000 
+current_rest_size     0.000000     0.000000 
+inibatch_size 10000.000000 10000.000000 
+maxtime_hr    8.000000    8.000000
+prev_rest_size     0.000000     0.000000 
+wait_sec   60.000000   60.000000 
+ 
+
+# version 30001
+
+data_scheme_bools
+
+loop_ 
+_rlnSchemeBooleanVariableName #1
+_rlnSchemeBooleanVariableValue #2
+_rlnSchemeBooleanVariableResetValue #3
+has_ctffind 0 0
+do_prep 1 1 
+do_2d 1 1 
+do_3d 0 0 
+has_larger_rest_size            0            0 
+do_retrain_topaz            1            1 
+has_topaz_model            0            0 
+inibatch_big_enough            0            0
+has_iniref            0            0  
+ 
+
+# version 30001
+
+data_scheme_strings
+
+loop_ 
+_rlnSchemeStringVariableName #1
+_rlnSchemeStringVariableValue #2
+_rlnSchemeStringVariableResetValue #3
+ctffind_mics Schemes/prep/ctffind/micrographs_ctf.star Schemes/prep/ctffind/micrographs_ctf.star
+ini_batch Schemes/proc-log/split_ini/particles_split1.star Schemes/proc-log/split_ini/particles_split1.star
+particles  particles  particles 
+rest_batch Schemes/proc-log/extract_rest/particles.star Schemes/proc-log/extract_rest/particles.star
+topaz_model Schemes/proc-log/train_topaz/model_epoch10.sav Schemes/proc-log/train_topaz/model_epoch10.sav
+iniref None None
+myref undefined undefined
+inimodel_output Schemes/proc-log/inimodel3d/initial_model.mrc Schemes/proc-log/inimodel3d/initial_model.mrc
+
+# version 30001
+
+data_scheme_operators
+
+loop_ 
+_rlnSchemeOperatorName #1
+_rlnSchemeOperatorType #2
+_rlnSchemeOperatorOutput #3
+_rlnSchemeOperatorInput1 #4
+_rlnSchemeOperatorInput2 #5
+HAS_ctffind bool=file_exists has_ctffind ctffind_mics undefined
+CHECK_ini    bool=ge inibatch_big_enough current_ini_size inibatch_size
+CHECK_iniref  bool=file_exists has_iniref iniref  undefined 
+COUNT_ini float=count_images current_ini_size   ini_batch  particles 
+COUNT_restbatch float=count_images current_rest_size rest_batch  particles 
+EXIT_maxtime exit_maxtime  undefined    maxtime_hr  undefined 
+HAS_rest_increased    bool=gt has_larger_rest_size current_rest_size prev_rest_size 
+HAS_topaz_model bool=file_exists has_topaz_model topaz_model  undefined 
+SET_prev_rest_size  float=set prev_rest_size current_rest_size  undefined 
+SET_myref_user string=set myref iniref undefined
+SET_myref_inimodel string=set myref inimodel_output undefined
+WAIT       wait  undefined   wait_sec  undefined 
+ 
+
+# version 30001
+
+data_scheme_jobs
+
+loop_ 
+_rlnSchemeJobNameOriginal #1
+_rlnSchemeJobName #2
+_rlnSchemeJobMode #3
+_rlnSchemeJobHasStarted #4
+select_mics select_mics continue    0
+inipicker  inipicker   continue            0 
+extract_ini extract_ini   continue            0 
+split_ini split_ini   continue            0 
+class2d_ini class2d_ini        new            0 
+select_ini select_ini        new            0 
+train_topaz train_topaz        new            0 
+restpicker restpicker   continue            0 
+extract_rest extract_rest   continue            0 
+class2d_rest class2d_rest        new            0 
+select_rest select_rest        new            0 
+inimodel3d inimodel3d        new            0 
+refine3d   refine3d        new            0 
+ 
+
+# version 30001
+
+data_scheme_edges
+
+loop_ 
+_rlnSchemeEdgeInputNodeName #1
+_rlnSchemeEdgeOutputNodeName #2
+_rlnSchemeEdgeIsFork #3
+_rlnSchemeEdgeOutputNodeNameIfTrue #4
+_rlnSchemeEdgeBooleanVariable #5
+WAIT HAS_ctffind              0  undefined  undefined 
+HAS_ctffind WAIT             1 EXIT_maxtime has_ctffind
+EXIT_maxtime select_mics              0  undefined  undefined 
+select_mics restpicker            1 HAS_topaz_model do_retrain_topaz
+HAS_topaz_model  inipicker            1 restpicker has_topaz_model 
+inipicker extract_ini            0  undefined  undefined 
+extract_ini split_ini            0  undefined  undefined 
+split_ini COUNT_ini            0  undefined  undefined 
+COUNT_ini CHECK_ini            0  undefined  undefined 
+CHECK_ini       WAIT            1 class2d_ini inibatch_big_enough 
+class2d_ini select_ini            0  undefined  undefined 
+select_ini train_topaz            0  undefined  undefined 
+train_topaz       WAIT            0  undefined  undefined 
+restpicker extract_rest           0  undefined  undefined 
+extract_rest COUNT_restbatch       0  undefined  undefined 
+COUNT_restbatch HAS_rest_increased            0  undefined  undefined 
+HAS_rest_increased       WAIT            1 class2d_rest has_larger_rest_size 
+class2d_rest select_rest            0  undefined  undefined 
+select_rest   SET_prev_rest_size         0  undefined  undefined 
+SET_prev_rest_size  WAIT       1 CHECK_iniref  do_3d 
+CHECK_iniref inimodel3d 1 SET_myref_user has_iniref
+inimodel3d SET_myref_inimodel            0  undefined  undefined 
+SET_myref_inimodel   refine3d            0  undefined  undefined
+SET_myref_user refine3d            0  undefined  undefined 
+refine3d WAIT            0  undefined  undefined 
diff --git a/mdcatch/Schemes/proc-log/select_ini/job.star b/mdcatch/Schemes/proc-log/select_ini/job.star
new file mode 100644
index 0000000..60d2573
--- /dev/null
+++ b/mdcatch/Schemes/proc-log/select_ini/job.star
@@ -0,0 +1,47 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.select.class2dauto
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+discard_label rlnImageName 
+discard_sigma          4 
+do_class_ranker        Yes 
+do_discard         No 
+  do_queue         No 
+ do_random         No 
+do_recenter         No 
+do_regroup         No 
+do_remove_duplicates         No 
+do_select_values         No 
+  do_split         No 
+duplicate_threshold         30 
+   fn_data         "" 
+    fn_mic         "" 
+  fn_model Schemes/proc-log/class2d_ini/run_it020_optimiser.star
+image_angpix         -1 
+min_dedicated         24 
+ nr_groups          1 
+  nr_split         -1 
+other_args         ""
+python_exe         $RELION_PYTHON
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+rank_threshold       0.35 
+select_label rlnCtfMaxResolution 
+select_maxval      9999. 
+select_minval     -9999. 
+split_size        100 
+ 
diff --git a/mdcatch/Schemes/proc-log/select_mics/job.star b/mdcatch/Schemes/proc-log/select_mics/job.star
new file mode 100644
index 0000000..d62f7b4
--- /dev/null
+++ b/mdcatch/Schemes/proc-log/select_mics/job.star
@@ -0,0 +1,47 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.select.onvalue
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+discard_label rlnImageName 
+discard_sigma          4 
+do_class_ranker        No 
+do_discard         No 
+  do_queue         No 
+ do_random         No 
+do_recenter         No 
+do_regroup         No 
+do_remove_duplicates         No 
+do_select_values        Yes 
+  do_split         No 
+duplicate_threshold         30 
+   fn_data         "" 
+    fn_mic $$ctffind_mics
+  fn_model         "" 
+image_angpix         -1 
+min_dedicated         24 
+ nr_groups          1 
+  nr_split         -1 
+other_args         ""
+python_exe         ""
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+rank_threshold       0.35 
+select_label rlnCtfMaxResolution 
+select_maxval          6 
+select_minval     -9999. 
+split_size        100 
+ 
diff --git a/mdcatch/Schemes/proc-log/select_rest/job.star b/mdcatch/Schemes/proc-log/select_rest/job.star
new file mode 100644
index 0000000..6064dfe
--- /dev/null
+++ b/mdcatch/Schemes/proc-log/select_rest/job.star
@@ -0,0 +1,47 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.select.class2dauto
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+discard_label rlnImageName 
+discard_sigma          4 
+do_class_ranker        Yes 
+do_discard         No 
+  do_queue         No 
+ do_random         No 
+do_recenter         No 
+do_regroup         No 
+do_remove_duplicates         No 
+do_select_values         No 
+  do_split         No 
+duplicate_threshold         30 
+   fn_data         "" 
+    fn_mic         "" 
+  fn_model Schemes/proc-log/class2d_rest/run_it100_optimiser.star
+image_angpix         -1 
+min_dedicated         24 
+ nr_groups          1 
+  nr_split         -1 
+other_args         ""
+python_exe         $RELION_PYTHON
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+rank_threshold       0.45 
+select_label rlnCtfMaxResolution 
+select_maxval      9999. 
+select_minval     -9999. 
+split_size        100 
+ 
diff --git a/mdcatch/Schemes/proc-log/split_ini/job.star b/mdcatch/Schemes/proc-log/split_ini/job.star
new file mode 100644
index 0000000..12dc6b5
--- /dev/null
+++ b/mdcatch/Schemes/proc-log/split_ini/job.star
@@ -0,0 +1,47 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.select.split
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+discard_label rlnImageName 
+discard_sigma          4 
+do_class_ranker         No 
+do_discard         No 
+  do_queue         No 
+ do_random         No 
+do_recenter         No 
+do_regroup         No 
+do_remove_duplicates         No 
+do_select_values         No 
+  do_split        Yes 
+duplicate_threshold         30 
+   fn_data Schemes/proc-log/extract_ini/particles.star
+    fn_mic         "" 
+  fn_model         "" 
+image_angpix         -1 
+min_dedicated         24 
+ nr_groups          1 
+  nr_split         -1 
+other_args         ""
+python_exe         ""
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+rank_threshold        0.5 
+select_label rlnCtfFigureOfMerit 
+select_maxval      9999. 
+select_minval     -9999. 
+split_size      10000 
+ 
diff --git a/mdcatch/Schemes/proc-log/train_topaz/job.star b/mdcatch/Schemes/proc-log/train_topaz/job.star
new file mode 100644
index 0000000..1e9e7ef
--- /dev/null
+++ b/mdcatch/Schemes/proc-log/train_topaz/job.star
@@ -0,0 +1,73 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.autopick.topaz.train
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+    angpix         -1 
+angpix_ref         -1 
+do_amyloid         No 
+do_ctf_autopick        Yes 
+do_ignore_first_ctfpeak_autopick         No 
+do_invert_refs        Yes 
+    do_log         No 
+do_pick_helical_segments         No 
+  do_queue         No 
+do_read_fom_maps         No 
+  do_ref3d         No 
+   do_refs         No 
+  do_topaz        Yes 
+do_topaz_pick         No 
+do_topaz_train        Yes 
+do_topaz_train_parts        Yes 
+do_write_fom_maps         No 
+fn_input_autopick Schemes/proc-log/select_mics/micrographs.star
+fn_ref3d_autopick         "" 
+fn_refs_autopick         "" 
+   gpu_ids          0 
+helical_nr_asu          1 
+helical_rise         -1 
+helical_tube_kappa_max        0.1 
+helical_tube_length_min         -1 
+helical_tube_outer_diameter        200 
+  highpass         -1 
+log_adjust_thr          0 
+log_diam_max        180 
+log_diam_min        150 
+log_invert         No 
+log_maxres         20 
+log_upper_thr          5 
+   lowpass         20 
+maxstddevnoise_autopick        1.1 
+min_dedicated         24 
+minavgnoise_autopick       -999 
+mindist_autopick        100 
+    nr_mpi          1 
+other_args         "" 
+psi_sampling_autopick          5 
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+ref3d_sampling "30 degrees" 
+ref3d_symmetry         C1 
+    shrink          0 
+threshold_autopick       0.05 
+topaz_model         "" 
+topaz_nr_particles        300
+topaz_other_args         "" 
+topaz_particle_diameter      100.0 
+topaz_train_parts Schemes/proc-log/select_ini/particles.star
+topaz_train_picks         "" 
+   use_gpu        Yes 
+ 
diff --git a/mdcatch/Schemes/proc-topaz/class2d_ini/job.star b/mdcatch/Schemes/proc-topaz/class2d_ini/job.star
new file mode 100644
index 0000000..ef70976
--- /dev/null
+++ b/mdcatch/Schemes/proc-topaz/class2d_ini/job.star
@@ -0,0 +1,55 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.class2d
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+allow_coarser         No 
+ctf_intact_first_peak         No 
+do_bimodal_psi        Yes 
+do_combine_thru_disc         No 
+do_ctf_correction        Yes 
+   do_grad         No
+  do_helix         No 
+do_parallel_discio        Yes 
+do_preread_images         No 
+  do_queue         No 
+do_restrict_xoff        Yes 
+do_zero_mask        Yes 
+dont_skip_align        Yes 
+   fn_cont         "" 
+    fn_img $$ini_batch 
+   gpu_ids        "0:1" 
+helical_rise       4.75 
+helical_tube_outer_diameter        200 
+highres_limit         -1 
+min_dedicated         24 
+nr_classes        25
+   nr_iter        20 
+    nr_mpi          3
+   nr_pool         30 
+nr_threads         6
+offset_range          5 
+offset_step          1 
+other_args         "" 
+particle_diameter      110.0 
+psi_sampling          6 
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+ range_psi          6 
+scratch_dir         "/ssd"
+ tau_fudge          2 
+   use_gpu        Yes 
+ 
diff --git a/mdcatch/Schemes/proc-topaz/class2d_rest/job.star b/mdcatch/Schemes/proc-topaz/class2d_rest/job.star
new file mode 100644
index 0000000..c1e823c
--- /dev/null
+++ b/mdcatch/Schemes/proc-topaz/class2d_rest/job.star
@@ -0,0 +1,55 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.class2d
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+allow_coarser         No 
+ctf_intact_first_peak         No 
+do_bimodal_psi        Yes 
+do_combine_thru_disc         No 
+do_ctf_correction        Yes 
+   do_grad        Yes 
+  do_helix         No 
+do_parallel_discio        Yes 
+do_preread_images         No 
+  do_queue         No 
+do_restrict_xoff        Yes 
+do_zero_mask        Yes 
+dont_skip_align        Yes 
+   fn_cont         "" 
+    fn_img Schemes/proc-topaz/extract_rest/particles.star
+   gpu_ids        "0,1"
+helical_rise       4.75 
+helical_tube_outer_diameter        200 
+highres_limit         -1 
+min_dedicated         24 
+nr_classes        50
+   nr_iter        100 
+    nr_mpi          1 
+   nr_pool         30 
+nr_threads         12 
+offset_range          5 
+offset_step          1 
+other_args         "" 
+particle_diameter      110.0 
+psi_sampling          6 
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+ range_psi          6 
+scratch_dir         "/ssd"
+ tau_fudge          2 
+   use_gpu        Yes 
+ 
diff --git a/mdcatch/Schedules/preprocess-topaz/extract/job.star b/mdcatch/Schemes/proc-topaz/extract_ini/job.star
similarity index 69%
rename from mdcatch/Schedules/preprocess-topaz/extract/job.star
rename to mdcatch/Schemes/proc-topaz/extract_ini/job.star
index 4892100..e1fe1f5 100644
--- a/mdcatch/Schedules/preprocess-topaz/extract/job.star
+++ b/mdcatch/Schemes/proc-topaz/extract_ini/job.star
@@ -3,8 +3,9 @@
 
 data_job
 
-_rlnJobType                             5
+_rlnJobTypeLabel             relion.extract
 _rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
  
 
 # version 30001
@@ -14,12 +15,14 @@ data_joboptions_values
 loop_ 
 _rlnJobOptionVariable #1 
 _rlnJobOptionValue #2 
-bg_diameter $$mask_diam_px 
+bg_diameter         -1 
 black_dust         -1 
-coords_suffix Schedules/preprocess-topaz/topazpicker/coords_suffix_topaz.star
+coords_suffix Schemes/proc-topaz/inipicker/autopick.star
 do_cut_into_segments        Yes 
 do_extract_helical_tubes        Yes 
 do_extract_helix         No 
+do_float16        Yes
+do_fom_threshold         No 
  do_invert        Yes 
    do_norm        Yes 
   do_queue         No 
@@ -27,14 +30,15 @@ do_recenter         No
 do_reextract         No 
 do_rescale        Yes 
 do_reset_offsets         No 
-extract_size $$box_size 
+extract_size        166 
 fndata_reextract         "" 
 helical_bimodal_angular_priors        Yes 
 helical_nr_asu          1 
 helical_rise          1 
 helical_tube_outer_diameter        200 
 min_dedicated         24 
-    nr_mpi          5 
+minimum_pick_fom          0 
+    nr_mpi          5
 other_args         "" 
       qsub       qsub 
 qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
@@ -42,7 +46,7 @@ qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh
 recenter_x          0 
 recenter_y          0 
 recenter_z          0 
-   rescale $$box_size_bin 
- star_mics Schedules/preprocess-topaz/ctffind/micrographs_ctf.star
+   rescale         48 
+ star_mics Schemes/proc-topaz/select_mics/micrographs.star
 white_dust         -1 
  
diff --git a/mdcatch/Schemes/proc-topaz/extract_rest/job.star b/mdcatch/Schemes/proc-topaz/extract_rest/job.star
new file mode 100644
index 0000000..16c185f
--- /dev/null
+++ b/mdcatch/Schemes/proc-topaz/extract_rest/job.star
@@ -0,0 +1,53 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             Extract
+_rlnJobTypeLabel             relion.extract
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+bg_diameter         -1 
+black_dust         -1 
+coords_suffix Schemes/proc-topaz/restpicker/autopick.star
+do_cut_into_segments        Yes 
+do_extract_helical_tubes        Yes 
+do_extract_helix         No 
+do_float16        Yes
+do_fom_threshold        No
+ do_invert        Yes 
+   do_norm        Yes 
+  do_queue         No 
+do_recenter         No 
+do_reextract         No 
+do_rescale        Yes 
+do_reset_offsets         No 
+extract_size        166 
+fndata_reextract         "" 
+helical_bimodal_angular_priors        Yes 
+helical_nr_asu          1 
+helical_rise          1 
+helical_tube_outer_diameter        200 
+min_dedicated         24 
+minimum_pick_fom         -3 
+    nr_mpi          12
+other_args         "" 
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+recenter_x          0 
+recenter_y          0 
+recenter_z          0 
+   rescale         48 
+ star_mics Schemes/proc-topaz/select_mics/micrographs.star
+white_dust         -1 
+ 
diff --git a/mdcatch/Schemes/proc-topaz/inimodel3d/job.star b/mdcatch/Schemes/proc-topaz/inimodel3d/job.star
new file mode 100644
index 0000000..abd6238
--- /dev/null
+++ b/mdcatch/Schemes/proc-topaz/inimodel3d/job.star
@@ -0,0 +1,46 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.initialmodel
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+ctf_intact_first_peak         No 
+do_combine_thru_disc         No 
+do_ctf_correction        Yes 
+do_parallel_discio        Yes 
+do_preread_images         No 
+  do_queue         No 
+do_solvent        Yes 
+   fn_cont         "" 
+    fn_img Schemes/proc-topaz/select_rest/particles.star
+   gpu_ids        0,1 
+min_dedicated         24 
+nr_classes          1 
+   nr_iter        100 
+    nr_mpi          1 
+   nr_pool         30 
+nr_threads         12 
+offset_range          6 
+offset_step          2 
+other_args         "" 
+particle_diameter        200 
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+  sampling "15 degrees" 
+scratch_dir       "/ssd"
+skip_gridding        Yes 
+  sym_name         C1
+   use_gpu        Yes 
+ 
diff --git a/mdcatch/Schemes/proc-topaz/inipicker/job.star b/mdcatch/Schemes/proc-topaz/inipicker/job.star
new file mode 100644
index 0000000..9ff10e6
--- /dev/null
+++ b/mdcatch/Schemes/proc-topaz/inipicker/job.star
@@ -0,0 +1,73 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.autopick.topaz.pick
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+    angpix         -1 
+angpix_ref         -1 
+do_amyloid         No 
+do_ctf_autopick        Yes 
+do_ignore_first_ctfpeak_autopick         No 
+do_invert_refs        Yes 
+    do_log        No
+do_pick_helical_segments         No 
+  do_queue         No 
+do_read_fom_maps         No 
+  do_ref3d         No 
+   do_refs         No 
+  do_topaz         Yes
+do_topaz_pick         Yes
+do_topaz_train         No 
+do_topaz_train_parts         No 
+do_write_fom_maps         No 
+fn_input_autopick Schemes/proc-topaz/select_mics/micrographs.star
+fn_ref3d_autopick         "" 
+fn_refs_autopick         "" 
+   gpu_ids         0
+helical_nr_asu          1 
+helical_rise         -1 
+helical_tube_kappa_max        0.1 
+helical_tube_length_min         -1 
+helical_tube_outer_diameter        200 
+  highpass         -1 
+log_adjust_thr        0.0 
+log_diam_max      180.0 
+log_diam_min      150.0 
+log_invert         No 
+log_maxres         20 
+log_upper_thr        5 
+   lowpass         20 
+maxstddevnoise_autopick         -1 
+min_dedicated         24 
+minavgnoise_autopick       -999 
+mindist_autopick        100 
+    nr_mpi          1 
+other_args         "" 
+psi_sampling_autopick          5 
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+ref3d_sampling "30 degrees" 
+ref3d_symmetry         C1 
+    shrink          0 
+threshold_autopick       0.05 
+topaz_model         "" 
+topaz_nr_particles         300
+topaz_other_args         "--threshold 0"
+topaz_particle_diameter         -1 
+topaz_train_parts         "" 
+topaz_train_picks         "" 
+   use_gpu         Yes
+ 
diff --git a/mdcatch/Schemes/proc-topaz/refine3d/job.star b/mdcatch/Schemes/proc-topaz/refine3d/job.star
new file mode 100644
index 0000000..62e3baa
--- /dev/null
+++ b/mdcatch/Schemes/proc-topaz/refine3d/job.star
@@ -0,0 +1,73 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.refine3d
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+auto_faster        Yes 
+auto_local_sampling "1.8 degrees" 
+ctf_intact_first_peak         No 
+do_apply_helical_symmetry        Yes 
+do_combine_thru_disc         No 
+do_ctf_correction        Yes 
+  do_helix         No 
+do_local_search_helical_symmetry         No 
+   do_pad1         No 
+do_parallel_discio        Yes 
+do_preread_images         No 
+  do_queue         No 
+do_solvent_fsc         No 
+do_zero_mask        Yes 
+   fn_cont         "" 
+    fn_img Schemes/proc-topaz/select_rest/particles.star
+   fn_mask         "" 
+    fn_ref $$myref
+   gpu_ids        0:1 
+helical_nr_asu          1 
+helical_range_distance         -1 
+helical_rise_inistep          0 
+helical_rise_initial          0 
+helical_rise_max          0 
+helical_rise_min          0 
+helical_tube_inner_diameter         -1 
+helical_tube_outer_diameter         -1 
+helical_twist_inistep          0 
+helical_twist_initial          0 
+helical_twist_max          0 
+helical_twist_min          0 
+helical_z_percentage         30 
+  ini_high         40 
+keep_tilt_prior_fixed        Yes 
+min_dedicated         24 
+    nr_mpi          3 
+   nr_pool         30 
+nr_threads         8 
+offset_range          5 
+offset_step          1 
+other_args         "" 
+particle_diameter        200 
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+ range_psi         10 
+ range_rot         -1 
+range_tilt         15 
+ref_correct_greyscale        Yes 
+ relax_sym         "" 
+  sampling "7.5 degrees" 
+scratch_dir       "/ssd"
+skip_gridding        Yes 
+  sym_name         C1
+   use_gpu        Yes 
+ 
diff --git a/mdcatch/Schemes/proc-topaz/restpicker/job.star b/mdcatch/Schemes/proc-topaz/restpicker/job.star
new file mode 100644
index 0000000..292d882
--- /dev/null
+++ b/mdcatch/Schemes/proc-topaz/restpicker/job.star
@@ -0,0 +1,73 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.autopick.topaz.pick
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+    angpix         -1 
+angpix_ref         -1 
+do_amyloid         No 
+do_ctf_autopick        Yes 
+do_ignore_first_ctfpeak_autopick         No 
+do_invert_refs        Yes 
+    do_log         No 
+do_pick_helical_segments         No 
+  do_queue         No 
+do_read_fom_maps         No 
+  do_ref3d        Yes 
+   do_refs         No 
+  do_topaz        Yes 
+do_topaz_pick        Yes 
+do_topaz_train         No 
+do_topaz_train_parts         No 
+do_write_fom_maps         No 
+fn_input_autopick Schemes/proc-topaz/select_mics/micrographs.star
+fn_ref3d_autopick         "" 
+fn_refs_autopick         "" 
+   gpu_ids          0
+helical_nr_asu          1 
+helical_rise         -1 
+helical_tube_kappa_max        0.1 
+helical_tube_length_min         -1 
+helical_tube_outer_diameter        200 
+  highpass         -1 
+log_adjust_thr          0 
+log_diam_max        180 
+log_diam_min        150 
+log_invert         No 
+log_maxres         20 
+log_upper_thr        999 
+   lowpass         20 
+maxstddevnoise_autopick         "" 
+min_dedicated         24 
+minavgnoise_autopick         "" 
+mindist_autopick         "" 
+    nr_mpi          1
+other_args         "" 
+psi_sampling_autopick          5 
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+ref3d_sampling "30 degrees" 
+ref3d_symmetry         "" 
+    shrink          0 
+threshold_autopick         "" 
+topaz_model $$topaz_model 
+topaz_nr_particles        300
+topaz_other_args         "--threshold 0" 
+topaz_particle_diameter      100.0 
+topaz_train_parts         "" 
+topaz_train_picks         "" 
+   use_gpu        Yes 
+ 
diff --git a/mdcatch/Schemes/proc-topaz/scheme.star b/mdcatch/Schemes/proc-topaz/scheme.star
new file mode 100644
index 0000000..58dec7b
--- /dev/null
+++ b/mdcatch/Schemes/proc-topaz/scheme.star
@@ -0,0 +1,145 @@
+
+
+# version 30001
+
+data_scheme_general
+
+_rlnSchemeName                       Schemes/proc-topaz/
+_rlnSchemeCurrentNodeName            WAIT
+ 
+
+# version 30001
+
+data_scheme_floats
+
+loop_ 
+_rlnSchemeFloatVariableName #1
+_rlnSchemeFloatVariableValue #2
+_rlnSchemeFloatVariableResetValue #3
+current_ini_size     0.000000     0.000000 
+current_rest_size     0.000000     0.000000 
+inibatch_size 10000.000000 10000.000000 
+maxtime_hr    8.000000    8.000000
+prev_rest_size     0.000000     0.000000 
+wait_sec   60.000000   60.000000 
+ 
+
+# version 30001
+
+data_scheme_bools
+
+loop_ 
+_rlnSchemeBooleanVariableName #1
+_rlnSchemeBooleanVariableValue #2
+_rlnSchemeBooleanVariableResetValue #3
+has_ctffind 0 0
+do_prep 1 1 
+do_2d 1 1 
+do_3d 0 0 
+has_larger_rest_size            0            0 
+do_retrain_topaz            1            1 
+has_topaz_model            0            0 
+inibatch_big_enough            0            0
+has_iniref            0            0  
+ 
+
+# version 30001
+
+data_scheme_strings
+
+loop_ 
+_rlnSchemeStringVariableName #1
+_rlnSchemeStringVariableValue #2
+_rlnSchemeStringVariableResetValue #3
+ctffind_mics Schemes/prep/ctffind/micrographs_ctf.star Schemes/prep/ctffind/micrographs_ctf.star
+ini_batch Schemes/proc-topaz/split_ini/particles_split1.star Schemes/proc-topaz/split_ini/particles_split1.star
+particles  particles  particles 
+rest_batch Schemes/proc-topaz/extract_rest/particles.star Schemes/proc-topaz/extract_rest/particles.star
+topaz_model Schemes/proc-topaz/train_topaz/model_epoch10.sav Schemes/proc-topaz/train_topaz/model_epoch10.sav
+iniref None None
+myref undefined undefined
+inimodel_output Schemes/proc-topaz/inimodel3d/initial_model.mrc Schemes/proc-topaz/inimodel3d/initial_model.mrc
+
+# version 30001
+
+data_scheme_operators
+
+loop_ 
+_rlnSchemeOperatorName #1
+_rlnSchemeOperatorType #2
+_rlnSchemeOperatorOutput #3
+_rlnSchemeOperatorInput1 #4
+_rlnSchemeOperatorInput2 #5
+HAS_ctffind bool=file_exists has_ctffind ctffind_mics undefined
+CHECK_ini    bool=ge inibatch_big_enough current_ini_size inibatch_size
+CHECK_iniref  bool=file_exists has_iniref iniref  undefined 
+COUNT_ini float=count_images current_ini_size   ini_batch  particles 
+COUNT_restbatch float=count_images current_rest_size rest_batch  particles 
+EXIT_maxtime exit_maxtime  undefined    maxtime_hr  undefined 
+HAS_rest_increased    bool=gt has_larger_rest_size current_rest_size prev_rest_size 
+HAS_topaz_model bool=file_exists has_topaz_model topaz_model  undefined 
+SET_prev_rest_size  float=set prev_rest_size current_rest_size  undefined 
+SET_myref_user string=set myref iniref undefined
+SET_myref_inimodel string=set myref inimodel_output undefined
+WAIT       wait  undefined   wait_sec  undefined 
+ 
+
+# version 30001
+
+data_scheme_jobs
+
+loop_ 
+_rlnSchemeJobNameOriginal #1
+_rlnSchemeJobName #2
+_rlnSchemeJobMode #3
+_rlnSchemeJobHasStarted #4
+select_mics select_mics continue    0
+inipicker  inipicker   continue            0 
+extract_ini extract_ini   continue            0 
+split_ini split_ini   continue            0 
+class2d_ini class2d_ini        new            0 
+select_ini select_ini        new            0 
+train_topaz train_topaz        new            0 
+restpicker restpicker   continue            0 
+extract_rest extract_rest   continue            0 
+class2d_rest class2d_rest        new            0 
+select_rest select_rest        new            0 
+inimodel3d inimodel3d        new            0 
+refine3d   refine3d        new            0 
+ 
+
+# version 30001
+
+data_scheme_edges
+
+loop_ 
+_rlnSchemeEdgeInputNodeName #1
+_rlnSchemeEdgeOutputNodeName #2
+_rlnSchemeEdgeIsFork #3
+_rlnSchemeEdgeOutputNodeNameIfTrue #4
+_rlnSchemeEdgeBooleanVariable #5
+WAIT HAS_ctffind              0  undefined  undefined 
+HAS_ctffind WAIT             1 EXIT_maxtime has_ctffind
+EXIT_maxtime select_mics              0  undefined  undefined 
+select_mics restpicker            1 HAS_topaz_model do_retrain_topaz
+HAS_topaz_model  inipicker            1 restpicker has_topaz_model 
+inipicker extract_ini            0  undefined  undefined 
+extract_ini split_ini            0  undefined  undefined 
+split_ini COUNT_ini            0  undefined  undefined 
+COUNT_ini CHECK_ini            0  undefined  undefined 
+CHECK_ini       WAIT            1 class2d_ini inibatch_big_enough 
+class2d_ini select_ini            0  undefined  undefined 
+select_ini train_topaz            0  undefined  undefined 
+train_topaz       WAIT            0  undefined  undefined 
+restpicker extract_rest           0  undefined  undefined 
+extract_rest COUNT_restbatch       0  undefined  undefined 
+COUNT_restbatch HAS_rest_increased            0  undefined  undefined 
+HAS_rest_increased       WAIT            1 class2d_rest has_larger_rest_size 
+class2d_rest select_rest            0  undefined  undefined 
+select_rest   SET_prev_rest_size         0  undefined  undefined 
+SET_prev_rest_size  WAIT       1 CHECK_iniref  do_3d 
+CHECK_iniref inimodel3d 1 SET_myref_user has_iniref
+inimodel3d SET_myref_inimodel            0  undefined  undefined 
+SET_myref_inimodel   refine3d            0  undefined  undefined
+SET_myref_user refine3d            0  undefined  undefined 
+refine3d WAIT            0  undefined  undefined 
diff --git a/mdcatch/Schemes/proc-topaz/select_ini/job.star b/mdcatch/Schemes/proc-topaz/select_ini/job.star
new file mode 100644
index 0000000..5986a0a
--- /dev/null
+++ b/mdcatch/Schemes/proc-topaz/select_ini/job.star
@@ -0,0 +1,47 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.select.class2dauto
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+discard_label rlnImageName 
+discard_sigma          4 
+do_class_ranker        Yes 
+do_discard         No 
+  do_queue         No 
+ do_random         No 
+do_recenter         No 
+do_regroup         No 
+do_remove_duplicates         No 
+do_select_values         No 
+  do_split         No 
+duplicate_threshold         30 
+   fn_data         "" 
+    fn_mic         "" 
+  fn_model Schemes/proc-topaz/class2d_ini/run_it020_optimiser.star
+image_angpix         -1 
+min_dedicated         24 
+ nr_groups          1 
+  nr_split         -1 
+other_args         ""
+python_exe         $RELION_PYTHON
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+rank_threshold       0.35 
+select_label rlnCtfMaxResolution 
+select_maxval      9999. 
+select_minval     -9999. 
+split_size        100 
+ 
diff --git a/mdcatch/Schemes/proc-topaz/select_mics/job.star b/mdcatch/Schemes/proc-topaz/select_mics/job.star
new file mode 100644
index 0000000..d62f7b4
--- /dev/null
+++ b/mdcatch/Schemes/proc-topaz/select_mics/job.star
@@ -0,0 +1,47 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.select.onvalue
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+discard_label rlnImageName 
+discard_sigma          4 
+do_class_ranker        No 
+do_discard         No 
+  do_queue         No 
+ do_random         No 
+do_recenter         No 
+do_regroup         No 
+do_remove_duplicates         No 
+do_select_values        Yes 
+  do_split         No 
+duplicate_threshold         30 
+   fn_data         "" 
+    fn_mic $$ctffind_mics
+  fn_model         "" 
+image_angpix         -1 
+min_dedicated         24 
+ nr_groups          1 
+  nr_split         -1 
+other_args         ""
+python_exe         ""
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+rank_threshold       0.35 
+select_label rlnCtfMaxResolution 
+select_maxval          6 
+select_minval     -9999. 
+split_size        100 
+ 
diff --git a/mdcatch/Schemes/proc-topaz/select_rest/job.star b/mdcatch/Schemes/proc-topaz/select_rest/job.star
new file mode 100644
index 0000000..7c8ec04
--- /dev/null
+++ b/mdcatch/Schemes/proc-topaz/select_rest/job.star
@@ -0,0 +1,47 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.select.class2dauto
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+discard_label rlnImageName 
+discard_sigma          4 
+do_class_ranker        Yes 
+do_discard         No 
+  do_queue         No 
+ do_random         No 
+do_recenter         No 
+do_regroup         No 
+do_remove_duplicates         No 
+do_select_values         No 
+  do_split         No 
+duplicate_threshold         30 
+   fn_data         "" 
+    fn_mic         "" 
+  fn_model Schemes/proc-topaz/class2d_rest/run_it100_optimiser.star
+image_angpix         -1 
+min_dedicated         24 
+ nr_groups          1 
+  nr_split         -1 
+other_args         ""
+python_exe         $RELION_PYTHON
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+rank_threshold       0.45 
+select_label rlnCtfMaxResolution 
+select_maxval      9999. 
+select_minval     -9999. 
+split_size        100 
+ 
diff --git a/mdcatch/Schemes/proc-topaz/split_ini/job.star b/mdcatch/Schemes/proc-topaz/split_ini/job.star
new file mode 100644
index 0000000..cc79bfd
--- /dev/null
+++ b/mdcatch/Schemes/proc-topaz/split_ini/job.star
@@ -0,0 +1,47 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.select.split
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+discard_label rlnImageName 
+discard_sigma          4 
+do_class_ranker         No 
+do_discard         No 
+  do_queue         No 
+ do_random         No 
+do_recenter         No 
+do_regroup         No 
+do_remove_duplicates         No 
+do_select_values         No 
+  do_split        Yes 
+duplicate_threshold         30 
+   fn_data Schemes/proc-topaz/extract_ini/particles.star
+    fn_mic         "" 
+  fn_model         "" 
+image_angpix         -1 
+min_dedicated         24 
+ nr_groups          1 
+  nr_split         -1 
+other_args         ""
+python_exe         ""
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+rank_threshold        0.5 
+select_label rlnCtfFigureOfMerit 
+select_maxval      9999. 
+select_minval     -9999. 
+split_size      10000 
+ 
diff --git a/mdcatch/Schemes/proc-topaz/train_topaz/job.star b/mdcatch/Schemes/proc-topaz/train_topaz/job.star
new file mode 100644
index 0000000..e2395ae
--- /dev/null
+++ b/mdcatch/Schemes/proc-topaz/train_topaz/job.star
@@ -0,0 +1,73 @@
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             relion.autopick.topaz.train
+_rlnJobIsContinue                       0
+_rlnJobIsTomo                           0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+    angpix         -1 
+angpix_ref         -1 
+do_amyloid         No 
+do_ctf_autopick        Yes 
+do_ignore_first_ctfpeak_autopick         No 
+do_invert_refs        Yes 
+    do_log         No 
+do_pick_helical_segments         No 
+  do_queue         No 
+do_read_fom_maps         No 
+  do_ref3d         No 
+   do_refs         No 
+  do_topaz        Yes 
+do_topaz_pick         No 
+do_topaz_train        Yes 
+do_topaz_train_parts        Yes 
+do_write_fom_maps         No 
+fn_input_autopick Schemes/proc-topaz/select_mics/micrographs.star
+fn_ref3d_autopick         "" 
+fn_refs_autopick         "" 
+   gpu_ids          0 
+helical_nr_asu          1 
+helical_rise         -1 
+helical_tube_kappa_max        0.1 
+helical_tube_length_min         -1 
+helical_tube_outer_diameter        200 
+  highpass         -1 
+log_adjust_thr          0 
+log_diam_max        180 
+log_diam_min        150 
+log_invert         No 
+log_maxres         20 
+log_upper_thr          5 
+   lowpass         20 
+maxstddevnoise_autopick        1.1 
+min_dedicated         24 
+minavgnoise_autopick       -999 
+mindist_autopick        100 
+    nr_mpi          1 
+other_args         "" 
+psi_sampling_autopick          5 
+      qsub       qsub 
+qsubscript /public/EM/RELION/relion/bin/relion_qsub.csh 
+ queuename    openmpi 
+ref3d_sampling "30 degrees" 
+ref3d_symmetry         C1 
+    shrink          0 
+threshold_autopick       0.05 
+topaz_model         "" 
+topaz_nr_particles        300
+topaz_other_args         "" 
+topaz_particle_diameter      100.0 
+topaz_train_parts Schemes/proc-topaz/select_ini/particles.star
+topaz_train_picks         "" 
+   use_gpu        Yes 
+ 
diff --git a/mdcatch/__init__.py b/mdcatch/__init__.py
index b209608..c661fa0 100644
--- a/mdcatch/__init__.py
+++ b/mdcatch/__init__.py
@@ -24,4 +24,4 @@
 # *
 # **************************************************************************
 
-from .run import main
+__version__ = '2.0b1'
diff --git a/mdcatch/config.py b/mdcatch/config.py
index 344df73..e9f76c1 100644
--- a/mdcatch/config.py
+++ b/mdcatch/config.py
@@ -24,61 +24,70 @@
 # *
 # **************************************************************************
 
-# Config variables
-DEBUG = 0
+# set to 1 for more diagnostic output
+DEBUG = 1
 
-# daemon mode vars
-DEF_USER = ("emuser", 11048)  # default name: (username, uid)
+# some default vars
 DEF_PIPELINE = "Relion"  # default pipeline: Relion or Scipion
-DEF_PICKER = "crYOLO"  # default particle picker: crYOLO or Topaz or LogPicker
 DEF_SOFTWARE = "EPU"  # default software: EPU or SerialEM
+DEF_PICKER = "Cryolo"  # default particle picker: Cryolo or Topaz or Log
 DEF_PREFIX = "lmb_"  # found metadata folder name should start with this prefix
-LOGPICKER_SIZES = (150, 180)  # default min/max size in A for Relion LogPicker
-TOPAZ_SIZE = 150  # default diameter in A for Topaz
+DEF_PARTICLE_SIZES = (150, 180)  # default min/max size in Angstroms
+DEF_SYMMETRY = "C1"
 
-# path to EPU session or folder with SerialEM mdoc files
-METADATA_PATH = "/mnt/MetaData/Krios1/EPU/OTFP"
-#METADATA_PATH = "/home/gsharov/soft/MDCatch/mdcatch/Metadata-examples/EPU"
+# path to folder with EPU sessions or folder with SerialEM mdoc files
+# in SerialEM case movies and mdocs are expected in the same folder
+METADATA_PATH = "/mnt/MetaData/Krios1/EPU"
 
 # path where Relion projects are created
-# for Scipion mtf, defects, gain and template files are copied here
 PROJECT_PATH = "/cephfs"
 
-# Folder with Relion 3.1 schedules
-SCHEDULE_PATH = "/home/gsharov/soft/MDCatch/mdcatch/Schedules"
+# Folder with Relion 4 template schemes
+SCHEMES_PATH = "/home/gsharov/soft/MDCatch-dev/mdcatch/Schemes"
 
-# Scipion pre-processing template
-JSON_TEMPLATE = "/home/gsharov/soft/MDCatch/mdcatch/template.json"
+# Scipion 3 pre-processing template
+JSON_TEMPLATE = "/home/gsharov/soft/MDCatch-dev/mdcatch/template.json"
 
 # main dictionary
 # instrumentID: [name, Cs, TFS camera, Gatan camera]
-SCOPE_DICT = {'3299': ['Krios1', 2.7, 'Falcon', 'K2'],
-              '3413': ['Krios2', 2.7, 'Falcon', 'K2'],
-              '3593': ['Krios3', 2.7, 'Falcon', 'K3'],
-              '9952833': ['Glacios', 2.7, 'Falcon', None]
-              }
+SCOPE_DICT = {
+    '3299': ['Krios1', 2.7, 'Falcon3', 'K3'],
+    '3413': ['Krios2', 2.7, 'Falcon4', 'K2'],
+    '3593': ['Krios3', 2.7, 'Falcon3', 'K3'],
+    '9952833': ['Glacios', 2.7, 'Falcon3', None]
+}
 
 ###############################################################################
 # EPU params
-EPU_MOVIES_DICT = {'Falcon': "Images-Disc*/GridSquare_*/Data/FoilHole_*_Data_*_Fractions.mrc",
-                   'K2': "Images-Disc*/GridSquare_*/Data/FoilHole_*_Data_*.mrc",
-                   'K3': "Images-Disc*/GridSquare_*/Data/FoilHole_*_Data_*_fractions.tiff"
-                   }
-GAIN_DICT = {'K2': "FoilHole_*_Data_*-gain-ref.MRC",
-             'K3': "FoilHole_*_Data_*_gain.tiff"
-             }
 
+# EPU-produced movie file patterns per each camera
+EPU_MOVIES_DICT = {
+    'Falcon3': "Images-Disc*/GridSquare_*/Data/FoilHole_*_Data_*_Fractions.mrc",
+    'Falcon4': "Images-Disc*/GridSquare_*/Data/FoilHole_*_Data_*_EER.eer",
+    'K2': "Images-Disc*/GridSquare_*/Data/FoilHole_*_Data_*.mrc",
+    'K3': "Images-Disc*/GridSquare_*/Data/FoilHole_*_Data_*_fractions.tiff"
+}
+# EPU-produced gain reference file patterns per each camera
+GAIN_DICT = {
+    'K2': "FoilHole_*_Data_*-gain-ref.MRC",
+    'K3': "FoilHole_*_Data_*_gain.tiff",
+    # Falcon 4 EER gain is not copied by EPU, so we need to provide a full path
+    'Falcon4': "/home/gsharov/20210128_135200_EER_GainReference.gain"
+}
+
+# Which EPU session files to parse for metadata (default is xml)
 # change the pattern below if you want to parse movie sums mrc instead
 PATTERN_EPU = "Images-Disc*/GridSquare_*/Data/FoilHole_*_Data_*.xml"
 
-# path to MTF files for Relion (300 kV only)
+# path to MTF files for Relion, %s is replaced by e.g. 300
 # examples: Name-count, Name-linear or Name,
 # camera names should match SCOPE_DICT
 MTF_DICT = {
-    'Falcon-count': '/home/gsharov/soft/MTFs/mtf_falcon3EC_300kV.star',
-    'Falcon-linear': '/home/gsharov/soft/MTFs/mtf_falcon2_300kV.star',
-    'K2': '/home/gsharov/soft/MTFs/mtf_k2_300kV.star',
-    'K3': '/home/gsharov/soft/MTFs/mtf_K3_300kv_nocds.star'
+    'Falcon4-count': '/home/gsharov/soft/MTFs/mtf_falcon4EC_%skV.star',
+    'Falcon3-count': '/home/gsharov/soft/MTFs/mtf_falcon3EC_%skV.star',
+    'Falcon3-linear': '/home/gsharov/soft/MTFs/mtf_falcon2_%skV.star',
+    'K2': '/home/gsharov/soft/MTFs/mtf_k2_%skV.star',
+    'K3': '/home/gsharov/soft/MTFs/mtf_K3_%skv_nocds.star'
 }
 
 # path to raw movies folder depending on camera name
@@ -92,12 +101,12 @@
 ###############################################################################
 # SerialEM params
 
+# SerialEM-produced movies pattern
 PATTERN_SEM_MOVIES = "*.tif"
 # change the pattern below if you want to parse movie tif instead
 PATTERN_SEM = "*.tif.mdoc"
-REGEX_MDOC_VAR = "(?P<var>[a-zA-Z0-9]+?) = (?P<value>(.*))"
 
-# SerialEM mdoc vars to parse
+# Which SerialEM mdoc variables to parse
 SERIALEM_PARAMS = [
     'T',  # Microscope ID
     'Voltage',
@@ -110,24 +119,16 @@
     'NumSubFrames',
     # 'DateTime',
     'DefectFile',
-    'GainReference',
-    # optional vars below can be added to mdoc using "AddToNextFrameStackMdoc key value"
-    'OpticalGroup',
-    'PhasePlateInserted',
-    'BeamTiltCompensation',
-    'Beamtilt'
+    'GainReference'
 ]
 
+# do not change this
+REGEX_MDOC_VAR = "(?P<var>[a-zA-Z0-9]+?) = (?P<value>(.*))"
+
 # help message for path selection
 help_message = """Select the following folder:\n\n
    For EPU: the EPU session folder on /mnt/MetaData/
-   with Images-DiscX folder inside.\n
+   with Images-Disc folder inside.\n
    OR\n
    For SerialEM: the folder on /mnt/Data/ that
    contains tif movies and mdoc files.\n"""
-
-# help message for particle size
-help_picker = """Provide particle size in Angstroms.\n\n
-   - crYOLO can estimate it automatically (set this to 0)\n
-   - Topaz requires this parameter to remove neighboring picks\n
-   - LogPicker requires Min and Max diameter"""
diff --git a/mdcatch/Schedules/external_job_cryolo.py b/mdcatch/external_job_cryolo.py
similarity index 60%
rename from mdcatch/Schedules/external_job_cryolo.py
rename to mdcatch/external_job_cryolo.py
index 100862f..d596659 100755
--- a/mdcatch/Schedules/external_job_cryolo.py
+++ b/mdcatch/external_job_cryolo.py
@@ -1,5 +1,29 @@
 #!/usr/bin/env python3
-
+# **************************************************************************
+# *
+# * Authors:     Grigory Sharov (gsharov@mrc-lmb.cam.ac.uk) [1]
+# *
+# * [1] MRC Laboratory of Molecular Biology, MRC-LMB
+# *
+# * This program is free software; you can redistribute it and/or modify
+# * it under the terms of the GNU General Public License as published by
+# * the Free Software Foundation; either version 3 of the License, or
+# * (at your option) any later version.
+# *
+# * This program is distributed in the hope that it will be useful,
+# * but WITHOUT ANY WARRANTY; without even the implied warranty of
+# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# * GNU General Public License for more details.
+# *
+# * You should have received a copy of the GNU General Public License
+# * along with this program; if not, write to the Free Software
+# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+# * 02111-1307  USA
+# *
+# *  All comments concerning this program package may be sent to the
+# *  e-mail address 'gsharov@mrc-lmb.cam.ac.uk'
+# *
+# **************************************************************************
 """ Based on https://github.com/DiamondLightSource/python-relion-yolo-it by
 Sjors H.W. Scheres, Takanori Nakane, Colin M. Palmer, Donovan Webb"""
 
@@ -17,9 +41,10 @@
 RELION_JOB_FAILURE_FILENAME = "RELION_JOB_EXIT_FAILURE"
 RELION_JOB_SUCCESS_FILENAME = "RELION_JOB_EXIT_SUCCESS"
 DONE_MICS = "done_mics.txt"
-CONDA_ENV = ". /home/gsharov/rc/conda.rc && conda activate cryolo-1.7.5"
+CONDA_ENV = ". /home/gsharov/rc/conda.rc && conda activate cryolo-1.7.7"
 CRYOLO_PREDICT = "cryolo_predict.py"
 CRYOLO_GEN_MODEL = "/home/gsharov/soft/cryolo/gmodel_phosnet_202005_N63_c17.h5"
+CRYOLO_GEN_JANNI_MODEL = "/home/gsharov/soft/cryolo/gmodel_phosnet_202005_nn_N63_c17.h5"
 CRYOLO_JANNI_MODEL = "/home/gsharov/soft/cryolo/gmodel_janni_20190703.h5"
 DEBUG = 0
 
@@ -32,13 +57,19 @@ def run_job(project_dir, args):
     box_size = args.box_size
     distance = 0
     model = args.model
+    filament = args.filament
+    if filament:
+        fil_width = args.filament_width
+        box_dist = args.box_distance
+        min_boxes = args.minimum_number_boxes
+    denoise = args.denoise
     gpus = args.gpu
     threads = args.threads
 
     getPath = lambda *arglist: os.path.join(project_dir, *arglist)
 
     if model == "None":
-        model = CRYOLO_GEN_MODEL
+        model = CRYOLO_GEN_MODEL if not denoise else CRYOLO_GEN_JANNI_MODEL
     else:
         model = getPath(model)
 
@@ -55,12 +86,20 @@ def run_job(project_dir, args):
 
     if box_size:  # is not 0
         json_dict["model"]["anchors"] = [int(box_size), int(box_size)]
-        distance = int(box_size / 2)  # use half the box_size
+        if not filament:
+            distance = int(box_size / 2)  # use half the box_size
+    if denoise:
+        json_dict["model"]["filter"] = [
+            CRYOLO_JANNI_MODEL,
+            24,
+            3,
+            "filtered_tmp/"
+        ]
 
     if DEBUG:
         print("Using following config.json: ", json_dict)
 
-    with open("config.json", "w") as json_file:
+    with open("config_cryolo.json", "w") as json_file:
         json.dump(json_dict, json_file, indent=4)
 
     # Reading the micrographs star file from relion
@@ -77,9 +116,13 @@ def run_job(project_dir, args):
 
     mic_fns = mictable.getColumnValues("rlnMicrographName")
     mic_ext = os.path.splitext(mic_fns[0])[1]
-    input_job = "/".join(mic_fns[0].split("/")[:2])
-    keys = ["/".join(i.split("/")[2:]) for i in mic_fns]  # remove JobType/jobXXX
-    values = [os.path.splitext(i)[0] + "_cryolo.star" for i in keys]  # _cryolo.star
+    if "job" in mic_fns[0].split("/")[1]:  # remove JobType/jobXXX
+        input_job = "/".join(mic_fns[0].split("/")[:2])
+        keys = ["/".join(i.split("/")[2:]) for i in mic_fns]
+    else:
+        input_job = ""
+        keys = mic_fns
+    values = [os.path.splitext(i)[0] + "_autopick.star" for i in keys]
     mic_dict = {k: v for k, v in zip(keys, values) if k not in done_mics}
 
     for mic in mic_dict:
@@ -106,15 +149,24 @@ def run_job(project_dir, args):
 
     # Launching cryolo
     args_dict = {
-        '--conf': "config.json",
+        '--conf': "config_cryolo.json",
         '--output': 'output',
         '--weights': model,
-        '--gpu': "%s" % gpus.replace('"', ''),
+        '--gpu': gpus.replace(',', ' '),
         '--threshold': thresh,
         '--distance': distance,
         '--cleanup': "",
-        '-nc': -1  # threads
+        '--num_cpu': -1 if threads == 1 else threads
     }
+
+    if filament:
+        args_dict.update({
+            '--filament': "",
+            '--filament_width': fil_width,
+            '--box_distance': box_dist,
+            '--minimum_number_boxes': min_boxes
+        })
+
     cmd = "%s && %s " % (CONDA_ENV, CRYOLO_PREDICT)
     cmd += " ".join(['%s %s' % (k, v) for k, v in args_dict.items()])
     cmd += " --input "
@@ -130,7 +182,8 @@ def run_job(project_dir, args):
         raise Exception("Command failed with return code %d" % proc.returncode)
 
     # Moving output star files for Relion to use
-    with open(DONE_MICS, "a+") as f:
+    table_coords = Table(columns=['rlnMicrographName', 'rlnMicrographCoordinates'])
+    with open(DONE_MICS, "a+") as f, open("autopick.star", "w") as mics_star:
         for mic in mic_dict:
             f.write("%s\n" % mic)
             mic_base = os.path.basename(mic)
@@ -140,18 +193,32 @@ def run_job(project_dir, args):
             coord_relion = mic_dict[mic]
             if os.path.exists(coord_cryolo):
                 os.rename(coord_cryolo, getPath(job_dir, coord_relion))
+                table_coords.addRow(os.path.join(input_job, mic), os.path.join(job_dir, coord_relion))
                 if DEBUG:
                     print("Moved %s to %s" % (coord_cryolo, getPath(job_dir, coord_relion)))
-
-    # Required output mics star file
-    with open("coords_suffix_cryolo.star", "w") as mics_star:
-        mics_star.write(in_mics)
-
-    # Required output nodes star file
-    nodes = Table(columns=['rlnPipeLineNodeName', 'rlnPipeLineNodeType'])
-    nodes.addRow(os.path.join(job_dir, "coords_suffix_cryolo.star"), "2")
-    with open("RELION_OUTPUT_NODES.star", "w") as nodes_star:
-        nodes.writeStar(nodes_star, tableName="output_nodes")
+        table_coords.writeStar(mics_star, tableName='coordinate_files')
+
+    # Required output job_pipeline.star file
+    pipeline_fn = getPath(job_dir, "job_pipeline.star")
+    table_gen = Table(columns=['rlnPipeLineJobCounter'])
+    table_gen.addRow(2)
+    table_proc = Table(columns=['rlnPipeLineProcessName', 'rlnPipeLineProcessAlias',
+                                'rlnPipeLineProcessTypeLabel', 'rlnPipeLineProcessStatusLabel'])
+    table_proc.addRow(job_dir, 'None', 'External', 'Running')
+    table_nodes = Table(columns=['rlnPipeLineNodeName', 'rlnPipeLineNodeTypeLabel'])
+    table_nodes.addRow(in_mics, "relion.MicrographStar")
+    table_nodes.addRow(os.path.join(job_dir, "autopick.star"), "relion.CoordinateStar")
+    table_input = Table(columns=['rlnPipeLineEdgeFromNode', 'rlnPipeLineEdgeProcess'])
+    table_input.addRow(in_mics, job_dir)
+    table_output = Table(columns=['rlnPipeLineEdgeProcess', 'rlnPipeLineEdgeToNode'])
+    table_output.addRow(job_dir, os.path.join(job_dir, "autopick.star"))
+
+    with open(pipeline_fn, "w") as f:
+        table_gen.writeStar(f, tableName="pipeline_general", singleRow=True)
+        table_proc.writeStar(f, tableName="pipeline_processes")
+        table_nodes.writeStar(f, tableName="pipeline_nodes")
+        table_input.writeStar(f, tableName="pipeline_input_edges")
+        table_output.writeStar(f, tableName="pipeline_output_edges")
 
     outputFn = getPath(job_dir, "output_for_relion.star")
     if not os.path.exists(outputFn):
@@ -162,21 +229,22 @@ def run_job(project_dir, args):
             for line in f:
                 if line.startswith("MEAN,"):
                     estim_sizepx = int(line.split(",")[-1])
-        print("\nFound estimated box size %d px from %s" % (estim_sizepx, f.name))
-    
+                    break
+        print("\ncrYOLO estimated box size %d px" % estim_sizepx)
+
         # calculate diameter, original (boxSize) and downsampled (boxSizeSmall) box
         optics = Table(fileName=getPath(in_mics), tableName='optics')
         angpix = float(optics[0].rlnMicrographPixelSize)
         # use + 20% for diameter
-        diam = int(estim_sizepx * angpix * 1.2)
+        diam = math.ceil(estim_sizepx * angpix * 1.2)
         # use +30% for box size, make it even
         boxSize = 1.3 * estim_sizepx
         boxSize = math.ceil(boxSize / 2.) * 2
-    
+
         # from relion_it.py script
         # Authors: Sjors H.W. Scheres, Takanori Nakane & Colin M. Palmer
         boxSizeSmall = None
-        for box in (32, 48, 64, 96, 128, 160, 192, 256, 288, 300, 320,
+        for box in (48, 64, 96, 128, 160, 192, 256, 288, 300, 320,
                     360, 384, 400, 420, 450, 480, 512, 640, 768,
                     896, 1024):
             # Don't go larger than the original box
@@ -189,10 +257,10 @@ def run_job(project_dir, args):
             if small_box_angpix < 4.25:
                 boxSizeSmall = box
                 break
-    
-        print("\nEstimated parameters:\n\tDiameter (A): %d\n\tBox size (px): %d\n"
+
+        print("\nSuggested parameters:\n\tDiameter (A): %d\n\tBox size (px): %d\n"
               "\tBox size binned (px): %d" % (diam, boxSize, boxSizeSmall))
-    
+
         # output all params into a star file
         tableCryolo = Table(columns=['rlnParticleDiameter',
                                      'rlnOriginalImageSize',
@@ -204,21 +272,15 @@ def run_job(project_dir, args):
         # create .gui_manualpickjob.star for easy display
         starString = """
 # version 30001
-
 data_job
-
 _rlnJobType                             3
 _rlnJobIsContinue                       0
-
-
 # version 30001
-
 data_joboptions_values
-
 loop_
 _rlnJobOptionVariable #1
 _rlnJobOptionValue #2
-    angpix         -1
+    angpix         %f
  black_val          0
 blue_value          0
 color_label rlnParticleSelectZScore
@@ -242,7 +304,7 @@ def run_job(project_dir, args):
  white_val          0
 """
         with open(getPath(".gui_manualpickjob.star"), "w") as f:
-            f.write(starString % diam)
+            f.write(starString % (angpix, diam))
 
     # remove output dir
     if os.path.isdir("output"):
@@ -256,18 +318,23 @@ def run_job(project_dir, args):
 def main():
     """Change to the job working directory, then call run_job()"""
     help = """
-External job for calling cryolo within Relion 3.1.0. Run it in the main Relion project directory, e.g.:
-    external_job_cryolo.py --o External/cryolo_picking --in_mics CtfFind/job004/micrographs_ctf.star --box_size 128 --threshold 0.3 --gpu "0 1"
+External job for calling cryolo within Relion 4.0. Run it in the Relion project directory, e.g.:
+    external_job_cryolo.py --o External/cryolo_picking --in_mics CtfFind/job004/micrographs_ctf.star
 """
     parser = argparse.ArgumentParser(usage=help)
     parser.add_argument("--in_mics", help="Input micrographs STAR file")
     parser.add_argument("--o", dest="out_dir", help="Output directory name")
-    parser.add_argument("--j", dest="threads", help="Number of CPU threads (default = 1)", type=int, default=1)
+    parser.add_argument("--j", dest="threads", help="Number of CPU threads (default = all)", type=int, default=1)
     parser.add_argument("--box_size", help="Box size (default = 0 means it's estimated)", type=int, default=0)
     parser.add_argument("--threshold", help="Threshold for picking (default = 0.3)", type=float, default=0.3)
-    parser.add_argument("--model", help="Cryolo training model (if not specified general is used)", default="None")
-    parser.add_argument("--gpu", help='GPUs to use (e.g. "0 1 2 3")', default="0")
-    parser.add_argument("--pipeline_control", help="Not used here. Required by relion")
+    parser.add_argument("--model", help="Cryolo training model (if not specified general model is used)", default="None")
+    parser.add_argument("--filament", help='Enable filament mode', default=False, action='store_true')
+    parser.add_argument("--fw", dest="filament_width", help='[FILAMENT MODE] Filament width (in pixel)', type=int, default=None)
+    parser.add_argument("--bd", dest="box_distance", help='[FILAMENT MODE] Distance in pixel between two boxes', type=int, default=None)
+    parser.add_argument("--mn", dest="minimum_number_boxes", help='[FILAMENT MODE] Minimum number of boxes per filament', type=int, default=None)
+    parser.add_argument("--denoise", help="Denoise with JANNI instead of lowpass filtering", default=False, action='store_true')
+    parser.add_argument("--gpu", help='GPUs to use (e.g. "0,1,2,3", default = "0")', default="0")
+    parser.add_argument("--pipeline_control", help="Not used here. Required by Relion")
 
     args = parser.parse_args()
 
@@ -276,9 +343,14 @@ def main():
         exit(1)
 
     if not args.in_mics.endswith(".star"):
-        print("Error: --in_mics must point to a micrographs star file")
+        print("Error: --in_mics must point to a micrographs star file!")
         exit(1)
 
+    if args.filament:
+        if None in [args.filament_width, args.box_distance, args.minimum_number_boxes]:
+            print("Error: --fw, --bd, --mn are required in filament mode!")
+            exit(1)
+
     project_dir = os.getcwd()
     os.makedirs(args.out_dir, exist_ok=True)
     os.chdir(args.out_dir)
diff --git a/mdcatch/Schedules/external_job_cryolo_train.py b/mdcatch/external_job_cryolo_train.py
similarity index 75%
rename from mdcatch/Schedules/external_job_cryolo_train.py
rename to mdcatch/external_job_cryolo_train.py
index 5965530..3136216 100755
--- a/mdcatch/Schedules/external_job_cryolo_train.py
+++ b/mdcatch/external_job_cryolo_train.py
@@ -1,5 +1,29 @@
 #!/usr/bin/env python3
-
+# **************************************************************************
+# *
+# * Authors:     Grigory Sharov (gsharov@mrc-lmb.cam.ac.uk) [1]
+# *
+# * [1] MRC Laboratory of Molecular Biology, MRC-LMB
+# *
+# * This program is free software; you can redistribute it and/or modify
+# * it under the terms of the GNU General Public License as published by
+# * the Free Software Foundation; either version 3 of the License, or
+# * (at your option) any later version.
+# *
+# * This program is distributed in the hope that it will be useful,
+# * but WITHOUT ANY WARRANTY; without even the implied warranty of
+# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# * GNU General Public License for more details.
+# *
+# * You should have received a copy of the GNU General Public License
+# * along with this program; if not, write to the Free Software
+# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+# * 02111-1307  USA
+# *
+# *  All comments concerning this program package may be sent to the
+# *  e-mail address 'gsharov@mrc-lmb.cam.ac.uk'
+# *
+# **************************************************************************
 """ Based on https://github.com/DiamondLightSource/python-relion-yolo-it by
 Sjors H.W. Scheres, Takanori Nakane, Colin M. Palmer, Donovan Webb"""
 
@@ -10,10 +34,9 @@
 import subprocess
 from emtable import Table  # requires pip install emtable
 
-
 RELION_JOB_FAILURE_FILENAME = "RELION_JOB_EXIT_FAILURE"
 RELION_JOB_SUCCESS_FILENAME = "RELION_JOB_EXIT_SUCCESS"
-CONDA_ENV = ". /home/gsharov/rc/conda.rc && conda activate cryolo-1.7.5"
+CONDA_ENV = ". /home/gsharov/rc/conda.rc && conda activate cryolo-1.7.7"
 CRYOLO_TRAIN = "cryolo_train.py"
 CRYOLO_GEN_MODEL = "/home/gsharov/soft/cryolo/gmodel_phosnet_202005_N63_c17.h5"
 CRYOLO_JANNI_MODEL = "/home/gsharov/soft/cryolo/gmodel_janni_20190703.h5"
@@ -27,12 +50,21 @@ def run_job(project_dir, args):
     start = time.time()
     in_parts = args.in_parts
     job_dir = args.out_dir
-    box_size = args.box_size
     model = args.model or CRYOLO_GEN_MODEL
     gpus = args.gpu
 
     getPath = lambda *arglist: os.path.join(project_dir, *arglist)
 
+    # Create folder structure for cryolo
+    os.mkdir(IMG_FOLDER)
+    os.mkdir(ANNOT_FOLDER)
+
+    # Reading the box size from relion
+    optics = Table(fileName=getPath(in_parts), tableName='optics')[0]
+    box_bin = int(optics.rlnImageSize)
+    box_size = float(optics.rlnImagePixelSize) // float(optics.rlnMicrographOriginalPixelSize) * box_bin
+    print("Using unbinned box size of %d px" % box_size)
+
     # Making a cryolo config file
     json_dict = {
         "model": {
@@ -74,11 +106,7 @@ def run_job(project_dir, args):
     with open("config.json", "w") as json_file:
         json.dump(json_dict, json_file, indent=4)
 
-    # Create folder structure for cryolo
-    os.mkdir(IMG_FOLDER)
-    os.mkdir(ANNOT_FOLDER)
-
-    # Reading the particles star file from relion
+    # Reading the particles from relion
     parttable = Table(fileName=getPath(in_parts), tableName='particles')
     mics_dict = {}
 
@@ -108,11 +136,11 @@ def run_job(project_dir, args):
                         (coords[0], coords[1], box_size, box_size))
         if DEBUG:
             print("Created box file: %s" % box)
-    
+
     # Launching cryolo
     args_dict = {
         '--conf': "config.json",
-        '--gpu': gpus,
+        '--gpu': gpus.replace(',', ' '),
         '--warmup': 0,
         '--fine_tune': "",
         '--cleanup': ""
@@ -139,28 +167,27 @@ def run_job(project_dir, args):
 
     end = time.time()
     diff = end - start
-    print("Job duration = %dh %dmin %dsec \n" % (diff//3600, diff//60 % 60, diff % 60))
+    print("Job duration = %dh %dmin %dsec \n" % (diff // 3600, diff // 60 % 60, diff % 60))
 
 
 def main():
     """Change to the job working directory, then call run_job()"""
     help = """
-External job for calling cryolo fine-tune training within Relion 3.1.0. Run it in the main Relion project directory, e.g.:
-    external_job_cryolo_train.py --o External/cryolo_training --in_parts Select/job004/particles.star --box_size 128
+External job for calling cryolo fine-tune training within Relion 3.1. Run it in the Relion project directory, e.g.:
+    external_job_cryolo_train.py --o External/cryolo_training --in_parts Select/job004/particles.star
 """
     parser = argparse.ArgumentParser(usage=help)
     parser.add_argument("--in_parts", help="Input particles STAR file")
     parser.add_argument("--o", dest="out_dir", help="Output directory name")
-    parser.add_argument("--box_size", help="Box size (px)", type=int)
     parser.add_argument("--model", help="Cryolo training model (if not specified general is used)")
-    parser.add_argument("--gpu", help='GPUs to use (e.g. "0 1 2 3")', default="0")
+    parser.add_argument("--gpu", help='GPUs to use (e.g. "0,1,2,3")', default="0")
     parser.add_argument("--j", dest="threads", help="Not used here. required by relion")
     parser.add_argument("--pipeline_control", help="Not used here. Required by relion")
 
     args = parser.parse_args()
 
-    if args.in_parts is None or args.out_dir is None or args.box_size is None:
-        print("Error: --in_parts,  --o and --box_size are required params!")
+    if args.in_parts is None or args.out_dir is None:
+        print("Error: --in_parts and --o are required params!")
         exit(1)
 
     if not args.in_parts.endswith(".star"):
@@ -185,4 +212,3 @@ def main():
 
 if __name__ == "__main__":
     main()
-
diff --git a/mdcatch/parser.py b/mdcatch/parser.py
index 6fb9b2d..996d58a 100644
--- a/mdcatch/parser.py
+++ b/mdcatch/parser.py
@@ -40,11 +40,12 @@ def __init__(self):
         self.mdPath = METADATA_PATH
         self.prjPath = PROJECT_PATH
         self.software = DEF_SOFTWARE
-        self.user = DEF_USER
+        self.user = None
         self.fn = None
         self.pipeline = DEF_PIPELINE
         self.picker = DEF_PICKER
-        self.size = (0, 0)
+        self.symmetry = DEF_SYMMETRY
+        self.size = DEF_PARTICLE_SIZES
 
         self.acqDict = {
             'Mode': 'Linear',
@@ -75,6 +76,12 @@ def setPicker(self, choice):
     def getPicker(self):
         return self.picker
 
+    def setSymmetry(self, choice):
+        self.symmetry = choice
+
+    def getSymmetry(self):
+        return self.symmetry
+
     def getSize(self):
         return self.size
 
@@ -116,47 +123,50 @@ def guessFn(self, prog="EPU"):
 
         return img
 
-    def parseImgEpu(self, fn):
-        """ Parse xml or mrc and return updated acqDict. """
-        acqDict = parseXml(fn) if fn.endswith("xml") else parseMrc(fn)
-        self.acqDict.update(acqDict)
-
-    def parseImgSem(self, fn):
-        """ Parse mdoc or tif and return updated acqDict. """
-        acqDict = parseMdoc(fn) if fn.endswith("mdoc") else parseTif(fn)
+    def parseMetadata(self, fn):
+        """ Parse metadata file and return updated acqDict. """
+        if fn.endswith("xml"):
+            acqDict = parseXml(fn)
+        elif fn.endswith("tif") or fn.endswith("tiff"):
+            acqDict = parseTif(fn)
+        elif fn.endswith("mdoc"):
+            acqDict = parseMdoc(fn)
+        elif fn.endswith("mrc") or fn.endswith("mrcs"):
+            acqDict = parseMrc(fn)
+        else:
+            raise Exception("Metadata format not recognized.")
         self.acqDict.update(acqDict)
 
     def calcDose(self):
-        """ Calculate dose rate per unbinned px. """
+        """ Calculate dose rate per unbinned px per s. """
         numFr = int(self.acqDict['NumSubFrames'])
         dose_total = float(self.acqDict['Dose'])  # e/A^2
         exp = float(self.acqDict['ExposureTime'])  # s
 
         if self.acqDict['Mode'] == 'Super-resolution':
-            pix = 2 * float(self.acqDict['PixelSpacing'])  # A
+            pix = 2 * float(self.acqDict['PixelSpacing']) / int(self.acqDict['Binning'])  # A
         else:
-            pix = float(self.acqDict['PixelSpacing'])  # A
+            pix = float(self.acqDict['PixelSpacing']) / int(self.acqDict['Binning'])  # A
 
         if numFr:  # not 0
             dose_per_frame = dose_total / numFr  # e/A^2/frame
         else:
             dose_per_frame = 0
-        dose_on_camera = dose_total * math.pow(pix, 2) / exp  # e/ubpx/s
+        dose_on_camera = dose_total * math.pow(pix, 2) / exp  # e/unbinned_px/s
 
         self.acqDict['DosePerFrame'] = str(dose_per_frame)
         self.acqDict['DoseOnCamera'] = str(dose_on_camera)
 
-    def calcBox(self, picker):
+    def calcBox(self):
         """ Calculate box, mask, downsample. """
         minSize, maxSize = self.acqDict['PtclSizes']
-        ptclSizeAng = max(minSize, maxSize) if picker == 'LogPicker' else minSize
         angpix = float(self.acqDict['PixelSpacing'])
 
-        if self.acqDict['Mode'] == 'Super-resolution':
-            # since we always bin by 2 in mc if using super-res
+        if self.acqDict['Mode'] == 'Super-resolution' and self.acqDict['Binning'] == '1':
+            # since we always bin by 2 in mc if using super-res and bin 1
             angpix *= 2
 
-        ptclSizePx = float(ptclSizeAng) / angpix
+        ptclSizePx = float(maxSize) / angpix
         # use +20% for mask size
         self.acqDict['MaskSize'] = str(math.ceil(1.2 * ptclSizePx))
         # use +30% for box size, make it even
@@ -165,7 +175,7 @@ def calcBox(self, picker):
 
         # from relion_it.py script
         # Authors: Sjors H.W. Scheres, Takanori Nakane & Colin M. Palmer
-        for box in (32, 48, 64, 96, 128, 160, 192, 256, 288, 300, 320,
+        for box in (48, 64, 96, 128, 160, 192, 256, 288, 300, 320,
                     360, 384, 400, 420, 450, 480, 512, 640, 768,
                     896, 1024):
             # Don't go larger than the original box
@@ -184,18 +194,19 @@ def guessDataDir(self, wait=False, testmode=False):
         movieDir, gainFn, defFn = 'None', 'None', 'None'
         camera = self.acqDict['Detector']
         scopeID = self.acqDict['MicroscopeID']
+        voltage = self.acqDict['Voltage']
 
         # get MTF file
         if camera == 'EF-CCD':
             model = SCOPE_DICT[scopeID][3]
             if model is not None:
-                self.acqDict['MTF'] = MTF_DICT[model]
+                self.acqDict['MTF'] = MTF_DICT[model] % voltage
         else:
             model = SCOPE_DICT[scopeID][2]
             if self.acqDict['Mode'] == 'Linear':
-                self.acqDict['MTF'] = MTF_DICT['%s-linear' % model]
+                self.acqDict['MTF'] = MTF_DICT['%s-linear' % model] % voltage
             else:
-                self.acqDict['MTF'] = MTF_DICT['%s-count' % model]
+                self.acqDict['MTF'] = MTF_DICT['%s-count' % model] % voltage
 
         # update with real camera name
         self.acqDict['Detector'] = model
@@ -212,11 +223,14 @@ def guessDataDir(self, wait=False, testmode=False):
             else:
                 movieDir = os.path.join(p1, session, EPU_MOVIES_DICT[model])
                 movieBaseDir = os.path.join(p1, session)
+                # Falcon 4 gain reference
+                if model == "Falcon4":
+                    gainFn = GAIN_DICT[model]
 
             if wait:  # in daemon mode wait for movie folder to appear
                 while True:
                     if not os.path.exists(movieBaseDir):
-                        print("Movie folder %s not found, waiting for 1 min.." % movieBaseDir)
+                        print("Movie folder %s not found, waiting for 60 s.." % movieBaseDir)
                         time.sleep(60)
                     else:
                         print("Movie folder found! Continuing..")
diff --git a/mdcatch/run.py b/mdcatch/run.py
index dd87460..3247bd7 100644
--- a/mdcatch/run.py
+++ b/mdcatch/run.py
@@ -99,13 +99,14 @@ def group1(self):
         label_path = QLabel('Path')
         label_pipeline = QLabel('Run pipeline in')
         label_picker = QLabel('Particle picker')
-        label_diam = QLabel('Particle diameter (A)')
-        label_diam.setToolTip(help_picker)
+        label_sym = QLabel('Symmetry')
+        label_diam = QLabel('Particle size (A)')
 
         vbox.addWidget(label_soft, alignment=Qt.Alignment())
         vbox.addWidget(label_path, alignment=Qt.Alignment())
         vbox.addWidget(label_pipeline, alignment=Qt.Alignment())
         vbox.addWidget(label_picker, alignment=Qt.Alignment())
+        vbox.addWidget(label_sym, alignment=Qt.Alignment())
         vbox.addWidget(label_diam, alignment=Qt.Alignment())
 
         return vbox
@@ -165,42 +166,45 @@ def group2(self):
         hbox_picker.setAlignment(Qt.AlignLeft)
         btgroup_picker = QButtonGroup()
 
-        self.button_cryolo = self.addRadioButton("crYOLO", default=DEF_PICKER == "crYOLO")
+        self.button_cryolo = self.addRadioButton("crYOLO", default=DEF_PICKER == "Cryolo")
         self.button_topaz = self.addRadioButton("Topaz", default=DEF_PICKER == "Topaz")
-        self.button_logpick = self.addRadioButton("LogPicker", default=DEF_PICKER == "LogPicker")
-
+        self.button_log = self.addRadioButton("LoG", default=DEF_PICKER == "Log")
         btgroup_picker.addButton(self.button_cryolo)
         btgroup_picker.addButton(self.button_topaz)
-        btgroup_picker.addButton(self.button_logpick)
+        btgroup_picker.addButton(self.button_log)
         btgroup_picker.buttonClicked.connect(lambda: self.updPicker(btgroup_picker))
         hbox_picker.addWidget(self.button_cryolo, alignment=Qt.Alignment())
         hbox_picker.addWidget(self.button_topaz, alignment=Qt.Alignment())
-        hbox_picker.addWidget(self.button_logpick, alignment=Qt.Alignment())
+        hbox_picker.addWidget(self.button_log, alignment=Qt.Alignment())
         grid.addLayout(hbox_picker)
 
+        # symmetry box
+        hbox_sym = QHBoxLayout()
+        self.symm = QLineEdit()
+        self.symm.setMinimumWidth(60)
+        self.symm.setMaximumWidth(60)
+        self.symm.setText(DEF_SYMMETRY)
+
+        hbox_sym.addWidget(self.symm, alignment=Qt.AlignLeft)
+        grid.addLayout(hbox_sym)
+
         # size box
         hbox_diam = QHBoxLayout()
-        self.label_diamMin = QLabel('')
-        self.label_diamMin.setToolTip(help_picker)
+        self.label_diamMin = QLabel('min')
         hbox_diam.addWidget(self.label_diamMin)
 
         self.spbox_diamMin = QSpinBox()
-        self.spbox_diamMin.setToolTip(help_picker)
         self.spbox_diamMin.setRange(0, 9999)
-        self.spbox_diamMin.setValue(LOGPICKER_SIZES[0] if DEF_PICKER != "crYOLO" else 0)
+        self.spbox_diamMin.setValue(DEF_PARTICLE_SIZES[0])
         self.spbox_diamMin.setFixedSize(60, 25)
         hbox_diam.addWidget(self.spbox_diamMin)
 
         self.label_diamMax = QLabel('max')
-        self.label_diamMax.setToolTip(help_picker)
-        self.label_diamMax.setVisible(self.button_logpick.isChecked())
         hbox_diam.addWidget(self.label_diamMax)
 
         self.spbox_diamMax = QSpinBox()
-        self.spbox_diamMax.setToolTip(help_picker)
-        self.spbox_diamMax.setVisible(self.button_logpick.isChecked())
         self.spbox_diamMax.setRange(10, 9999)
-        self.spbox_diamMax.setValue(LOGPICKER_SIZES[1])
+        self.spbox_diamMax.setValue(DEF_PARTICLE_SIZES[1])
         self.spbox_diamMax.setFixedSize(60, 25)
         hbox_diam.addWidget(self.spbox_diamMax)
         hbox_diam.setAlignment(Qt.AlignLeft)
@@ -218,22 +222,6 @@ def updPipeline(self, btgroup):
 
     def updPicker(self, btgroup):
         bt = btgroup.checkedButton()
-        if self.button_cryolo.isChecked():  # crYOLO
-            self.label_diamMin.setText("")
-            self.spbox_diamMin.setValue(0)
-            self.label_diamMax.setVisible(False)
-            self.spbox_diamMax.setVisible(False)
-        elif self.button_topaz.isChecked():  # Topaz
-            self.label_diamMin.setText("")
-            self.spbox_diamMin.setValue(LOGPICKER_SIZES[0])
-            self.label_diamMax.setVisible(False)
-            self.spbox_diamMax.setVisible(False)
-        elif self.button_logpick.isChecked():  # LogPicker
-            self.label_diamMin.setText("min")
-            self.spbox_diamMin.setValue(LOGPICKER_SIZES[0])
-            self.label_diamMax.setVisible(True)
-            self.spbox_diamMax.setVisible(True)
-
         App.model.setPicker(bt.text())
         App.model.setSize(self.spbox_diamMin.value(), self.spbox_diamMax.value())
 
@@ -254,12 +242,13 @@ def refreshPath(self, path):
     def validatePage(self):
         """ Executed when Next is pressed.
         Returns True or False. """
+        App.model.setSymmetry(self.symm.text())
         App.model.setSize(self.spbox_diamMin.value(), self.spbox_diamMax.value())
 
         if App.model.getMdPath() is None:
             App.model.setMdPath(METADATA_PATH)
 
-        username, uid = getUsername(App.model.getMdPath())
+        username, uid = getUsername()
         App.model.setUser(username, uid)
 
         if DEBUG:
@@ -269,6 +258,7 @@ def validatePage(self):
                    App.model.getUser(),
                    App.model.getPipeline(),
                    App.model.getPicker(),
+                   App.model.getSymmetry(),
                    App.model.getSize()])
 
         prog = App.model.getSoftware()
@@ -278,7 +268,7 @@ def validatePage(self):
             App.showDialog("ERROR", "No matching files found!\n\n" + help_message)
             return False
         else:
-            print("\nFiles found: %s\n" % fnList)
+            print("\nFile found: %s\n" % fnList)
             App.model.setFn(fnList)
             return True
 
@@ -307,7 +297,6 @@ def __init__(self, parent=None):
         self.mainLayout = QGridLayout()
         self.mainLayout.addWidget(self.group1(), 0, 0)
         self.mainLayout.addWidget(self.group2(), 0, 1)
-        self.doCalcBox = False
         self.setLayout(self.mainLayout)
 
     def initializePage(self):
@@ -316,16 +305,16 @@ def initializePage(self):
         prog = App.model.getSoftware()
         fnList = App.model.getFn()
 
-        if prog == 'EPU':
-            App.model.parseImgEpu(fnList)
-        else:  # SerialEM
-            App.model.parseImgSem(fnList)
+        App.model.parseMetadata(fnList)
 
         self.addPtclSizeWidgets(acqDict)
         App.model.calcDose()
         App.model.guessDataDir()
 
-        self.setSubTitle("Found the following metadata from %s session:" % prog)
+        msg = "Found the following metadata from %s session:" % prog
+        if 'Warning' in acqDict:
+            msg += "\n%s" % acqDict['Warning']
+        self.setSubTitle(msg)
 
         scopeID = acqDict['MicroscopeID']
         time = round(float(acqDict['ExposureTime']), 3)
@@ -384,7 +373,7 @@ def group2(self):
         mode = QLabel("Mode")
         time = QLabel("Exposure time (s)")
         frames = QLabel("Frames")
-        dosepf = QLabel("Dose per frame (e/A²)")
+        dosepf = QLabel("Fluence per frame (e/A²)")
         gain = QLabel("Gain reference")
         defects = QLabel("Defects file")
 
@@ -435,21 +424,14 @@ def group3(self):
         return groupBox
 
     def addPtclSizeWidgets(self, acqDict):
-        """ Add particle size widgets depending on the input params. """
-        picker = App.model.getPicker()
+        """ Add particle size widgets. """
         sizes = App.model.getSize()
         acqDict['PtclSizes'] = sizes
-        acqDict['Picker'] = picker
-
-        if picker == 'crYOLO' and sizes[0] == 0:
-            pass  # automated estimation, no params needed
-        else:
-            self.doCalcBox = True
-            App.model.calcBox(picker)
-            self.mainLayout.addWidget(self.group3(), 1, 0)
-            self.box.setText(acqDict['BoxSize'])
-            self.mask.setText(acqDict['MaskSize'])
-            self.box_bin.setText(acqDict['BoxSizeSmall'])
+        App.model.calcBox()
+        self.mainLayout.addWidget(self.group3(), 1, 0)
+        self.box.setText(acqDict['BoxSize'])
+        self.mask.setText(acqDict['MaskSize'])
+        self.box_bin.setText(acqDict['BoxSizeSmall'])
 
     def onFinish(self):
         """ Finish is pressed, we need to update all editable vars. """
@@ -457,11 +439,11 @@ def onFinish(self):
         App.model.acqDict['DosePerFrame'] = self.dosepf.text()
         App.model.acqDict['PixelSpacing'] = self.px.text()
         App.model.acqDict['PhasePlateUsed'] = self.vpp.isChecked()
-
-        if self.doCalcBox:
-            App.model.acqDict['BoxSize'] = self.box.text()
-            App.model.acqDict['MaskSize'] = self.mask.text()
-            App.model.acqDict['BoxSizeSmall'] = self.box_bin.text()
+        App.model.acqDict['BoxSize'] = self.box.text()
+        App.model.acqDict['MaskSize'] = self.mask.text()
+        App.model.acqDict['BoxSizeSmall'] = self.box_bin.text()
+        App.model.acqDict['Picker'] = App.model.getPicker()
+        App.model.acqDict['Symmetry'] = App.model.getSymmetry()
 
         print("\nFinal parameters:\n")
         for k, v in sorted(App.model.acqDict.items()):
diff --git a/mdcatch/schedule.py b/mdcatch/schedule.py
index 208fdd7..f917820 100644
--- a/mdcatch/schedule.py
+++ b/mdcatch/schedule.py
@@ -30,35 +30,96 @@
 import json
 
 from .utils.misc import precalculateVars, getPrjName
-from .config import DEBUG, JSON_TEMPLATE, SCHEDULE_PATH, PATTERN_SEM_MOVIES
+from .config import JSON_TEMPLATE, SCHEMES_PATH, PATTERN_SEM_MOVIES
 
 
 def setupRelion(paramDict):
-    """ Prepare and launch Relion 3.1 schedules. """
+    """ Prepare and launch Relion 4.0 schemes. """
+    try:
+        subprocess.check_output(["which", "relion_schemer"],
+                                stderr=subprocess.DEVNULL)
+    except subprocess.CalledProcessError:
+        print("ERROR: Relion not found in PATH!")
+        exit(1)
+
     bin, gain, defect, group_frames = precalculateVars(paramDict)
-    mapDict = {'Cs': paramDict['Cs'],
-               'dose_rate': paramDict['DosePerFrame'],
-               'angpix': paramDict['PixelSpacing'],
-               'voltage': paramDict['Voltage'],
-               'motioncorr_bin': bin,
-               'group_frames': group_frames,
-               'is_VPP': paramDict['PhasePlateUsed'],
-               'optics_group': paramDict['OpticalGroup'],
-               'size_min': paramDict['PtclSizes'][0],
-               'size_max': paramDict['PtclSizes'][1],
-               }
-
-    pickerSchedule = {'crYOLO': 'preprocess-cryolo',
-                      'Topaz': 'preprocess-topaz',
-                      'LogPicker': 'preprocess-logpicker'}
-    preprocess_schd = pickerSchedule[paramDict['Picker']]
-
-    if paramDict['PtclSizes'][0] != 0:
+    mask_diam = int(paramDict['MaskSize']) * bin * float(paramDict['PixelSpacing'])
+    mapDict = {
+        'prep__do_at_most': 15,
+        'prep__ctffind__do_phaseshift': paramDict['PhasePlateUsed'],
+        'prep__importmovies__Cs': paramDict['Cs'],
+        'prep__importmovies__angpix': paramDict['PixelSpacing'],
+        'prep__importmovies__kV': paramDict['Voltage'],
+        'prep__importmovies__optics_group_name': '"%s"' % paramDict['OpticalGroup'],
+        'prep__motioncorr__bin_factor': bin,
+        'prep__motioncorr__dose_per_frame': paramDict['DosePerFrame'],
+        'prep__motioncorr__group_frames': group_frames
+    }
+
+    picker = paramDict['Picker'].lower()
+    if picker == 'topaz':
+        mapDict.update({
+            'proc-topaz__class2d_ini__particle_diameter': mask_diam,
+            'proc-topaz__class2d_rest__particle_diameter': mask_diam,
+            'proc-topaz__extract_ini__bg_diameter': paramDict['MaskSize'],
+            'proc-topaz__extract_ini__extract_size': paramDict['BoxSize'],
+            'proc-topaz__extract_ini__rescale': paramDict['BoxSizeSmall'],
+            'proc-topaz__extract_rest__bg_diameter': paramDict['MaskSize'],
+            'proc-topaz__extract_rest__extract_size': paramDict['BoxSize'],
+            'proc-topaz__extract_rest__rescale': paramDict['BoxSizeSmall'],
+            'proc-topaz__inimodel3d__particle_diameter': mask_diam,
+            'proc-topaz__inimodel3d__sym_name': '"%s"' % paramDict['Symmetry'],
+            'proc-topaz__inipicker__topaz_particle_diameter': paramDict['PtclSizes'][1],
+            'proc-topaz__refine3d__particle_diameter': mask_diam,
+            'proc-topaz__refine3d__sym_name': '"%s"' % paramDict['Symmetry'],
+            'proc-topaz__restpicker__topaz_particle_diameter': paramDict['PtclSizes'][1],
+            'proc-topaz__train_topaz__topaz_particle_diameter': paramDict['PtclSizes'][1],
+        })
+    elif picker == 'cryolo':
         mapDict.update({
-            'box_size': paramDict['BoxSize'],
-            'mask_diam_px': paramDict['MaskSize'],
-            'mask_diam': int(paramDict['MaskSize']) * bin * float(paramDict['PixelSpacing']),
-            'box_size_bin': paramDict['BoxSizeSmall'],
+            'prep__motioncorr__do_float16': "No",  # Cryolo cant read mrc 16-bit
+            'proc-cryolo__class2d_ini__particle_diameter': mask_diam,
+            'proc-cryolo__class2d_rest__particle_diameter': mask_diam,
+            'proc-cryolo__extract_ini__bg_diameter': paramDict['MaskSize'],
+            'proc-cryolo__extract_ini__extract_size': paramDict['BoxSize'],
+            'proc-cryolo__extract_ini__rescale': paramDict['BoxSizeSmall'],
+            'proc-cryolo__extract_rest__bg_diameter': paramDict['MaskSize'],
+            'proc-cryolo__extract_rest__extract_size': paramDict['BoxSize'],
+            'proc-cryolo__extract_rest__rescale': paramDict['BoxSizeSmall'],
+            'proc-cryolo__inimodel3d__particle_diameter': mask_diam,
+            'proc-cryolo__inimodel3d__sym_name': '"%s"' % paramDict['Symmetry'],
+            'proc-cryolo__inipicker__param2_value': paramDict['BoxSize'],
+            'proc-cryolo__refine3d__particle_diameter': mask_diam,
+            'proc-cryolo__refine3d__sym_name': '"%s"' % paramDict['Symmetry'],
+            'proc-cryolo__restpicker__param2_value': paramDict['BoxSize'],
+        })
+    else:  # logpicker
+        mapDict.update({
+            'proc-log__class2d_ini__particle_diameter': mask_diam,
+            'proc-log__class2d_rest__particle_diameter': mask_diam,
+            'proc-log__extract_ini__bg_diameter': paramDict['MaskSize'],
+            'proc-log__extract_ini__extract_size': paramDict['BoxSize'],
+            'proc-log__extract_ini__rescale': paramDict['BoxSizeSmall'],
+            'proc-log__extract_rest__bg_diameter': paramDict['MaskSize'],
+            'proc-log__extract_rest__extract_size': paramDict['BoxSize'],
+            'proc-log__extract_rest__rescale': paramDict['BoxSizeSmall'],
+            'proc-log__inimodel3d__particle_diameter': mask_diam,
+            'proc-log__inimodel3d__sym_name': '"%s"' % paramDict['Symmetry'],
+            'proc-log__inipicker__log_diam_min': paramDict['PtclSizes'][0],
+            'proc-log__inipicker__log_diam_max': paramDict['PtclSizes'][1],
+            'proc-log__refine3d__particle_diameter': mask_diam,
+            'proc-log__refine3d__sym_name': '"%s"' % paramDict['Symmetry'],
+            'proc-log__restpicker__topaz_particle_diameter': paramDict['PtclSizes'][1],
+            'proc-log__train_topaz__topaz_particle_diameter': paramDict['PtclSizes'][1],
+        })
+
+    if paramDict['Mode'] == "EER":
+        eer_group = 1 // float(paramDict['DosePerFrame'])  # group to achieve 1 e/A^2/frame
+        mapDict.update({
+            'prep__motioncorr__bin_factor': 1,
+            'prep__motioncorr__group_frames': 1,
+            'prep__motioncorr__dose_per_frame': 1.0,
+            'prep__motioncorr__eer_grouping': eer_group
         })
 
     prjName = getPrjName(paramDict)
@@ -76,88 +137,150 @@ def setupRelion(paramDict):
     if paramDict['Software'] == 'EPU':
         # EPU: Movies -> EPU session folder
         origPath1, origPath2 = paramDict['MoviePath'].split('/Images-Disc')
-        mapDict['movies_wildcard'] = 'Movies/Images-Disc%s' % origPath2
+        mapDict['prep__importmovies__fn_in_raw'] = '"Movies/Images-Disc%s"' % origPath2
     else:
         # SerialEM: Movies -> Raw path folder
         origPath1 = paramDict['MoviePath'].split(PATTERN_SEM_MOVIES)[0]
-        mapDict['movies_wildcard'] = 'Movies/%s' % PATTERN_SEM_MOVIES
-
-    if DEBUG:
-        print("Params passed to Relion: ", mapDict)
+        mapDict['prep__importmovies__fn_in_raw'] = '"Movies/%s"' % PATTERN_SEM_MOVIES
 
     os.symlink(origPath1, movieDir)
     os.chdir(prjPath)
-    # Create .gui_projectdir file, so that other users can open GUI
-    with open('.gui_projectdir', 'w'):
-        pass
+    # Create .gui_projectdir file, so that users can open GUI
+    open('.gui_projectdir', 'w').close()
+    # Create .gui_manualpickjob.star for easy picking results display
+    starString = """
+
+# version 30001
+
+data_job
+
+_rlnJobTypeLabel             ManualPick
+_rlnJobIsContinue                       0
+ 
+
+# version 30001
+
+data_joboptions_values
+
+loop_ 
+_rlnJobOptionVariable #1 
+_rlnJobOptionValue #2 
+    angpix         %s 
+ black_val          0 
+blue_value          0 
+color_label rlnAutopickFigureOfMerit 
+  diameter        %s 
+  do_color         No 
+do_fom_threshold         No 
+  do_queue         No 
+do_startend         No 
+  fn_color         "" 
+     fn_in         "" 
+  highpass         -1 
+   lowpass         20 
+  micscale        0.2 
+min_dedicated         24 
+minimum_pick_fom          0 
+other_args         "" 
+      qsub       qsub 
+qsubscript /home/gsharov/rc/relion-slurm.sh 
+ queuename    openmpi 
+ red_value          2 
+sigma_contrast          3 
+ white_val          0     
+"""
+    with open(".gui_manualpickjob.star", "w") as f:
+        f.write(starString % (float(paramDict['PixelSpacing']) * bin,
+                              paramDict['PtclSizes'][1]))
 
     for i in [gain, defect, paramDict['MTF']]:
         if os.path.exists(i):
             shutil.copyfile(i, os.path.basename(i))
 
-    mapDict['gainref'] = os.path.basename(gain) or '""'
-    mapDict['mtf_file'] = os.path.basename(paramDict['MTF'])
-    mapDict['defect_file'] = os.path.basename(defect) or '""'
+    if os.path.exists(gain):
+        mapDict['prep__motioncorr__fn_gain_ref'] = '"%s"' % os.path.basename(gain)
+    else:
+        mapDict['prep__motioncorr__fn_gain_ref'] = ''
 
-    try:
-        subprocess.check_output(["which", "relion_scheduler"],
-                                stderr=subprocess.DEVNULL)
-        if not os.path.exists('Schedules'):
-            shutil.copytree(SCHEDULE_PATH, os.getcwd() + '/Schedules')
-    except subprocess.CalledProcessError:
-        print("ERROR: relion command not found in PATH or Schedules not found!")
-        exit(1)
+    if os.path.exists(paramDict['MTF']):
+        mapDict['prep__importmovies__fn_mtf'] = '"%s"' % os.path.basename(paramDict['MTF'])
+    else:
+        mapDict['prep__importmovies__fn_mtf'] = ''
 
-    # setup ACL for uid
-    uid = paramDict['User'][1]
-    if uid:  # not zero
-        cmdList = ["setfacl -R -m u:%s:rwX %s" % (uid, prjPath)]
-        cmdList.append("setfacl -R -d -m u:%s:rwX %s" % (uid, prjPath))
-        cmdList.append("setfacl -R -m m::rwx %s" % prjPath)
-        cmdList.append("setfacl -R -d -m m::rwx %s" % prjPath)
-        try:
-            for cmd in cmdList:
-                subprocess.check_output(cmd.split())
-        except subprocess.CalledProcessError:
-            print("Warning: setfacl command failed, ignoring..")
-
-    # Set up scheduler vars
+    if os.path.exists(defect):
+        mapDict['prep__motioncorr__fn_defect'] = '"%s"' % os.path.basename(defect)
+    else:
+        mapDict['prep__motioncorr__fn_defect'] = ''
+
+    if not os.path.exists('Schemes'):
+        shutil.copytree(SCHEMES_PATH, os.getcwd() + '/Schemes')
+
+    for fn in ['external_job_cryolo.py', 'external_job_cryolo_train.py']:
+        shutil.copy(os.path.join(os.path.dirname(os.path.abspath(__file__)), fn),
+                    os.getcwd())
+
+    # Save relion params in .py file
+    with open("relion_it_options.py", 'w') as file:
+        file.write("{\n")
+        for k, v in mapDict.items():
+            if v != '':
+                file.write("'%s' : %s, \n" % (k, v))
+        file.write("}\n")
+
+    # Save acquisition params
+    with open("%s_session_params" % paramDict['Software'], "w") as fn:
+        fn.write("Movies dir: %s\n\n" % origPath1)
+        for k, v in sorted(paramDict.items()):
+            fn.write("%s = %s\n" % (k, v))
+
+    # Set up schemer vars
     cmdList = list()
     for key in mapDict:
-        cmd = 'relion_scheduler --schedule %s --set_var %s --value %s' % (
-            preprocess_schd, key, str(mapDict[key]))
-        cmdList.append(cmd)
+        if mapDict[key] != '':
+            opts = key.split("__")
+            if key.count("__") == 2:  # job option
+                jobstar = 'Schemes/' + opts[0] + '/' + opts[1] + '/job.star'
+                cmd = 'relion_pipeliner --editJob %s --editOption %s --editValue %s' % (
+                    jobstar, opts[2], mapDict[key])
+            else:  # scheme option
+                cmd = 'relion_schemer --scheme %s --set_var %s --value %s --original_value %s' % (
+                    opts[0], opts[1], mapDict[key], mapDict[key])
+
+            cmdList.append(cmd)
+
+    for cmd in sorted(cmdList):
+        print(cmd)
+        os.system(cmd)
 
-    cmdList.append('relion_scheduler --schedule class2d --set_var mask_diam --value %s' % mapDict.get('mask_diam', 0))
+    # Run schemer
+    cmdList = ['relion_schemer --scheme prep --reset &',
+               'relion_schemer --scheme prep --run --pipeline_control Schemes/prep/ >> Schemes/prep/run.out 2>> Schemes/prep/run.err &',
+               f'relion_schemer --scheme proc-{picker} --reset &',
+               f'relion_schemer --scheme proc-{picker} --run --pipeline_control Schemes/proc-{picker}/ >> Schemes/proc-{picker}/run.out 2>> Schemes/proc-{picker}/run.err &']
 
     for cmd in cmdList:
         print(cmd)
-        proc = subprocess.check_output(cmd.split())
-
-    # Run scheduler with Popen - without waiting for return
-    cmd1 = 'relion_scheduler --schedule %s --run --pipeline_control Schedules/%s/ &' % (
-        preprocess_schd, preprocess_schd)
-    cmd2 = 'relion_scheduler --schedule class2d --run --pipeline_control Schedules/class2d/ &'
-
-    with open("schedules_preprocess.log", "w") as fnLog1:
-        print(cmd1)
-        proc = subprocess.Popen(cmd1.split(), universal_newlines=True,
-                                stdout=fnLog1, stderr=subprocess.STDOUT)
-    with open("schedules_class2d.log", "w") as fnLog2:
-        print(cmd2)
-        proc = subprocess.Popen(cmd2.split(), universal_newlines=True,
-                                stdout=fnLog2, stderr=subprocess.STDOUT)
+        os.system(cmd)
 
 
 def setupScipion(paramDict):
-    """ Prepare and schedule Scipion 3 workflow.
+    """ Prepare and scheme Scipion 3 workflow.
     The default template will run import movies, relion motioncor,
     ctffind4, cryolo picking, extraction and summary monitor protocols.
     """
+    try:
+        subprocess.check_output(["which", "scipion3"], stderr=subprocess.DEVNULL)
+    except subprocess.CalledProcessError:
+        print("ERROR: scipion3 command not found in PATH!")
+        exit(1)
+
     prjName = getPrjName(paramDict)
-    prjPath = os.path.join(paramDict['PrjPath'], prjName)
-    os.mkdir(prjPath)
-    os.chdir(prjPath)
+    cmd = "scipion3 printenv | grep SCIPION_USER_DATA | cut -d'=' -f2"
+    proc = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+    out, err = proc.communicate()
+    scipionDir = os.path.abspath(out.decode().replace('"', '').replace('\n', ''))
+    prjPath = scipionDir + "/projects/" + prjName
+
     with open(JSON_TEMPLATE, 'r') as f:
         protocolsList = json.load(f)
     protNames = dict()
@@ -167,9 +290,6 @@ def setupScipion(paramDict):
         protNames[protClassName] = i
 
     bin, gain, defect, group_frames = precalculateVars(paramDict)
-    for i in [gain, defect, paramDict['MTF']]:
-        if os.path.exists(i):
-            shutil.copyfile(i, os.path.basename(i))
 
     # import movies
     importProt = protocolsList[protNames["ProtImportMovies"]]
@@ -188,32 +308,48 @@ def setupScipion(paramDict):
     importProt["sphericalAberration"] = float(paramDict['Cs'])
     importProt["samplingRate"] = float(paramDict['PixelSpacing'])
     importProt["dosePerFrame"] = float(paramDict['DosePerFrame'])
-    importProt["gainFile"] = os.path.join(os.getcwd(), os.path.basename(gain)) if gain else ""
+    importProt["gainFile"] = (prjPath + "/" + os.path.basename(gain)) if gain else ""
 
     # motioncorr
     movieProt = protocolsList[protNames["ProtRelionMotioncor"]]
     movieProt["binFactor"] = bin
     movieProt["groupFrames"] = group_frames
-    movieProt["defectFile"] = os.path.join(os.getcwd(), os.path.basename(defect)) if defect else ""
+    movieProt["defectFile"] = (prjPath + "/" + os.path.basename(defect)) if defect else ""
 
     # ctffind
     ctfProt = protocolsList[protNames["CistemProtCTFFind"]]
     ctfProt["findPhaseShift"] = paramDict['PhasePlateUsed']
 
+    # picking
+    pickProt = protocolsList[protNames["SphireProtCRYOLOPicking"]]
+    pickProt["boxSize"] = paramDict['BoxSize']
+
+    # extract
+    extrProt = protocolsList[protNames["ProtRelionExtractParticles"]]
+    extrProt["boxSize"] = paramDict['BoxSize']
+    extrProt["rescaledSize"] = paramDict['BoxSizeSmall']
+    extrProt["backDiameter"] = paramDict['MaskSize']
+
     jsonFn = "%s.json" % prjName
     with open(jsonFn, "w") as f:
         jsonStr = json.dumps(protocolsList, indent=4, separators=(',', ': '))
         f.write(jsonStr)
 
-    try:
-        subprocess.check_output(["which", "scipion3"], stderr=subprocess.DEVNULL)
-    except subprocess.CalledProcessError:
-        print("ERROR: scipion3 command not found in PATH!")
-        exit(1)
-
     cmd = 'scipion3 python -m pyworkflow.project.scripts.create %s %s' % (
         prjName, os.path.abspath(jsonFn))
     proc = subprocess.run(cmd.split(), check=True)
 
-    cmd2 = 'scipion3 python -m pyworkflow.project.scripts.schedule %s' % prjName
+    os.rename(jsonFn, os.path.join(prjPath, jsonFn))
+    os.chdir(prjPath)
+    for i in [gain, defect, paramDict['MTF']]:
+        if os.path.exists(i):
+            shutil.copyfile(i, os.path.basename(i))
+
+    # Save acquisition params
+    with open("%s_session_params" % paramDict['Software'], "w") as fn:
+        fn.write("Movies dir: %s\n\n" % importProt["filesPath"])
+        for k, v in sorted(paramDict.items()):
+            fn.write("%s = %s\n" % (k, v))
+
+    cmd2 = 'scipion3 python -m pyworkflow.project.scripts.scheme %s' % prjName
     proc2 = subprocess.Popen(cmd2.split(), universal_newlines=True)
diff --git a/mdcatch/template.json b/mdcatch/template.json
index bc148f9..993f369 100644
--- a/mdcatch/template.json
+++ b/mdcatch/template.json
@@ -10,7 +10,7 @@
         "runName": null,
         "runMode": 0,
         "importFrom": 0,
-        "filesPath": "/home/azazello/data/tutorials/relion30_tutorial/Movies/",
+        "filesPath": "/work/gsharov/Movies/Images-Disc1/GridSquare_15465465/Data/",
         "filesPattern": "*tiff",
         "copyFiles": false,
         "haveDataBeenPhaseFlipped": false,
@@ -24,7 +24,7 @@
         "scannedPixelSize": 7.0,
         "doseInitial": 0.0,
         "dosePerFrame": 1.277,
-        "gainFile": "/home/azazello/data/tutorials/relion30_tutorial/Movies/gain.mrc",
+        "gainFile": "/work/gsharov/Movies/gain.mrc",
         "darkFile": null,
         "dataStreaming": true,
         "timeout": 10800,
@@ -42,7 +42,7 @@
     },
     {
         "object.className": "ProtRelionMotioncor",
-        "object.id": "86",
+        "object.id": "87",
         "object.label": "relion - motion correction",
         "object.comment": "",
         "_useQueue": false,
@@ -51,14 +51,14 @@
         "runName": null,
         "runMode": 0,
         "sumFrame0": 1,
-        "sumFrameN": 0,
+        "sumFrameN": 24,
         "doDW": true,
         "saveNonDW": false,
         "savePSsum": true,
         "dosePSsum": 4.0,
-        "extraParams": "",
         "doComputePSD": false,
         "doComputeMicThumbnail": true,
+        "extraParams": "",
         "bfactor": 150,
         "patchX": 5,
         "patchY": 5,
@@ -67,14 +67,16 @@
         "gainRot": 0,
         "gainFlip": 0,
         "defectFile": null,
+        "eerGroup": 32,
+        "eerSampling": 0,
         "hostName": "localhost",
-        "numberOfThreads": 4,
+        "numberOfThreads": 24,
         "numberOfMpi": 1,
         "inputMovies": "2.outputMovies"
     },
     {
         "object.className": "CistemProtCTFFind",
-        "object.id": "174",
+        "object.id": "178",
         "object.label": "cistem - ctffind4",
         "object.comment": "",
         "_useQueue": false,
@@ -101,16 +103,16 @@
         "maxPhaseShift": 180.0,
         "stepPhaseShift": 10.0,
         "hostName": "localhost",
-        "numberOfThreads": 2,
+        "numberOfThreads": 1,
         "numberOfMpi": 1,
         "streamingWarning": null,
         "streamingSleepOnWait": 0,
         "streamingBatchSize": 5,
-        "inputMicrographs": "86.outputMicrographsDoseWeighted"
+        "inputMicrographs": "87.outputMicrographsDoseWeighted"
     },
     {
         "object.className": "SphireProtCRYOLOPicking",
-        "object.id": "236",
+        "object.id": "241",
         "object.label": "sphire - cryolo picking",
         "object.comment": "",
         "_useQueue": false,
@@ -134,11 +136,11 @@
         "streamingWarning": null,
         "streamingSleepOnWait": 0,
         "streamingBatchSize": 5,
-        "inputMicrographs": "86.outputMicrographsDoseWeighted"
+        "inputMicrographs": "87.outputMicrographsDoseWeighted"
     },
     {
         "object.className": "ProtRelionExtractParticles",
-        "object.id": "288",
+        "object.id": "295",
         "object.label": "relion - particles extraction",
         "object.comment": "",
         "_useQueue": false,
@@ -160,12 +162,11 @@
         "streamingBatchSize": 5,
         "hostName": "localhost",
         "numberOfMpi": 4,
-        "ctfRelations": "174.outputCTF",
-        "inputCoordinates": "236.outputCoordinates"
+        "inputCoordinates": "241.outputCoordinates"
     },
     {
         "object.className": "ProtMonitorSummary",
-        "object.id": "376",
+        "object.id": "362",
         "object.label": "emfacilities - monitor summary",
         "object.comment": "",
         "_useQueue": false,
@@ -175,10 +176,10 @@
         "runMode": 0,
         "inputProtocols": [
             "2",
-            "86",
-            "174",
-            "236",
-            "288"
+            "87",
+            "178",
+            "241",
+            "295"
         ],
         "samplingInterval": 60,
         "stddevValue": 0.04,
diff --git a/mdcatch/utils/__init__.py b/mdcatch/utils/__init__.py
index 8844338..b20435d 100644
--- a/mdcatch/utils/__init__.py
+++ b/mdcatch/utils/__init__.py
@@ -26,5 +26,5 @@
 
 from .feixml import parseXml
 from .feimrc import parseMrc
-from .bigtiff import parseTif
+from .tiff import parseTif
 from .mdoc import parseMdoc
diff --git a/mdcatch/utils/bigtiff.py b/mdcatch/utils/bigtiff.py
deleted file mode 100644
index 88d9ef4..0000000
--- a/mdcatch/utils/bigtiff.py
+++ /dev/null
@@ -1,140 +0,0 @@
-#!/usr/bin/env python3
-# **************************************************************************
-# *
-# * Authors:     Grigory Sharov (gsharov@mrc-lmb.cam.ac.uk) [1]
-# *
-# * [1] MRC Laboratory of Molecular Biology, MRC-LMB
-# *
-# * This program is free software; you can redistribute it and/or modify
-# * it under the terms of the GNU General Public License as published by
-# * the Free Software Foundation; either version 3 of the License, or
-# * (at your option) any later version.
-# *
-# * This program is distributed in the hope that it will be useful,
-# * but WITHOUT ANY WARRANTY; without even the implied warranty of
-# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# * GNU General Public License for more details.
-# *
-# * You should have received a copy of the GNU General Public License
-# * along with this program; if not, write to the Free Software
-# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-# * 02111-1307  USA
-# *
-# *  All comments concerning this program package may be sent to the
-# *  e-mail address 'gsharov@mrc-lmb.cam.ac.uk'
-# *
-# **************************************************************************
-
-""" This script parses BigTIFF file header from SerialEM movies. """
-
-from struct import unpack
-
-from .dtypes import bigtiff_tags
-from ..config import DEBUG, SCOPE_DICT
-
-
-def parseTif(fn):
-    header_dict = dict()
-    with open(fn, 'rb') as fin:
-        fin.seek(0)
-        header = fin.read(16)
-        try:
-            byteorder = {b'II': '<', b'MM': '>'}[header[:2]]
-        except KeyError:
-            raise NotImplemented('Not a TIFF file!')
-
-        version = unpack(byteorder + 'H', header[2:4])[0]  # 43 = BigTIFF
-        if version == 42:
-            raise NotImplemented('Only BigTIFF files are supported!')
-
-        ifd_offset = unpack(byteorder + 'Q', header[8:16])[0]  # offset to the first IFD
-        # find number of tags in the first IFD
-        fin.seek(ifd_offset)
-        num_tags = unpack(byteorder + 'Q', fin.read(8))[0]
-        start = int(ifd_offset) + 8
-
-        for _ in range(1, num_tags+1):
-            fin.seek(start)
-            tag = fin.read(20)  # every tag takes 20 bytes
-            tagnum = unpack(byteorder + 'H', tag[:2])[0]  # IFD tag
-            tagname = bigtiff_tags[tagnum][0]
-            dtype = unpack(byteorder + 'H', tag[2:4])[0]  # IFD type
-
-            if dtype in [3, 16]:  # SHORT 2-byte uint / LONG8 8-byte uint
-                header_dict[tagname] = unpack(byteorder + 'Q', tag[12:20])[0]  # IFD value
-            elif dtype == 5:  # RATIONAL 2x 4-byte uint
-                header_dict[tagname] = unpack(byteorder + 'L', tag[12:16])[0]
-            elif dtype == 2:  # ASCII 8-byte
-                count = unpack(byteorder + 'Q', tag[4:12])[0]
-                offset = unpack(byteorder + 'Q', tag[12:20])[0]
-                header_dict[tagname] = (count, offset)
-            elif dtype == 1:  # BYTE 1-byte uint
-                header_dict[tagname] = unpack(byteorder + 'B', tag[12:13])[0]
-            start += 20
-
-        # parse tags 270=ImageDescription, 306=DateTime && update dict
-        for i in ["ImageDescription", "DateTime"]:
-            count_desc, offset_desc = header_dict[i]
-            fin.seek(offset_desc)
-            part = fin.read(count_desc)
-            res = unpack(byteorder + '%ds' % count_desc,
-                         part[:count_desc+1])[0]
-            header_dict[i] = res.decode('utf-8').strip('\x00')
-
-        # count number of IFDs
-        c = 0
-        next_offset = ifd_offset
-        while next_offset != 0:
-            fin.seek(next_offset)
-            num_tags = int(unpack(byteorder + 'Q', fin.read(8))[0])
-            fin.seek(next_offset + num_tags * 20 + 8)
-            next_offset = int(unpack(byteorder + 'Q', fin.read(8))[0])
-            c += 1
-    header_dict["nimg"] = c
-
-    newDict = _standardizeDict(header_dict)
-
-    if DEBUG:
-        for k, v in sorted(newDict.items()):
-            print("%s = %s" % (k, v))
-
-    return newDict
-
-
-def _standardizeDict(acqDict):
-    """Convert values to expected format. """
-    stdDict = {
-        'MicroscopeID': "3593",
-        'Detector': "EF-CCD",
-        'Mode': 'Counting',
-        'NumSubFrames': acqDict['nimg'],
-        'ExposureTime': 1,
-        'Dose': '0',
-        'OpticalGroup': 'opticsGroup1',
-        'PhasePlateUsed': 'false',
-        'MTF': 'None',
-        'Voltage': 300,
-    }
-
-    print("Warning: tif headers do not contain enough metadata, "
-          "so some default values were used.\n")
-
-    desc = acqDict['ImageDescription'].split("\n")
-    stdDict['GainReference'] = desc[1].strip()
-
-    if len(desc) == 3:
-        stdDict['DefectFile'] = desc[2].strip()
-
-    sr = 1.0
-    if acqDict['ImageLength'] in ['7676', '11520']:
-        sr = 2.0
-        stdDict["Mode"] = 'Super-resolution'
-
-    stdDict['PixelSpacing'] = float(acqDict['XResolution']) / 2.54e+8 / sr
-    stdDict['Cs'] = SCOPE_DICT[stdDict['MicroscopeID']][1]
-
-    # convert all to str
-    for key in stdDict:
-        stdDict[key] = str(stdDict[key])
-
-    return stdDict
diff --git a/mdcatch/utils/dtypes.py b/mdcatch/utils/dtypes.py
deleted file mode 100644
index ef8f8d4..0000000
--- a/mdcatch/utils/dtypes.py
+++ /dev/null
@@ -1,206 +0,0 @@
-# **************************************************************************
-# *
-# * Authors:     Grigory Sharov (gsharov@mrc-lmb.cam.ac.uk) [1]
-# *
-# * [1] MRC Laboratory of Molecular Biology, MRC-LMB
-# *
-# * This program is free software; you can redistribute it and/or modify
-# * it under the terms of the GNU General Public License as published by
-# * the Free Software Foundation; either version 3 of the License, or
-# * (at your option) any later version.
-# *
-# * This program is distributed in the hope that it will be useful,
-# * but WITHOUT ANY WARRANTY; without even the implied warranty of
-# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# * GNU General Public License for more details.
-# *
-# * You should have received a copy of the GNU General Public License
-# * along with this program; if not, write to the Free Software
-# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-# * 02111-1307  USA
-# *
-# *  All comments concerning this program package may be sent to the
-# *  e-mail address 'gsharov@mrc-lmb.cam.ac.uk'
-# *
-# **************************************************************************
-
-import numpy as np
-
-# See https://www.awaresystems.be/imaging/tiff/tifftags/baseline.html
-# BigTIFF dtypes:
-# 1: BYTE 1-byte uint
-# 2: ASCII 8-byte
-# 3: SHORT 2-byte uint
-# 5: RATIONAL 2x 4-byte uint
-# 16: LONG8 8-byte uint
-
-bigtiff_tags = {
-    # tag: (name, dtype)
-    256: ("ImageWidth", 3),  # nx
-    257: ("ImageLength", 3),  # ny
-    258: ("BitsPerSample", 3),  # data type
-    259: ("Compression", 3),  # 5=LZW
-    262: ("PhotometricInterpretation", 3),  # The color space of the image data.
-    270: ("ImageDescription", 2),
-    273: ("StripOffsets", 16),
-    277: ("SamplesPerPixel", 3),
-    278: ("RowsPerStrip", 3),
-    279: ("StripByteCounts", 16),
-    282: ("XResolution", 5),  # The number of pixels per ResolutionUnit in the ImageWidth direction.
-    283: ("YResolution", 5),  # The number of pixels per ResolutionUnit in the ImageLength direction.
-    284: ("PlanarConfiguration", 3),
-    296: ("ResolutionUnit", 3),  # The unit of measurement for XResolution and YResolution. 2=inch, 3=cm.
-    306: ("DateTime", 2),  # YYYY:MM:DD HH:MM:SS
-    339: ("SampleFormat", 3),
-    340: ("MinSampleValue", 1),  # min
-    341: ("MaxSampleValue", 1),  # max
-}
-
-# See https://www.ccpem.ac.uk/mrc_format/mrc2014.php
-# The code below is taken from mrcfile/dtypes.py and modified,
-# is distributed under a 3-Clause BSD licence
-# Copyright (c) 2016, Science and Technology Facilities Council
-mrc_tags = np.dtype([
-    ('NX', 'i4'),
-    ('NY', 'i4'),
-    ('NZ', 'i4'),
-    ('MODE', 'i4'),
-    ('NXSTART', 'i4'),
-    ('NYSTART', 'i4'),
-    ('NZSTART', 'i4'),
-    ('MX', 'i4'),
-    ('MY', 'i4'),
-    ('MZ', 'i4'),
-    ('CELLA', [  # cell dimensions in Angstroms
-        ('X', 'f4'),
-        ('Y', 'f4'),
-        ('Z', 'f4')
-    ])
-])
-
-# See EPU user manual for FEI1/FEI2 MRC header details
-# For Timestamp definition see:
-# https://docs.microsoft.com/en-us/cpp/atl-mfc-shared/reference/coledatetime-class?redirectedfrom=MSDN&view=vs-2019
-fei_tags = [
-    ('Metadata size', 'i4'),  # bytes
-    ('Metadata version', 'i4'),
-    ('Bitmask 1', 'u4'),
-    ('Timestamp', 'f8'),  # days from December 30, 1899, at midnight
-    ('Microscope type', 'S16'),
-    ('D-Number', 'S16'),
-    ('Application', 'S16'),
-    ('Application version', 'S16'),
-    ('HT', 'f8'),  # Volt
-    ('Dose', 'f8'),  # electrons/m^2
-    ('Alpha tilt', 'f8'),  # deg.
-    ('Beta tilt', 'f8'),  # deg.
-    ('X-Stage', 'f8'),  # m
-    ('Y-Stage', 'f8'),  # m
-    ('Z-Stage', 'f8'),  # m
-    ('Tilt axis angle', 'f8'),  # deg.
-    ('Dual axis rotation', 'f8'),  # deg.
-    ('Pixel size X', 'f8'),  # m
-    ('Pixel size Y', 'f8'),  # m
-    ('Unused space', 'S48'),
-    ('Defocus', 'f8'),  # m
-    ('STEM Defocus', 'f8'),  # m
-    ('Applied defocus', 'f8'),  # m
-    ('Instrument mode', 'i4'),
-    ('Projection mode', 'i4'),
-    ('Objective lens mode', 'S16'),
-    ('High magnification mode', 'S16'),
-    ('Probe mode', 'i4'),
-    ('EFTEM On', '?'),
-    ('Magnification', 'f8'),
-    ('Bitmask 2', 'u4'),
-    ('Camera length', 'f8'),  # m
-    ('Spot index', 'i4'),
-    ('Illuminated area', 'f8'),  # m
-    ('Intensity', 'f8'),
-    ('Convergence angle', 'f8'),  # degr.
-    ('Illumination mode', 'S16'),
-    ('Wide convergence angle range', '?'),
-    ('Slit inserted', '?'),
-    ('Slit width', 'f8'),  # eV
-    ('Acceleration voltage offset', 'f8'),  # Volt
-    ('Drift tube voltage', 'f8'),  # Volt
-    ('Energy shift', 'f8'),  # eV
-    ('Shift offset X', 'f8'),  # a.u.
-    ('Shift offset Y', 'f8'),  # a.u.
-    ('Shift X', 'f8'),  # a.u.
-    ('Shift Y', 'f8'),  # a.u.
-    ('Integration time', 'f8'),  # s
-    ('Binning Width', 'i4'),
-    ('Binning Height', 'i4'),
-    ('Camera name', 'S16'),
-    ('Readout area left', 'i4'),
-    ('Readout area top', 'i4'),
-    ('Readout area right', 'i4'),
-    ('Readout area bottom', 'i4'),
-    ('Ceta noise reduction', '?'),
-    ('Ceta frames summed', 'i4'),
-    ('Direct detector electron counting', '?'),
-    ('Direct detector align frames', '?'),
-    ('Camera param reserved 0', 'i4'),
-    ('Camera param reserved 1', 'i4'),
-    ('Camera param reserved 2', 'i4'),
-    ('Camera param reserved 3', 'i4'),
-    ('Bitmask 3', 'u4'),
-    ('Camera param reserved 4', 'i4'),
-    ('Camera param reserved 5', 'i4'),
-    ('Camera param reserved 6', 'i4'),
-    ('Camera param reserved 7', 'i4'),
-    ('Camera param reserved 8', 'i4'),
-    ('Camera param reserved 9', 'i4'),
-    ('Phase Plate', '?'),
-    ('STEM Detector name', 'S16'),
-    ('Gain', 'f8'),
-    ('Offset', 'f8'),
-    ('STEM param reserved 0', 'i4'),
-    ('STEM param reserved 1', 'i4'),
-    ('STEM param reserved 2', 'i4'),
-    ('STEM param reserved 3', 'i4'),
-    ('STEM param reserved 4', 'i4'),
-    ('Dwell time', 'f8'),  # s
-    ('Frame time', 'f8'),  # s
-    ('Scan size left', 'i4'),
-    ('Scan size top', 'i4'),
-    ('Scan size right', 'i4'),
-    ('Scan size bottom', 'i4'),
-    ('Full scan FOV X', 'f8'),  # m
-    ('Full scan FOV Y', 'f8'),  # m
-    ('Element', 'S16'),
-    ('Energy interval lower', 'f8'),
-    ('Energy interval higher', 'f8'),
-    ('Method', 'i4'),
-    ('Is dose fraction', '?'),
-    ('Fraction number', 'i4'),
-    ('Start frame', 'i4'),
-    ('End frame', 'i4'),
-    ('Input stack filename', 'S80'),
-    ('Bitmask 4', 'u4'),
-    ('Alpha tilt min', 'f8'),  # deg.
-    ('Alpha tilt max', 'f8')  # deg.
-]
-
-fei1_tags = np.dtype(fei_tags)
-
-fei_tags.extend([
-    ('Scan rotation', 'f8'),  # rad.
-    ('Diffraction pattern rotation', 'f8'),  # rad.
-    ('Image rotation', 'f8'),  # rad.
-    ('Scan mode enumeration', 'i4'),  # 0 - other, 1 - raster, 2 - serpentine raster
-    ('Acquisition time stamp', 'i8'),  # us since 01/01/1970
-    ('Detector commercial name', 'S16'),
-    ('Start tilt angle', 'f8'),  # deg.
-    ('End tilt angle', 'f8'),  # deg.
-    ('Tilt per image', 'f8'),  # deg.
-    ('Tilt speed', 'f8'),  # deg./s
-    ('Beam center X pixel', 'i4'),  # px
-    ('Beam center Y pixel', 'i4'),  # px
-    ('CFEG flash timestamp', 'i8'),  # us since 01/01/1970
-    ('Phase plate position index', 'i4'),
-    ('Objective aperture name', 'S16')
-])
-
-fei2_tags = np.dtype(fei_tags)
diff --git a/mdcatch/utils/feimrc.py b/mdcatch/utils/feimrc.py
index 1430bf3..c004ee6 100644
--- a/mdcatch/utils/feimrc.py
+++ b/mdcatch/utils/feimrc.py
@@ -26,52 +26,31 @@
 
 """ This script parses MRC 2014 FEI1/FEI2 file header. """
 
-import numpy as np
+import mrcfile
 import math
-from struct import unpack
 
-from .dtypes import mrc_tags, fei1_tags, fei2_tags
 from ..config import DEBUG, SCOPE_DICT
 
 
 def parseMrc(fn):
-    with open(fn, 'rb') as fin:
-        fin.seek(0)
-        header = fin.read(1024)
-        map = header[208:212]
-        machst = header[212:214]
-        exttyp = header[104:108]
-
-        if map != b'MAP ' or machst != b'DD':  # 0x44 0x44 is little endian
-            print("Not a MRC file or not little endian byte order!")
-            return None
-        if exttyp not in [b'FEI1', b'FEI2']:
-            print("No FEI1 or FEI2 extended header found!")
-            return None
-
-        fin.seek(1024)
-        md_size = unpack('<L', fin.read(4))[0]
-        fin.seek(1024)
-        ext_header = fin.read(md_size)
-
-    # parse main header
-    header_arr = np.frombuffer(header[:52], dtype=mrc_tags)
-    keys = header_arr.dtype.names
-    header_dict = [dict(zip(keys, value)) for value in header_arr][0]
-
-    header_dict["apix_x"] = header_dict["CELLA"]["X"] / header_dict["NX"]
-    header_dict["apix_y"] = header_dict["CELLA"]["Y"] / header_dict["NY"]
-
-    # parse extended header
-    fei_tags = fei1_tags if exttyp == b'FEI1' else fei2_tags
-    ext_header_arr = np.frombuffer(ext_header, dtype=fei_tags)
-    keys = ext_header_arr.dtype.names
-    ext_header_dict = [dict(zip(keys, value)) for value in ext_header_arr][0]
-
-    acqDict = {**header_dict, **ext_header_dict}
+    acqDict = {}
+    with mrcfile.open(fn, header_only=True) as mrc:
+        main = mrc.header
+        ext = mrc.extended_header
+
+    for item in main.dtype.names:
+        acqDict[item] = main[item]
+
+    if len(ext):
+        for item in ext.dtype.names:
+            acqDict[item] = ext[item][0]
+
     newDict = _standardizeDict(acqDict)
 
     if DEBUG:
+        for k, v in sorted(acqDict.items()):
+            print("%s = %s" % (k, v))
+        print(40 * "=")
         for k, v in sorted(newDict.items()):
             print("%s = %s" % (k, v))
 
@@ -100,6 +79,7 @@ def _standardizeDict(acqDict):
         'SpotSize': acqDict['Spot index'],
         'Voltage': float(acqDict['HT']) // 1000,
         'PhasePlateUsed': bool(acqDict['Phase Plate']),
+        'Warning': 'MRC header does not contain frame number, please check the fluence!'
     }
 
     sr = 1
diff --git a/mdcatch/utils/feixml.py b/mdcatch/utils/feixml.py
index 5c66533..a83a7c9 100644
--- a/mdcatch/utils/feixml.py
+++ b/mdcatch/utils/feixml.py
@@ -39,17 +39,22 @@ def parseXml(fn):
     nspace = {'so': '{http://schemas.datacontract.org/2004/07/Fei.SharedObjects}',
               'ar': '{http://schemas.microsoft.com/2003/10/Serialization/Arrays}',
               'fr': '{http://schemas.datacontract.org/2004/07/Fei.Applications.Common.Omp.Interface}',
-              'tp': '{http://schemas.datacontract.org/2004/07/Fei.Types}'}
+              'tp': '{http://schemas.datacontract.org/2004/07/Fei.Types}',
+              'dr': '{http://schemas.datacontract.org/2004/07/System.Drawing}'}
 
     items = {'ExposureTime': "./{so}microscopeData/{so}acquisition/{so}camera/{so}ExposureTime",
              'Detector': "./{so}microscopeData/{so}acquisition/{so}camera/{so}Name",
              'GunLens': "./{so}microscopeData/{so}gun/{so}GunLens",
              'SpotSize': "./{so}microscopeData/{so}optics/{so}SpotIndex",
+             'ProbeMode': "./{so}microscopeData/{so}optics/{so}ProbeMode",
              'Magnification': "./{so}microscopeData/{so}optics/{so}TemMagnification/{so}NominalMagnification",
              'BeamSize': "./{so}microscopeData/{so}optics/{so}BeamDiameter",
              'Voltage': "./{so}microscopeData/{so}gun/{so}AccelerationVoltage",
+             'ExtractorVoltage': "./{so}microscopeData/{so}gun/{so}ExtractorVoltage",
              'MicroscopeID': "./{so}microscopeData/{so}instrument/{so}InstrumentID",
              'PixelSpacing': "./{so}SpatialScale/{so}pixelSize/{so}x/{so}numericValue",
+             'EnergySelectionSlitWidth': "./{so}microscopeData/{so}optics/{so}EnergyFilter/{so}EnergySelectionSlitWidth",
+             'Binning': "./{so}microscopeData/{so}acquisition/{so}camera/{so}Binning/{dr}x",
              'EPUversion': "./{so}microscopeData/{so}core/{so}ApplicationSoftwareVersion",
              'BeamTiltX': "./{so}microscopeData/{so}optics/{so}BeamTilt/{tp}_x",
              'BeamTiltY': "./{so}microscopeData/{so}optics/{so}BeamTilt/{tp}_y",
@@ -60,13 +65,17 @@ def parseXml(fn):
              }
 
     for key in items:
-        acqDict[key] = root.find(items[key].format(**nspace)).text
+        try:
+            acqDict[key] = root.find(items[key].format(**nspace)).text
+        except:
+            pass
 
     if acqDict['MicroscopeID'] in SCOPE_DICT:
         acqDict['Cs'] = SCOPE_DICT[acqDict['MicroscopeID']][1]
 
     acqDict['BeamSize'] = float(acqDict['BeamSize']) * math.pow(10, 6)
     acqDict['Voltage'] = int(acqDict['Voltage']) // 1000
+    acqDict['Binning'] = int(acqDict['Binning'])
 
     # get cameraSpecificInput: ElectronCountingEnabled, SuperResolutionFactor etc.
     customDict = dict()
@@ -77,10 +86,12 @@ def parseXml(fn):
 
     # check if counting/super-res is enabled
     sr = 1.0
+    acqDict['Mode'] = 'Linear'
     if customDict['ElectronCountingEnabled'] == 'true':
         sr = float(customDict['SuperResolutionFactor'])  # 1 - counting, 2 - super-res
         acqDict['Mode'] = 'Counting' if sr == 1.0 else 'Super-resolution'
 
+    # EPU's pixel size refers to a physical pixel, which is already multiplied by Binning factor
     acqDict['PixelSpacing'] = float(acqDict['PixelSpacing']) * math.pow(10, 10) / sr
 
     if acqDict['Detector'] == 'EF-CCD':
@@ -89,7 +100,10 @@ def parseXml(fn):
     else:
         # count number of DoseFractions for Falcon 3
         elem = "./{so}microscopeData/{so}acquisition/{so}camera/{so}CameraSpecificInput/{ar}KeyValueOfstringanyType/{ar}Value/{fr}DoseFractions"
-        acqDict['NumSubFrames'] = len(root.find(elem.format(**nspace)))
+        try:
+            acqDict['NumSubFrames'] = len(root.find(elem.format(**nspace)))
+        except:
+            pass
 
     # get customData: Dose, DoseOnCamera, PhasePlateUsed, AppliedDefocus
     customDict = dict()
@@ -98,20 +112,24 @@ def parseXml(fn):
     for k, v in zip(root.findall(keys.format(**nspace)), root.findall(values.format(**nspace))):
         customDict[k.text] = v.text
 
+    if 'Detectors[BM-Falcon].EerGainReference' in customDict:
+        acqDict['NumSubFrames'] = int(float(acqDict['ExposureTime']) * 248)
+        acqDict['Mode'] = "EER"
     if 'AppliedDefocus' in customDict:
         acqDict['AppliedDefocus'] = float(customDict['AppliedDefocus']) * math.pow(10, 6)
     if 'Dose' in customDict:
         acqDict['Dose'] = float(customDict['Dose']) * math.pow(10, -20)
     if 'PhasePlateUsed' in customDict:
         acqDict['PhasePlateUsed'] = customDict['PhasePlateUsed']
+    if 'Aperture[C2].Name' in customDict:
+        acqDict['C2Aperture'] = customDict['Aperture[C2].Name']
+    if 'Aperture[OBJ].Name' in customDict:
+        acqDict['ObjAperture'] = customDict['Aperture[OBJ].Name']
 
         if customDict['PhasePlateUsed'] == 'true':
             acqDict['PhasePlateNumber'] = customDict['PhasePlateApertureName'].split(" ")[-1]
             acqDict['PhasePlatePosition'] = customDict['PhasePlatePosition']
 
-    if 'DoseOnCamera' in customDict:
-        acqDict['DoseOnCamera'] = customDict['DoseOnCamera']
-
     if DEBUG:
         for k, v in sorted(acqDict.items()):
             print("%s = %s" % (k, v))
diff --git a/mdcatch/utils/mdoc.py b/mdcatch/utils/mdoc.py
index 6e1a068..604bb1d 100644
--- a/mdcatch/utils/mdoc.py
+++ b/mdcatch/utils/mdoc.py
@@ -66,8 +66,11 @@ def parseMdoc(fn):
     if 'TargetDefocus' in acqDict:
         acqDict['AppliedDefocus'] = acqDict.pop('TargetDefocus')
     if 'Binning' in acqDict:
-        acqDict['Mode'] = 'Super-resolution' if acqDict['Binning'] == '0.5' else 'Counting'
-        acqDict.pop('Binning')
+        if acqDict['Binning'] == '0.5':
+            acqDict['Mode'] = 'Super-resolution'
+            acqDict['Binning'] = 1
+        else:
+            acqDict['Mode'] = 'Counting'
     if 'PhasePlateInserted' in acqDict:
         acqDict['PhasePlateUsed'] = acqDict.pop('PhasePlateInserted')
 
diff --git a/mdcatch/utils/misc.py b/mdcatch/utils/misc.py
index 55f018f..fd4a94b 100644
--- a/mdcatch/utils/misc.py
+++ b/mdcatch/utils/misc.py
@@ -25,33 +25,14 @@
 # **************************************************************************
 
 import os
-import subprocess
 from datetime import datetime
 
-from ..config import (DEF_USER, SCOPE_DICT, DEF_PICKER,
-                      TOPAZ_SIZE, LOGPICKER_SIZES)
+from ..config import SCOPE_DICT
 
 
-def getUsername(mdPath):
-    """ Return username and uid using NIS database. """
-    mdFolder = os.path.basename(mdPath)
-    try:
-        username = mdFolder.split("_")[1]
-    except IndexError:
-        return DEF_USER
-
-    cmd = "/usr/bin/ypmatch %s passwd" % username
-    try:
-        res = subprocess.check_output(cmd.split())
-    except subprocess.CalledProcessError:
-        print("Warning: username %s not found! Using defaults: " % username, DEF_USER)
-        return DEF_USER
-    except FileNotFoundError:
-        print("Warning: command %s failed! Using defaults: " % cmd, DEF_USER)
-        return DEF_USER
-    else:
-        uid = str(res).split(":")[2]
-        return username, uid
+def getUsername():
+    """ Return username and uid. """
+    return os.getlogin(), os.getuid()
 
 
 def getPrjName(paramDict):
@@ -70,10 +51,10 @@ def getPrjName(paramDict):
 def precalculateVars(paramDict):
     """ Returns binning, gain, defect files and frame grouping. """
     # set motioncor bin to 2 if using super-res data
-    bin = 2.0 if paramDict['Mode'] == 'Super-resolution' else 1.0
+    bin = 2.0 if (paramDict['Mode'] == 'Super-resolution' and paramDict['Binning'] == '1') else 1.0
     gain = '' if paramDict['GainReference'] == 'None' else paramDict['GainReference']
     defect = '' if paramDict['DefectFile'] == 'None' else paramDict['DefectFile']
-    # group frames if dose rate < 0.8 e/A^2/frame
+    # group frames if fluence < 0.8 e/A^2/frame
     group_frames = 1
     dpf = float(paramDict['DosePerFrame'])
     if dpf < 0.8:
@@ -82,15 +63,3 @@ def precalculateVars(paramDict):
             group_frames += 1
 
     return bin, gain, defect, group_frames
-
-
-def setParticleSizes(model):
-    """ Setup particle sizes when running in non-GUI mode. """
-    if DEF_PICKER == 'Topaz':
-        model.acqDict['PtclSizes'] = TOPAZ_SIZE, LOGPICKER_SIZES[1]
-        model.calcBox(DEF_PICKER)
-    elif DEF_PICKER == 'LogPicker':
-        model.acqDict['PtclSizes'] = LOGPICKER_SIZES
-        model.calcBox(DEF_PICKER)
-    else:
-        model.acqDict['PtclSizes'] = 0, LOGPICKER_SIZES[1]
diff --git a/mdcatch/utils/tiff.py b/mdcatch/utils/tiff.py
new file mode 100644
index 0000000..0bf71a5
--- /dev/null
+++ b/mdcatch/utils/tiff.py
@@ -0,0 +1,150 @@
+# **************************************************************************
+# *
+# * Authors:     Grigory Sharov (gsharov@mrc-lmb.cam.ac.uk) [1]
+# *
+# * [1] MRC Laboratory of Molecular Biology, MRC-LMB
+# *
+# * This program is free software; you can redistribute it and/or modify
+# * it under the terms of the GNU General Public License as published by
+# * the Free Software Foundation; either version 3 of the License, or
+# * (at your option) any later version.
+# *
+# * This program is distributed in the hope that it will be useful,
+# * but WITHOUT ANY WARRANTY; without even the implied warranty of
+# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# * GNU General Public License for more details.
+# *
+# * You should have received a copy of the GNU General Public License
+# * along with this program; if not, write to the Free Software
+# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+# * 02111-1307  USA
+# *
+# *  All comments concerning this program package may be sent to the
+# *  e-mail address 'gsharov@mrc-lmb.cam.ac.uk'
+# *
+# **************************************************************************
+
+""" This script parses TIFF file header. """
+
+from tifffile import TiffFile
+
+from ..config import DEBUG, SCOPE_DICT
+
+
+# See https://www.awaresystems.be/imaging/tiff/tifftags/baseline.html
+
+tif_tags = {
+    # IFD tag code: name
+    256: "ImageWidth",  # nx
+    257: "ImageLength",  # ny
+    258: "BitsPerSample",  # data type
+    259: "Compression",  # 5=LZW, 65000=EER compressed data 8-bit, 65001=EER compressed data 7-bit
+    262: "PhotometricInterpretation",  # The color space of the image data.
+    270: "ImageDescription",
+    273: "StripOffsets",
+    277: "SamplesPerPixel",
+    278: "RowsPerStrip",
+    279: "StripByteCounts",
+    282: "XResolution",  # The number of pixels per ResolutionUnit in the ImageWidth direction.
+    283: "YResolution",  # The number of pixels per ResolutionUnit in the ImageLength direction.
+    284: "PlanarConfiguration",
+    296: "ResolutionUnit",  # The unit of measurement for XResolution and YResolution. 2=inch, 3=cm.
+    306: "DateTime",  # YYYY:MM:DD HH:MM:SS
+    339: "SampleFormat",
+    340: "MinSampleValue",  # min
+    341: "MaxSampleValue",  # max
+    65001: "TFS EER Metadata",  # Movie metadata,
+    65100: "TFS EER gain Metadata",  # Camera defects
+}
+
+
+def parseTif(fn):
+    acqDict = {"ImageDescription": "None\n",
+               "DateTime": "None",
+               "XResolution": (1, 1),
+               "ResolutionUnit": 1,
+               "ExposureTime": 1.0
+               }
+
+    with TiffFile(fn) as tif:
+        for page in tif.pages:
+            for tag in page.tags:
+                acqDict[tif_tags[tag.code]] = tag.value
+                # print(tag.code, tag.dtype)
+            break
+
+        acqDict["nimg"] = len(tif.pages)
+
+    if 'TFS EER Metadata' in acqDict:
+        import xml.etree.ElementTree as ET
+        root = ET.fromstring(acqDict["TFS EER Metadata"].decode('utf-8'))
+        tmp = {}
+        for item in root:
+            tmp[item.get('name')] = item.text
+
+        acqDict['ExposureTime'] = float(tmp['exposureTime'])
+        acqDict['Dose_e/px'] = float(tmp['totalDose'])
+
+    newDict = _standardizeDict(acqDict)
+
+    if DEBUG:
+        for k, v in sorted(acqDict.items()):
+            if k != "StripByteCounts" and k != "StripOffsets":
+                print("%s = %s" % (k, v))
+        print(40 * "=")
+        for k, v in sorted(newDict.items()):
+            print("%s = %s" % (k, v))
+
+    return newDict
+
+
+def _standardizeDict(acqDict):
+    """Convert values to expected format. """
+    stdDict = {
+        'MicroscopeID': "3593",
+        'Detector': 'EF-CCD',
+        'Mode': 'Counting',
+        'NumSubFrames': acqDict['nimg'],
+        'ExposureTime': acqDict['ExposureTime'],
+        'Dose': 0,
+        'OpticalGroup': 'opticsGroup1',
+        'PhasePlateUsed': 'false',
+        'MTF': 'None',
+        'Voltage': 300,
+        'Binning': 1,
+        'Warning': 'TIF header does not contain enough metadata, please check these values!'
+    }
+
+    desc = acqDict['ImageDescription'].split("\n")
+    stdDict['GainReferenceTransform'] = desc[0].split("r/f")[-1]
+    stdDict['GainReference'] = desc[1].strip() or None
+
+    if len(desc) == 3:
+        stdDict['DefectFile'] = desc[2].strip()
+
+    # find mode/detector from image size
+    sr = 1.0
+    if acqDict['ImageLength'] in [7676, 11520]:
+        sr = 2.0
+        stdDict['Mode'] = 'Super-resolution'
+    elif acqDict['ImageLength'] == acqDict['ImageWidth'] == 4096:
+        stdDict['Detector'] = 'BM-Falcon'
+
+    # find pixel size A/px
+    if acqDict['ResolutionUnit'] == 1:  # unknown
+        stdDict['PixelSpacing'] = 1.0
+    elif acqDict['ResolutionUnit'] == 2:  # inch
+        stdDict['PixelSpacing'] = float(acqDict['XResolution'][0]) / 2.54e+8 / sr
+    else:  # cm
+        stdDict['PixelSpacing'] = float(acqDict['XResolution'][0]) / 1e+8 / sr
+
+    if 'Dose_e/px' in acqDict:
+        stdDict['Dose'] = acqDict['Dose_e/px'] / (stdDict['PixelSpacing']) ** 2  # e/A^2
+
+    stdDict['Cs'] = SCOPE_DICT[stdDict['MicroscopeID']][1]
+
+    # convert all to str
+    for key in stdDict:
+        stdDict[key] = str(stdDict[key])
+
+    return stdDict
diff --git a/mdcatch/watcher.py b/mdcatch/watcher.py
index 98df4f7..4580747 100644
--- a/mdcatch/watcher.py
+++ b/mdcatch/watcher.py
@@ -29,7 +29,7 @@
 from watchdog.events import RegexMatchingEventHandler
 
 from .config import *
-from .utils.misc import getUsername, setParticleSizes
+from .utils.misc import getUsername
 from .parser import Parser
 from .schedule import setupRelion, setupScipion
 
@@ -73,31 +73,31 @@ def start_app(mdFn):
     model = Parser()
     model.setSoftware(DEF_SOFTWARE)
     model.setPipeline(DEF_PIPELINE)
+    model.setSize(DEF_PARTICLE_SIZES)
+    model.setSymmetry(DEF_SYMMETRY)
     model.setMdPath(mdPath)
     model.setFn(mdFn)
 
-    username, uid = getUsername(mdPath)
+    username, uid = getUsername()
     model.setUser(username, uid)
-    model.acqDict['User'] = model.getUser()
+    model.acqDict['User'] = username
 
     if DEBUG:
         print("\n\nInput params: ",
               model.getSoftware(),
               model.getMdPath(),
               model.getUser(),
-              model.getPipeline())
+              model.getPipeline(),
+              model.getSymmetry(),
+              model.getSize())
 
-    print("\nFiles found: %s\n" % mdFn)
-
-    if DEF_SOFTWARE == 'EPU':
-        model.parseImgEpu(mdFn)
-    else:  # SerialEM
-        model.parseImgSem(mdFn)
+    print("\nFile found: %s\n" % mdFn)
 
+    model.parseMetadata(mdFn)
     model.calcDose()
     model.guessDataDir(wait=True)
-    model.acqDict['Picker'] = DEF_PICKER
-    setParticleSizes(model)
+    model.acqDict['PtclSizes'] = DEF_PARTICLE_SIZES
+    model.calcBox()
 
     print("\nFinal parameters:\n")
     for k, v in sorted(model.acqDict.items()):
diff --git a/setup.py b/setup.py
index 11f8b28..56946b0 100644
--- a/setup.py
+++ b/setup.py
@@ -33,30 +33,27 @@
 # Always prefer setuptools over distutils
 from setuptools import setup, find_packages
 from os import path
+from mdcatch import __version__
 
 here = path.abspath(path.dirname(__file__))
 
 setup(
     name='MDCatch',
-    version='1.1',
+    version=__version__,
     description='Fetch metadata from EPU / SerialEM and launch on-the-fly pre-processing',
     long_description='See https://github.com/azazellochg/MDCatch for more details',
     url='https://github.com/azazellochg/MDCatch',
     author='Grigory Sharov',
     author_email='gsharov@mrc-lmb.cam.ac.uk',
     classifiers=[
-        'Development Status :: 4 - Beta',
+        'Development Status :: 3 - Alpha',
         'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
         'Programming Language :: Python :: 3'
     ],
     keywords='cryo-em python qt5 epu serialem',
     packages=find_packages(),
-    install_requires=['pyqt5', 'numpy', 'emtable', 'watchdog'],
-    entry_points={
-        'console_scripts': [
-            'mdcatch=mdcatch.run:main'
-        ],
-    },
+    install_requires=['pyqt5', 'watchdog', 'mrcfile', 'tifffile', 'emtable'],
+    entry_points={'console_scripts': ['mdcatch=mdcatch.run:main']},
     project_urls={
         'Bug Reports': 'https://github.com/azazellochg/MDCatch/issues',
         'Source': 'https://github.com/azazellochg/MDCatch',


Test patch:
diff --git a/mdcatch/tests/fake_run.py b/mdcatch/tests/fake_run.py
new file mode 100644
index 0000000..3375af1
--- /dev/null
+++ b/mdcatch/tests/fake_run.py
@@ -0,0 +1,46 @@
+#!/usr/bin/env python3
+
+from mdcatch.schedule import setupRelion, setupScipion
+
+paramDict = {
+       #"AppliedDefocus": -1.5,
+       #"BeamShiftX": -0.11633544415235519,
+       #"BeamShiftY": -0.019380046054720879,
+       "BeamSize": 1.0499999999999998,
+       #"BeamTiltX": 0.00850762240588665,
+       #"BeamTiltY": 0.0088164648041129112,
+       "Cs": 2.7,
+       "DefectFile": "None",
+       "Detector": "K2",
+       "Dose": 34.123202510617006,
+       "DoseOnCamera": 0.5184268233337922,
+       "DosePerFrame": 1.277,
+       "EPUversion": "2.7.0.5806",
+       "ExposureTime": 8,
+       "GainReference": "/work/gsharov/Movies/gain.mrc",
+       "GunLens": 6,
+       "ImageShiftX": 0,
+       "ImageShiftY": 0,
+       "MTF": "/home/gsharov/soft/MTFs/mtf_k2_300kV.star",
+       "Magnification": 75000,
+       "MicroscopeID": "3299",
+       "Mode": "Counting",
+       "MoviePath": "/work/gsharov/Movies/Images-Disc1/GridSquare_15465465/Data/*tiff",
+       "NumSubFrames": 24,
+       "OpticalGroup": "opticsGroup1",
+       "PhasePlateUsed": False,
+       "PixelSpacing": 0.885,
+       "PrjPath": "/cephfs",
+       "PtclSizes": (150, 180),
+       "BoxSize": 200,
+       "BoxSizeSmall": 64,
+       "MaskSize": 180,
+       "Software": "EPU",
+       "SpotSize": 10,
+       "User": ('gsharov', 26096),
+       "Voltage": 200,
+}
+
+setupRelion(paramDict)
+#setupScipion(paramDict)
+
diff --git a/mdcatch/Metadata-examples/EPU/Falcon/Images-Disc1/GridSquare_18879811/Data/FoilHole_18890345_Data_18881924_18881926_20200320_090200.xml b/mdcatch/tests/testdata/FoilHole_18890345_Data_18881924_18881926_20200320_090200.xml
old mode 100755
new mode 100644
similarity index 100%
rename from mdcatch/Metadata-examples/EPU/Falcon/Images-Disc1/GridSquare_18879811/Data/FoilHole_18890345_Data_18881924_18881926_20200320_090200.xml
rename to mdcatch/tests/testdata/FoilHole_18890345_Data_18881924_18881926_20200320_090200.xml
diff --git a/mdcatch/Metadata-examples/EPU/K2/Images-Disc1/GridSquare_28349771/Data/FoilHole_22011316_Data_19957701_19957703_20200323_100235.xml b/mdcatch/tests/testdata/FoilHole_22011316_Data_19957701_19957703_20200323_100235.xml
old mode 100755
new mode 100644
similarity index 100%
rename from mdcatch/Metadata-examples/EPU/K2/Images-Disc1/GridSquare_28349771/Data/FoilHole_22011316_Data_19957701_19957703_20200323_100235.xml
rename to mdcatch/tests/testdata/FoilHole_22011316_Data_19957701_19957703_20200323_100235.xml
diff --git a/mdcatch/Metadata-examples/SerialEM/img_h1_s2_i374_movie_00001_Jul30_07.56.47.tif.mdoc b/mdcatch/tests/testdata/img_h1_s2_i374_movie_00001_Jul30_07.56.47.tif.mdoc
similarity index 89%
rename from mdcatch/Metadata-examples/SerialEM/img_h1_s2_i374_movie_00001_Jul30_07.56.47.tif.mdoc
rename to mdcatch/tests/testdata/img_h1_s2_i374_movie_00001_Jul30_07.56.47.tif.mdoc
index 16d2188..180d701 100644
--- a/mdcatch/Metadata-examples/SerialEM/img_h1_s2_i374_movie_00001_Jul30_07.56.47.tif.mdoc
+++ b/mdcatch/tests/testdata/img_h1_s2_i374_movie_00001_Jul30_07.56.47.tif.mdoc
@@ -26,7 +26,7 @@ NumSubFrames = 40
 FrameDosesAndNumber = 0 40
 DateTime = 11-Aug-19  14:13:22
 DefectFile = defects_00000_Aug11_14.13.17.txt
-GainReference = SuperRef_00000_Aug11_14.13.17.dm4
+GainReference = SuperRef_00000_Aug11_14.13.17.mrc
 PhasePlateInserted = True
 BeamTiltCompensation = True
 OpticalGroup = hole2-shot3
diff --git a/mdcatch/tests/tests.py b/mdcatch/tests/tests.py
index e98aa01..0a939e6 100644
--- a/mdcatch/tests/tests.py
+++ b/mdcatch/tests/tests.py
@@ -29,37 +29,35 @@
 import unittest
 
 from ..config import *
-from ..utils.misc import getUsername, setParticleSizes
+from ..utils.misc import getUsername
 from ..parser import Parser
 
 
 class TestParser(unittest.TestCase):
     @classmethod
     def setUpClass(cls):
-        cls.epuDir = os.path.join(os.path.dirname(__file__), "../Metadata-examples/EPU")
-        cls.semDir = os.path.join(os.path.dirname(__file__), "../Metadata-examples/SerialEM/")
+        cls.cwd = os.path.dirname(__file__) + "/testdata"
 
-    def test_epu(self):
-        print("=" * 80, "\nTesting xml or mrc parser...")
-        xmlFns = glob(os.path.join(self.epuDir, "*/%s" % PATTERN_EPU), recursive=True)
-        xmlFns = [os.path.abspath(x) for x in xmlFns]
+    def test_run(self):
+        fns = glob(os.path.join(self.cwd, "*"))
+        fns = [os.path.abspath(x) for x in fns]
 
-        for mdFn in xmlFns:
-            mdPath = "/".join(mdFn.split("/")[:-4])
-            model = Parser()
-            model.setSoftware("EPU")
-            self._runParser(model, mdPath, mdFn)
+        model = Parser()
+        # Test EPU cases
+        for fn in fns:
+            if fn.endswith("mdoc"):
+                continue
+            else:
+                model.setSoftware("EPU")
+            self._runParser(model, self.cwd, os.path.abspath(fn))
 
-    def test_sem(self):
-        print("=" * 80, "\nTesting mdoc or tif parser...")
-        mdocFns = glob(os.path.join(self.semDir, PATTERN_SEM))
-        mdocFns = [os.path.abspath(x) for x in mdocFns]
-
-        for mdFn in mdocFns:
-            mdPath = "/".join(mdFn.split("/")[:-1])
-            model = Parser()
-            model.setSoftware("SerialEM")
-            self._runParser(model, mdPath, mdFn)
+        # Test SerialEM cases
+        for fn in fns:
+            if fn.endswith("xml"):
+                continue
+            else:
+                model.setSoftware("SerialEM")
+            self._runParser(model, self.cwd, os.path.abspath(fn))
 
     def _runParser(self, model, mdPath, mdFn):
         """ Run the parser and return model acqDict. """
@@ -67,7 +65,7 @@ def _runParser(self, model, mdPath, mdFn):
         model.setMdPath(mdPath)
         model.setFn(mdFn)
 
-        username, uid = getUsername(mdPath)
+        username, uid = getUsername()
         model.setUser(username, uid)
         model.acqDict['User'] = model.getUser()
 
@@ -75,20 +73,17 @@ def _runParser(self, model, mdPath, mdFn):
               model.getSoftware(),
               model.getMdPath(),
               model.getUser(),
-              model.getPipeline())
+              model.getPipeline(),
+              model.getPicker())
         print("\nFiles found: %s\n" % mdFn)
 
-        if model.getSoftware() == 'EPU':
-            model.parseImgEpu(mdFn)
-        else:  # SerialEM
-            model.parseImgSem(mdFn)
+        model.parseMetadata(mdFn)
 
         model.calcDose()
         model.guessDataDir(testmode=True)
-        model.acqDict['Picker'] = DEF_PICKER
-        setParticleSizes(model)
+        model.acqDict['PtclSizes'] = DEF_PARTICLE_SIZES
+        model.calcBox()
 
         print("\nFinal parameters:\n")
         for k, v in sorted(model.acqDict.items()):
             print(k, v)
-        print('\n')