{"id":25977663,"url":"https://github.com/juke34/sapin","last_synced_at":"2026-03-02T13:42:45.618Z","repository":{"id":177613299,"uuid":"657679615","full_name":"Juke34/SAPiN","owner":"Juke34","description":"Summarize Alignment Pile by Nucleotide","archived":false,"fork":false,"pushed_at":"2025-06-24T16:36:56.000Z","size":8800,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-27T00:40:58.144Z","etag":null,"topics":["alignment","bam"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Juke34.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-06-23T15:33:07.000Z","updated_at":"2025-06-24T16:37:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"40945e8e-1301-4155-9e66-d574efcc2c5b","html_url":"https://github.com/Juke34/SAPiN","commit_stats":null,"previous_names":["juke34/sapin"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Juke34/SAPiN","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Juke34%2FSAPiN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Juke34%2FSAPiN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Juke34%2FSAPiN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Juke34%2FSAPiN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Juke34","download_url":"https://codeload.github.com/Juke34/SAPiN/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Juke34%2FSAPiN/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30005048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T12:19:43.414Z","status":"ssl_error","status_checked_at":"2026-03-02T12:19:02.215Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alignment","bam"],"created_at":"2025-03-05T04:38:49.939Z","updated_at":"2026-03-02T13:42:45.605Z","avatar_url":"https://github.com/Juke34.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\n\n# SAPiN\n---------------------------\n\u003cimg src=\"img/IRD.png\" width=\"300\" height=\"100\" /\u003e \u003cimg src=\"img/MIVEGEC.png\" width=\"150\" height=\"100\" /\u003e\n\u003ch2\u003e\u003cem\u003eS\u003c/em\u003eummarize \u003cem\u003eA\u003c/em\u003elignment \u003cem\u003ePi\u003c/em\u003ele by \u003ci\u003eN\u003c/i\u003eucleotide\u003c/h2\u003e \n\n## Table of Contents\n\n   * [Foreword](#foreword)\n   * [Install](#install)\n   * [Usage](#usage)\n   * [Output](#output)     \n   * [Acknowledgement](#acknowledgement)\n\n## Foreword\n\nThis tool aims to summarize BAM read alignment by pileup or reads at each position in a tabulated way. More convenient as a mpileup format and containing extra information.\n\n## Output\n\nHere an example of output you would get with SAPiN\n\n```\nSEQID   POS     REF     QUAL    A       T       G       C       N       INS     DEL     IUPAC   COV     COV_ATGC    MUT_RAT APOBEC  ADAR    REGION  CODON   NUC     DESC\nHPV42REF        118     C       38.28   0       16      0       1356    0       0       0       0       1374    1372    1.17    1.2     .       AATGTCAGGTA             CAG     1       gene:ID=gene-1;Name=E6@@mRNA:ID=nbis-rna-1;Parent=gene-1;Name=E6@@exon:ID=nbis-exon-1;Parent=nbis-rna-1;Name=E6@@CDS:ID=cds-1;Parent=nbis-rna-1;Name=E6\n```\n\nHere a description of the different fields\n\n| Field | Optional | Type | Description |\n| --- | --- | --- | --- |\n| SEQID |  | String | The ID of the landmark used to establish the coordinate system for the current feature. |\n| POS   |  | Integer | The reference position, with the 1st base having position 1 |\n| REF   |  | Character | The reference base. | \n| QUAL  |  | Float | Mean Phred-scaled quality score for the sequenced position. |\n| A     |  | Integer | Number of Adenine nucleotide at the position |\n| T     |  | Integer | Number of Thymine nucleotide at the position |\n| G     |  | Integer | Number of Guanosine nucleotide at the position |\n| C     |  | Integer | Number of Cytosine nucleotide at the position |\n| N     |  | Integer | Number of Unknown nucleotide at the position |\n| INS     |  | Integer | Number of Insertion at the position |\n| DEL     |  | Integer | Number of Deletion at the position |\n| IUPAC     |  | Integer | Number of IUPAC nucleotide (minus A,T,G,C,N) at the position |\n| COV     |  | Integer | Coverage at the position (including INS,DEL,IUPAC) |\n| COV_ATGC    |  | Integer | Coverage at the position of A,T,G,C nucleotide only |\n| MUT_RAT    |  | Float | Mutation ration (COV_ATGC/nb mutated nuc*100) |\n| APOBEC    |  | Float | Mutation ration of C-to-T or G-to-A. Usefull when studying transcriptomes |\n| ADAR    |  | Float | Mutation ration of A-to-G or T-to-C. Usefull when studying transcriptomes |\n| REGION    |  | STRING | substring of 5 nucleotide on each side. Usefill to make pattern |\n| CODON    | Only if GFF provided | STRING | substring of codon in phase/frame (/!\\ do not take spliced CDS in account). |\n| NUC    | Only if GFF provided | Integer | 1,2 or 3. Indicate in the CODON (previous column) which nucleotide is the one studied at the position |\n| DESC    | Only if GFF provided | STRING | feature type and attributes extracted from the gff at the position |\n\n## Install\n\n### Prerequisite\n\n * python3\n * pysam\n * gffutils\n * matplotlib\n\n They should be automatically installed during SAPiN installation.\n\n#### Installation with pip:\n\n```bash\npip install git+https://github.com/Juke34/SAPiN.git\n```\n\nor if you do not have administrative rights on your machine\n\n```bash\npip install --user git+https://github.com/Juke34/SAPiN.git\n```\n\n\n#### Installation with git:\n\nClone the repository:\n\n```bash\ngit clone https://github.com/Juke34/SAPiN.git\n```\n\nInstall:\n\n```bash\npython -m pip install .\n```\n\n#### Check installation\n\nExecuting:\n```bash\nsapin\n```\n\nor\n\n```bash\nsapin -h\n```\n\nwill display some help.\n\n## Update\n\n#### Update with pip:\n\n```bash\npip install git+https://github.com/Juke34/SAPiN.git --upgrade\n```\n\nor if you do not have administartive rights on your machine\n\n```bash\npip install --user git+https://github.com/Juke34/SAPiN.git --upgrade\n```\n\n#### Update with git:\n\nMove into the repository folder and execute:\n\n```bash\ngit pull\npython -m pip install .\n```\n\n## Uninstall\n\n```bash\npip uninstall sapin\n```\n\n## Usage\n\n```\nsapin -a t/reference.bam -f t/reference.fasta \n```\n\n**advanced:**\n```\nsapin -a t/reference.bam -f t/reference.fasta -g t/reference_agat.gff3 -cf 1000 -bqf 20 -p\n```\n\n## Parameters\n\n| Parameter | Type | Description |\n| --- | --- | --- |\n|  -a, --ali     | String | Path to the BAM input file |\n|  -f, --fasta     | String | Path to the reference fasta file used to align the reads against. |\n|  -g, --gff     | String | Optional - Path to the reference gff |\n|  -o, --output    | String | Path to the tsv output file |\n|  -p, --plot    | Boolean | To plot the ratio of mutation per position (sapin_plot.svg by default. If outpout provided output.svg). |\n|  -q, --quiet    | Boolean | \"Decrease verbosity |\n|  -v, --verbose    | Boolean | Increase verbosity |\n|  -z, --gzip    | Boolean | Gzip output file |\n|  -s, --shame    | Boolean | Suppress the shameless plug |\n|  -cf, --cover_filter    | Integer | filter output to report only site with coverage \u003e= \u003cInteger\u003e |\n|  -bqf, --base_quality_filter    | Integer | filter output to report only site with base quality \u003e= \u003cInteger\u003e (default 0) |\n|  -mqf, --base_quality_filter    | Integer | filter output to report only site with mapping quality \u003e= \u003cInteger\u003e (default 0) |\n|  -mf, --mutation_filter    | Integer | filter output to report only site where the mutation ratio \u003e= \u003cInteger\u003e (default 0) |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuke34%2Fsapin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuke34%2Fsapin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuke34%2Fsapin/lists"}