{"id":20083752,"url":"https://github.com/y9c/cpup","last_synced_at":"2026-06-01T01:31:57.171Z","repository":{"id":40590308,"uuid":"323400930","full_name":"y9c/cpup","owner":"y9c","description":"Convert mpileup format to base count tsv table","archived":false,"fork":false,"pushed_at":"2023-12-19T03:29:34.000Z","size":668,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T13:51:05.657Z","etag":null,"topics":["bioinformatics","dna-modifications","mpileup","mutations","rna-modifications","samtools","snp-genotyping"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/y9c.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2020-12-21T17:14:16.000Z","updated_at":"2023-12-29T17:35:34.000Z","dependencies_parsed_at":"2023-12-19T06:38:10.151Z","dependency_job_id":"d96f79b2-4ecd-44a9-babd-d027cff92f20","html_url":"https://github.com/y9c/cpup","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/y9c/cpup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y9c%2Fcpup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y9c%2Fcpup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y9c%2Fcpup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y9c%2Fcpup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/y9c","download_url":"https://codeload.github.com/y9c/cpup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y9c%2Fcpup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33756575,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bioinformatics","dna-modifications","mpileup","mutations","rna-modifications","samtools","snp-genotyping"],"created_at":"2024-11-13T15:48:39.306Z","updated_at":"2026-06-01T01:31:57.155Z","avatar_url":"https://github.com/y9c.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cpup\n\n**Convert samtools mpileup result into base count table**\n\n\u003e Feature:\n\n- multiple bam files are supported\n- filter sites before output\n- output by strandness\n- group and count indels by pattern\n\n## Install\n\n```bash\ngit clone https://github.com/y9c/cpup.git\ncd ./cpup\nmake\n```\n\n## Usage\n\nPipe the output of samtools mpileup into this tools!\n\n```\nUsage:\n  samtools mpileup -d 0 -Q 10 --reverse-del -l \u003c.bed\u003e -f \u003c.fa\u003e \u003c.bam\u003e | cpup\n\n  -h, --help          show help\n  -H, --headerless    hide header\n  -S, --strandless    ignore strand information\n  -s, --by-strand     output by strand\n  -m, --major-strand  output major strand only\n  -i, --indel         append indel count\n  -e, --ends          append read ends (5' | 3') count\n  -c, --count []      select count columns\n  -f, --filter []     filter sites\n  -F, --drop []       drop sites\n\n```\n\n`samtools mpileup` can mpileup the mapping result site by site in the format\nbelow. The 5th (8th, 11st, 14th, ...) column report the observed bases in each site.\n\n```\nXII     455422  C       16      \u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c,,        FFFFFFFFFFFFFFFF        4       \u003c\u003c,,    FFFF\nXII     455423  T       16      \u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c,,        FFFFFFFFFFFFFFFF        4       \u003c\u003c,,    FFFF\nXII     455424  C       17      \u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c,,^$,     FFFFFFFFFFFFFFFFE       4       \u003c\u003c,,    FFFF\nXII     455425  A       18      \u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c,,,^$,    FFFFFFFFFFFFFFFFFF      4       \u003c\u003c,,    FFFF\nXII     455426  A       18      \u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c,,,,      FFFFFFFFFFFFFFFFFF      4       \u003c\u003c,,    FFFF\nXII     455427  A       20      \u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c,,,,^$,^$,        FFFFFFFFFFFFFFFFFFEE    4       \u003c\u003c,,    FFFF\nXII     455428  C       20      \u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c,,,,,,    FFFFFFFFFFFFFFFFFFFF    4       \u003c\u003c,,    FFFF\nXII     455429  A       20      \u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c,,,,,,    FFFFFFFFFFFFFFFFFFFF    4       \u003c\u003c,,    FFFF\nXII     455430  G       22      \u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c,,,,,,^$,^$,      FFFFFFFFFFFFFFFFFFFFBB  4       \u003c\u003c,,    FFFF\nXII     455431  G       23      \u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c,,,,,,,,^$,       FFFFFFFFFFFFFFFFFFFFEED 4       \u003c\u003c,,    FFFF\n...\n```\n\n`cpup` can convert the mpileup output into table below by parameters `-i -s -f mut:3`.\n\n```\nchr     pos     ref_base        strand  depth,a,c,g,t,n,gap,insert,delete,istat,dstat           depth,a,c,g,t,n,gap,insert,delete,istat,dstat\nXII     455496  C       -       1409,17,0,0,0,0,2,0,2,,c:1|caa:1        139,3,0,0,0,0,1,0,2,,c:1|caa:1\nXII     455498  T       -       1454,0,6,2,0,0,407,0,244,,at:220|att:24 144,0,0,1,0,0,37,0,27,,at:23|att:4\nXII     455499  T       -       1496,0,1,12,0,0,250,0,12,,t:7|tt:5      151,0,0,2,0,0,29,0,1,,t:1\nXII     455500  A       -       1455,0,2,2,0,0,256,0,0,,        145,0,1,0,0,0,28,0,0,,\nXII     729179  T       +       223,0,3,0,0,0,33,0,0,,  56,0,0,0,0,0,14,0,0,,\nXII     729182  C       +       235,1,0,0,4,0,2,0,0,,   56,0,0,0,0,0,1,0,0,,\n```\n\n\u003e NOTE:\n\n- `-Q` in samtools mpileup should not be set to zero, which might bring bug in counting overlapping reads.\n- `-f` to check **any** (max) value greater than cutoff.\n  eg: `mut:3` for filter sites with **more than or equal to(\u003e=)** 3 mutations in any sample.\n  You can set multile filters, like `mut:3,delete:2` to filter sites with \u003e= 3 mutations in any samples, meanwhile, are should be \u003e=2 delete events.\n- `-F` to check **all** (min) value greater than cutoff.\n\n## Q\u0026A?\n\n- filter input base by its quality?\n\n`samtools` can do it\n\n- filter output site by cutoff?\n\n`awk` can do it\n\n- samtools mpileup is too slow?\n\n`bcftools mpileup` might a better choice, if you are not confusing with tags (`-t AD`, `-t ADF`, `-t ADR`).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fy9c%2Fcpup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fy9c%2Fcpup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fy9c%2Fcpup/lists"}