{"id":19755725,"url":"https://github.com/hrbigelow/depngs","last_synced_at":"2026-04-17T19:32:35.034Z","repository":{"id":18038040,"uuid":"21080887","full_name":"hrbigelow/depngs","owner":"hrbigelow","description":"Next-gen Sequencing analysis tools","archived":false,"fork":false,"pushed_at":"2023-02-13T20:05:47.000Z","size":2150,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T09:10:07.934Z","etag":null,"topics":["bam-files","bioinformatics","mutation-analysis","ngs"],"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/hrbigelow.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":"2014-06-21T23:10:38.000Z","updated_at":"2023-02-07T16:54:09.000Z","dependencies_parsed_at":"2025-02-28T02:11:21.197Z","dependency_job_id":"17ae37e4-64b6-4905-87d0-64c9e3fd9553","html_url":"https://github.com/hrbigelow/depngs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hrbigelow/depngs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbigelow%2Fdepngs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbigelow%2Fdepngs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbigelow%2Fdepngs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbigelow%2Fdepngs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hrbigelow","download_url":"https://codeload.github.com/hrbigelow/depngs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbigelow%2Fdepngs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31943372,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"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":["bam-files","bioinformatics","mutation-analysis","ngs"],"created_at":"2024-11-12T03:12:54.451Z","updated_at":"2026-04-17T19:32:35.029Z","avatar_url":"https://github.com/hrbigelow.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dep - Diversity Estimation Probabilistically\n\nA tool to estimate nucleotide base composition in non-clonal samples from next-gen\nsequence alignment\n\n## Synopsis\n\n    dep dist [options] samples.rdb sample_pairings.rdb ref.fasta\n    dep pileup [options] samples.rdb ref.fasta out.pileup\n\n    # full usage\n    man -l dep.1\n    man -l pileup_depth_stats.1\n    man -l pileup_to_bindepth.1\n\n# Introduction\n\nDep is a tool that estimates nucleotide base composition of non-clonal samples or\nmutational distance between two non-clonal samples.  For such samples, using a\ntraditional diploid genotype caller violates its assumption of a locus being one of\nthe 10 possible discrete diploid genotypes AA, CC, GG, TT, AC, AG, AT, CG, CT, GT.\nMaking this false assumption is worse if trying to detect changes in the genotype\nbetween pairs of samples (such as timepoints of the same patient).  This is because\none of the non-clonal samples may close to a threshold of 25\\% X + 75\\% Y, which is\nforced to be genotyped as XY or YY, neither of which are very close to the actual\nnucleotide composition.  And, if a pair of samples fall on either side of this\nthreshold, there may be no significant change in the base composition, yet\nindividually genotyping them will flag a change.  Even though such a situation may be\nrare in absolute terms, it can be common among the pool of flagged changes.\n\nTypically, the problem setting is as follows.  The replicating virus or cancer genome\ncan mutate at each division, with the result that a population is non-clonal.  Each\nposition in the genome potentially has a different selective or mutational pressure.\nTaking the population as a whole, we want to measure the fraction of the population\nhaving A, C, G, and T at each position in the genome.  Knowing this allows biologists\nto measure the effect of a drug on the mutational profile, or to spot locations that\ncorrelate with survival or death.   \n\nWhile cancer cells divide and mutate, the immune system recognizes some of them\nas bad, and is able to kill them off.  Other cells acquire mutations that allow\nthem to evade attack for awhile until the immune system adapts.  A Darwinian\nnatural selection dynamic takes hold.  In between adaptations, a mostly\ndecimated population of cancer cells can regrow from a very small subpopulation\n('clonal expansion'). \n\nThink of the game like this:  The immune system is AlphaGo playing a billion Go\ngames simultaneously, each against a different amateur.  At each time step, the\namateurs each make a random move.  AlphaGo responds and the process repeats.\nAlso, at each time step, some fraction of games end, with the amateurs losing.\nWhen these games end, there is room for any remaining amateurs to clone\nthemselves with the same board state until there are a billion games in play. \n\nSo, at any given time, in a very rare cases, the amateur might make a really\ngood move, and since he can clone his board state, the overall setup provides a\nbrute-force opportunity for the amateurs to win.\n\nBreaking from the metaphor now, the goal is to spot which positions in the\ngenome have undergone clonal expansion, and when.  This is done by comparing\nthe measured base composition of different cancer tissue samples at successive\ntimepoints.  And to get an accurate picture, one must be able to detect rare\nsubpopulations.\n\nSo the problem is this:  Now imagine I give you an urn with a billion balls,\nsome unknown fraction of red, blue, green, and yellow.  You can only take out\n5000 balls, and you actually can't observe the color of each ball directly.\nYou have a machine that can measure the color, but it is not 100% accurate.  In\nfact, it outputs a color and a confidence score (based on its own internal\nmetrics) telling you how likely it is to be correct.  For the sake of argument,\nlet's say we can take this confidence score as accurate.\n\nSo you get your 5000 measurements of (color, confidence score), and now you\nwant to estimate the fraction of different colors in the full urn.  The model I chose\nis a two-stage model:\n\n\n\n# Implementation\n\ndep is a multi-threaded filter which consumes one or more .bam files and outputs one\nor more result files.  It is a unix-like filter in that it outputs an analysis for\neach genomic position in the order given in the inputs.  The analysis can be any of:\n\n- base composition estimation with confidence intervals\n- mutational distance estimation with confidence intervals\n- indel composition\n- indel mutational distance estimation\n- pileup\n\nAt the top level of execution it is a parallel for-loop with fixed memory buffer\nspecified by the user.  writing the output in the same order as the input, under the\nrace condition of different worker finishing times, presents a technical challenge.\nThis is solved using a linked list of output result buffers.  The linked-list\nstructure preserves the order.  Each buffer can be loaded by a worker thread, or\nunloaded by a single writer thread.  To prevent worker thread starvation, there are\nmore buffers than threads.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrbigelow%2Fdepngs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhrbigelow%2Fdepngs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrbigelow%2Fdepngs/lists"}