File Info

Filename
.command.sh
Full Path
s3://natera-rnd-pltf-dev-nextflow-scratch-01/work/d5/e487264c8e7a460e9abf6a2cf1148e/.command.sh
Size
2.1 KB
Attempt
#!/bin/bash -Ceuo pipefail
# Use local filesystem for manta's run directory to avoid filesystem
# consistency issues with pyflow on shared/network storage. See: https://github.com/Illumina/manta/issues/5
MANTA_RUN_DIR="/var/tmp/manta"
mkdir -p ${MANTA_RUN_DIR}

# Stage reference to local filesystem to avoid concurrent read failures from parallel workers on shared/network storage.
REF_DIR="/var/tmp/ref"
mkdir -p ${REF_DIR}
cp Homo_sapiens_assembly38.fasta Homo_sapiens_assembly38.fasta.fai ${REF_DIR}/
REF="${REF_DIR}/$(basename Homo_sapiens_assembly38.fasta)"

configManta.py \
    --tumorBam COLO829_c_0001_gDNA_0001_B23H2NLLT4_6.recalibrated.bam \
    --normalBam COLO829BL_c_01_gDNA_0001_A237FLHLT3_1.recalibrated.bam \
    --reference ${REF} \
     \
    --runDir ${MANTA_RUN_DIR} \
    --callRegions xgen-exome-hyb-panel-v2-targets-hg38_AND_altera_v3_targets_postQC_hg38_AND_foresight_clarity.bed.gz \
    --exome

python ${MANTA_RUN_DIR}/runWorkflow.py -m local -j 14

mv ${MANTA_RUN_DIR}/results/variants/candidateSmallIndels.vcf.gz \
    COLO829_tumor_75pct_rep2.manta.candidate_small_indels.vcf.gz
mv ${MANTA_RUN_DIR}/results/variants/candidateSmallIndels.vcf.gz.tbi \
    COLO829_tumor_75pct_rep2.manta.candidate_small_indels.vcf.gz.tbi
mv ${MANTA_RUN_DIR}/results/variants/candidateSV.vcf.gz \
    COLO829_tumor_75pct_rep2.manta.candidate_sv.vcf.gz
mv ${MANTA_RUN_DIR}/results/variants/candidateSV.vcf.gz.tbi \
    COLO829_tumor_75pct_rep2.manta.candidate_sv.vcf.gz.tbi
mv ${MANTA_RUN_DIR}/results/variants/diploidSV.vcf.gz \
    COLO829_tumor_75pct_rep2.manta.diploid_sv.vcf.gz
mv ${MANTA_RUN_DIR}/results/variants/diploidSV.vcf.gz.tbi \
    COLO829_tumor_75pct_rep2.manta.diploid_sv.vcf.gz.tbi
mv ${MANTA_RUN_DIR}/results/variants/somaticSV.vcf.gz \
    COLO829_tumor_75pct_rep2.manta.somatic_sv.vcf.gz
mv ${MANTA_RUN_DIR}/results/variants/somaticSV.vcf.gz.tbi \
    COLO829_tumor_75pct_rep2.manta.somatic_sv.vcf.gz.tbi

cat <<-END_VERSIONS > versions.yml
"NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_MANTA:MANTA_SOMATIC":
    manta: $( configManta.py --version )
END_VERSIONS