File Info

Filename
.command.sh
Full Path
s3://natera-rnd-pltf-dev-nextflow-scratch-01/work/2d/e98bddc07332c02e957c2d3a58a172/.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 aih-tih-sc-d666f1-R1_A23YTGFLT4_1.SJ.out.tab \
    --chimJ_file aih-tih-sc-d666f1-R1_A23YTGFLT4_1.Chimeric.out.junction \
    --bam_file aih-tih-sc-d666f1-R1_A23YTGFLT4_1.Aligned.sortedByCoord.out.bam \
    --output_prefix aih-tih-sc-d666f1-R1_A23YTGFLT4_1 \
    --ctat_genome_lib ctat_genome_lib_build_dir \
    --vis --sample_name aih-tih-sc-d666f1-R1_A23YTGFLT4_1

# Sort output files to ensure consistent ordering across runs while preserving headers
if [ -f aih-tih-sc-d666f1-R1_A23YTGFLT4_1.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 aih-tih-sc-d666f1-R1_A23YTGFLT4_1.cancer.introns > aih-tih-sc-d666f1-R1_A23YTGFLT4_1.cancer.introns.tmp
    tail -n +2 aih-tih-sc-d666f1-R1_A23YTGFLT4_1.cancer.introns | LC_ALL=C sort -k4,4nr -k1,1 >> aih-tih-sc-d666f1-R1_A23YTGFLT4_1.cancer.introns.tmp
    mv aih-tih-sc-d666f1-R1_A23YTGFLT4_1.cancer.introns.tmp aih-tih-sc-d666f1-R1_A23YTGFLT4_1.cancer.introns
fi

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