# 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.
      * 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
* `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

## **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.](/files/1fZOD9X90FpCzG7H2glH)

## Common Next Steps

* 2D Classification


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guide.cryosparc.com/processing-data/all-job-types-in-cryosparc/utilities/job-particle-sets-tool.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
