BamSnap: A lightweight command-line visualization tool for sequencing reads in BAM files.
This is a fork of the original BamSnap tool developed by the Park Lab.
This fork was created to address specific issues with the original BamSnap tool when working with short reference sequences and to update the codebase for compatibility with newer versions of the Pillow library (version 10 and above).
-
Handling Short References: The original BamSnap encountered errors when processing BAM files aligned to small reference sequences (e.g., viral genomes, small plasmids). This fork implements fixes to allow BamSnap to handle short reference sequences gracefully without errors.
-
Compatibility with Pillow 10+: The original code used methods from the Pillow library that have been deprecated or removed in version 10 and above. This fork updates the code to be compatible with Pillow 10+, ensuring continued functionality with the latest versions of the library.
-
Bounds Checking for Short References: Implemented bounds checking and position adjustments throughout the code to ensure genomic positions stay within valid ranges of the reference sequence.
-
Updated Pillow Method Calls: Replaced deprecated methods such as
getsize()
with their modern equivalents likegetbbox()
to maintain compatibility with Pillow 10+. -
Code Refactoring: Minor refactoring and cleanup to improve code readability and maintainability.
- Python 3.4+
- Pillow (Python Imaging Library) (version 10.0.0 or higher)
- pysam
- pyfaidx
- pytabix
Clone this forked repository and install BamSnap:
*bash*
git clone https://github.com/mendezg/bamsnap.git
cd bamsnap
pip install -e .
*/bash*
This fork is not currently available via PyPI. Please install it directly from this repository using the instructions above.
*bash*
bamsnap -bam test.bam -pos 1:7364529 -out test.png
*/bash*
For more details, refer to the BamSnap Documentation.
Note: The documentation refers to the original BamSnap. While most functionalities remain the same, some details may differ due to the changes in this fork.
- 1000 Genome Data: 1000 genomic loci in 2504 individuals
- BamSnap Plot Gallery
Note: These resources are from the original BamSnap and are provided for reference.
BamSnap is licensed under the MIT License. See the LICENSE file for details.
This fork is based on the original BamSnap tool developed by the Park Lab. We thank the original authors for their work and contributions to the bioinformatics community.
For questions or comments about this fork, please contact mendezg.
Contributions to improve this fork are welcome. Please submit pull requests or open issues on GitHub.
- Fixed: Issues with processing BAM files aligned to short reference sequences.
- Updated: Codebase for compatibility with Pillow 10+.
- Improved: Code readability and maintainability.