Skip to content

Commit 8f6849c

Browse files
Documentation update
1 parent cc5682e commit 8f6849c

20 files changed

+135
-272
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ These packages are mostly used for plotting, so if you do not wish to install th
1111

1212
Once dependencies are installed, you can run notebooks (`*.ipynb`) using your [Jupyter Notebook](https://jupyter.org/) environment of choice.
1313
You can run python scripts (`*.py`) directly in the terminal in the usual way (`path/to/script.py` or `python path/to/script.py`).
14+
If you click a notebook in GitHub it will open so that you can see the result of each cell.
15+
Python scripts do not have this feature, but are contained in their own directory with a README explaining the script's usage.
1416

1517
## 💻 Where can I run these scripts from?
1618
The scripts and notebooks do *not* need to be run on the master node --- they simply need to have access to the following ports:
92.4 KB
Loading
64.2 KB
Loading

back-to-cs-uid.ipynb

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Back to CS UID\n",
8+
"Sometimes particles must be processed outside CryoSPARC and then re-imported. Unfortunately, the re-imported particles have new UIDs, making some jobs more difficult or impossible in CryoSPARC. This script re-assigns the original UIDs to particles, provided they were not externally re-extracted."
9+
]
10+
},
311
{
412
"cell_type": "code",
513
"execution_count": null,
@@ -29,6 +37,13 @@
2937
"project = cs.find_project(project_uid)"
3038
]
3139
},
40+
{
41+
"cell_type": "markdown",
42+
"metadata": {},
43+
"source": [
44+
"Here we load particles from two jobs. The first (J134 in this case) was never exported from CryoSPARC. This job provides the original UIDs. The second (J217 in this case) is the Import Particles job that was used to re-import the particles after external processing."
45+
]
46+
},
3247
{
3348
"cell_type": "code",
3449
"execution_count": 2,
@@ -43,10 +58,11 @@
4358
},
4459
{
4560
"cell_type": "code",
46-
"execution_count": 3,
61+
"execution_count": null,
4762
"metadata": {},
4863
"outputs": [],
4964
"source": [
65+
"# function to strip UIDs from micrographs\n",
5066
"uid_pattern = r\"^[0-9]{21}_\"\n",
5167
"def remove_uid(uid_mic:str) -> str:\n",
5268
" uid_mic = uid_mic.split('/')[-1]\n",
@@ -59,10 +75,11 @@
5975
},
6076
{
6177
"cell_type": "code",
62-
"execution_count": 4,
78+
"execution_count": null,
6379
"metadata": {},
6480
"outputs": [],
6581
"source": [
82+
"# \"img\" is a temporary field which combines the particle stack and blob index for a given particle\n",
6683
"rel_parts.add_fields(fields = ['img'], dtypes = ['str'])\n",
6784
"rel_parts['img'] = [\n",
6885
" f\"{i}@{remove_uid(m)}\"\n",
@@ -109,6 +126,7 @@
109126
}
110127
],
111128
"source": [
129+
"# remove the temporary field and save the particles with CryoSPARC UIDs to the workspace.\n",
112130
"drop_image = rel_parts.drop_fields('img', copy = True)\n",
113131
"cs.save_external_result(\n",
114132
" project_uid,\n",

change-pixel-size/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Changing Pixel Size
2+
3+
The scripts in this directory create a new output with an updated pixel size, perhaps found as a result of pixel size calibrations performed using earlier results.
4+
5+
## `change_apix_extract.py`
6+
7+
This script changes the pixel size of all particles in a stack to a provided value.
8+
Note that only particle metadata is changed, and it is only changed for the new particle output this job creates.
9+
No existing jobs are modified.
10+
Note also that the micrograph pixel sizes are *not* changed, so if the particles are re-extracted their pixel sizes will revert to the old value.
11+
12+
Example usage:
13+
```
14+
change_apix_extract.py P123,W2,J456 1.008
15+
```
16+
17+
## `change_apix_micrographs.py`
18+
19+
This script changes all of the pixel size fields of a set of micrographs.
20+
21+
Example usage:
22+
```
23+
change_apix_micrographs.py P123,W2,J456 1.008
24+
```
File renamed without changes.

check_pose_duplicates.ipynb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Check Pose Duplicates\n",
8+
"This notebook checks a particle stack for particles with identical poses and stores their UIDs in a set for downstream use.\n",
9+
"This may be useful if one wishes to [remove particles only when their location *and pose* are identical](https://discuss.cryosparc.com/t/remove-duplicates-considering-orientation/13474/6?u=rwaldo) (or very close)."
10+
]
11+
},
312
{
413
"cell_type": "code",
514
"execution_count": 165,

class-2d-no-gaps.ipynb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Class 2D No Gaps\n",
8+
"This notebook plots 2D Classes with no gaps between them."
9+
]
10+
},
311
{
412
"cell_type": "code",
513
"execution_count": 23,

count_sym_exp_copies.ipynb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Count Sym Exp Copies\n",
8+
"This notebook counts and plots the number of symmetry-expanded copies of a particle remain in a particle stack.\n",
9+
"It may be useful when using classification on symmetry-expanded particles to count the occurance of a given feature."
10+
]
11+
},
312
{
413
"cell_type": "code",
514
"execution_count": 6,

0 commit comments

Comments
 (0)