Skip to content

Commit fb1e73c

Browse files
committed
final ui cleanup
1 parent 96a5224 commit fb1e73c

File tree

5 files changed

+99
-119
lines changed

5 files changed

+99
-119
lines changed

latch_metadata/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
author=LatchAuthor(
99
name="nf-core",
1010
),
11+
repository="https://github.com/latchbio-nfcore/scrnaseq",
1112
parameters=generated_parameters,
1213
runtime_resources=NextflowRuntimeResources(
1314
cpus=4,

latch_metadata/parameters.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
from dataclasses import dataclass
22
from enum import Enum
3-
from pathlib import Path
43
from typing import List, Optional
54

6-
from flytekit.core.annotation import FlyteAnnotation
75
from latch.types.directory import LatchDir, LatchOutputDir
86
from latch.types.file import LatchFile
97
from latch.types.metadata import (
108
Fork,
119
ForkBranch,
12-
LatchAuthor,
13-
NextflowMetadata,
10+
LatchRule,
1411
NextflowParameter,
1512
Params,
1613
Section,
@@ -149,6 +146,12 @@ class SampleSheet:
149146
section_title=None,
150147
display_name="Run name",
151148
description="Name of Run",
149+
rules=[
150+
LatchRule(
151+
regex=r"^[a-zA-Z0-9_-]+$",
152+
message="Run name must contain only letters, digits, underscores, and dashes. No spaces are allowed.",
153+
)
154+
],
152155
),
153156
"email": NextflowParameter(
154157
type=Optional[str],

version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.0
1+
2.7.1

wf/__init__.py

Lines changed: 87 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
from typing import Annotated, List, Optional
1+
from typing import List, Optional
22

3-
from flytekit.core.annotation import FlyteAnnotation
43
from latch.resources.launch_plan import LaunchPlan
54
from latch.resources.workflow import workflow
65
from latch.types import metadata
76
from latch.types.directory import LatchDir, LatchOutputDir
87
from latch.types.file import LatchFile
98

9+
from wf.cellxgene import cellxgene_prep
1010
from wf.entrypoint import (
1111
Aligner,
1212
Chemistry,
1313
Reference_Type,
1414
SampleSheet,
1515
STAR_options,
16-
cellxgene_prep,
1716
initialize,
1817
kb_workflow,
1918
nextflow_runtime,
@@ -60,12 +59,94 @@ def nf_nf_core_scrnaseq(
6059
skip_emptydrops: bool = True,
6160
) -> LatchOutputDir:
6261
"""
63-
nf-core/scrnaseq
62+
nf-core/scrnaseq is a bioinformatics best-practice analysis pipeline for processing 10x Genomics single-cell RNA-seq data.
63+
64+
<html>
65+
<p align="center">
66+
<img src="https://user-images.githubusercontent.com/31255434/182289305-4cc620e3-86ae-480f-9b61-6ca83283caa5.jpg" alt="Latch Verified" width="100">
67+
</p>
68+
69+
<p align="center">
70+
<strong>
71+
Latch Verified
72+
</strong>
73+
</p>
74+
75+
<p align="center">
76+
77+
[![Cite with Zenodo](http://img.shields.io/badge/DOI-10.5281/zenodo.3568187-1073c8?labelColor=000000)](https://doi.org/10.5281/zenodo.3568187)
78+
79+
**nf-core/scrnaseq** is a bioinformatics best-practice analysis pipeline for processing 10x Genomics single-cell RNA-seq data.
80+
81+
## Introduction
82+
83+
This workflow is hosted on Latch Workflows, using a native Nextflow integration, with a graphical interface for accessible analysis by scientists. There is also an integration with Latch Registry so that batched workflows can be launched from “graphical sample sheets” or tables associating raw sequencing files with metadata.
84+
85+
This is a community effort in building a pipeline capable to support:
86+
87+
- Alevin-Fry + AlevinQC
88+
- STARSolo
89+
- Kallisto + BUStools
90+
91+
## Documentation
92+
93+
The nf-core/scrnaseq pipeline comes with documentation about the pipeline [usage](https://nf-co.re/scrnaseq/usage), [parameters](https://nf-co.re/scrnaseq/parameters) and [output](https://nf-co.re/scrnaseq/output).
94+
95+
## Usage
96+
97+
First, prepare a samplesheet with your input data that looks as follows:
98+
99+
`samplesheet.csv`:
100+
101+
sample,fastq_1,fastq_2,expected_cells
102+
pbmc8k,pbmc8k_S1_L007_R1_001.fastq.gz,pbmc8k_S1_L007_R2_001.fastq.gz,10000
103+
pbmc8k,pbmc8k_S1_L008_R1_001.fastq.gz,pbmc8k_S1_L008_R2_001.fastq.gz,10000
104+
105+
Each row represents a fastq file (single-end) or a pair of fastq files (paired end).
106+
107+
## Decision Tree for users
108+
109+
The nf-core/scrnaseq pipeline features several paths to analyze your single cell data. Future additions will also be done soon, e.g. the addition of multi-ome analysis types. To aid users in analyzing their data, we have added a decision tree to help people decide on what type of analysis they want to run and how to choose appropriate parameters for that.
110+
111+
Options for the respective alignment method can be found [here](https://github.com/nf-core/scrnaseq/blob/dev/docs/usage.md#aligning-options) to choose between methods.
112+
113+
## Pipeline output
114+
115+
To see the results of an example test run with a full size dataset refer to the [results](https://nf-co.re/scrnaseq/results) tab on the nf-core website pipeline page.
116+
For more details about the output files and reports, please refer to the
117+
[output documentation](https://nf-co.re/scrnaseq/output).
118+
119+
## Credits
120+
121+
nf-core/scrnaseq was originally written by Bailey PJ, Botvinnik O, Marques de Almeida F, Gabernet G, Peltzer A, Sturm G.
122+
123+
We thank the following people and teams for their extensive assistance in the development of this pipeline:
124+
125+
- @heylf
126+
- @KevinMenden
127+
- @FloWuenne
128+
- @rob-p
129+
- [GHGA](https://www.ghga.de/)
130+
131+
## Contributions and Support
132+
133+
If you would like to contribute to this pipeline, please see the [contributing guidelines](.github/CONTRIBUTING.md).
134+
135+
For further information or help, don't hesitate to get in touch on the [Slack `#scrnaseq` channel](https://nfcore.slack.com/channels/scrnaseq) (you can join with [this invite](https://nf-co.re/join/slack)).
136+
137+
## Citations
138+
139+
If you use nf-core/scrnaseq for your analysis, please cite it using the following doi: [10.5281/zenodo.3568187](https://doi.org/10.5281/zenodo.3568187)
140+
141+
The basic benchmarks that were used as motivation for incorporating the three available modular workflows can be found in [this publication](https://www.biorxiv.org/content/10.1101/673285v2).
142+
143+
We offer all three paths for the processing of scRNAseq data so it remains up to the user to decide which pipeline workflow is chosen for a particular analysis question.
144+
145+
An extensive list of references for the tools used by the pipeline can be found in the [`CITATIONS.md`](CITATIONS.md) file.
64146
65-
Sample Description
66147
"""
67148

68-
pvc_name: str = initialize()
149+
pvc_name: str = initialize(run_name=run_name)
69150
run_name = nextflow_runtime(
70151
pvc_name=pvc_name,
71152
input=input,

wf/entrypoint.py

Lines changed: 3 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,16 @@
99
from typing import Any, List, Optional
1010

1111
import requests
12-
import typing_extensions
13-
from flytekit.core.annotation import FlyteAnnotation
1412
from latch.executions import rename_current_execution, report_nextflow_used_storage
1513
from latch.ldata.path import LPath
1614
from latch.resources.tasks import custom_task, nextflow_runtime_task
17-
from latch.resources.workflow import workflow
18-
from latch.types import metadata
1915
from latch.types.directory import LatchDir, LatchOutputDir
2016
from latch.types.file import LatchFile
2117
from latch_cli.nextflow.utils import _get_execution_name
2218
from latch_cli.nextflow.workflow import get_flag
2319
from latch_cli.services.register.utils import import_module_by_path
2420
from latch_cli.utils import urljoins
2521

26-
from wf.cellxgene import cellxgene_prep
27-
2822
meta = Path("latch_metadata") / "__init__.py"
2923
import_module_by_path(meta)
3024

@@ -142,7 +136,9 @@ def custom_samplesheet_constructor(
142136

143137

144138
@custom_task(cpu=0.25, memory=0.5, storage_gib=1)
145-
def initialize() -> str:
139+
def initialize(run_name: str) -> str:
140+
rename_current_execution(str(run_name))
141+
146142
token = os.environ.get("FLYTE_INTERNAL_EXECUTION_ID")
147143
if token is None:
148144
raise RuntimeError("failed to get execution token")
@@ -166,11 +162,6 @@ def initialize() -> str:
166162
return resp.json()["name"]
167163

168164

169-
# input_construct_samplesheet = metadata._nextflow_metadata.parameters[
170-
# "input"
171-
# ].samplesheet_constructor
172-
173-
174165
@nextflow_runtime_task(cpu=8, memory=8, storage_gib=500)
175166
def nextflow_runtime(
176167
run_name: str,
@@ -212,9 +203,7 @@ def nextflow_runtime(
212203
skip_emptydrops: bool = True,
213204
) -> str:
214205
shared_dir = Path("/nf-workdir")
215-
rename_current_execution(str(run_name))
216206

217-
# input_samplesheet = input_construct_samplesheet(input)
218207
# Create custom sample sheet
219208
input_samplesheet = custom_samplesheet_constructor(
220209
samples=input, shared_dir=shared_dir
@@ -396,97 +385,3 @@ def nextflow_runtime(
396385
sys.exit(1)
397386

398387
return str(run_name)
399-
400-
401-
@workflow(metadata._nextflow_metadata)
402-
def nf_nf_core_scrnaseq(
403-
run_name: str,
404-
input: List[SampleSheet],
405-
outdir: LatchOutputDir,
406-
email: Optional[str],
407-
multiqc_title: Optional[str],
408-
barcode_whitelist: Optional[LatchFile],
409-
protocol: Chemistry,
410-
skip_multiqc: bool,
411-
skip_fastqc: bool,
412-
genome_source: str,
413-
genome: Optional[str],
414-
fasta: Optional[LatchFile],
415-
transcript_fasta: Optional[LatchFile],
416-
gtf: Optional[LatchFile],
417-
salmon_index: Optional[LatchDir],
418-
txp2gene: Optional[LatchFile],
419-
star_index: Optional[LatchDir],
420-
star_ignore_sjdbgtf: Optional[LatchFile],
421-
seq_center: Optional[str],
422-
kallisto_index: Optional[LatchDir],
423-
kb_t1c: Optional[LatchFile],
424-
kb_t2c: Optional[LatchFile],
425-
kb_filter: bool,
426-
cellranger_index: Optional[LatchFile],
427-
motifs: Optional[str],
428-
cellrangerarc_config: Optional[str],
429-
cellrangerarc_reference: Optional[str],
430-
universc_index: Optional[LatchFile],
431-
multiqc_methods_description: Optional[LatchFile],
432-
aligner: Aligner = Aligner.alevin,
433-
latch_genome: Reference_Type = Reference_Type.hg38,
434-
simpleaf_rlen: Optional[int] = 91,
435-
star_feature: Optional[STAR_options] = STAR_options.gene,
436-
kb_workflow: Optional[kb_workflow] = kb_workflow.std,
437-
save_reference: bool = False,
438-
skip_emptydrops: bool = True,
439-
) -> LatchOutputDir:
440-
"""
441-
nf-core/scrnaseq
442-
443-
Sample Description
444-
"""
445-
446-
pvc_name: str = initialize()
447-
run_name = nextflow_runtime(
448-
pvc_name=pvc_name,
449-
input=input,
450-
outdir=outdir,
451-
run_name=run_name,
452-
email=email,
453-
multiqc_title=multiqc_title,
454-
barcode_whitelist=barcode_whitelist,
455-
aligner=aligner,
456-
protocol=protocol,
457-
skip_multiqc=skip_multiqc,
458-
skip_fastqc=skip_fastqc,
459-
skip_emptydrops=skip_emptydrops,
460-
genome_source=genome_source,
461-
genome=genome,
462-
latch_genome=latch_genome,
463-
fasta=fasta,
464-
transcript_fasta=transcript_fasta,
465-
gtf=gtf,
466-
save_reference=save_reference,
467-
salmon_index=salmon_index,
468-
txp2gene=txp2gene,
469-
simpleaf_rlen=simpleaf_rlen,
470-
star_index=star_index,
471-
star_ignore_sjdbgtf=star_ignore_sjdbgtf,
472-
seq_center=seq_center,
473-
star_feature=star_feature,
474-
kallisto_index=kallisto_index,
475-
kb_t1c=kb_t1c,
476-
kb_t2c=kb_t2c,
477-
kb_workflow=kb_workflow,
478-
kb_filter=kb_filter,
479-
cellranger_index=cellranger_index,
480-
motifs=motifs,
481-
cellrangerarc_config=cellrangerarc_config,
482-
cellrangerarc_reference=cellrangerarc_reference,
483-
universc_index=universc_index,
484-
multiqc_methods_description=multiqc_methods_description,
485-
)
486-
487-
return cellxgene_prep(
488-
run_name=run_name,
489-
aligner=aligner,
490-
skip_emptydrops=skip_emptydrops,
491-
outdir=outdir,
492-
)

0 commit comments

Comments
 (0)