Skip to content

Commit

Permalink
Merge pull request #124 from klarman-cell-observatory/yiming
Browse files Browse the repository at this point in the history
Update signature score calculation
  • Loading branch information
yihming authored Sep 23, 2020
2 parents fcb9bda + d34ae03 commit b078df1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
6 changes: 3 additions & 3 deletions workflows/cumulus/cumulus.wdl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version 1.0

import "https://api.firecloud.org/ga4gh/v1/tools/cumulus:cumulus_tasks/versions/22/plain-WDL/descriptor" as tasks
import "https://api.firecloud.org/ga4gh/v1/tools/cumulus:cumulus_tasks/versions/23/plain-WDL/descriptor" as tasks
# import "cumulus_tasks.wdl" as tasks
workflow cumulus {
Expand Down Expand Up @@ -100,7 +100,7 @@ workflow cumulus {
# Random number generator seed. [default: 0]
Int? random_state
# Calculate signature scores for gene sets in <GMT_file>.
File? calc_signature_scores
String? calc_signature_scores
# Number of PCs. [default: 50]
Int? nPC
# Number of neighbors used for constructing affinity matrix. [default: 100]
Expand Down Expand Up @@ -302,7 +302,7 @@ workflow cumulus {
correction_method = correction_method,
batch_group_by = batch_group_by,
random_state = random_state,
gene_signature_file = calc_signature_scores,
gene_signature_set = calc_signature_scores,
nPC = nPC,
knn_K = knn_K,
knn_full_speed = knn_full_speed,
Expand Down
15 changes: 12 additions & 3 deletions workflows/cumulus/cumulus_tasks.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ task run_cumulus_cluster {
String? correction_method
String? batch_group_by
Int? random_state
File? gene_signature_file
String? gene_signature_set
Int? nPC
Int? knn_K
Boolean? knn_full_speed
Expand Down Expand Up @@ -151,11 +151,17 @@ task run_cumulus_cluster {
String docker_registry
}
Boolean is_url = defined(gene_signature_set) && sub(select_first([gene_signature_set]), "^gs://.+", "URL") == "URL"
command {
set -e
export TMPDIR=/tmp
monitor_script.sh > monitoring.log &
if [ ~{is_url} == true ]; then
gsutil -q cp ~{gene_signature_set} gene_signature.gmt
fi
python <<CODE
from subprocess import check_call
Expand Down Expand Up @@ -210,8 +216,11 @@ task run_cumulus_cluster {
call_args.extend(['--counts-per-cell-after', '~{counts_per_cell_after}'])
if '~{random_state}' is not '':
call_args.extend(['--random-state', '~{random_state}'])
if '~{gene_signature_file}' is not '':
call_args.extend(['--calc-signature-scores', '~{gene_signature_file}'])
if '~{gene_signature_set}' is not '':
if '~{is_url}' is 'true':
call_args.extend(['--calc-signature-scores', 'gene_signature.gmt'])
else:
call_args.extend(['--calc-signature-scores', '~{gene_signature_set}'])
if '~{no_select_hvf}' is 'true':
call_args.append('--no-select-hvf')
if '~{select_hvf_flavor}' is not '':
Expand Down

0 comments on commit b078df1

Please sign in to comment.