File Info

Filename
.command.sh
Full Path
s3://natera-rnd-pltf-dev-nextflow-scratch-01/work/47/308a4e549c7161d4229760f88fbeea/.command.sh
Size
1.0 KB
Attempt
#!/bin/bash -euo pipefail
# Create BAM list file
echo "tih_rna_sample_00570_B23MVV7LT4_1.Aligned.sortedByCoord.out.bam" > bam_list.txt

# Run NGSCheckMate
# SNP BED file is included in the container at /usr/local/NGSCheckMate/SNP/SNP_GRCh38_hg38_wChr.bed
# Reference genome is passed via NCM_REF environment variable
export NCM_REF="ref_genome.fa"
bash /usr/local/bin/ncm.py \
    -B \
    -l bam_list.txt \
    -bed /usr/local/NGSCheckMate/SNP/SNP_GRCh38_hg38_wChr.bed \
    -O . \
    -N "tih_rna_sample_00570_B23MVV7LT4_1" \


# Ensure VCF output exists
if [ ! -f "tih_rna_sample_00570_B23MVV7LT4_1.vcf" ]; then
    # Try alternative naming
    VCF_FILE=$(find . -name "*.vcf" -type f | head -n 1)
    if [ -n "$VCF_FILE" ]; then
        mv "$VCF_FILE" "tih_rna_sample_00570_B23MVV7LT4_1.vcf"
    else
        echo "Error: No VCF file generated" >&2
        exit 1
    fi
fi

cat <<-END_VERSIONS > versions.yml
"NFCORE_RNAFUSION:RNAFUSION:RNA_CONTAMINATION_DETECTION_WORKFLOW:NGSCheckMATE":
    ngscheckmate: 1.0.0
END_VERSIONS