Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mingyu
    Junior Member
    • Oct 2010
    • 3

    #1

    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
  • ffinkernagel
    Senior Member
    • Oct 2009
    • 110

    #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

    • mingyu
      Junior Member
      • Oct 2010
      • 3

      #3
      ffinkernagel, Thank you for your reply.

      My python version is 2.6, pysam version is 0.3

      Is compatibility an issue?

      ML

      Comment

      • ffinkernagel
        Senior Member
        • Oct 2009
        • 110

        #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

        • mingyu
          Junior Member
          • Oct 2010
          • 3

          #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

          • mmartin
            Member
            • Aug 2009
            • 73

            #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

            • 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, 10-22-2026, 11:13 AM
            0 responses
            23 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 10-22-2026, 10:48 AM
            0 responses
            20 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...