aboutsummaryrefslogtreecommitdiff
path: root/tools/gridss-annotateVariants.nix
diff options
context:
space:
mode:
authorl-d-s <distefano.l@wehi.edu.au>2018-11-22 12:04:23 +1100
committerl-d-s <distefano.l@wehi.edu.au>2018-11-22 12:04:23 +1100
commit7c36ee4ec628767c834ad803aac76d93e31f0486 (patch)
tree2edf423614fc077c4027b7996f690b004ec4f25b /tools/gridss-annotateVariants.nix
parent3c568bacd397a3ddcb203811f7fa5a1f8af760a3 (diff)
parent0ade062d2da8a7111b14aa3d72ef7c741e98352d (diff)
Merge branch 'master' of https://github.com/PapenfussLab/bionix
Diffstat (limited to 'tools/gridss-annotateVariants.nix')
-rw-r--r--tools/gridss-annotateVariants.nix20
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