Hi,
I am getting error while using StringTie (1.3.3b) on aligned reads from both HISAT2 (2.1.0) and STAR (2.5.3a). Please help me to rectify the problem. The error is related to missing headers in the alignment files but when I print header using samtools I can see the headers in those alignment files (hisat2 and star aligned).
Steps used:
HISAT2 alignment:
hisat2 --dta --known-splicesite-infile spliceSites.txt --phred33 --qc-filter -x ht2_index/hg38 -U sample1.fastq.gz | samtools view -bS -o sample1_hisat2.bam -
samtools sort -o sample1_hisat2_sorted.bam -O sample1_hisat2.bam
samtools view -H sample1_hisat2_sorted.bam | head
@HD VN:1.0 SO:coordinate
@SQ SN:1 LN:248956422
@SQ SN:10 LN:133797422
@SQ SN:11 LN:135086622
@SQ SN:12 LN:133275309
@SQ SN:13 LN:114364328
@SQ SN:14 LN:107043718
@SQ SN:15 LN:101991189
@SQ SN:16 LN:90338345
@SQ SN:17 LN:83257441
stringtie sample1_hisat2_sorted.bam -G hg38.GTF -B -e -x -C hg38.GTF -p 8 -A hg38_gene_abund.tab -o hg38_assembled.gtf
Error:
[samopen] no @SQ lines in the header.
[sam_read1] missing header? Abort!
STAR alignment:
STAR \
--readFilesCommand zcat \
--outSAMmapqUnique 255 \
--outSAMattributes All \
--outSAMattrIHstart 0 \
--outSAMtype BAM SortedByCoordinate \
--outSAMunmapped None \
--outFileNamePrefix path/sample1_star \
--runMode alignReads \
--genomeDir genome_dir/STAR_index/ \
--readFilesIn sample1.fastq.gz
samtools view -H sample1_starAligned.sortedByCoord.out.bam | head
@HD VN:1.4 SO:coordinate
@SQ SN:1 LN:248956422
@SQ SN:10 LN:133797422
@SQ SN:11 LN:135086622
@SQ SN:12 LN:133275309
@SQ SN:13 LN:114364328
@SQ SN:14 LN:107043718
@SQ SN:15 LN:101991189
@SQ SN:16 LN:90338345
@SQ SN:17 LN:83257441
stringtie sample1_starAligned.sortedByCoord.out.bam -G hg38.GTF -B -e -x -C hg38.GTF -p 8 -A hg38_gene_abund.tab -o hg38_assembled.gtf
Error:
[samopen] no @SQ lines in the header.
[sam_read1] missing header? Abort!
Thank a lot. You saved my day. The problem was exactly what you mentioned.
I removed '
-x
' since it doesn't have any input file (unnecessary parameter)I also had another problem that
-C
(the output file name) and the-G
(reference files names) where pointing to same GTF reference file (hg38.GTF). It was replacing the original GTF reference file for the output.Moved @Russ's comment to an answer. Go ahead and accept to provide closure to this thread.