cufflinks fails on STAR output

1,046 views
Skip to first unread message

Laurent Marc

unread,
Jan 16, 2014, 5:57:12 AM1/16/14
to rna-...@googlegroups.com
--Hi,

when i run cufflinks on sam file generated by STAR it returns this error:

Error: this SAM file doesn't appear to be correctly sorted!
        current hit is at MT:8144, last one was at MT:11680
Cufflinks requires that if your file has SQ records in
the SAM header that they appear in the same order as the chromosomes names
in the alignments.
If there are no SQ records in the header, or if the header is missing,
the alignments must be sorted lexicographically by chromsome
name and by position.


this is my STAR command:

STAR --runMode alignReaSTAR --runMode alignReads --genomeDir INDEX_DIR/STAR --genomeLoad NoSharedMemory --readFilesIn R1_001.fastq.gz R2_001.fastq.gz --readFilesCommand "zcat -fc" --outStd SAM --runThreadN 10 --outFilterMultimapNmax 10 --outSAMmode Full --outSAMattributes Standard --outSAMstrandField intronMotif --outFileNamePrefix ./index2_ --outReadsUnmapped Fastx --outFilterScoreMinOverLread 0.9 --outFilterMismatchNoverLmax 0.05 --outFilterMismatchNmax 4 --sjdbGTFfile GRCh37.gtf --sjdbOverhang 99 | samtools view -bS - > Aligned.out.bam


this is my cufflinks command:

cufflinks -p 10 --library-type fr-unstranded -u --output-dir=cufflinks_index2 -G GRCh37.gtf Aligned.out.bam

maybe i need to sort bam output ?

thank you --

Laurent Marc

unread,
Jan 16, 2014, 8:29:11 AM1/16/14
to rna-...@googlegroups.com
--
problem is over,
the correct syntax was:

STAR......--sjdbOverhang 99 | samtools view -bS - | samtools sort - Aligned.out

Laurent --

Zoe

unread,
May 27, 2014, 4:55:31 PM5/27/14
to rna-...@googlegroups.com
Hi All,

I run the Tophat-cufflink pipeline, it works fine. I also want to try STAR-Cufflink pipeline and STAR-HTSeq pipeline
However, I have some problem to deal with the output SAM file from STAR.

Below are the procedures I applied to my data
1. run STAR, with the parameters:
STAR --genomeDir ./path/to/Genome/ --readFileIn ./path/to/input/read_r1.fastq ./path/to/input/read_r2.fastq --runThreadN 8 --outFileNamePreFix ./path/to/output/dir/ --outSAMstrandField intronMotif

2. samtools view -b -S Aligned.out.sam > Aligned.out.bam
3. samtools sort -n Aligned.out.bam Aligned.out.bam_sorted.bam
4. cufflinks -p 8 -o output/dir Aligned.out.bsm_sorted.bam

The error message is:""Error: sort order of readsin BAMs must be the same"

Is anybody can help me figure out what went wrong?

Thank you in advance,
Zoe

SBGJansen

unread,
May 29, 2014, 3:47:29 AM5/29/14
to rna-...@googlegroups.com
Hi,

Why do you namesort the bam files? Remove the -n from samtools sort command and try again.

Reply all
Reply to author
Forward
0 new messages