Skip to content

Commit

Permalink
add cram into inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
kubranarci committed Nov 12, 2024
1 parent 601f6a5 commit 2b698ef
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ results/
result/
results2/
results37/
results_vep/
results_annovar/
test.xml
test_output/
tests/data/
Expand All @@ -21,3 +23,4 @@ testdata_hg37/
.github/CODEOWNERS-tmp
bin/vcfparser.pyc
singularity/
snvs_*
28 changes: 23 additions & 5 deletions assets/schema_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,33 @@
},
"tumor": {
"type": "string",
"pattern": "^\\S+\\.bam$",
"errorMessage": "BAM file for tumors must be provided'"
"pattern": "^\\S+\\.(bam|cram)$",
"errorMessage": "BAM or CRAM file for tumors must be provided'"
},
"tumor_index": {
"type": "string",
"pattern": "^\\S+\\.(bai|crai)$",
"errorMessage": "BAI OR crai file matching to BAM for tumors must be provided'"
},
"control": {
"errorMessage": "BAM file for as control matching to tumor, if there is",
"errorMessage": "BAM or CRAM file for as control matching to tumor, if there is",
"anyOf": [
{
"type": "string",
"pattern": "^\\S+\\.(bam|cram)$"
},
{
"type": "string",
"maxLength": 0
}
]
},
"control_index": {
"errorMessage": "BAI or CRAI file matching to BAM for as control matching to tumor, if there is",
"anyOf": [
{
"type": "string",
"pattern": "^\\S+\\.bam$"
"pattern": "^\\S+\\.(bai|crai)$"
},
{
"type": "string",
Expand All @@ -31,6 +49,6 @@
]
}
},
"required": ["sample", "tumor"]
"required": ["sample", "tumor", "tumor_index"]
}
}
2 changes: 1 addition & 1 deletion conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ process {
]
}
withName: 'ENSEMBLVEP_VEP' {
//ext.args ='--everything --filter_common --per_gene --total_length --offline'
ext.args ='--everything --filter_common --per_gene --total_length --offline'
publishDir = [
[
mode: params.publish_dir_mode,
Expand Down
8 changes: 4 additions & 4 deletions modules/local/grep_samplename.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ process GREP_SAMPLENAME {

conda (params.enable_conda ? "" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'docker://kubran/odcf_mpileupsnvcalling:v0':'kubran/odcf_mpileupsnvcalling:v0' }"
'docker://kubran/samtools:v1.9':'kubran/samtools:v1.9' }"

input:
tuple val(meta), path(tumor), path(tumor_bai), path(control), path(control_bai)
Expand All @@ -20,8 +20,8 @@ process GREP_SAMPLENAME {
if (meta.iscontrol == '1')
{
"""
controlname=`samtools view -H $meta.control_bam | grep '^@RG' | sed "s/.*SM:\\([^\\t]*\\).*/\\1/g" | uniq`
tumorname=`samtools view -H $meta.tumor_bam | grep '^@RG' | sed "s/.*SM:\\([^\\t]*\\).*/\\1/g" | uniq`
controlname=`samtools view -H $control | grep '^@RG' | sed "s/.*SM:\\([^\\t]*\\).*/\\1/g" | uniq`
tumorname=`samtools view -H $tumor | grep '^@RG' | sed "s/.*SM:\\([^\\t]*\\).*/\\1/g" | uniq`
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand All @@ -33,7 +33,7 @@ process GREP_SAMPLENAME {
else {
"""
controlname='dummy'
tumorname=`samtools view -H $meta.tumor_bam | grep '^@RG' | sed "s/.*SM:\\([^\\t]*\\).*/\\1/g" | uniq`
tumorname=`samtools view -H $tumor | grep '^@RG' | sed "s/.*SM:\\([^\\t]*\\).*/\\1/g" | uniq`
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
5 changes: 5 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ params {
cytobandcol = '"CYTOBAND"' // default value
geneannocols = '"ANNOVAR_FUNCTION,GENE,EXONIC_CLASSIFICATION,ANNOVAR_TRANSCRIPTS"' // default value

// VEP
vep_cache_version = null
vep_genome = null
vep_cache = null
download_cache = true // DO NOT Download annotation cache

// Files //
data_path = null // If database files in the same place
Expand Down

0 comments on commit 2b698ef

Please sign in to comment.