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!



I think the issue is not in your file but in your `stringtie` command. It looks like it could use a bit of tweaking. The `-x` option requires a parameter and is interpreting the `-C hg38.GTF` as input, resulting in the error message. Try removing the `-x` (or specifying a file) and seeing if that helps.