Skip to content

Commit

Permalink
Enable STARsolo to handle out-of-memory in BAM sorting (#375)
Browse files Browse the repository at this point in the history
Add two inputs limitBAMsortRAM and outBAMsortingBinsN to expose the corresponding STAR options.
  • Loading branch information
yihming authored Feb 14, 2023
1 parent e65817a commit de2a45b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
10 changes: 9 additions & 1 deletion docs/starsolo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ A brief description of the sample sheet format is listed below **(required colum
- ``SlideSeq``
- ``ShareSeq``
- ``None``

If not specified, use the default ``tenX_v3``.

**3.2 Assay-specific preset STARsolo options**
Expand Down Expand Up @@ -310,6 +310,14 @@ Below are inputs for *count* workflow. Notice that required inputs are in bold.
- "BAM SortedByCoordinate"
- | "BAM SortedByCoordinate" for *tenX_v3*, *tenX_v2*, *SeqWell* and *DropSeq* assay types,
| "BAM Unsorted" otherwise.
* - limitBAMsortRAM
- [STAR option] Maximum available RAM (bytes) for sorting BAM. If ``0``, it will be set to the genome index size.
- 0
- 0
* - outBAMsortingBinsN
- [STAR option] Number of genome bins fo coordinate-sorting.
- 50
- 50
* - star_version
- STAR version to use. Currently support: ``2.7.9a``, ``2.7.10a`` (`2.7.10a_alpha_220601 <https://github.com/alexdobin/STAR/releases/tag/2.7.10a_alpha_220601>`_).
- "2.7.10a"
Expand Down
11 changes: 11 additions & 0 deletions workflows/starsolo/starsolo_count.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ workflow starsolo_count {
String? soloUMIfiltering
String? soloCellFilter
String? soloOutFormatFeaturesGeneField3
Float? limitBAMsortRAM
Int? outBAMsortingBinsN
String docker_registry
String star_version
String zones
Expand Down Expand Up @@ -86,6 +88,8 @@ workflow starsolo_count {
soloUMIfiltering = soloUMIfiltering,
soloCellFilter = soloCellFilter,
soloOutFormatFeaturesGeneField3 = soloOutFormatFeaturesGeneField3,
limitBAMsortRAM = limitBAMsortRAM,
outBAMsortingBinsN = outBAMsortingBinsN,
docker_registry = docker_registry,
version = star_version,
zones = zones,
Expand Down Expand Up @@ -138,6 +142,8 @@ task run_starsolo {
String? soloUMIfiltering
String? soloCellFilter
String? soloOutFormatFeaturesGeneField3
Float? limitBAMsortRAM
Int? outBAMsortingBinsN
String docker_registry
String version
String zones
Expand Down Expand Up @@ -342,6 +348,11 @@ task run_starsolo {
if '~{soloOutFormatFeaturesGeneField3}' != '':
args_dict['--soloOutFormatFeaturesGeneField3'] = remove_extra_space('~{soloOutFormatFeaturesGeneField3}').split(' ')
if '~{limitBAMsortRAM}' != '':
args_dict['--limitBAMsortRAM'] = '~{limitBAMsortRAM}'
if '~{outBAMsortingBinsN}' != '':
args_dict['--outBAMsortingBinsN'] = '~{outBAMsortingBinsN}'
call_args += generate_args_list(args_dict)
print(' '.join(call_args))
Expand Down
6 changes: 6 additions & 0 deletions workflows/starsolo/starsolo_workflow.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ workflow starsolo_workflow {
String docker_registry = "quay.io/cumulus"
# Reference Index TSV
File acronym_file = "gs://regev-lab/resources/starsolo/index.tsv"
# Maximum available RAM (bytes) for sorting BAM. If =0, it will be set to the genome index size. 0 value can only be used with --genomeLoad NoSharedMemory option.
Float? limitBAMsortRAM
# Number of genome bins fo coordinate-sorting. Default: 50
Int? outBAMsortingBinsN
# Disk space in GB needed per sample
Int disk_space = 500
# Google cloud zones to consider for execution
Expand Down Expand Up @@ -136,6 +140,8 @@ workflow starsolo_workflow {
soloUMIfiltering = soloUMIfiltering,
soloCellFilter = soloCellFilter,
soloOutFormatFeaturesGeneField3 = soloOutFormatFeaturesGeneField3,
limitBAMsortRAM = limitBAMsortRAM,
outBAMsortingBinsN = outBAMsortingBinsN,
output_directory = output_directory_stripped,
docker_registry = docker_registry,
star_version = star_version,
Expand Down

0 comments on commit de2a45b

Please sign in to comment.