-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: minor issues with sigpromatrix and snv multiplicity
- Loading branch information
1 parent
793835b
commit dc3dc6f
Showing
12 changed files
with
730 additions
and
293 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/usr/bin/perl | ||
|
||
#------------------------------------------------------------------------------- | ||
# | ||
# Read a VCF file (via STDIN), split EFF fields from INFO column into many lines | ||
# leaving one line per effect. | ||
# | ||
# Note: In lines having multiple effects, all other information will be | ||
# repeated. Only the 'EFF' field will change. | ||
# | ||
# Pablo Cingolani 2012 | ||
#------------------------------------------------------------------------------- | ||
|
||
$INFO_FIELD_NUM = 7; | ||
|
||
while( $l = <STDIN> ) { | ||
# Show header lines | ||
if( $l =~ /^#/ ) { print $l; } | ||
else { | ||
chomp $l; | ||
|
||
@t = @infos = @effs = (); # Clear arrays | ||
|
||
# Non-header lines: Parse fields | ||
@t = split /\t/, $l; | ||
|
||
# Get INFO column | ||
$info = $t[ $INFO_FIELD_NUM ]; | ||
|
||
# Parse INFO column | ||
@infos = split /;/, $info; | ||
|
||
# Find EFF field | ||
$infStr = ""; | ||
foreach $inf ( @infos ) { | ||
# Is this the EFF field? => Find it and split it | ||
if( $inf =~/^EFF=(.*)/ ) { | ||
@effs = split /,/, $1; | ||
$fieldName = "EFF"; | ||
} elsif( $inf =~/^ANN=(.*)/ ) { | ||
@effs = split /,/, $1; | ||
$fieldName = "ANN"; | ||
} else { | ||
$infStr .= ( $infStr eq '' ? '' : ';' ) . $inf; | ||
} | ||
} | ||
|
||
# Print VCF line | ||
if( $#effs <= 0 ) { print "$l\n"; } # No EFF found, just show line | ||
else { | ||
$pre = ""; | ||
for( $i=0 ; $i < $INFO_FIELD_NUM ; $i++ ) { $pre .= ( $i > 0 ? "\t" : "" ) . "$t[$i]"; } | ||
|
||
$post = ""; | ||
for( $i=$INFO_FIELD_NUM+1 ; $i <= $#t ; $i++ ) { $post .= "\t$t[$i]"; } | ||
|
||
foreach $eff ( @effs ) { print $pre . "\t" . $infStr . ( $infStr eq '' ? '' : ';' ) . "$fieldName=$eff" . $post . "\n" ; } | ||
} | ||
} | ||
} |
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
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,59 @@ | ||
process SNV_MULTIPLICITY { | ||
|
||
tag "$meta.id" | ||
label 'process_medium' | ||
|
||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'docker://mskilab/snv_multiplicity:0.0.3': | ||
'mskilab/snv_multiplicity:0.0.3' }" | ||
|
||
input: | ||
// tuple val(meta), path(somatic_snv), path(somatic_snv_tbi), path(germline_snv), path(germline_snv_tbi), path(jabba_rds) | ||
tuple val(meta), path(somatic_snv, stageAs: "somatic_snv.vcf"), path(germline_snv, stageAs: "germline_snv.vcf"), path(jabba_rds) | ||
path(ref) | ||
path(ref_fai) | ||
|
||
output: | ||
tuple val(meta), path('*est_snv_cn_somatic.rds'), emit: snv_multiplicity_rds | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
def VERSION = '0.1' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. | ||
def DOWNSAMPLE_JAR = "${baseDir}/bin/downsamplevcf.jar" | ||
def SNPSIFT_JAR = "${baseDir}/bin/SnpSift.jar" | ||
def VCFEFF_PERL = "${baseDir}/bin/vcfEffOnePerLine.pl" | ||
|
||
""" | ||
export RSCRIPT_PATH=\$(echo "${baseDir}/bin/snv_multiplicity3.R") | ||
Rscript \$RSCRIPT_PATH \\ | ||
--somatic_snv ${somatic_snv} \\ | ||
--germline_snv ${germline_snv} \\ | ||
--fasta ${ref} \\ | ||
--jabba ${jabba_rds} \\ | ||
--downsample_jar ${DOWNSAMPLE_JAR} \\ | ||
--snpsift_jar ${SNPSIFT_JAR} \\ | ||
--vcfeff_perl ${VCFEFF_PERL} \\ | ||
--cores ${task.cpus} \\ | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
snv_multiplicity: ${VERSION} | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
""" | ||
touch est_snv_cn_somatic.rds | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
snv_multiplicity: ${VERSION} | ||
END_VERSIONS | ||
""" | ||
} |
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,32 @@ | ||
// | ||
// VCF SNV_MULTIPLICITY | ||
// | ||
|
||
include { SNV_MULTIPLICITY } from '../../../modules/local/snv_multiplicity/main.nf' | ||
|
||
workflow VCF_SNV_MULTIPLICITY { | ||
// defining inputs | ||
take: | ||
input // required: [meta, somatic_vcf, somatic_tbi, germline_vcf, germline_tbi, jabba_rds] | ||
ref | ||
ref_fai | ||
|
||
//Creating empty channels for output | ||
main: | ||
versions = Channel.empty() | ||
snv_multiplicity_rds = Channel.empty() | ||
|
||
SNV_MULTIPLICITY( | ||
input, | ||
ref, | ||
ref_fai | ||
) | ||
|
||
// initializing outputs from snv_multiplicity | ||
snv_multiplicity_rds = SNV_MULTIPLICITY.out.snv_multiplicity_rds | ||
versions = SNV_MULTIPLICITY.out.versions | ||
|
||
emit: | ||
snv_multiplicity_rds | ||
versions | ||
} |
Oops, something went wrong.