Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • pysam: a python wrapper of samtools

    Dear NGS community:

    We announce the first release of pysam, a free/open-source lightweight wrapper of SAMtools with a pythonic interface.

    The code and documentation can be found at the Pysam website:



    The python module wraps most functionality of Heng Li's C implementation of SAMtools (http://samtools.sourceforge.net). We would like to thank Heng Li for his assistance and, of course, all the samtools developers for providing samtools in the first place.

    We hope you find it useful and we welcome feedback and comments.

    Best wishes,

    The pysam developers

  • #2
    I've used pysam for a couple of days now and greatly appreciate your effort!

    Comment


    • #3
      This is very welcome news, thanks for taking the time to create it. Does it use SWIG?

      Comment


      • #4
        Pysam uses pyrex to wrap the samtools code. Also, note there has been a bugfix release.

        Originally posted by quinlana View Post
        This is very welcome news, thanks for taking the time to create it. Does it use SWIG?

        Comment


        • #5
          pysam w/ 2.4 and 2.5

          I tried pysam today and found that it is not compatible with python <2.6.

          The reason is because it uses the 'namedtuple' object which is new is python 2.6

          I downloaded the following namedtuple implementation and am now able to use pysam with python 2.5 --



          Pysam developers -- you might consider making a python2.5 version available too!

          Thanks a lot for your sharing this great tool!

          Comment


          • #6
            Any chance of supporting python 3.1 or greater?

            Comment


            • #7
              We intend to support python 3 in the near future (this requires moving to cython from pyrex). For older versions of python 2 (<2.6), we would suggest using choy's work-around (using the namedtuple available from ActiveState code).

              Comment


              • #8
                Yes, thanks for making this available.

                Unfortunately I have not been able to install it and get the compilation errors below. If anyone can help I'd be grateful.

                Using:
                pysam-0.1.1
                Python 2.6.4
                Pyrex-0.9.8.5
                gcc (GCC) 4.3.2 20081105 (Red Hat 4.3.2-7)
                Linux 2.6.27.5-117.fc10.x86_64

                pysam-0.1.1: python2.6 setup.py build
                running build
                running build_py
                running build_ext
                building 'pysam/csamtools' extension
                gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Isamtools -I/c/matthew/include/py
                thon2.6 -c pysam/csamtools.c -o build/temp.linux-x86_64-2.6/pysam/csamtools.o
                In file included from pysam/csamtools.c:35:
                samtools/bam.h:341: warning: function declaration isnât a prototype
                samtools/bam.h:351: warning: function declaration isnât a prototype
                pysam/csamtools.c: In function â:
                pysam/csamtools.c:1740: warning: passing argument 7 of â from incompatible pointer type
                pysam/csamtools.c: In function â:
                pysam/csamtools.c:2020: warning: passing argument 1 of â from incompatible pointer type
                pysam/csamtools.c:2023: warning: passing argument 7 of â from incompatible pointer type
                pysam/csamtools.c: In function â:
                pysam/csamtools.c:4042: warning: assignment from incompatible pointer type
                pysam/csamtools.c: In function â:
                pysam/csamtools.c:7162: error: â undeclared (first use in this function)
                pysam/csamtools.c:7162: error: (Each undeclared identifier is reported only once
                pysam/csamtools.c:7162: error: for each function it appears in.)
                pysam/csamtools.c:7163: error: â undeclared (first use in this function)
                pysam/csamtools.c:7168: error: â undeclared (first use in this function)
                pysam/csamtools.c:7191: error: â undeclared (first use in this function)
                error: command 'gcc' failed with exit status 1

                Comment


                • #9
                  for the record - this was caused by not cleaning up an earlier unsuccessful installation attempt with an older version of pyrex

                  Comment


                  • #10
                    compiling pysam under cygwin or mingw32

                    I apologize if this is not an appropriate forum for this type of thing, but it is the only forum I can find that mentions pysam.

                    I'm trying to compile the latest version of pysam (0.1.2) under Windows Vista 64-bit (and that is not by choice).

                    I started using gcc from the cygwin tools, but gcc.exe would not run on this 64-bit system (odd). I switched to MinGW toolchain and got pysam to compile, but it won't link.

                    The build process for python extensions generates a .def file with an undefined symbol, in this case "initpysam/csamtools". I can see where this symbol name is generated but I am wondering if anyone else has run into this. It seems like it would affect anyone compiling pysam under cygwin or MinGW32.

                    Thanks in advance,

                    -csw

                    Comment


                    • #11
                      Originally posted by cswarth View Post
                      I'm trying to compile the latest version of pysam (0.1.2) under Windows Vista 64-bit (and that is not by choice).
                      I spoke with one of the authors of pysam and he said they had not tried much to make it work under windows. A colleague said it worked well under linux and mac. I compiled it easily under macos, and I'll just dual boot this windows machine with linux. Problem solved.

                      Comment


                      • #12
                        Installation issue:

                        $ which python
                        /usr/local/python/2.5.1/bin/python

                        $ python setup.py install
                        Traceback (most recent call last):
                        File "setup.py", line 56, in <module>
                        from Cython.Distutils import build_ext
                        ImportError: No module named Cython.Distutils
                        --
                        bioinfosm

                        Comment


                        • #13
                          You need to install the Cython library for Python.

                          See http://www.cython.org/
                          Last edited by maubp; 11-18-2010, 01:54 PM. Reason: added URL

                          Comment


                          • #14
                            Originally posted by maubp View Post
                            You need to install the Cython library for Python.

                            See http://www.cython.org/
                            that solved it. Thanks!
                            --
                            bioinfosm

                            Comment


                            • #15
                              running - python setup.py build, i have this error. why!??!

                              running build
                              running build_py
                              running build_ext
                              building 'csamtools' extension
                              gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DFILE_OFFSET_BITS=64 -D_USE_KNETFILE= -Isamtools -Ipysam -I/usr/include/python2.6 -c pysam/csamtools.c -o build/temp.linux-i686-2.6/pysam/csamtools.o
                              In file included from pysam/csamtools.c:140:
                              samtools/razf.h:38:18: error: zlib.h: No such file or directory
                              In file included from pysam/csamtools.c:140:
                              samtools/razf.h:91: error: expected specifier-qualifier-list before ‘z_stream’
                              In file included from pysam/csamtools.c:142:
                              samtools/bam.h:354: warning: function declaration isn’t a prototype
                              samtools/bam.h:369: warning: function declaration isn’t a prototype
                              pysam/csamtools.c: In function ‘__pyx_pf_9csamtools_7Samfile_fetch’:
                              pysam/csamtools.c:5363: warning: passing argument 7 of ‘bam_fetch’ from incompatible pointer type
                              samtools/bam.h:596: note: expected ‘bam_fetch_f’ but argument is of type ‘int (*)(struct bam1_t *, void *)’
                              pysam/csamtools.c: In function ‘__pyx_pf_9csamtools_7Samfile_pileup’:
                              pysam/csamtools.c:6057: warning: passing argument 1 of ‘bam_plbuf_init’ from incompatible pointer type
                              samtools/bam.h:525: note: expected ‘bam_pileup_f’ but argument is of type ‘int (*)(uint32_t, uint32_t, int, struct bam_pileup1_t *, void *)’
                              pysam/csamtools.c:6066: warning: passing argument 7 of ‘bam_fetch’ from incompatible pointer type
                              samtools/bam.h:596: note: expected ‘bam_fetch_f’ but argument is of type ‘int (*)(struct bam1_t *, void *)’
                              pysam/csamtools.c: In function ‘__pyx_f_9csamtools_14IteratorColumn_cnext’:
                              pysam/csamtools.c:10974: warning: assignment discards qualifiers from pointer target type
                              pysam/csamtools.c: In function ‘__pyx_pf_9csamtools_11AlignedRead_5cigar___set__’:
                              pysam/csamtools.c:12631: warning: passing argument 4 of ‘pysam_bam_update’ from incompatible pointer type
                              pysam/pysam_util.h:33: note: expected ‘uint8_t *’ but argument is of type ‘uint32_t *’
                              pysam/csamtools.c: In function ‘__Pyx_InitGlobals’:
                              pysam/csamtools.c:21875: warning: this decimal constant is unsigned only in ISO C90
                              error: command 'gcc' failed with exit status 1

                              Comment

                              Latest Articles

                              Collapse

                              • 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
                              • seqadmin
                                Techniques and Challenges in Conservation Genomics
                                by seqadmin



                                The field of conservation genomics centers on applying genomics technologies in support of conservation efforts and the preservation of biodiversity. This article features interviews with two researchers who showcase their innovative work and highlight the current state and future of conservation genomics.

                                Avian Conservation
                                Matthew DeSaix, a recent doctoral graduate from Kristen Ruegg’s lab at The University of Colorado, shared that most of his research...
                                03-08-2024, 10:41 AM

                              ad_right_rmr

                              Collapse

                              News

                              Collapse

                              Topics Statistics Last Post
                              Started by seqadmin, Yesterday, 06:37 PM
                              0 responses
                              8 views
                              0 likes
                              Last Post seqadmin  
                              Started by seqadmin, Yesterday, 06:07 PM
                              0 responses
                              8 views
                              0 likes
                              Last Post seqadmin  
                              Started by seqadmin, 03-22-2024, 10:03 AM
                              0 responses
                              49 views
                              0 likes
                              Last Post seqadmin  
                              Started by seqadmin, 03-21-2024, 07:32 AM
                              0 responses
                              66 views
                              0 likes
                              Last Post seqadmin  
                              Working...
                              X