-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace input CSV with YAML and parse sample ID from BAM (#106)
* update submodules * remove CSV and add YAML input * add custom schema * udate ouput dir structure set up * change patient_id to sample_id * update pipeval * remove empty line * update channels to parse input from YAML * Update CHANGELOG.md * fix YAML linting * fix YAML linting * update help comments * remove redundant code * update comment in config * update logging * use params.samples_to_process to parse sample id * set sample ID from tumor ID extracted using params.samples_to_process * remove redundant code * check for multiple tumor samples before setting sample param * fix typo in error --------- Co-authored-by: Mootor <mmootor@ip-0A125250.rhxrlfvjyzbupc03cc22jkch3c.xx.internal.cloudapp.net>
- Loading branch information
1 parent
0c8def0
commit 9917c17
Showing
11 changed files
with
229 additions
and
131 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
/** | ||
* This custom schema namespace implements a custom type for checking input BAMs for call-sSV | ||
*/ | ||
custom_schema_types { | ||
allowed_input_types = [ | ||
'BAM' | ||
] | ||
allowed_bam_types = [ | ||
'normal', | ||
'tumor' | ||
] | ||
|
||
/** | ||
* Check that input types are in allowed list | ||
*/ | ||
check_input_type_keys = { List given, String name, List choices=custom_schema_types.allowed_input_types -> | ||
for (elem in given) { | ||
if (!(elem in choices)) { | ||
throw new Exception("Invalid paramter ${name}. Valid types: ${choices}.") | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Check if given input is a Namespace | ||
*/ | ||
check_if_namespace = { val, String name -> | ||
if (!(val in Map)) { | ||
throw new Exception("${name} should be a Namespace, not ${val.getClass()}.") | ||
} | ||
} | ||
|
||
/** | ||
* Check if given input is a list | ||
*/ | ||
check_if_list = { val, String name -> | ||
if (!(val in List || val in Set)) { | ||
throw new Exception("${name} should be a List, not ${val.getClass()}.") | ||
} | ||
} | ||
|
||
/** | ||
* Check that input is namespace of expected types | ||
*/ | ||
check_input_namespace = { Map options, String name, Map properties -> | ||
// Check parameters keys | ||
custom_schema_types.check_if_namespace(options[name], name) | ||
def given_keys = options[name].keySet() as ArrayList | ||
custom_schema_types.check_input_type_keys(given_keys, name) | ||
|
||
options[name].each { entry -> | ||
def entry_as_map = [:] | ||
entry_as_map[entry.key] = entry.value | ||
schema.validate_parameter(entry_as_map, entry.key, properties.elements[entry.key]) | ||
} | ||
} | ||
|
||
/** | ||
* Check namespace BAM | ||
*/ | ||
check_bam_namespace = { Map options, String name, Map properties -> | ||
custom_schema_types.check_if_namespace(options[name], name) | ||
def given_keys = options[name].keySet() as ArrayList | ||
if (given_keys.size() <= 0) { | ||
throw new Exception("No inputs provided! Please provide inputs in the CSV or YAML.") | ||
} | ||
custom_schema_types.check_input_type_keys(given_keys, name, custom_schema_types.allowed_bam_types) | ||
|
||
options[name].each { entry -> | ||
def entry_as_map = [:] | ||
entry_as_map[entry.key] = entry.value | ||
schema.validate_parameter(entry_as_map, entry.key, properties.elements[entry.key]) | ||
} | ||
} | ||
|
||
/** | ||
* Check if proper BAM entry list | ||
*/ | ||
check_bam_list = { Map options, String name, Map properties -> | ||
custom_schema_types.check_if_list(options[name], name) | ||
for (item in options[name]) { | ||
schema.check_path(item, 'r') | ||
} | ||
} | ||
|
||
types = [ | ||
'InputNamespace': custom_schema_types.check_input_namespace, | ||
'InputBAMNamespace': custom_schema_types.check_bam_namespace, | ||
'BAMEntryList': custom_schema_types.check_bam_list | ||
] | ||
} |
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
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 |
---|---|---|
@@ -1,51 +1,68 @@ | ||
--- | ||
input_csv: | ||
type: 'Path' | ||
mode: 'r' | ||
required: true | ||
help: 'Absolute path to the input CSV file' | ||
sample_id: | ||
type: 'String' | ||
required: true | ||
help: 'Sample ID' | ||
reference_fasta: | ||
type: 'Path' | ||
mode: 'r' | ||
required: true | ||
help: 'Absolute path to a reference FASTA file' | ||
type: 'Path' | ||
mode: 'r' | ||
required: true | ||
help: 'Absolute path to a reference FASTA file' | ||
exclusion_file: | ||
type: 'Path' | ||
mode: 'r' | ||
required: true | ||
help: 'Absoulte path to an exclusion file' | ||
type: 'Path' | ||
mode: 'r' | ||
required: true | ||
help: 'Absoulte path to an exclusion file' | ||
algorithm: | ||
type: 'List' | ||
required: true | ||
help: 'List of SV caller(s) for calling' | ||
default: | ||
- delly | ||
- manta | ||
choices: | ||
- delly | ||
- manta | ||
type: 'List' | ||
required: true | ||
help: 'List of available somatic SV callers' | ||
default: | ||
- delly | ||
- manta | ||
choices: | ||
- delly | ||
- manta | ||
output_dir: | ||
type: 'Path' | ||
mode: 'w' | ||
required: true | ||
help: 'Absolute path to output directory' | ||
type: 'Path' | ||
mode: 'w' | ||
required: true | ||
help: 'Absolute path to output directory' | ||
dataset_id: | ||
type: 'String' | ||
required: true | ||
help: 'Dataset identifier' | ||
type: 'String' | ||
required: true | ||
help: 'Dataset identifier' | ||
map_qual: | ||
type: 'Integer' | ||
required: true | ||
default: 20 | ||
type: 'Integer' | ||
required: true | ||
default: 20 | ||
min_clique_size: | ||
type: 'Integer' | ||
required: true | ||
default: 5 | ||
type: 'Integer' | ||
required: true | ||
default: 5 | ||
mad_cutoff: | ||
type: 'Integer' | ||
required: true | ||
default: 15 | ||
type: 'Integer' | ||
required: true | ||
default: 15 | ||
filter_condition: | ||
type: 'String' | ||
required: true | ||
default: "FILTER=='PASS'" | ||
type: 'String' | ||
required: true | ||
default: "FILTER=='PASS'" | ||
input: | ||
type: 'InputNamespace' | ||
required: true | ||
help: 'Input samples' | ||
elements: | ||
BAM: | ||
type: 'InputBAMNamespace' | ||
required: true | ||
help: 'Input BAMs for somatic structural variant calling' | ||
elements: | ||
normal: | ||
type: 'BAMEntryList' | ||
required: false | ||
help: 'Input normal BAMs' | ||
tumor: | ||
type: 'BAMEntryList' | ||
required: false | ||
help: 'Input tumor BAMs' |
Submodule pipeline-Nextflow-config
updated
from eb52a2 to cb9a70
Submodule pipeline-Nextflow-module
updated
7 files
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
sample_id: "sample_id" | ||
input: | ||
BAM: | ||
normal: | ||
- "/absolute/path/to/BAM" | ||
tumor: | ||
- "/abosolute/path/to/BAM" |
Oops, something went wrong.