{"id":44836036,"url":"https://github.com/grenaud/glactools","last_synced_at":"2026-02-17T01:36:07.706Z","repository":{"id":37677530,"uuid":"98125621","full_name":"grenaud/glactools","owner":"grenaud","description":"command-line tools for the management of genotype likelihoods and allele counts","archived":false,"fork":false,"pushed_at":"2024-02-12T08:28:58.000Z","size":131675,"stargazers_count":28,"open_issues_count":12,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-02-12T09:43:24.784Z","etag":null,"topics":["acf","allele-counts","genome-wide-data","genotype-likelihoods","glf","population"],"latest_commit_sha":null,"homepage":"http://grenaud.github.io/glactools/","language":"C++","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/grenaud.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}},"created_at":"2017-07-23T21:10:51.000Z","updated_at":"2024-01-23T01:29:44.000Z","dependencies_parsed_at":"2022-09-03T16:20:41.450Z","dependency_job_id":"386f21ed-0de6-47fe-96ce-1495c9adeed2","html_url":"https://github.com/grenaud/glactools","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/grenaud/glactools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grenaud%2Fglactools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grenaud%2Fglactools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grenaud%2Fglactools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grenaud%2Fglactools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grenaud","download_url":"https://codeload.github.com/grenaud/glactools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grenaud%2Fglactools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29529513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T00:57:22.232Z","status":"ssl_error","status_checked_at":"2026-02-17T00:54:25.811Z","response_time":115,"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":["acf","allele-counts","genome-wide-data","genotype-likelihoods","glf","population"],"created_at":"2026-02-17T01:36:07.177Z","updated_at":"2026-02-17T01:36:07.691Z","avatar_url":"https://github.com/grenaud.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n  glactools: command-line toolset for the management of Genotype Likelihoods and Allele Counts\n==========================================================\n\nQUESTIONS :\n   gabriel [dot] reno [ at sign ] gmail [dot] com\n\n\nAbout\n----------------------\n\nglactools is a set of command-line tools for the management of Genotype Likelihood (GL) and Allele Counts (AC).\n\n\nDescription\n----------------------\n\nglactools is a suite of utilities to:\n* convert various file formats (VCF,BAM,23andme) into **genotype likelihood (GLF)** or **allele count (ACF)** files. \n  * GLF files contains genotype likelihoods for a single individual\n  * ACF files contains allele counts for either a single individual or a group of individuals (population)\n* GLF/ACF contain both variant and invariant sites\n* GLF/ACF are binary compressed files that borrow heavily from the BAM format.\n* filter, combined GLF/ACF from various individuals, merge individuals into populations\n* create subsets (only a single population or retain transversions)\n* index for rapid retrieval\n* compute summary statistics on those matrices. \n* export genotype likelihood (GLF) or allele count (ACF) to various formats for population genetics applications (treemix,fasta,EIGENSTRAT,G-PhoCS,PLINK).\n\n![diagram](https://github.com/grenaud/glactools/raw/master/doc/diagram.png \"Diagram\")\n\n\nExamples of uses\n----------------------\n\nglactools aims at allowing users to convert genetic data into an intermediate format (either GLF for genotype likelihoods or ACF for allele counts), perform operations and export to different format. This set of tools enables users to perform various tasks without knowledge of scripting, here are some examples:\n\n* Compute D-statistics but use the Gorilla from UCSC as the ancestral allele.\n* Retain sites in the human genome where a certain population has the ancestral allele and a different population has the derived allele.\n* Produce Treemix input using a mixture of BAM and VCF files using transversions only\n* Combine a BAM file from a single individual and 1000Genomes data to G-PhoCS or ADMIXTURE input\n\n\n\nDownloading:\n----------------------\n\nGo to https://github.com/grenaud/glactools and either:\n\n1) Download the ZIP \n\nor\n\n2) Do a \"git clone --depth 1 https://github.com/grenaud/glactools.git\"\n\nInstallation\n----------------------\n\n1) make sure you have \"git\" installed, check for it by typing \" git --version\" and \"cmake --version\".  \n\nFor Ubuntu:\n\n     sudo apt-get install git\n\nFor MacOS, if you have Homebrew (https://brew.sh/) installed: \n\n     brew install git\n\n2) make sure you have gcc that supports -std=c++11, gcc version 4.7 or above. Type \"gcc -v\" and check the version. Have the standard zlib, bzlib.h and lzma. Under Ubuntu type:\n\n     sudo apt install g++\n     sudo apt install zlib1g-dev\n     sudo apt install libbz2-dev\n     sudo apt install liblzma-dev\n     sudo apt install libcurl4-openssl-dev\n     \nFor MacOS, if you have Homebrew (https://brew.sh/) installed:\n\n     brew install gcc\n     brew install zlib\n     brew install zv\n     \n    \n\n3) As the makefile uses \"git clone\" to download subpackages, please make sure that the computer on which you are installing glactools has access to the internet. Once done, simply type :\n\n     cd glactools\n     make\n\nFor MacOS, if you get the problem: fatal error: 'lzma.h' file not found, this is a problem building htslib with homebrew, please refer to the following htslib page: https://github.com/samtools/htslib/issues/493\n\n\n4) (optional) Either put the executable in the overall path or add the path to your $PATH environment or add an alias to be able to call \"glactools\" from any directory.\n\nQuick start\n-----------------\nFor the impatients, you can download some ACF and GLF data:\n\n     wget -O 2arch3modern.acf.gz https://www.dropbox.com/s/n4su20ghlb3jqni/2arch3modern.acf.gz?dl=0\n     wget -O YorubaB.glf.gz https://www.dropbox.com/s/w9af2n6mr9nafw8/YorubaB.glf.gz?dl=0\n\nThe first file contains chromosome 21 from 2 archaic homins and 3 modern humans. The second are the genotype likelihoods for a Yoruba individual.\n\nYou can now view the first lines:\n \n     glactools view 2arch3modern.acf.gz |head -n 20 \n     glactools view YorubaB.glf.gz       |head -n 20 \n\nYou can index them:\n\n     glactools index 2arch3modern.acf.gz\n     glactools index YorubaB.glf.gz       \n\nYou can view a chunk:\n\n     glactools view  2arch3modern.acf.gz       21:9675190-9675199 \n     glactools view  YorubaB.glf.gz            21:9560830-9560840\n\nYou can view the defline:\n \n     glactools view -h 2arch3modern.acf.gz |head -n 20 \n   \nor just view which populations are defined:\n \n     glactools view -p 2arch3modern.acf.gz \n\nor view the full header:\n \n     glactools view -P 2arch3modern.acf.gz \n\nThe header is particularly useful as it defines which operations were used to produce this file.\n\nDocumentation\n-----------------\n\nThe documentation is found here:\n\n     doc/reference.pdf\n\n\nExample of usage\n-----------------\n\nWe will download 5 different, single individual VCF files as testData (those were mapped to hg19, see \"how do I specify the root and ancestral population?\" for info about hg38):\n\n    mkdir -p testData/\n    cd testData/\n    wget http://cdna.eva.mpg.de/neandertal/altai/AltaiNeandertal/VCF/AltaiNea.hg19_1000g.21.mod.vcf.gz\n    wget http://cdna.eva.mpg.de/neandertal/altai/Denisovan/DenisovaPinky.hg19_1000g.21.mod.vcf.gz\n    wget http://cdna.eva.mpg.de/neandertal/altai/ModernHumans/vcf/SS6004468.hg19_1000g.21.mod.vcf.gz\n    wget http://cdna.eva.mpg.de/neandertal/altai/ModernHumans/vcf/SS6004475.hg19_1000g.21.mod.vcf.gz\n    wget http://cdna.eva.mpg.de/neandertal/altai/ModernHumans/vcf/SS6004477.hg19_1000g.21.mod.vcf.gz\n    wget ftp://ftp.healthtech.dtu.dk/public/EPO/all_hg19.epo.gz\n    wget ftp://ftp.healthtech.dtu.dk/public/EPO/all_hg19.epo.gz.tbi\n    wget ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/technical/reference/human_g1k_v37.fasta.fai\n    cd ..\n\n- Convert the VCF files to ACF files:\n\n      glactools vcf2acf --fai testData/human_g1k_v37.fasta.fai --epo testData/all_hg19.epo.gz testData/AltaiNea.hg19_1000g.21.mod.vcf.gz      AltaiNean    \u003e testData/AltaiNean.acf.gz\n      glactools vcf2acf --fai testData/human_g1k_v37.fasta.fai --epo testData/all_hg19.epo.gz testData/DenisovaPinky.hg19_1000g.21.mod.vcf.gz Denisova     \u003e testData/Denisova.acf.gz\n      glactools vcf2acf --fai testData/human_g1k_v37.fasta.fai --epo testData/all_hg19.epo.gz testData/SS6004468.hg19_1000g.21.mod.vcf.gz     FrenchB      \u003e testData/FrenchB.acf.gz\n      glactools vcf2acf --fai testData/human_g1k_v37.fasta.fai --epo testData/all_hg19.epo.gz testData/SS6004475.hg19_1000g.21.mod.vcf.gz     YorubaB      \u003e testData/YorubaB.acf.gz\n      glactools vcf2acf --fai testData/human_g1k_v37.fasta.fai --epo testData/all_hg19.epo.gz testData/SS6004477.hg19_1000g.21.mod.vcf.gz     AustralianB  \u003e testData/AustralianB.acf.gz\n\n- glactools index them:\n\n      glactools index testData/AltaiNean.acf.gz\n      glactools index testData/Denisova.acf.gz\n      glactools index testData/FrenchB.acf.gz\n      glactools index testData/YorubaB.acf.gz\n      glactools index testData/AustralianB.acf.gz\n\n- Create an intersection:\n\n      glactools intersect testData/AltaiNean.acf.gz testData/Denisova.acf.gz testData/AustralianB.acf.gz testData/FrenchB.acf.gz testData/YorubaB.acf.gz \u003e testData/2arch3modern.acf.gz\n\nThese commands are found in testData/Makefile\n\n- Visualize the intersection:\n\n      glactools view    testData/2arch3modern.acf.gz |less -S # view data\n      glactools view -h testData/2arch3modern.acf.gz |less -S # view data+defline\n      glactools view -H testData/2arch3modern.acf.gz |less -S # view data+full header\n\n\n- Merge the modern humans and archaic as one population:\n\n      glactools meld -u testData/2arch3modern.acf.gz   \"AltaiNean,Denisova\" \"Archaics\"  |./glactools meld /dev/stdin   \"AustralianB,FrenchB,YorubaB\" \"Modern\"  \u003e testData/all.merged.acf.gz\n\n- Get basic statistics:\n     \n      glactools stats testData/2arch3modern.acf.gz\n\n- Index the file\n     \n      glactools index testData/2arch3modern.acf.gz\n\n- View a genomic region:\n\n      glactools view testData/2arch3modern.acf.gz 21:25098220-25098230\n\n- View an entire chromosome:\n\n      glactools view testData/2arch3modern.acf.gz 21\n\n- Visualize sites where the archaics hominin and modern ones differ:\n\n      glactools snosharing -u testData/all.merged.acf.gz \"Archaics\"  \"Modern\" |./glactools view - \n\n- Visualize sites where the archaics hominin and modern ones differ and the archaic is ancestral and the modern humans are derived:\n\n      glactools  snosharing -u testData/all.merged.acf.gz \"Archaics\"  \"Modern\"  | ./glactools sharing -u /dev/stdin  \"root\" \"Archaics\"|./glactools view -\n\n- Visualize sites where the archaics hominin and modern differ and the archaic is derived and the modern humans are ancestral:\n\n      glactools  snosharing -u testData/all.merged.acf.gz \"Archaics\"  \"Modern\"  | ./glactools sharing -u /dev/stdin  \"root\" \"Modern\"|./glactools view - \n\n- Export to treemix:\n\n      glactools acf2treemix testData/2arch3modern.acf.gz    |gzip \u003e testData/all.treemix.gz\n\n\nProblems/feature request\n----------------------\n\nIf you have a Github account, I recommend that you create an issue. That way other users can see what you wrote, comment on it and I can keep track of it more easily. I more than welcome pull requests!\n\nOtherwise, send me a mail gabriel [dot] reno [at sign here] gmail [dot] com\n\nTips\n----------------------\n\n* when working with VCF files called from bcftools call, make sure that the -v option is not used because this will only print variable sites. If you use GATK, make sure you output every site using --output_mode EMIT_ALL_SITES.\n* Do not store ACF/GLF in raw text, it is a waste of disk space.\n\n\nFAQ\n----------------------\n\n### Why do I have a bunch of garbled characters printed on the terminal when I use glactools?\n\nglactools **ALWAYS** prints compressed binary. The only thing to modify is the ability to print as uncompressed binary (-u option), this is recommended when using UNIX pipes. However if you wish to view an ACF/GLF as a text file, simply use \"glactools view\"\n\n### why do you have data import from single VCF and multi VCF at the same time?\n\nA single VCF usually carries extra information for the single individual such as depth of coverage and additional information in the INFO fields. Ideally you should have a consistent set of filters that does not generate any reference/alternative allele/heterozygous site bias and generate your GLF or ACF files.\n\n### I got the following: Warning: No EOF marker, likely due to an I/O error  [E::bgzf_read] Read block operation failed with error -1 after 0 of 2 bytes\n\nThis is likely an input/output error and the file was not written properly to begin with. Try to regenerate it.\n\n### what is the difference between \"union\" and \"intersection\"? \n\n\"union\" will allow sites to be undefined in a specific population or individual.  \"intersection\" will require all sides to be defined in every population or individual.\n\n### what is the -u option and what does it do?\n\nhow many program there is a -u option which allows users to get a uncompressed glactools output.  This is useful when UNIX piping from one program to another.  If not, one program would compress whereas the second one would decompress,  This is wasteful in terms of CPU.  Therefore when piping into another glactools program, we recommend using the -u.\n\n### what is the difference between root and ancestral (anc)?\n\nThe root is an individual or population that is an outgroup to all other individuals/populations in the file. The ancestor is the most recent common ancestor to the root population and all other individuals/populations in a file.\n\n### how do I specify the root and ancestral population\n\n\u003c\u003c\u003c\u003c\u003c\u003c\u003c HEAD\nif you're dealing with hominin samples,  we recommend using the -epo option which uses  EPO alignments from Ensembl which are alignments to different primate species. otherwise simply transform  a VCF file  from the roof population  using the program \"usepopsrootanc\". The EPO information can be found here for hg19:\n\n    ftp://ftp.healthtech.dtu.dk/public/EPO/all_hg19.epo.gz\n    ftp://ftp.healthtech.dtu.dk/public/EPO/all_hg19.epo.gz.tbi\n\nand here for hg38:\n\n    ftp://ftp.healthtech.dtu.dk/public/EPO/all_hg38.epo.gz\n    ftp://ftp.healthtech.dtu.dk/public/EPO/all_hg38.epo.gz.tbi\n=======\nif you're dealing with hominin samples,  we recommend using the -epo option which uses  EPO alignments from Ensembl which are alignments to different primate species. otherwise simply transform  a VCF file  from the roof population  using the program \"usepopsrootanc\". Here is an example:\n\nSuppose you have a file with the populations you want to use as outgroup and ancestor. In the case of hominin, it would be the chimp as outgroup and the Chimp/human ancestor as the ancestor. For example we have the following:\n\nfile1.acf.gz:\n\n    #ACF\n    #PG:union AltaiNean.acf.gz Denisova.acf.gz FrenchB.acf.gz YorubaB.acf.gz AustralianB.acf.gz \n    #GITVERSION: 6e48e0efbfb131a6723830fa98f655a36da8c574\n    #DATE: 2019-12-02\n    #SQ\tSN:1\tLN:249250621\n    #SQ\tSN:2\tLN:243199373\n    #chr\tcoord\tREF,ALT\troot\tanc\tchimp\tChimpHumanAncestor\n    2\t100022\tA,N\t0,0:0\t0,0:0\t1,0:0\t1,0:0\n    2\t100023\tG,N\t0,0:0\t0,0:0\t1,0:0\t1,0:0\n    2\t100024\tA,N\t0,0:0\t0,0:0\t1,0:0\t1,0:0\n    2\t100025\tC,N\t0,0:0\t0,0:0\t1,0:0\t1,0:0\n    2\t100026\tA,N\t0,0:0\t0,0:0\t1,0:0\t1,0:0\n    2\t100027\tG,N\t0,0:0\t0,0:0\t1,0:0\t1,0:0\n    2\t100028\tA,N\t0,0:0\t0,0:0\t1,0:0\t1,0:0\n    2\t100029\tA,N\t0,0:0\t0,0:0\t1,0:0\t1,0:0\n    2\t100030\tC,N\t0,0:0\t0,0:0\t1,0:0\t1,0:0\n    2\t100031\tT,N\t0,0:0\t0,0:0\t1,0:0\t1,0:0\n    2\t100032\tT,N\t0,0:0\t0,0:0\t1,0:0\t1,0:0\n    2\t100033\tC,N\t0,0:0\t0,0:0\t1,0:0\t1,0:0\n    2\t100034\tA,N\t0,0:0\t0,0:0\t1,0:0\t1,0:0\n    2\t100035\tT,N\t0,0:0\t0,0:0\t1,0:0\t1,0:0\n    2\t100036\tT,N\t0,0:0\t0,0:0\t1,0:0\t1,0:0\n    2\t100037\tG,N\t0,0:0\t0,0:0\t1,0:0\t1,0:0\n\nAnd we would have a second file without root and ancestral information:\n\nfile2.acf.gz:\n\n    #ACF\n    #PG:union AltaiNean.acf.gz Denisova.acf.gz FrenchB.acf.gz YorubaB.acf.gz AustralianB.acf.gz \n    #GITVERSION: 6e48e0efbfb131a6723830fa98f655a36da8c574\n    #DATE: 2019-12-02\n    #SQ\tSN:1\tLN:249250621\n    #SQ\tSN:2\tLN:243199373\n    #chr\tcoord\tREF,ALT\troot\tanc\tAltaiNean\tDenisova\tFrenchB\tYorubaB\tAustralianB\n    2\t100022\tA,N\t0,0:0\t0,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100023\tG,N\t0,0:0\t0,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100024\tA,N\t0,0:0\t0,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100025\tC,N\t0,0:0\t0,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100026\tA,N\t0,0:0\t0,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100027\tG,N\t0,0:0\t0,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100028\tA,N\t0,0:0\t0,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100029\tA,N\t0,0:0\t0,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100030\tC,N\t0,0:0\t0,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100031\tT,N\t0,0:0\t0,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100032\tT,N\t0,0:0\t0,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100033\tC,N\t0,0:0\t0,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100034\tA,N\t0,0:0\t0,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100035\tT,N\t0,0:0\t0,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100036\tT,N\t0,0:0\t0,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100037\tG,N\t0,0:0\t0,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    \nFirst we will go into file1 and it take our two populations as our root and ancestor and put it into file3.acf.gz:\n\n`glactools usepopsrootanc file1.acf.gz chimp ChimpHumanAncestor  \u003e file3.acf.gz\n`\n\nfile3.acf.gz will look like this:\n\n    #ACF\n    #PG:usepopsrootanc /tmp/temp.acf.gz chimp ChimpHumanAncestor \n    #GITVERSION: 9d3e4107ea445a16737fb841e2181dabf31acac9\n    #DATE: 2020-04-02\n    #USEPOPASROOTANC: chimp chimp\n    #USEPOPASROOTANC#1\n    #\t#ACF\n    #\t#PG:union AltaiNean.acf.gz Denisova.acf.gz FrenchB.acf.gz YorubaB.acf.gz AustralianB.acf.gz \n    #\t#GITVERSION: 6e48e0efbfb131a6723830fa98f655a36da8c574\n    #\t#DATE: 2019-12-02\n    #\t#chr\tcoord\tREF,ALT\troot\tanc\tchimp\tChimpHumanAncestor\n    #SQ\tSN:1\tLN:249250621\n    #SQ\tSN:2\tLN:243199373\n    #chr\tcoord\tREF,ALT\troot\tanc\n    2\t100022\tA,N\t1,0:0\t1,0:0\n    2\t100023\tG,N\t1,0:0\t1,0:0\n    2\t100024\tA,N\t1,0:0\t1,0:0\n    2\t100025\tC,N\t1,0:0\t1,0:0\n    2\t100026\tA,N\t1,0:0\t1,0:0\n    2\t100027\tG,N\t1,0:0\t1,0:0\n    2\t100028\tA,N\t1,0:0\t1,0:0\n    2\t100029\tA,N\t1,0:0\t1,0:0\n    2\t100030\tC,N\t1,0:0\t1,0:0\n    2\t100031\tT,N\t1,0:0\t1,0:0\n    2\t100032\tT,N\t1,0:0\t1,0:0\n    2\t100033\tC,N\t1,0:0\t1,0:0\n    2\t100034\tA,N\t1,0:0\t1,0:0\n    2\t100035\tT,N\t1,0:0\t1,0:0\n    2\t100036\tT,N\t1,0:0\t1,0:0\n    2\t100037\tG,N\t1,0:0\t1,0:0\n\nThen you can use \"replaceanc\" to put the ancestral information into file2:\n\n`glactools replaceanc  file2.acf.gz  file3.acf.gz  \u003e file4.acf.gz\n`\n\nfile4 should contain the same information as file1 except with the ancestral information of file1:\n\n    #ACF\n    #PG:replaceanc /tmp/temp2.acf.gz /tmp/file3.acf.gz \n    #GITVERSION: 9d3e4107ea445a16737fb841e2181dabf31acac9\n    #DATE: 2020-04-02\n    #REPLACEANC:\n    #REPLACEANC#1\n    #\t#ACF\n    #\t#PG:union AltaiNean.acf.gz Denisova.acf.gz FrenchB.acf.gz YorubaB.acf.gz AustralianB.acf.gz \n    #\t#GITVERSION: 6e48e0efbfb131a6723830fa98f655a36da8c574\n    #\t#DATE: 2019-12-02\n    #\t#chr\tcoord\tREF,ALT\troot\tanc\tAltaiNean\tDenisova\tFrenchB\tYorubaB\tAustralianB\n    #REPLACEANC#2\n    #\t#ACF\n    #\t#PG:usepopsrootanc /tmp/temp.acf.gz chimp ChimpHumanAncestor \n    #\t#GITVERSION: 9d3e4107ea445a16737fb841e2181dabf31acac9\n    #\t#DATE: 2020-04-02\n    #\t#USEPOPASROOTANC: chimp chimp\n    #\t#USEPOPASROOTANC#1\n    #\t#\t#ACF\n    #\t#\t#PG:union AltaiNean.acf.gz Denisova.acf.gz FrenchB.acf.gz YorubaB.acf.gz AustralianB.acf.gz \n    #\t#\t#GITVERSION: 6e48e0efbfb131a6723830fa98f655a36da8c574\n    #\t#\t#DATE: 2019-12-02\n    #\t#\t#chr\tcoord\tREF,ALT\troot\tanc\tchimp\tChimpHumanAncestor\n    #\t#chr\tcoord\tREF,ALT\troot\tanc\n    #SQ\tSN:1\tLN:249250621\n    #SQ\tSN:2\tLN:243199373\n    #chr\tcoord\tREF,ALT\troot\tanc\tAltaiNean\tDenisova\tFrenchB\tYorubaB\tAustralianB\n    2\t100022\tA,N\t1,0:0\t1,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100023\tG,N\t1,0:0\t1,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100024\tA,N\t1,0:0\t1,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100025\tC,N\t1,0:0\t1,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100026\tA,N\t1,0:0\t1,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100027\tG,N\t1,0:0\t1,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100028\tA,N\t1,0:0\t1,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100029\tA,N\t1,0:0\t1,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100030\tC,N\t1,0:0\t1,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100031\tT,N\t1,0:0\t1,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100032\tT,N\t1,0:0\t1,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100033\tC,N\t1,0:0\t1,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100034\tA,N\t1,0:0\t1,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100035\tT,N\t1,0:0\t1,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100036\tT,N\t1,0:0\t1,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    2\t100037\tG,N\t1,0:0\t1,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\t2,0:0\n    \n\nIn this case I have created 1 superfluous files, depending on the level of comfort with Unix file descriptors, you can do the same process without creating intermediate files:\n\n`glactools replaceanc  file2.acf.gz  \u003c(glactools usepopsrootanc -u file1.acf.gz chimp ChimpHumanAncestor )  \u003e file4.acf.gz\n`\n\n\u003e\u003e\u003e\u003e\u003e\u003e\u003e 6d59fd67972381a17ace6dafa267e8e49a57f81c\n\n\n### Can glactools handle data coming from simulations?\n\nYes, but I recommend using msprime as it can produce directly VCF output.  The one issue is that it does not,  as of this writing, combine individuals together and merely reports haploid data. So one would need to modify the GT field accordingly.\n\n### Can glactools handle BCF?\n\nYes, simply use \"bcftools view\" and pipe into glactools as such:\n\n     glactools vcf2acf \u003c(bcftools view in.bcf) put_name_of_sample_here \n\n### Can glactools handle CRAM?\n\nYes, simply use \"samtools view -b in.cram\" and pipe into glactools:\n\n     glactools vcf2acf put_reference_here.fa \u003c(samtools view -b in.cram) put_name_of_sample_here \n\n\n### Got the following error message while building the package:  CMake Error at CMakeLists.txt:9 (cmake_minimum_required): CMake 3.0 or higher is required.  You are running version 2.X.XXX\n\nUpdate cmake, in Ubuntu, the following seems to work:\n\n     sudo -E add-apt-repository -y ppa:george-edison55/cmake-3.x\n     sudo -E apt-get update\n     sudo apt-get install cmake\n\n\n### When I import data from EIGENSTRAT, all sites are flagged as non-CpGs, why?\n\nWe cannot know for sure whether a C or G had a G or a C after it. \n\n### When I run \"compute\", I get 6 types of results, what are the differences?\n\nThe summary stats in glactools compute are reported as such:\n* all: all sites\n* no Cpg: sites marked as CpG are ignored        \n* only Cpg: only sites marked as CpG are considered        \n* transitions: only transitions are considered        \n* transversions: only transversions are considered        \n* no damage: sites that are potentially damaged are ignored. The difference between transversions is that ancestral C -\u003e derived T is ignored but not ancestral T -\u003e derived C.\n \n\n### I get: \"Error, missing data in the EPO file\" when adding the ancestral alleles, why?\n\nThe likely reason is a discrepancy between chromosome names (e.g. \"1\" and \"chr1\"). \n\n \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrenaud%2Fglactools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrenaud%2Fglactools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrenaud%2Fglactools/lists"}