Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • feralBiologist
    Member
    • Jun 2011
    • 61

    #1

    How to convert GTF to RefFlat?

    My use case is as follows:

    I have aligned RNA-Seq data using tophat2 and a GTF file I got from Ensembl. Now I would like to produce alignment stats (number of reads mapping to exons, introns, intergenic regions) and, it seems, the CollectRnaSeqMetrics script from the Piccard toolset would be the most straight-forward to use. However, it requires annotation in RefFlat format (why on Earth there have to be so many different annotation formats??). So now I would like to convert GTF to RefFlat format. There is, apparently, a tool called gtfToGenePred which is supposed to do this but I could not find a manual or documentation for it. Can anyone provide info on converting GTF files to RefFlat format? Alternatively, can you suggest a way I can get the alignment stats using a GTF annotation file?
  • dpryan
    Devon Ryan
    • Jul 2011
    • 3478

    #2
    If you just run gtfToGenePred without any arguments then it prints its usage instructions. This is by far the simplest method to generate the file you want.

    Comment

    • feralBiologist
      Member
      • Jun 2011
      • 61

      #3
      Originally posted by dpryan View Post
      If you just run gtfToGenePred without any arguments then it prints its usage instructions. This is by far the simplest method to generate the file you want.
      Thanks. I tried it but it does not seem to work:

      Code:
      localhost:Downloads nnikolo$ ls -lt gtf*
      -rwxr-xr-x@ 1 nnikolo  staff  12944032 19 Feb 12:18 gtfToGenePred
      localhost:Downloads nnikolo$ ./gtfToGenePred
      -bash: ./gtfToGenePred: cannot execute binary file
      localhost:Downloads nnikolo$ gtfToGenePred
      -bash: /Users/nnikolo/Downloads/gtfToGenePred: cannot execute binary file

      Comment

      • dpryan
        Devon Ryan
        • Jul 2011
        • 3478

        #4
        chmod a+x gtfToGenePred

        Comment

        • GenoMax
          Senior Member
          • Feb 2008
          • 7142

          #5
          @feralBiologist: Looks like you may not have download the correct binary (or did you compile this yourself)? What OS are you using?

          Comment

          • sarvidsson
            Senior Member
            • Jan 2015
            • 137

            #6
            Originally posted by dpryan View Post
            chmod a+x gtfToGenePred
            Code:
            [B]-rw[B]x[/B]r-[B]x[/B]r-[B]x[/B][/B]@ 1 nnikolo  staff  12944032 19 Feb 12:18 gtfToGenePred
            Doesn't seem to be the problem

            Comment

            • dpryan
              Devon Ryan
              • Jul 2011
              • 3478

              #7
              Yeah, I expect that GenoMax is correct and the wrong executable was downloaded. I should note that I just downloaded and tested that program on a GTF file on my workstation (running Ubuntu) and it worked fine.
              Last edited by dpryan; 02-19-2015, 06:24 AM.

              Comment

              • feralBiologist
                Member
                • Jun 2011
                • 61

                #8
                Originally posted by GenoMax View Post
                @feralBiologist: Looks like you may not have download the correct binary (or did you compile this yourself)? What OS are you using?
                I am on MacOS X. Actually, I could not find a proper download page - just opening one of the Google search results ended up automatically downloading the binary.

                Comment

                • sarvidsson
                  Senior Member
                  • Jan 2015
                  • 137

                  #9
                  What about this one? http://hgdownload.cse.ucsc.edu/admin.../gtfToGenePred

                  Comment

                  • feralBiologist
                    Member
                    • Jun 2011
                    • 61

                    #10
                    Originally posted by sarvidsson View Post
                    Thanks - I think it's robots.txt that UCSC put which prevented Google from displaying that site.

                    Comment

                    • feralBiologist
                      Member
                      • Jun 2011
                      • 61

                      #11
                      I ran into troubles again. I was able to run gtfToGenePred and it produced a refFlat file from the Ensembl GTF file. However, when I tried using it with Picard's CollectRnaSeqMetrics I got

                      Code:
                      Exception in thread "main" picard.annotation.AnnotationException: Wrong number of fields in refFlat file mm75.genePred at line 1
                              at picard.annotation.RefFlatReader.load(RefFlatReader.java:80)
                              at picard.annotation.RefFlatReader.load(RefFlatReader.java:66)
                              at picard.annotation.GeneAnnotationReader.loadRefFlat(GeneAnnotationReader.java:37)
                              at picard.analysis.CollectRnaSeqMetrics.setup(CollectRnaSeqMetrics.java:105)
                              at picard.analysis.SinglePassSamProgram.makeItSo(SinglePassSamProgram.java:98)
                              at picard.analysis.SinglePassSamProgram.doWork(SinglePassSamProgram.java:53)
                              at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:187)
                              at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:95)
                              at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:105)
                      So, gtfToGenePred has, apparently, produced an invalid file. Has anyone, actually, used gtfToGenePred successfully?

                      Comment

                      • GenoMax
                        Senior Member
                        • Feb 2008
                        • 7142

                        #12
                        While you wait for someone to sort out the refFlat issue you could try this tool: http://rseqc.sourceforge.net/

                        Hopefully will get you stats similar to what you are looking for.

                        Comment

                        • feralBiologist
                          Member
                          • Jun 2011
                          • 61

                          #13
                          Originally posted by feralBiologist View Post
                          Has anyone, actually, used gtfToGenePred successfully?
                          If anyone is interested - here is the GTF I used, the refFlat produced, and here are the command line arguments I used for CollectRnaSeqMetrics:

                          Code:
                          java -jar picard.jar CollectRnaSeqMetrics INPUT=sample.sam REF_FLAT=mm75.genePred STRAND=NONE MINIMUM_LENGTH=100 CHART=chart.out OUTPUT=accepted_hits_sam.stat
                          I'd be interested if anyone can make CollectRnaSeqMetrics work using these input files.

                          Comment

                          • GenoMax
                            Senior Member
                            • Feb 2008
                            • 7142

                            #14
                            Based on the answer Pierre provided: https://www.biostars.org/p/107779/

                            Try your luck with this refFlat.txt file: http://hgdownload.cse.ucsc.edu/golde...refFlat.txt.gz

                            Note: If you need Ensembl ID's then this would not help. At least this file does not produce an error with CollectRnaSeqMetrics.

                            Comment

                            • feralBiologist
                              Member
                              • Jun 2011
                              • 61

                              #15
                              Originally posted by GenoMax View Post
                              Based on the answer Pierre provided: https://www.biostars.org/p/107779/

                              Try your luck with this refFlat.txt file: http://hgdownload.cse.ucsc.edu/golde...refFlat.txt.gz

                              Note: If you need Ensembl ID's then this would not help. At least this file does not produce an error with CollectRnaSeqMetrics.
                              Unfortunately, I did quite a bit of work already using the Ensembl GTF - I would have to start afresh and discard all the work done so far as I can't be certain that the Ensembl version I am using (75) has an exact UCSC equivalent. Seems to me to be too much of a hassle if the only bit missing is the stats on intergenic regions and introns.

                              Comment

                              Latest Articles

                              Collapse

                              • SEQadmin2
                                Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
                                by SEQadmin2



                                Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

                                Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
                                ...
                                10-14-2026, 09:55 AM
                              • SEQadmin2
                                New Genomics Technologies Take Aim at Long-Standing Limits
                                by SEQadmin2


                                Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

                                We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
                                ...
                                09-28-2026, 10:25 AM

                              ad_right_rmr

                              Collapse

                              News

                              Collapse

                              Topics Statistics Last Post
                              Started by SEQadmin2, Yesterday, 11:13 AM
                              0 responses
                              19 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, Yesterday, 10:48 AM
                              0 responses
                              18 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 10-15-2026, 10:52 AM
                              0 responses
                              36 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 10-14-2026, 05:39 AM
                              0 responses
                              42 views
                              0 reactions
                              Last Post SEQadmin2  
                              Working...