Unconfigured Ad

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

    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

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by SEQadmin2, 06-09-2026, 11:58 AM
            0 responses
            24 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 06-05-2026, 10:09 AM
            0 responses
            29 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 06-04-2026, 08:59 AM
            0 responses
            39 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 06-02-2026, 12:03 PM
            0 responses
            62 views
            0 reactions
            Last Post SEQadmin2  
            Working...