Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • errors while using python dexseq_prepare_annotation.py

    Hi there, I am trying to use the dexseq_prepare_annotation.py tool in DEXseq and have tried several different gtf files but they all seem to get the same error. Not sure what could be causing this (below). Python version maybe? Any suggestions folks have are appreciated. Thanks -Rich

    python dexseq_prepare_annotation.py test.gtf

    Traceback (most recent call last):
    File "dexseq_prepare_annotation.py", line 25, in ?
    for f in HTSeq.GFF_Reader( gtf_file ):
    File "/usr/lib64/python2.4/site-packages/HTSeq-0.5.3p3-py2.4-linux-x86_64.egg/HTSeq/__init__.py", line 204, in __iter__
    for line in FileOrSequence.__iter__( self ):
    File "/usr/lib64/python2.4/site-packages/HTSeq-0.5.3p3-py2.4-linux-x86_64.egg/HTSeq/__init__.py", line 42, in __iter__
    if self.fos.lower().endswith( ( ".gz" , ".gzip" ) ):
    TypeError: expected a character buffer object

  • #2
    Hi greener,

    I am not sure, but I think the problem is that you did not specify an output file:

    Code:
    Usage: python dexseq_prepare_annotation.py <in.gtf> <out.gff>
    Alejandro

    Comment


    • #3
      Thanks areyes, Yes I did try it with an out file. still get the same error

      Comment


      • #4
        hmm strange. could you show the first lines of your gtf file?

        Comment


        • #5
          here is one

          [greener@kojak bowtie]$ head -n 10 /vol01/genome/mouse/ucsc/annotation/mm9_ucsc_refGene.txt.gtf2.2
          chr1 ucsc exon 134212701 134213049 . + 0 gene_id "NM_028778:134212701"; transcript_id "NM_028778:134212701";
          chr1 ucsc exon 134221529 134221650 . + 0 gene_id "NM_028778:134212701"; transcript_id "NM_028778:134212701";
          chr1 ucsc exon 134224273 134224425 . + 1 gene_id "NM_028778:134212701"; transcript_id "NM_028778:134212701";
          chr1 ucsc exon 134224707 134224773 . + 0 gene_id "NM_028778:134212701"; transcript_id "NM_028778:134212701";
          chr1 ucsc exon 134226534 134226654 . + 0 gene_id "NM_028778:134212701"; transcript_id "NM_028778:134212701";
          chr1 ucsc exon 134227135 134227268 . + 0 gene_id "NM_028778:134212701"; transcript_id "NM_028778:134212701";
          chr1 ucsc exon 134227897 134230065 . + 1 gene_id "NM_028778:134212701"; transcript_id "NM_028778:134212701";
          chr1 ucsc exon 134212701 134213049 . + 0 gene_id "NM_001195025:134212701"; transcript_id "NM_001195025:134212701";
          chr1 ucsc exon 134221529 134221650 . + 0 gene_id "NM_001195025:134212701"; transcript_id "NM_001195025:134212701";
          chr1 ucsc exon 134222782 134222806 . + 1 gene_id "NM_001195025:134212701"; transcript_id "NM_001195025:134212701";

          Comment


          • #6
            I got the same error message here. Did you find any solutions?

            Thanks.

            Comment


            • #7
              I just noticed we never answer this message, an apology for that.

              Could you try to update python (to at least 2.5 ) and HTSeq to the most recent?
              I was unable to reproduce the error, I think this might solve it. Let me know if not.

              Alejandro

              Comment


              • #8
                Hi areyes,

                I'm also getting an error message when trying to use the dexseq_prepare_annotation.py. I'm trying to use it on the gtf file for drosophila from http://useast.ensembl.org/info/data/ftp/index.html.

                $python dexseq_prepare_annotation.py Drosophila_melanogaster.BDGP5.67.gtf Drosophila_melanogaster.BDGP5.67.gff

                The error message I receive is:
                Traceback (most recent call last):
                File "dexseq_prepare_annotation.py", line 89, in <module>
                assert l[i].iv.end <= l[i+1].iv.start, str(l[i+1]) + " starts too early"
                AssertionError: <GenomicFeature: exonic_part 'FBgn0261841+FBgn0261840+FBgn0261837+FBgn0261843+FBgn0261845+FBgn0261844+FBgn0261838+FBgn0261839+FBgn0002781+FBgn0261842' at 3R: 17178958 -> 17178091 (strand '-')> starts too early

                We've used dexseq_prepare_annotation.py on gtf files from other species and it has always worked great. Seems strange since the pasilla package in R uses drosophila as the example dataset.

                Here is the head of the drosophila gtf file:

                3R protein_coding exon 380 509 . + . gene_id "FBgn0037213"; transcript_id "FBtr0078961"; exon_number "1"; gene_name "CG12581"; gene_biotype "protein_coding"; transcript_name "CG12581-RB";
                3R protein_coding exon 578 1913 . + . gene_id "FBgn0037213"; transcript_id "FBtr0078961"; exon_number "2"; gene_name "CG12581"; gene_biotype "protein_coding"; transcript_name "CG12581-RB";
                3R protein_coding CDS 1115 1913 . + 0 gene_id "FBgn0037213"; transcript_id "FBtr0078961"; exon_number "2"; gene_name "CG12581"; gene_biotype "protein_coding"; transcript_name "CG12581-RB"; protein_id "FBpp0078601";
                3R protein_coding start_codon 1115 1117 . + 0 gene_id "FBgn0037213"; transcript_id "FBtr0078961"; exon_number "2"; gene_name "CG12581"; gene_biotype "protein_coding"; transcript_name "CG12581-RB";
                3R protein_coding exon 7784 8649 . + . gene_id "FBgn0037213"; transcript_id "FBtr0078961"; exon_number "3"; gene_name "CG12581"; gene_biotype "protein_coding"; transcript_name "CG12581-RB";
                3R protein_coding CDS 7784 8649 . + 2 gene_id "FBgn0037213"; transcript_id "FBtr0078961"; exon_number "3"; gene_name "CG12581"; gene_biotype "protein_coding"; transcript_name "CG12581-RB"; protein_id "FBpp0078601";
                3R protein_coding exon 9439 10200 . + . gene_id "FBgn0037213"; transcript_id "FBtr0078961"; exon_number "4"; gene_name "CG12581"; gene_biotype "protein_coding"; transcript_name "CG12581-RB";
                3R protein_coding CDS 9439 9768 . + 0 gene_id "FBgn0037213"; transcript_id "FBtr0078961"; exon_number "4"; gene_name "CG12581"; gene_biotype "protein_coding"; transcript_name "CG12581-RB"; protein_id "FBpp0078601";
                3R protein_coding stop_codon 9769 9771 . + 0 gene_id "FBgn0037213"; transcript_id "FBtr0078961"; exon_number "4"; gene_name "CG12581"; gene_biotype "protein_coding"; transcript_name "CG12581-RB";
                3R protein_coding exon 380 1913 . + . gene_id "FBgn0037213"; transcript_id "FBtr0078962"; exon_number "1"; gene_name "CG12581"; gene_biotype "protein_coding"; transcript_name "CG12581-RA";


                Any thoughts? Thanks in advance

                Comment


                • #9
                  I give a look into that annotation file, the annotation of the gene mod(mdg4) seems to have some problems, I just removed it:

                  Code:
                  grep -v "mod(mdg4)" Drosophila_melanogaster.BDGP5.67.gtf > Drosophila_melanogaster.BDGP5.67.filtered.gtf
                  And the DEXSeq error goes away!

                  Comment


                  • #10
                    Thanks areyes! Helpful as always!

                    Comment


                    • #11
                      Hi everyone,
                      I've been trying to use the dexseq_prepare_annotation.py script but I kept on getting error. Please see the code below.

                      imumorin@ansci253135199:~/myrnaseqexp$ python dexseq_prepare_annotation.py Drosophila_melanogaster.BDGP5.70.gtf Drosophila_melanogaster.BDGP5.70.gff
                      File "dexseq_prepare_annotation.py", line 4
                      <!DOCTYPE html>
                      ^
                      SyntaxError: invalid syntax

                      I got the script from this page https://github.com/olgabot/rna-seq-d..._annotation.py and I used the wget command. Can someone please help me?

                      Comment


                      • #12
                        I was suspecting that it was incorrectly installed since I searched the package but couldn't get the script out. See a part of my ls -al for the script:

                        -rw-rw-r-- 1 imumorin imumorin 55209 2013-02-22 15:24 dexseq_prepare_annotation.py

                        Any clue?

                        Comment


                        • #13
                          Well, a Python file is not supposed to contain a Doctype tag. You downloaded the HTML source of the page displaying the code of the Python script, not the script itself.

                          Why did you download it separately from the DEXSeq package at all?

                          Use the R command system.file( package="DEXSeq" ) to see which directory R has installed DEXSeq in. There you will find a sub-directory python-scripts containing the correct file.

                          Comment


                          • #14
                            Originally posted by Simon Anders View Post
                            Well, a Python file is not supposed to contain a Doctype tag. You downloaded the HTML source of the page displaying the code of the Python script, not the script itself.

                            Why did you download it separately from the DEXSeq package at all?

                            Use the R command system.file( package="DEXSeq" ) to see which directory R has installed DEXSeq in. There you will find a sub-directory python-scripts containing the correct file.
                            Thanks Simon. I followed your que and it worked for version 2.15. I'm using ubuntu linux and I tried to upgrade it to version 2.15.2 but it appears I couldn't figure it out. Is there anyone that knows how I can upgrade the R version 2.13 in ubuntu linux to 2.15.2?
                            Any help will be greatly appreciated.

                            Thanks Simon once again...

                            Comment


                            • #15
                              The R version included in Canonical's official Ubuntu package repository is always a bit old. If you add the package repository from CRAN to your package sources, you can always get the newest version.

                              See here for details: http://cran.r-project.org/bin/linux/ubuntu/README

                              Comment

                              Latest Articles

                              Collapse

                              • seqadmin
                                Current Approaches to Protein Sequencing
                                by seqadmin


                                Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
                                04-04-2024, 04:25 PM
                              • seqadmin
                                Strategies for Sequencing Challenging Samples
                                by seqadmin


                                Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
                                03-22-2024, 06:39 AM

                              ad_right_rmr

                              Collapse

                              News

                              Collapse

                              Topics Statistics Last Post
                              Started by seqadmin, 04-11-2024, 12:08 PM
                              0 responses
                              25 views
                              0 likes
                              Last Post seqadmin  
                              Started by seqadmin, 04-10-2024, 10:19 PM
                              0 responses
                              28 views
                              0 likes
                              Last Post seqadmin  
                              Started by seqadmin, 04-10-2024, 09:21 AM
                              0 responses
                              24 views
                              0 likes
                              Last Post seqadmin  
                              Started by seqadmin, 04-04-2024, 09:00 AM
                              0 responses
                              52 views
                              0 likes
                              Last Post seqadmin  
                              Working...
                              X