PDA

View Full Version : Star with cufflinks


Nino
06-06-2013, 07:04 AM
Hey Guys,

I was wondering if anyone knows how to integrate cufflinks with star. Up until now I have star just for the alignments with chimeric searches, now I need to use cufflinks since searches for novel transcripts. I was told the two programs are used hand in hand. If anyone has any insight on this please let me know. Tried to search information regarding this but was unsuccessful.

Thanks,
Nino

alexdobin
06-06-2013, 12:04 PM
Hi Nino,

For non-strand-specific data, you need to use STAR option --outSAMstrandField intronMotif which will add the XS attribute to all canonically spliced alignments using their introns' motifs - that's exactly what Cufflinks needs.

For strand-specific data, you do not need any extra parameters for STAR runs, but you need to use --library-type option for Cufflinks. For example, for the "standard" dUTP protocol you need to use --library-type fr-firststrand in Cufflinks.

Do not use the option --outSAMattributes All, as Cufflinks (as well as many other tools) have compatibility problems with the latest SAM format specifications.

For poly-A+ selected RNAs, all other default parameters generally work well in our ENCODE experience.
As always I would highly recommend using annotations for mapping.
Also, --outFilterType BySJout could help clean up rare junctions, and --outFilterIntronMotifs RemoveNoncanonicalUnannotated will clean up non-canonical junctions.

Total RNA data is much harder to assemble with Cufflinks since it contains a substantial intronic signal. Please check this post (https://groups.google.com/d/msg/rna-star/X8mjUc7nm1U/dl7Jy12BNAIJ), you may need to mask "complex" loci.

Cheers
Alex

Nino
06-10-2013, 09:30 AM
Hey Alexdobin,

Thanks for the info and help I was able to get it to work. Cheers!

Nino

bob-loblaw
06-13-2013, 05:47 AM
Hi guys,

this is probably a good place to ask this question. But I ran STAR with that option to add the XS attribute. But when I run cufflinks I get this

BAM record error: found spliced alignment without XS attribute
BAM record error: found spliced alignment without XS attribute
BAM record error: found spliced alignment without XS attribute
BAM record error: found spliced alignment without XS attribute
BAM record error: found spliced alignment without XS attribute
> Processing Locus chr1:2835641-2836005 [ ] 0%BAM record error: found spliced alignment without XS attribute
> Processing Locus chr1:2882539-2882944 [ ] 0%BAM record error: found spliced alignment without XS attribute
> Processing Locus chr1:3536416-3537049 [ ] 0%BAM record error: found spliced alignment without XS attribute
> Processing Locus chr1:3537448-3539171 [ ] 0%BAM record error: found spliced alignment without XS attribute
> Processing Locus chr1:3646678-3647038 [ ] 0%BAM record error: found spliced alignment without XS attribute

It does keep running, and the percentage does increase, but I was wondering if this behaviour is normal for STAR and cufflinks?

sdriscoll
06-13-2013, 06:38 AM
No, not expected. These errors are saying that the XS tag is not added. I've used this workflow as well and didn't have any trouble. Maybe STAR slipped up.

bob-loblaw
06-13-2013, 06:40 AM
I've had issues with this version of STAR on my machine before. The option for writing out unmapped reads to fastq format doesn't work either, although theres a pretty easy workaround for that. I may try to reinstall it. Thanks.

Good thing STAR is so quick to run! If it was Tophat that did this, I'd have to set aside about a month of machine time to catch up!

alexdobin
06-13-2013, 10:18 AM
Please try the latest STAR patch ftp://ftp2.cshl.edu/gingeraslab/tracks/STARrelease/Alpha/STAR_2.3.1o.tgz
It supposed to have fixed the problems with the output of unmapped fastqs.
I also checked that it outputs the XS flag. If it still does not work, please send me your Log.out file.

bob-loblaw
06-15-2013, 09:06 AM
Please try the latest STAR patch ftp://ftp2.cshl.edu/gingeraslab/tracks/STARrelease/Alpha/STAR_2.3.1o.tgz
It supposed to have fixed the problems with the output of unmapped fastqs.
I also checked that it outputs the XS flag. If it still does not work, please send me your Log.out file.

The unmapped fastx is working for me now as is cufflinks, it started working with the version I had installed though. Odd. Although I've noticed with the intronmotif option for cufflinks that it only works for me when it's very last option specified.

Thanks

alexdobin
06-19-2013, 12:54 PM
The unmapped fastx is working for me now as is cufflinks, it started working with the version I had installed though. Odd. Although I've noticed with the intronmotif option for cufflinks that it only works for me when it's very last option specified.

Thanks

This is indeed odd. Could you please send me the Log.out file for the case where the intronMotif option does not work? It actually contains information about all parameters that STAR read from command line.

bob-loblaw
06-25-2013, 02:51 AM
This is indeed odd. Could you please send me the Log.out file for the case where the intronMotif option does not work? It actually contains information about all parameters that STAR read from command line.

Here is the log file from one where the introMotif option does not work! Thanks!

alexdobin
06-25-2013, 07:00 PM
Here is the log file from one where the introMotif option does not work! Thanks!

Hi @bob-loblaw,

According to the Log.out, I believe there was a typo in your command line:
--outSAMstrandField introMotif
while you needed
--outSAMstrandField intronMotif
Unfortunately STAR does not yet check all of the input values so in this case the parameter just got ignored and the XS flag was not generated.

Cheers
Alex

bob-loblaw
06-26-2013, 01:07 AM
Hi @bob-loblaw,

According to the Log.out, I believe there was a typo in your command line:
--outSAMstrandField introMotif
while you needed
--outSAMstrandField intronMotif
Unfortunately STAR does not yet check all of the input values so in this case the parameter just got ignored and the XS flag was not generated.

Cheers
Alex

Well I've never felt as stupid as I do right now haha. Thanks though!

alexdobin
06-26-2013, 12:21 PM
I have made these kind of typo mistakes many times, and sometimes even had to run a debugger to figure out what the problem was. :)
It is high on my TODO list (though not on the very top) to enforce strict control of all user options.

ndejay
01-10-2014, 07:49 AM
Hi all,

I had an additional question.

You say that --outSAMstrandField intronMotif is necessary for unstranded reads, but what would happen if I used the option on stranded reads? I am hoping it has no effect.

Thanks.

sdriscoll
01-10-2014, 08:00 AM
I'd assume it would just do what it does normally except in the output the intron orientation would always match the alignment orientation. The intron motif and orientation is estimated from the genome and not from the orientation of the alignment. There should be a setting in STAR, however, to make it aware of this so it can correctly assign intron orientation to novel intron motifs...if there are any.

kaus
12-22-2014, 09:00 AM
Hi guys,

this is probably a good place to ask this question. But I ran STAR with that option to add the XS attribute. But when I run cufflinks I get this

BAM record error: found spliced alignment without XS attribute
BAM record error: found spliced alignment without XS attribute
BAM record error: found spliced alignment without XS attribute
BAM record error: found spliced alignment without XS attribute
BAM record error: found spliced alignment without XS attribute
> Processing Locus chr1:2835641-2836005 [ ] 0%BAM record error: found spliced alignment without XS attribute
> Processing Locus chr1:2882539-2882944 [ ] 0%BAM record error: found spliced alignment without XS attribute
> Processing Locus chr1:3536416-3537049 [ ] 0%BAM record error: found spliced alignment without XS attribute
> Processing Locus chr1:3537448-3539171 [ ] 0%BAM record error: found spliced alignment without XS attribute
> Processing Locus chr1:3646678-3647038 [ ] 0%BAM record error: found spliced alignment without XS attribute

It does keep running, and the percentage does increase, but I was wondering if this behaviour is normal for STAR and cufflinks?

Hey guys
I'm having the same issue. When I run Cufflinks this is what I get
[bam_header_read] EOF marker is absent. The input is probably truncated.
[bam_header_read] invalid BAM binary header (this is not a BAM file).
File /Users/sohailkhan/Documents/MiSeq_data/12082014_CLIP/untag_sorted doesn't appear to be a valid BAM file, trying SAM...
[12:24:10] Loading reference annotation.
[12:24:11] Inspecting reads and determining fragment length distribution.
> Processing Locus AB325691:1478-3197 [ ] 0%SAM error on line 49: found spliced alignment without XS attribute
> Processing Locus I:27352-27763 [**** ] 16%SAM error on line 380: found spliced alignment without XS attribute
SAM error on line 381: found spliced alignment without XS attribute
SAM error on line 384: found spliced alignment without XS attribute
> Processing Locus I:29763-31069 [**** ] 16%SAM error on line 474: found spliced alignment without XS attribute
SAM error on line 479: found spliced alignment without XS attribute
SAM error on line 480: found spliced alignment without XS attribute
SAM error on line 481: found spliced alignment without XS attribute
SAM error on line 482: found spliced alignment without XS attribute
SAM error on line 485: found spliced alignment without XS attribute
SAM error on line 486: found spliced alignment without XS attribute
SAM error on line 488: found spliced alignment without XS attribute
SAM error on line 489: found spliced alignment without XS attribute
> Processing Locus I:45874-48399 [**** ] 16%SAM error on line 603: found spliced alignment without XS attribute
SAM error on line 604: found spliced alignment without XS attribute
I used the latest STAR release for Mac and I'm using the latest release of Cufflinks. The STAR options I used were:

--runThreadN 6 --outSJfilterOverhangMin 30 10 10 10
--outFilterMismatchNmax 6 --alignIntronMin 10 --alignIntronMax 500 --alignMatesGapMax 500 --alignSplicedMateMapLmin 1 --outFilterType BySJout --outFilterIntronMotifs RemoveNoncanonical --sjdbGTFfile /PATH --sjdbOverhang 74
Is there any option I need to add for the right XS attributes?

alexdobin
01-08-2015, 01:44 PM
Hey guys
I'm having the same issue. When I run Cufflinks this is what I get
[bam_header_read] EOF marker is absent. The input is probably truncated.
[bam_header_read] invalid BAM binary header (this is not a BAM file).
File /Users/sohailkhan/Documents/MiSeq_data/12082014_CLIP/untag_sorted doesn't appear to be a valid BAM file, trying SAM...
[12:24:10] Loading reference annotation.
[12:24:11] Inspecting reads and determining fragment length distribution.
> Processing Locus AB325691:1478-3197 [ ] 0%SAM error on line 49: found spliced alignment without XS attribute
> Processing Locus I:27352-27763 [**** ] 16%SAM error on line 380: found spliced alignment without XS attribute
SAM error on line 381: found spliced alignment without XS attribute
SAM error on line 384: found spliced alignment without XS attribute
> Processing Locus I:29763-31069 [**** ] 16%SAM error on line 474: found spliced alignment without XS attribute
SAM error on line 479: found spliced alignment without XS attribute
SAM error on line 480: found spliced alignment without XS attribute
SAM error on line 481: found spliced alignment without XS attribute
SAM error on line 482: found spliced alignment without XS attribute
SAM error on line 485: found spliced alignment without XS attribute
SAM error on line 486: found spliced alignment without XS attribute
SAM error on line 488: found spliced alignment without XS attribute
SAM error on line 489: found spliced alignment without XS attribute
> Processing Locus I:45874-48399 [**** ] 16%SAM error on line 603: found spliced alignment without XS attribute
SAM error on line 604: found spliced alignment without XS attribute
I used the latest STAR release for Mac and I'm using the latest release of Cufflinks. The STAR options I used were:

--runThreadN 6 --outSJfilterOverhangMin 30 10 10 10
--outFilterMismatchNmax 6 --alignIntronMin 10 --alignIntronMax 500 --alignMatesGapMax 500 --alignSplicedMateMapLmin 1 --outFilterType BySJout --outFilterIntronMotifs RemoveNoncanonical --sjdbGTFfile /PATH --sjdbOverhang 74
Is there any option I need to add for the right XS attributes?

Hi @kaus,

to add XS flag, you need the --outSAMstrandField intronMotif option which was mentioned before. Note that --sjdbGTFfile /PATH --sjdbOverhang 74 options have to be used at the genome generation step, at the mapping stage they have no effect.

Cheers
Alex

tonup69
01-23-2016, 05:59 AM
Hi folks,

I think this would be a good place to post my current issue since it must have something to do with using STAR and Cufflinks. I have now had two fatal errors in my analysis (I may have solved one of them, but it may have caused the second one):

1) Cuffmerge failed because it indicated that there were duplicate IDs in the gtf file. We figured out that this was because transcripts and exons can have the same cords (especially in the fly genome). We fixed this by eliminating all transcript lines and leaving only exon level information in the file. A similar fix was posted here, but I can't find the link right now.

2) Cuffdiff now throws an error for the BAM files:

Fatal error: Error
[05:15:57] Loading reference annotation.
[05:16:02] Inspecting maps and determining fragment length distributions.
BAM record error: found spliced alignment without XS attribute

I set up STAR to run using the "add XS for Cufflinks" option, but I guess that didn't work since I got this Cuffdiff error AND a quick look at the BAM files did not reveal any lines with the XS tag.

I am running this analysis on a local install of GALAXY. I do not code or use the command line, but I have a bioinformaticist who can help me if I need to manipulate the files outside of GALAXY.

P.S. I know I could use Tophat for mapping, but STAR gives better results with Ion Proton data (we tested in house). Also, do you think this could be due to using the "all modern SAM tools" attribute and not the "original SAM tools"

Sorry for the long message - I need to analyze this data by Monday so I can put a figure in my grant due next week!

LTR

alexdobin
01-26-2016, 08:31 AM
Hi LTR,

the "--outSAMstrandField intronMotif" option should produce XS flags for all spliced alignments. If you used this option and Cufflinks still complains about it, please send me the Log.out and SAM/BAM file.

Cheers
Alex

natallah
12-07-2016, 05:35 AM
Hi I ran STAR on stranded data with this command:
STAR --runThreadN 4 --genomeDir ./STARoutput --readFilesIn OS1.common_1.fastq OS1.common_2.fastq --outFileNamePrefix ./OS1trimmed

However when I try running Cufflinks after I get the following error:
BAM record error: found spliced alignment without XS attribute

The version is:

versionSTAR 020201


Thanks,
Nadia

alexdobin
12-12-2016, 09:06 AM
Hi I ran STAR on stranded data with this command:
STAR --runThreadN 4 --genomeDir ./STARoutput --readFilesIn OS1.common_1.fastq OS1.common_2.fastq --outFileNamePrefix ./OS1trimmed

However when I try running Cufflinks after I get the following error:
BAM record error: found spliced alignment without XS attribute

The version is:

versionSTAR 020201


Thanks,
Nadia

Hi Nadia,

if you your RNA-seq data is stranded, you need to run Cufflinks with --library-type option. If your RNA-seq data is unstranded, you have to run STAR with "--outSAMstrandField intronMotif" option.

Cheers
Alex