File Info

Filename
.command.sh
Full Path
s3://natera-rnd-pltf-dev-nextflow-scratch-01/work/07/8cb4f4809afdbbc37ca6fd5b20ae95/.command.sh
Size
1.2 KB
Attempt
#!/bin/bash -euo pipefail
python -u /usr/local/src/CTAT-SPLICING/STAR_to_cancer_introns.py \
    --SJ_tab_file V4_0001_RNA_0005_23H5VFLT4_s07.SJ.out.tab \
    --chimJ_file V4_0001_RNA_0005_23H5VFLT4_s07.Chimeric.out.junction \
    --bam_file V4_0001_RNA_0005_23H5VFLT4_s07.Aligned.sortedByCoord.out.bam \
    --output_prefix V4_0001_RNA_0005_23H5VFLT4_s07 \
    --ctat_genome_lib ctat_genome_lib_build_dir \
    --vis --sample_name V4_0001_RNA_0005_23H5VFLT4_s07

# Sort output files to ensure consistent ordering across runs while preserving headers
if [ -f V4_0001_RNA_0005_23H5VFLT4_s07.cancer.introns ]; then
    # Extract header (first line) and sort data lines by fourth column (uniq_mapped) descending, then by first column (intron)
    head -n 1 V4_0001_RNA_0005_23H5VFLT4_s07.cancer.introns > V4_0001_RNA_0005_23H5VFLT4_s07.cancer.introns.tmp
    tail -n +2 V4_0001_RNA_0005_23H5VFLT4_s07.cancer.introns | LC_ALL=C sort -k4,4nr -k1,1 >> V4_0001_RNA_0005_23H5VFLT4_s07.cancer.introns.tmp
    mv V4_0001_RNA_0005_23H5VFLT4_s07.cancer.introns.tmp V4_0001_RNA_0005_23H5VFLT4_s07.cancer.introns
fi

cat <<-END_VERSIONS > versions.yml
"NFCORE_RNAFUSION:RNAFUSION:CTATSPLICING_STARTOCANCERINTRONS":
    ctat-splicing: 0.0.3
END_VERSIONS