Running and Verifying Pysam
Procedure
- Use PuTTY to log in to the server as the root user.
- Go to the pysam-0.15.4/tests/pysam_data/ folder in the Pysam source code directory and locate example_aligned_pairs.sam.
cd tests/pysam_data/
- Run Pysam.
python3 import pysam samfile = pysam.AlignmentFile("example_aligned_pairs.sam") samfile.count()In the command output, 52 indicates that the Pysam has successfully parsed the sam file.

Parent topic: pysam 0.15.4 Porting Guide (CentOS 7.6)