Skip to content

3. Transcript assembly (StringTie)

Assemble transcripts from each STAR BAM with StringTie. One GTF per sample becomes the stringtie.fofn list behind reconcile --stringtie-list, the transcript evidence Mikado reconciles against the Helixer models.

The per-sample command. -p is generalized to the Slurm allocation and the BAM/GTF names are derived from the sample, nothing is hardcoded:

Terminal window
stringtie <sample>_Aligned.sortedByCoord.out.bam --rf -m 100 -p ${SLURM_CPUS_ON_NODE} -v -o <sample>.gtf
FlagMeaning
--rfReverse-stranded (first-strand / dUTP) library.
-m 100Minimum assembled transcript length, 100 nt.
-p ${SLURM_CPUS_ON_NODE}Threads, the cores of the Slurm allocation.
-vVerbose logging.
-o <sample>.gtfPer-sample output GTF.

A Slurm array over samples.txt, writing GTFs to stringtie/:

#!/bin/bash
#SBATCH --job-name=stringtie
#SBATCH --array=1-21
#SBATCH --cpus-per-task=8
#SBATCH --mem=16G
#SBATCH --time=2:00:00
#SBATCH --output=logs/stringtie_%A_%a.log
set -euo pipefail
module load stringtie
BAM_DIR="bam"
OUT_DIR="stringtie"
SAMPLE_LIST="samples.txt"
mkdir -p "${OUT_DIR}" logs
SAMPLE=$(sed -n "${SLURM_ARRAY_TASK_ID}p" "${SAMPLE_LIST}")
[[ -n "${SAMPLE}" ]] || { echo "no sample for task ${SLURM_ARRAY_TASK_ID}"; exit 1; }
stringtie "${BAM_DIR}/${SAMPLE}_Aligned.sortedByCoord.out.bam" \
--rf -m 100 -p ${SLURM_CPUS_ON_NODE} -v \
-o "${OUT_DIR}/${SAMPLE}.gtf"
Terminal window
sbatch stringtie.sh

One GTF path per line, in samples.txt order:

Terminal window
# stringtie.fofn → reconcile --stringtie-list
while read -r s; do echo "stringtie/${s}.gtf"; done < samples.txt > stringtie.fofn
wc -l stringtie.fofn # 21

stringtie.fofnreconcile --stringtie-list.

Next: prepare protein evidence with helixforge utils →