diff options
author | l-d-s <distefano.l@wehi.edu.au> | 2018-11-22 12:04:23 +1100 |
---|---|---|
committer | l-d-s <distefano.l@wehi.edu.au> | 2018-11-22 12:04:23 +1100 |
commit | 7c36ee4ec628767c834ad803aac76d93e31f0486 (patch) | |
tree | 2edf423614fc077c4027b7996f690b004ec4f25b /tools/gridss-annotateVariants.nix | |
parent | 3c568bacd397a3ddcb203811f7fa5a1f8af760a3 (diff) | |
parent | 0ade062d2da8a7111b14aa3d72ef7c741e98352d (diff) |
Merge branch 'master' of https://github.com/PapenfussLab/bionix
Diffstat (limited to 'tools/gridss-annotateVariants.nix')
-rw-r--r-- | tools/gridss-annotateVariants.nix | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/tools/gridss-annotateVariants.nix b/tools/gridss-annotateVariants.nix index 6c8fbc6..122c451 100644 --- a/tools/gridss-annotateVariants.nix +++ b/tools/gridss-annotateVariants.nix @@ -2,8 +2,8 @@ , nixpkgs , bwaIndexAttrs ? {} , faidxAttrs ? {} +, indexAttrs ? {} , assemblyAttrs ? {} -, extractSVReadsAttrs ? {} , collectMetricsAttrs ? {} , softClipsToSplitReadsAttrs ? {} , identifyVariantsAttrs ? {} @@ -35,6 +35,16 @@ let done ''; + linkSV = input: '' + BASENAME=$(basename ${input}) + WRKDIR="''${BASENAME}.gridss.working" + if [[ ! -e $WRKDIR ]] ; then + mkdir $WRKDIR + fi + ln -s ${input} $WRKDIR/$BASENAME.sv.bam + ln -s ${bionix.samtools.index indexAttrs input} $WRKDIR/$BASENAME.sv.bai + ''; + assembly = bionix.samtools.sort {} (softClipsToSplitReads softClipsToSplitReadsAttrs (bionix.samtools.sort { nameSort = true;} (bionix.gridss.assemble assemblyAttrs inputs))); in @@ -50,12 +60,10 @@ stdenv.mkDerivation rec { for f in ${bionix.bwa.index bwaIndexAttrs ref}/*; do ln -s $f done - ${concatMapStringsSep "\n" (linkInput extractSVReads extractSVReadsAttrs) inputs} + ${concatMapStringsSep "\n" (linkSV) inputs} + ${linkSV assembly} ${concatMapStringsSep "\n" (linkInput collectMetrics collectMetricsAttrs) inputs} ${linkInput collectMetrics collectMetricsAttrs assembly} - ASSBASE=$(basename ${assembly}) - ln -s ${assembly} $ASSBASE.gridss.working/$ASSBASE.sv.bam - ln -s ${bionix.samtools.index {} assembly} $ASSBASE.gridss.working/$ASSBASE.sv.bai ln -s ${identifyVariants identifyVariantsAttrs inputs} input.vcf java -Xmx4g -Dsamjdk.create_index=true \ -cp ${jar} gridss.AnnotateVariants \ @@ -65,7 +73,7 @@ stdenv.mkDerivation rec { INPUT_VCF=input.vcf \ OUTPUT_VCF=out.vcf \ WORKING_DIR=$TMPDIR/ \ - ${optionalString (config != null) ("CONFIGURATION_FILE=" + bionix.gridss.ggridssConfig config)} \ + ${optionalString (config != null) ("CONFIGURATION_FILE=" + bionix.gridss.gridssConfig config)} \ TMP_DIR=$TMPDIR/ mv out.vcf $out |