-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BD rhapsody sequence analysis #96
Merged
Merged
Changes from all commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
a773d67
wip
rcannood 410aec5
fix test
rcannood 4ff4bf1
add help
rcannood 1bfd1b9
update 2.2 args
rcannood 703007d
fix bug
rcannood 0b597a7
extend test data
rcannood b39b2b8
Merge remote-tracking branch 'origin/main' into bd_rhapsody_sequence_…
rcannood 732ac4d
output separate files
rcannood 4d5a0c8
analyse missing args
rcannood 325cef4
tweaks to test
rcannood a261478
fix script
rcannood af21cc2
fix test
rcannood 401e432
fix test
rcannood 343ec5f
move small reference
rcannood 743fd59
wip generate wta test data
rcannood 7cad605
don't forget about umi in r1
rcannood 6a690f0
remove unneeded pkg
rcannood 6cb8ef1
load reference in memory just once
rcannood 8d3c473
fix random choices
rcannood 3e4fd80
extend test
rcannood aa60d98
add abc immunediscoverypanel
rcannood 89eccfe
wip abc testing code
rcannood b536557
fix abc test; need unique instrument, run and flowcell ids for each s…
rcannood 6e59f50
add smk data
rcannood 3c37877
add entry to changelog
rcannood 01d4a18
remove old test file
rcannood 0bac1ff
adapt test for missing read
rcannood 5402b44
update description
rcannood 94f9fc6
add comment
rcannood cbbc222
ensure cwl files are absolute
rcannood 802d097
Apply suggestions from code review
rcannood 21dfb67
fix suggestion
rcannood f8f9c16
newer pipelines have docker requirements as a hint instead of a stric…
rcannood a77d3dc
rename str to content
rcannood bcd01e6
remove deleted resources
rcannood 8a1e1a6
fix containers
rcannood db269d6
fix script
rcannood a41985b
fix suggestion
rcannood 20036f1
fix suggestion...
rcannood 45534ec
fix test
rcannood 38cc27a
fix component name
rcannood 1ef5e7e
Merge remote-tracking branch 'origin/main' into bd_rhapsody_sequence_…
rcannood d5866b5
fix test
rcannood f052627
apply suggestions
rcannood cba2a07
Merge remote-tracking branch 'origin/main' into bd_rhapsody_sequence_…
rcannood ffca947
fix test
rcannood 95d53a0
added note
rcannood 587f0b3
Merge remote-tracking branch 'origin/main' into bd_rhapsody_sequence_…
rcannood 908c1ee
fix changelog
rcannood e7b9f97
fix changelog again
rcannood f6e4d91
splitting hairs here
rcannood File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
115 changes: 0 additions & 115 deletions
115
src/bd_rhapsody/bd_rhapsody_make_reference/make_rhap_reference_2.2.1_nodocker.cwl
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 0 additions & 47 deletions
47
src/bd_rhapsody/bd_rhapsody_make_reference/test_data/script.sh
This file was deleted.
Oops, something went wrong.
116 changes: 116 additions & 0 deletions
116
src/bd_rhapsody/bd_rhapsody_sequence_analysis/_process_cwl.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
# Extract arguments from CWL file and write them to arguments.yaml | ||
# | ||
# This script: | ||
# - reads the CWL file | ||
# - extracts the main workflow arguments | ||
# - compares cwl arguments to viash config arguments | ||
# - writes the arguments to arguments.yaml | ||
# | ||
# It can be used to update the arguments in the viash config after an | ||
# update to the CWL file has been made. | ||
# | ||
# Dependencies: tidyverse, jsonlite, yaml, dynutils | ||
# | ||
# Install dependencies: | ||
# ```R | ||
# install.packages(c("tidyverse", "jsonlite", "yaml", "dynutils")) | ||
# ``` | ||
# | ||
# Usage: | ||
# ```bash | ||
# Rscript src/bd_rhapsody/bd_rhapsody_sequence_analysis/_process_cwl.R | ||
# ``` | ||
|
||
library(tidyverse) | ||
|
||
# fetch and read cwl file | ||
lines <- read_lines("https://bitbucket.org/CRSwDev/cwl/raw/8feeace1141b24749ea6003f8e6ad6d3ad5232de/v2.2.1/rhapsody_pipeline_2.2.1.cwl") | ||
cwl_header <- lines[[1]] | ||
cwl_obj <- jsonlite::fromJSON(lines[-1], simplifyVector = FALSE) | ||
|
||
# detect main workflow arguments | ||
gr <- dynutils::list_as_tibble(cwl_obj$`$graph`) | ||
|
||
gr %>% print(n = 100) | ||
|
||
main <- gr %>% filter(gr$id == "#main") | ||
|
||
main_inputs <- main$inputs[[1]] | ||
|
||
input_ids <- main_inputs %>% map_chr("id") %>% gsub("^#main/", "", .) | ||
|
||
# check whether in config | ||
config <- yaml::read_yaml("src/bd_rhapsody/bd_rhapsody_sequence_analysis/config.vsh.yaml") | ||
config$all_arguments <- config$argument_groups %>% map("arguments") %>% list_flatten() | ||
arg_names <- config$all_arguments %>% map_chr("name") %>% gsub("^--", "", .) | ||
|
||
# arguments in cwl but not in config | ||
setdiff(tolower(input_ids), arg_names) | ||
|
||
# arguments in config but not in cwl | ||
setdiff(arg_names, tolower(input_ids)) | ||
|
||
# create arguments from main_inputs | ||
arguments <- map(main_inputs, function(main_input) { | ||
input_id <- main_input$id %>% gsub("^#main/", "", .) | ||
input_type <- main_input$type[[2]] | ||
|
||
if (is.list(input_type) && input_type$type == "array") { | ||
multiple <- TRUE | ||
input_type <- input_type$items | ||
} else { | ||
multiple <- FALSE | ||
} | ||
|
||
if (is.list(input_type) && input_type$type == "enum") { | ||
choices <- input_type$symbols %>% | ||
gsub(paste0(input_type$name, "/"), "", .) | ||
input_type <- "enum" | ||
} else { | ||
choices <- NULL | ||
} | ||
|
||
description <- | ||
if (is.null(main_input$label)) { | ||
main_input$doc | ||
} else if (is.null(main_input$doc)) { | ||
main_input$label | ||
} else { | ||
paste0(main_input$label, ". ", main_input$doc) | ||
} | ||
|
||
type_map <- c( | ||
"float" = "double", | ||
"int" = "integer", | ||
"string" = "string", | ||
"boolean" = "boolean", | ||
"File" = "file", | ||
"enum" = "string" | ||
) | ||
|
||
out <- list( | ||
name = paste0("--", tolower(input_id)), | ||
type = type_map[input_type], | ||
# TODO: use summary when viash 0.9 is released | ||
# summary = main_input$doc, | ||
# description = main_input$doc, | ||
description = description, | ||
multiple = multiple, | ||
choices = choices, | ||
info = list( | ||
config_key = input_id | ||
) | ||
) | ||
|
||
out[!sapply(out, is.null)] | ||
}) | ||
|
||
|
||
|
||
yaml::write_yaml( | ||
arguments, | ||
"src/bd_rhapsody/bd_rhapsody_sequence_analysis/arguments.yaml", | ||
handlers = list( | ||
logical = yaml::verbatim_logical | ||
) | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would propose to also create an unpublished component for this, so that it it easier to run and manage the dependencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙅 No thank you! It will never be used as part of a pipeline or a standalone component. The script uses just base tidyverse. And oh, one dynutils statement which probably has an equivalent function in the tidyverse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but in that case I would add a short README with perhaps the following:
Just in case somebody wants to work on this in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!