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 StringTie template
Section titled “The StringTie template”The per-sample command. -p is generalized to the Slurm allocation and the BAM/GTF names
are derived from the sample, nothing is hardcoded:
stringtie <sample>_Aligned.sortedByCoord.out.bam --rf -m 100 -p ${SLURM_CPUS_ON_NODE} -v -o <sample>.gtf| Flag | Meaning |
|---|---|
--rf | Reverse-stranded (first-strand / dUTP) library. |
-m 100 | Minimum assembled transcript length, 100 nt. |
-p ${SLURM_CPUS_ON_NODE} | Threads, the cores of the Slurm allocation. |
-v | Verbose logging. |
-o <sample>.gtf | Per-sample output GTF. |
Run it over the 21 samples
Section titled “Run it over the 21 samples”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.logset -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"sbatch stringtie.shBuild stringtie.fofn
Section titled “Build stringtie.fofn”One GTF path per line, in samples.txt order:
# stringtie.fofn → reconcile --stringtie-listwhile read -r s; do echo "stringtie/${s}.gtf"; done < samples.txt > stringtie.fofn
wc -l stringtie.fofn # 21stringtie.fofn → reconcile --stringtie-list.