pysam | Python module for reading and manipulating SAM | Genomics library

 by   pysam-developers C Version: 0.22.0 License: MIT

kandi X-RAY | pysam Summary

kandi X-RAY | pysam Summary

pysam is a C library typically used in Artificial Intelligence, Genomics applications. pysam has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

Pysam is a Python module for reading and manipulating SAM/BAM/VCF/BCF files. It's a lightweight wrapper of the htslib C-API, the same one that powers samtools, bcftools, and tabix.

            kandi-support Support

              pysam has a low active ecosystem.
              It has 658 star(s) with 256 fork(s). There are 49 watchers for this library.
              There were 1 major release(s) in the last 6 months.
              There are 241 open issues and 593 have been closed. On average issues are closed in 102 days. There are 7 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of pysam is 0.22.0

            kandi-Quality Quality

              pysam has 0 bugs and 0 code smells.

            kandi-Security Security

              pysam has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              pysam code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              pysam is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              pysam releases are available to install and integrate.
              It has 7767 lines of code, 807 functions and 47 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of pysam
            Get all kandi verified functions for this library.

            pysam Key Features

            No Key Features are available at this moment for pysam.

            pysam Examples and Code Snippets

            How to trim or pad a sequence to be a certain length bio python
            Pythondot img1Lines of Code : 23dot img1License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            from pysam import FastxFile
            fasta_q_file = "INPUT.fasta"
            out_filename = "OUTPUT_NAME.fasta"
            size_size_trim = 50
            with FastxFile(fasta_q_file) as fh, open(out_filename, mode='w') as fout:
                for entry in fh:
                    sequence_id = entry.
            Changing an orientation of a reverse sequence in the fasta file doesnt work
            Pythondot img2Lines of Code : 47dot img2License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            import os
            import sys 
            import pysam
            from Bio import SeqIO, Seq, SeqRecord
            def main(in_file):
                out_file = "%s.fa" % os.path.splitext(in_file)[0]
                with open('test_non_reverse.txt', 'w') as non_reverse:
                    with open(out_file, "w") 

            Community Discussions


            Snakemake Conda environment does not seem to be activating though it says it is
            Asked 2021-Mar-30 at 22:22

            I am running Snakemake with the --use-conda option. Snakemake successfully creates the environment, which should include pysam. I am able to manually activate this created environment, and within it, run my script, which imports the module pysam, with no problems. However, when running the Snakemake pipeline, I get the following error log:



            Answered 2021-Mar-30 at 22:22

            Turns out that the newer version of snakemake 6.0.0+ must have some issue with this. I used snakemake 5.8.2 instead and things work just fine. Not sure exactly what's going on under the hood but seems identical to this issue:



            Why does installing pysam python package fail?
            Asked 2020-May-26 at 20:59

            I'm new to python and running the command:

            pip install pysam

            Which results in:



            Answered 2020-Feb-12 at 22:37

            if you have anaconda, try this:

            conda install -c bioconda pysam



            python click: "got unexpected extra arguments"
            Asked 2020-Apr-06 at 07:11

            I have written a small and simple interface with Click, I get this error "Error: Got unexpected extra arguments" and I just can't figure out why this occurs?

            Here is my



            Answered 2020-Apr-06 at 07:11

            Your preprocess function calls itself, resulting in the "unexpected extra arguments" error (see Click: "Got unexpected extra arguments" when passing string for a similar case). This is because its definition hides the one that you imported from .preprocessor.

            You should instead import the external preprocess function using a different name, e.g.:


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install pysam

            You can download it from GitHub.


            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • PyPI

            pip install pysam

          • CLONE
          • HTTPS


          • CLI

            gh repo clone pysam-developers/pysam

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link