Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • Problem with pysam.Samfile

    I installed Pysam a few days ago, but I couldn't open any sam files
    using it.

    I can "import pysam"...no error message

    When I write
    f = pysam.Samfile("ex3.sam", "r")
    I get the following error message:

    Exception AttributeError: "StderrStore instance has no attribute
    'stderr_save'" in <bound method StderrStore.__del__ of
    <csamtools.StderrStore instance at 0x12d1638>> ignored
    Traceback (most recent call last):
    File "<pyshell#1>", line 1, in <module>
    f = pysam.Samfile("ex3.sam", "r")
    File "csamtools.pyx", line 258, in csamtools.Samfile.__cinit__
    (pysam/csamtools.c:2674)
    File "csamtools.pyx", line 362, in csamtools.Samfile._open (pysam/
    csamtools.c:3757)
    File "csamtools.pyx", line 167, in csamtools.StderrStore.__init__
    (pysam/csamtools.c:2400)
    AttributeError: 'PseudoFile' object has no attribute 'fileno'

    Can anyone tell me what is my problem? And how to fix this problem?

    Thanks a lot!

    ML

  • #2
    Hello,
    I'd cross post this to pysams issue tracker at http://code.google.com/p/pysam/issues/list .

    What version of pysam did you download and what python version are you using?

    Comment


    • #3
      ffinkernagel, Thank you for your reply.

      My python version is 2.6, pysam version is 0.3

      Is compatibility an issue?

      ML

      Comment


      • #4
        not really, but I wanted to exclude that you were either not on cpython, or had downloaded the newest-possibly-unstable version from the source code repository.

        Have you by any chance a redirected stderr?
        It appears that the error lies in the part that redirects the stderr temporarily to capture samtools output. This could be anything from shell level indirection, using something else than 'python' or 'ipython' to run your script (I know Ipython works, I don't know about bpython) or maybe you're not running under linux? Any idea?

        So long,
        FF

        Comment


        • #5
          Thanks ffinkernagel!

          I am using standard cpython, and it should be stable because it's version 2.6.
          I have never redirect stderr, at least not as I know of.
          Finally, I am using Linux.
          I am a newbie in both Next Generation Seq and Python, I feel that to solve this problem I need deep knowledge of both, so probably I will give up. And generate pileup file directly from command line, and then use python to analyze the data.

          Thanks again for your help.

          ML

          Comment


          • #6
            I'll repeat my message I've sent to the pysam mailing list in reply to your request:

            This is a bug in pysam: It assumes that standard error is a regular file. When using the IDLE shell (which you seem to do), this assumption does not hold and as soon as pysam tries to redirect standard error to a temporary file, the above error occurs. I suggest you file a bug report.

            Marcel

            Comment

            Latest Articles

            Collapse

            • seqadmin
              Essential Discoveries and Tools in Epitranscriptomics
              by seqadmin




              The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
              04-22-2024, 07:01 AM
            • 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

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by seqadmin, Today, 11:49 AM
            0 responses
            12 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, Yesterday, 08:47 AM
            0 responses
            16 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 04-11-2024, 12:08 PM
            0 responses
            61 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 04-10-2024, 10:19 PM
            0 responses
            60 views
            0 likes
            Last Post seqadmin  
            Working...
            X