{"id":23592651,"url":"https://github.com/chris1221/aavcf","last_synced_at":"2025-11-04T10:30:30.285Z","repository":{"id":95256244,"uuid":"148680562","full_name":"Chris1221/aavcf","owner":"Chris1221","description":"Swap allels to ancestral / derived in a VCF. ","archived":false,"fork":false,"pushed_at":"2018-12-10T14:54:09.000Z","size":36,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-27T08:16:22.210Z","etag":null,"topics":["cpp"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Chris1221.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}},"created_at":"2018-09-13T18:29:09.000Z","updated_at":"2022-12-26T09:33:23.000Z","dependencies_parsed_at":"2023-03-22T14:47:45.760Z","dependency_job_id":null,"html_url":"https://github.com/Chris1221/aavcf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chris1221%2Faavcf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chris1221%2Faavcf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chris1221%2Faavcf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chris1221%2Faavcf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Chris1221","download_url":"https://codeload.github.com/Chris1221/aavcf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239432739,"owners_count":19637798,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cpp"],"created_at":"2024-12-27T08:15:03.500Z","updated_at":"2025-11-04T10:30:30.170Z","avatar_url":"https://github.com/Chris1221.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"### A tiny tool for recoding alleles in a VCF. \n\nThis aims to be an easy way to recode alleles from major/minor to ancestral/derived. You only need:\n\n- A `.vcf(.gz)` (Phased, or unphased, but you must specify this).\n- A `.fasta(.gz)` with ancestral states of each base. \n\nUsage is pretty straightforward:\n\n```{sh}\naavcf   -v your.vcf(.gz) \\\n        -f your.fasta(.gz) \\\n        -l your.log \\\n```\n \nI've also provided `vcf`, `vcf_line`, and `fasta` classes in `fasta.cpp/.h` for extensibility. Each of these have a `read`,`write`, and `get_allele` (either for a particular entry or position) methods and are just abstractions of `std::vector` and `std::string` read in directly from data.\n  \n#### Installation\n\n*Short version*: Same as any project build on `CMake`.\n\n*Slightly longer version*: \n\n```{sh}\nmkdir build; cd build; cmake\nmake\n```\n\nCreating an empty `build` directory allows you to easily delete all the `CMake` build instructions if you so desire without a fresh clone.\n\n#### Usage Flags\n\n- `-v / --vcf`: The path to a `.vcf(.gz)` file in `4.1-4.3` file format. \n    - Currently only one sample VCFs are acceptable input.\n- `-f / --fasta`: The path to a `.fasta(.gz)` file on the same build as the VCF (i.e. the genomic coordinates are the same).\n- `-l / --log`: Path to a log file to store all information on actions taken.\n    - Defaults to `./log.txt`.\n- `-h / --help`: Will unsurprisingly show you the help menu. \n\n### Actions\n\n`aavcf` will do one of four things for each variant in the VCF:\n\n1. Do nothing: If the ancestral allele is already the reference, no action is taken.\n2. Flip alleles (`Flip` in log): If the ancestral is the alternate, the coding is flipped.\n3. Uninformative allele (`UnInfo` in log): The ancestral allele is unknown, so derived state cannot be found. Code all alleles to `0`.\n4. Different alleles (`DifAlt` in log): The ancestral allele is neither the reference nor the alternative, so no information is known. Code all alleles to `0`. \n\n\n#### C++ Class usage\n\nTo construct a `fasta`:\n\n```{c++}\nfasta new (std::string path_to_fasta);\n```\n\n- `new.get_allele(unsigned int pos)` will retrieve an allele at a position.\n\nTo construct a `vcf`\n\n```{c++}\nvcf new (std::string path_to_vcf, char delim = '\\t')\n```\n\n- `new.entries` is a `std::vector\u003cvcf_line\u003e`, so the `n`th variant is retrieved with `new.entries[i]`.\n- Each entry in the VCF for each variant is mutable and can be accessed by its standard name: `new.entries[i].id = \"rs1\"`.\n- To write the VCF out, including meta data, simply call the `new.write(std::string path)` method. \n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris1221%2Faavcf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchris1221%2Faavcf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris1221%2Faavcf/lists"}