Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
yihming committed Feb 24, 2025
1 parent 8d3f34a commit bd4be75
Show file tree
Hide file tree
Showing 11 changed files with 285 additions and 285 deletions.
12 changes: 2 additions & 10 deletions docs/starsolo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -335,20 +335,12 @@ Below are inputs for *count* workflow. Notice that required inputs are in bold.
- Disk space in GB needed for count per sample.
- 500
- 500
* - backend
- Cloud infrastructure backend to use. Available options:

- ``gcp`` for Google Cloud;
- ``aws`` for Amazon AWS;
- ``local`` for local machine.
- "gcp"
- "gcp"
* - preemptible
- Number of maximum preemptible tries allowed. This works only when *backend* is ``gcp``.
- Number of maximum preemptible tries allowed. Only works for GCP
- 2
- 2
* - awsQueueArn
- The AWS ARN string of the job queue to be used. This only works for ``aws`` backend.
- The AWS ARN string of the job queue to be used. Only works for AWS
- "arn:aws:batch:us-east-1:xxx:job-queue/priority-gwf"
- ""

Expand Down
7 changes: 5 additions & 2 deletions workflows/cellranger/cellranger_atac_create_reference.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ workflow cellranger_atac_create_reference {

# Number of preemptible tries
Int preemptible = 2
# Backend
String backend = "gcp"
# Arn string of AWS queue
String awsQueueArn = ""

Expand All @@ -41,6 +39,11 @@ workflow cellranger_atac_create_reference {
# Output directory, with trailing slashes stripped
String output_directory_stripped = sub(output_directory, "[/\\s]+$", "")

# Backend: gcp, aws, local
Boolean use_gcp = sub(output_directory, "^gs://.+$", "gcp") == "gcp"
Boolean use_aws = sub(output_directory, "^s3://.+$", "aws") == "aws"
String backend = (if use_gcp then "gcp" else (if use_aws then "aws" else "local"))

call run_cellranger_atac_create_reference {
input:
docker_registry = docker_registry,
Expand Down
42 changes: 9 additions & 33 deletions workflows/cellranger/cellranger_count.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ workflow cellranger_count {
String input_fastqs_directories
# A comma-separated list of input data types
String? input_data_types
# A comma-separated list of input feature barcode files
String? input_fbf
# A comma-separated list of input auxiliary files
String? input_aux
# CellRanger output directory, gs url
String output_directory

Expand All @@ -20,9 +20,6 @@ workflow cellranger_count {
# Index TSV file
File acronym_file

# Target panel CSV for targeted gene expression analysis
File? target_panel

# chemistry of the channel
String chemistry = "auto"
# Force pipeline to use this number of cells, bypassing the cell detection algorithm, mutually exclusive with expect_cells.
Expand Down Expand Up @@ -69,10 +66,9 @@ workflow cellranger_count {
input_samples = input_samples,
input_fastqs_directories = input_fastqs_directories,
input_data_types = input_data_types,
input_fbf = input_fbf,
input_aux = input_aux,
output_directory = output_directory,
genome_file = genome_file,
target_panel = target_panel,
chemistry = chemistry,
force_cells = force_cells,
expect_cells = expect_cells,
Expand Down Expand Up @@ -104,10 +100,9 @@ task run_cellranger_count {
String? input_samples
String input_fastqs_directories
String? input_data_types
String? input_fbf
String? input_aux
String output_directory
File genome_file
File? target_panel
String chemistry
Int? force_cells
Int? expect_cells
Expand Down Expand Up @@ -191,22 +186,17 @@ task run_cellranger_count {
for fastq_f in fastq_files:
check_fastq_file(fastq_f, sample_name)
samples = data_types = fbfs = None
samples = data_types = auxs = None
fastqs_dirs = []
if '~{input_samples}' != '':
assert version.parse('~{cellranger_version}') >= version.parse('3.0.2')
samples = '~{input_samples}'.split(',')
data_types = '~{input_data_types}'.split(',')
fbfs = '~{input_fbf}'.split(',')
auxs = '~{input_aux}'.split(',')
target_panel = set()
feature_file = set()
for dtype, fbf in zip(data_types, fbfs):
if dtype == 'rna':
target_panel.add(fbf)
else:
feature_file.add(fbf)
for dtype, aux in zip(data_types, auxs):
feature_file.add(aux)
def _locate_file(file_set, keyword):
if len(file_set) > 1:
Expand All @@ -220,7 +210,6 @@ task run_cellranger_count {
check_call(call_args)
return os.path.abspath(os.path.basename(file_loc))
target_panel = _locate_file(target_panel, 'target panel')
feature_file = _locate_file(feature_file, 'feature reference')
assert feature_file != ''
Expand Down Expand Up @@ -256,26 +245,14 @@ task run_cellranger_count {
if samples is None: # not Feature Barcode
call_args.extend(['--sample=~{sample_id}', '--fastqs=' + ','.join(fastqs_dirs)])
if ('~{target_panel}' != '') and (os.path.basename('~{target_panel}') != 'null'):
assert version.parse('~{cellranger_version}') >= version.parse('4.0.0')
call_args.append('--target-panel=~{target_panel}')
else:
call_args.extend(['--libraries=libraries.csv', '--feature-ref=' + feature_file])
if target_panel != '':
assert version.parse('~{cellranger_version}') >= version.parse('4.0.0')
call_args.append('--target-panel=' + target_panel)
if '~{force_cells}' != '':
call_args.append('--force-cells=~{force_cells}')
if '~{expect_cells}' != '':
call_args.append('--expect-cells=~{expect_cells}')
if '~{include_introns}' == 'true':
assert version.parse('~{cellranger_version}') >= version.parse('5.0.0')
if version.parse('~{cellranger_version}') >= version.parse('7.0.0'):
call_args.extend(['--include-introns', '~{include_introns}'])
else:
call_args.append('--include-introns')
elif version.parse('~{cellranger_version}') >= version.parse('7.0.0'):
if '~{include_introns}' == 'false':
call_args.extend(['--include-introns', '~{include_introns}'])
# For generating BAM output
Expand All @@ -286,7 +263,6 @@ task run_cellranger_count {
call_args.append('--create-bam=false')
else:
if '~{no_bam}' == 'true':
assert version.parse('~{cellranger_version}') >= version.parse('5.0.0')
call_args.append('--no-bam')
if '~{secondary}' != 'true':
Expand Down
7 changes: 5 additions & 2 deletions workflows/cellranger/cellranger_create_reference.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,18 @@ workflow cellranger_create_reference {

# Number of preemptible tries
Int preemptible = 2
# Backend
String backend = "gcp"
# Arn string of AWS queue
String awsQueueArn = ""
}

# Output directory, with trailing slashes stripped
String output_directory_stripped = sub(output_directory, "[/\\s]+$", "")

# Backend: gcp, aws, local
Boolean use_gcp = sub(output_directory, "^gs://.+$", "gcp") == "gcp"
Boolean use_aws = sub(output_directory, "^s3://.+$", "aws") == "aws"
String backend = (if use_gcp then "gcp" else (if use_aws then "aws" else "local"))

call generate_create_reference_config {
input:
input_sample_sheet = input_sample_sheet,
Expand Down
Loading

0 comments on commit bd4be75

Please sign in to comment.