# Job: Particle Sets Tool

## Description

Split a particle group into subsets or compare two groups.

## **Inputs**

* `particles_A`: Particles
  * With only this group $$A$$ specified, choose the `split` action to split the data into multiple batches
* `particles_B`: Particles (optional)
  * With both groups $$A$$ and $$B$$ , choose the `intersect` action to compute set operations on the two groups, including (i) intersection $$A ∩ B$$ and differences (ii) $$A - B$$ and (iii) $$B - A$$.

## **Common Parameters**

* `Action`
  * With *only one particle input group*, choose **`split`** to split the data into multiple batches
  * With *both particle input groups*, choose **`intersect`** to compute the set intersection and difference between the two groups.
  * if `intersect` is selected, a new parameter is available: `Field to Intersect`
    * `uid`: use the `uid` field to intersect the two inputs
    * `path` : use the particle's path and image index to intersect the two inputs.&#x20;
      * The token used to intersect particles will be a concatenation of the particle's path from `blob/path` and its index from `blob/idx`.
* `Split num. batches`: With the `split` action, how many batches to split the particles into&#x20;
* `Split batch size`: With the `split` action, the number of items to place into each split batch that is output. Additional items will be output as a separate remainder output. If the value is `None`, the items will be split into equal sized batches.
* `Split randomize`: With the `split` action, randomize the particles to add to each batch&#x20;

## **Outputs**

* Split mode:
  * `split_X` (multiple outputs): With the `split` action, batches of the resulting particles
  * `remainder`: With the `split` action, particles left out of `split_X` batches due to the specified batch size and number of batches
* Intersect mode:
  * `intersect` and `intersect_B` outputs: With the `intersect` action, these contain the result of $$A ∩ B$$
    * For the `intersect` output, all of the result groups in common from set A and B (e.g. `blob`, `ctf`, `alignments3D`, etc.) and passthrough groups will be copied *from set A*
    * For the `intersect_B` output, all of the result and passthrough groups will be copied *from set B*
  * `A_minus_B`: With the `intersect` action, set difference $$A - B$$
  * `B_minus_A`: With the `intersect` action, set difference$$B - A$$

![Example outputs when only one input particle set is provided compared to two sets.](https://1916621962-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M7DGv3GkRvGGpbVPCgg%2Fuploads%2FZ2cxjRmmrPaP3UcP74b2%2Fv4-5-0-particle-sets-tool-output-examples-0.png?alt=media\&token=5d450c51-8cde-44d1-8724-987f234e3d08)

## Common Next Steps

* 2D Classification
