Skip to content

Commit

Permalink
initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
akhanf committed Feb 13, 2024
1 parent a976c55 commit e39535b
Show file tree
Hide file tree
Showing 29 changed files with 6,101 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ jobs:
with:
directory: .test
snakefile: workflow/Snakefile
args: "--use-conda --show-failed-logs --cores 3 --conda-cleanup-pkgs cache --all-temp"
args: "--sdm apptainer --show-failed-logs --cores 1 --all-temp"

- name: Test report
uses: snakemake/[email protected]
with:
directory: .test
snakefile: workflow/Snakefile
args: "--report report.zip"
args: "--report report.zip"
2 changes: 1 addition & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
id: release
with:
release-type: go # just keep a changelog, no version anywhere outside of git tags
package-name: <repo>
package-name: SPIMprep
6 changes: 3 additions & 3 deletions .snakemake-workflow-catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ usage:
desc: # describe your flags here in a few sentences (they will be inserted below the example commands)
flags: # put your flags here
software-stack-deployment: # definition of software deployment method (at least one of conda, singularity, or singularity+conda)
conda: true # whether pipeline works with --use-conda
singularity: false # whether pipeline works with --use-singularity
conda: false # whether pipeline works with --use-conda
singularity: true # whether pipeline works with --use-singularity
singularity+conda: false # whether pipeline works with --use-singularity --use-conda
report: true # add this to confirm that the workflow allows to use 'snakemake --report report.zip' to generate a report containing all results and explanations
report: true # add this to confirm that the workflow allows to use 'snakemake --report report.zip' to generate a report containing all results and explanations
16 changes: 4 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
# Snakemake workflow: `<name>`
# Snakemake workflow: `SPIMprep`

[![Snakemake](https://img.shields.io/badge/snakemake-≥6.3.0-brightgreen.svg)](https://snakemake.github.io)
[![GitHub actions status](https://github.com/<owner>/<repo>/workflows/Tests/badge.svg?branch=main)](https://github.com/<owner>/<repo>/actions?query=branch%3Amain+workflow%3ATests)


A Snakemake workflow for `<description>`

A Snakemake workflow forp re-processing single plane illumination microscopy (SPIM, aka lightsheet microscopy)

## Usage

The usage of this workflow is described in the [Snakemake Workflow Catalog](https://snakemake.github.io/snakemake-workflow-catalog/?usage=<owner>%2F<repo>).

If you use this workflow in a paper, don't forget to give credits to the authors by citing the URL of this (original) <repo>sitory and its DOI (see above).
The usage of this workflow is described in the [Snakemake Workflow Catalog](https://snakemake.github.io/snakemake-workflow-catalog/?usage=khanlab%2Fspimprep).

# TODO

* Replace `<owner>` and `<repo>` everywhere in the template (also under .github/workflows) with the correct `<repo>` name and owning user or organization.
* Replace `<name>` with the workflow name (can be the same as `<repo>`).
* Replace `<description>` with a description of what the workflow does.
* The workflow will occur in the snakemake-workflow-catalog once it has been made public. Then the link under "Usage" will point to the usage instructions if `<owner>` and `<repo>` were correctly set.
Note: Designed to work with data from the Miltenyi Biotec UltraMicroscope Blaze, but could be adapted to other types of data
3 changes: 1 addition & 2 deletions config/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Describe how to configure the workflow (using config.yaml and maybe additional files).
All of them need to be present with example entries inside of the config folder.
Add datasets to datasets.tsv, and update config.yml to customize options.
74 changes: 74 additions & 0 deletions config/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
datasets: 'config/datasets.tsv'


root: 'results'
work: 'work'

targets:
desc:
- stitchedflatcorr #e.g. can be stitchedraw to skip flatfield correction

import:
raw_tif_pattern: "{prefix}_Blaze[{tilex} x {tiley}]_C{channel}_xyz-Table Z{zslice}.ome.tif"
raw_tif_glob: "{prefix}_Blaze[[]{tilex} x {tiley}[]]_C{channel}_xyz-Table Z{zslice}.ome.tif"
intensity_rescaling: 0.5 #raw images seem to be at the upper end of uint16 (over-saturated) -- causes wrapping issues when adjusting with flatfield correction etc. this rescales the raw data as it imports it..



basic_flatfield_corr:
max_n_images: 500
fitting_opts:
get_darkfield: True
smoothness_flatfield: 1.0
smoothness_darkfield: 1.0
sparse_cost_darkfield: 0.01


bigstitcher:
calc_pairwise_shifts:
downsample_in_x: 4
downsample_in_y: 4
downsample_in_z: 1
filter_pairwise_shifts:
min_r: 0.7
fuse_dataset:
downsampling: 1
block_size_x: 1024 # for storage
block_size_y: 1024
block_size_z: 1
block_size_factor_x: 2 #e.g. 2 will use 2*block_size for computation
block_size_factor_y: 2
block_size_factor_z: 1

ome_zarr:
max_downsampling_layers: 4 # e.g. 4 levels: { 0: orig, 1: ds2, 2: ds4, 3: ds8, 4: ds16}
rechunk_size: #z, y, x
- 1
- 1024
- 1024
scaling_method: 'local_mean' #can be nearest, gaussian, local_mean, zoom (zoom uses spline interp)

nifti:
levels: #cannot be higher than max_downsampling_layers in ome_zarr
- 3
- 4

templates:
- ABAv3

atlases:
ABAv3:
anat: 'resources/ABAv3/P56_Atlas.nii.gz'
dseg: 'resources/ABAv3/P56_Annotation.nii.gz'
lut: 'resources/ABAv3/labelmapper_ABAv3_to_all.json'

atlasreg:
stain: autof
level: 4
desc: stitchedflatcorr



containers:
spimprep: 'docker://khanlab/spimprep-deps:main'
miracl: 'docker://mgoubran/miracl:2.2.5'
2 changes: 2 additions & 0 deletions config/datasets.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
subject sample acq stain_0 stain_1 dataset_path
mouse1 brain 1x abeta autof input_data/test_lightsheet_ome.tar
Binary file added dag.pdf
Binary file not shown.
Loading

0 comments on commit e39535b

Please sign in to comment.