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

            • kinpict.com
              Reply to 16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
              by kinpict.com
              The part about this topic feels surprisingly grounded, and the details on the page is the bit that made me slow down. I’d keep <a href="https://kinpict.com/">ai family photo generator</a> bookmarked for later.
              Today, 06:37 PM
            • SEQadmin2
              16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
              by SEQadmin2





              NGS has revolutionized clinical microbiology by offering new ways to identify and surveil pathogens without prior knowledge of the target. One popular approach is 16S rRNA and ITS amplicon sequencing, which targets specific microbial markers. But studies are increasingly incorporating shotgun metagenomics, a technique that sequences all DNA from a sample without targeting specific microbial markers. This approach allows more detailed taxonomic classification,...
              10-30-2026, 06:46 AM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by SEQadmin2, 11-12-2026, 07:59 AM
            0 responses
            26 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 11-05-2026, 09:25 AM
            0 responses
            35 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 11-03-2026, 11:54 AM
            2 responses
            55 views
            0 reactions
            Last Post kinpict.com  
            Started by SEQadmin2, 10-28-2026, 09:57 AM
            0 responses
            175 views
            0 reactions
            Last Post SEQadmin2  
            Working...