{"id":51083011,"url":"https://github.com/griffan/yhap","last_synced_at":"2026-06-23T20:01:01.872Z","repository":{"id":71395184,"uuid":"94805067","full_name":"Griffan/YHap","owner":"Griffan","description":"A population model for probabilistic assignment of Y haplogroups from sequencing data and chip data","archived":false,"fork":false,"pushed_at":"2019-03-19T17:58:09.000Z","size":31907,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-10-20T20:06:37.919Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Griffan.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-06-19T17:51:11.000Z","updated_at":"2023-10-20T20:06:38.974Z","dependencies_parsed_at":null,"dependency_job_id":"b9a97b2c-25b3-4b80-8330-535743f34051","html_url":"https://github.com/Griffan/YHap","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/Griffan/YHap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Griffan%2FYHap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Griffan%2FYHap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Griffan%2FYHap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Griffan%2FYHap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Griffan","download_url":"https://codeload.github.com/Griffan/YHap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Griffan%2FYHap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34704748,"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-06-23T02:00:07.161Z","response_time":65,"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":[],"created_at":"2026-06-23T20:00:59.449Z","updated_at":"2026-06-23T20:01:01.864Z","avatar_url":"https://github.com/Griffan.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# YHap\r\n\r\n\r\nYHap is a tool to automatically assign haplogroup label to male human sample based on genotype data on Y chromosome.\r\n\r\n\r\n* _Motivation_: Y haplogroup analyses are an important component of genealogical reconstruction, population genetic analyses, medical genetics and forensics. These fields are increasingly moving towards use of low-coverage, high throughput sequencing. While there have been methods recently proposed for assignment of Y haplogroups on the basis of high-coverage sequence data, assignment on the basis of low-coverage data remains challenging.\r\n\r\n\r\n* _Results_: We developed a new algorithm, YHap, which uses an imputation framework to jointly predict Y chromosome genotypes and assign Y haplogroups using low coverage population sequence data. We use data from the 1000 genomes project to demonstrate that YHap provides accurate Y haplogroup assignment with less than 2x coverage. This method also is suitable for certain marker set based chip dataset.\r\n\r\n\r\n* _Citation_: Zhang F, Chen R, Liu D, Yao X, Li G, Jin Y, et al. YHap: a population model for probabilistic assignment of Y haplogroups from re-sequencing data. BMC Bioinformatics [Internet]. 2013;14:331. Available from: http://www.ncbi.nlm.nih.gov/pubmed/24252171\r\n\r\n\r\n\r\n\r\n* Input File: VCF format genotype file\r\n\r\n\r\n\r\n\r\n## Installation\r\n\r\n\r\nDownload or git clone the repo:\r\n```\r\ngit clone https://github.com/Griffan/YHap.git\r\ncd YHap/rundir/\r\n```\r\n## Guide for beginners\r\n\r\n\r\nThere is a one stop running script:\r\n\r\n\r\n```\r\nsh prepare.data.and.run.sh VCFFilePath dataAlias\r\n```\r\nNote: script will use dataAlias as dir name to create tmp, so please don't include any \"/\" within dataAlias.\r\n\r\nAfter the whole process done, you would find your result in \r\n \r\n```\r\nYHap/rundir/dataAlias/YHap.assignment.dataAlias.txt\r\n```\r\n \r\nThe format for YHap.assignment.dataAlias.txt is:\r\n \r\n```\r\nSampleID        Haplogroup\r\n```\r\n\r\n\r\nIn case you have prepared data using \"prepare.data.and.run.sh\", and you want to rerun:\r\n```\r\nsh run.sh VCFFilePath dataAlias\r\n```\r\n\r\n\r\nIn case you want to clean all these newly generated files, you can do:\r\n```\r\nsh rm.sh VCFFilePath dataAlias\r\n```\r\nfollowing the prompt, if you are sure, you can delete them safely.\r\n\r\n\r\n## For more advanced users\r\nIf you want to run YHap step by step:\r\nrundir/ is the directory for running the program\r\nlib/ contains the java libraries\r\ndata/ contains the data directories\r\nPlease also refer to run.sh in rundir/, especially \r\n```\r\necho \"\r\nperl ../prepare.dataset.pl $vcfDirLoc $dataAlias \u003edata.csv\r\ncp ../param.txt param.txt\r\ncp ../split.txt split.txt\r\nnohup perl ../autorun.advanced.pl ${dataAlias} newres_${dataAlias}_1_Y_0_25mb/mostLikelyState/${dataAlias}.txt\r\n\"|sh\r\n```\r\nto ease the cumbersome of generating data.csv file.\r\n\r\n\r\n**RUNNING PROGRAM FOR FIRST TIME**\r\n\r\n\r\nTo run the program go into the rundir/test/ directory and type:\r\n```\r\nsh ../../singleStepRun.sh\r\n```\r\n##### _(you may need to make this executable first, and this script could be a template for customized purpose)_\r\n\r\n\r\nThe results will appear in a new directory\r\n```\r\nnewres_1_Y_0_25mb/mostLikelyState\r\n```\r\nin which you will find the files:\r\n```\r\nYCC.txt\r\nCHBYhapmap.txt\r\n```\r\nwhich contain the allocation of samples to haplogroups.\r\n\r\n\r\n\r\n\r\n**MODIFYING THE PARAMETERS**\r\n\r\n\r\nThe parameters are contained in three files in rundir //_but most of the parameters you should not modify_ \r\n\r\n\r\nsplit.txt : This contains the coordinates of the region to include in the analysis\r\n\r\n\r\ndata.csv : \r\nThis contains information on the different data sources, with one column per data source.  \r\n- The name of the data source is contained in the first row.  \r\n- The location of the data is specified in the third row, relative to the data directory (data/).  \r\n- The only other row relevant is the 'phenoToInclude' row which specifies which samples to include in the analysis.  i.e. for CEUY, phenoToInclude is set to POP~CEU.  This is decoded via reference to the pheno.txt file in the relevant data directory.  In this way, CEUY, CHBY etc share a common data directory, but the pheno.txt file is used to extract subsets of\r\nthis file at run-time.\r\n\r\n\r\nparam.txt : This is the master parameter file, and specifies which data sources to include from data.csv, via the --include option.  The --useDataAsModel option is used to specify which haplogroups to include in the analysis. These parameters could also be specified via direct cmdline when using java -jar command.\r\n\r\n\r\n**MAKING NEW DATA FILES FROM VCF FILES**\r\n\r\n\r\n- Put the vcf file in the YHap/vcf/ directory\r\n- Change into this directory and type\r\n```\r\nsh ../convertVCF.sh $filename $chr\r\n```\r\nwhere filename is the name of the file you wish to convert, and chr is\r\nthe chromosome in the chromosome column of the vcf (Y in this case).\r\nAfter conversion, move the whole directory to YHap/data directory\r\n```\r\ncd YHap/\r\nmv vcf data/\r\n```\r\nNotice that when specifying data.csv, the location should be adjusted accordingly. e.g. (in this case vcf/)\r\n\r\n\r\n**MAKING NEW TREE FILES FROM YCC SNP INDEX**\r\n- Prepare SNP index file, with the format being:\r\n```\r\nchr start_bp end_bp snpID rsID haplogroup ancestral_allele derived_allele is_ref_eq_ancestral\r\n```\r\n- Put the vcf file in the YHap/SNPIndex/ directory\r\n- Change into this directory and type\r\n```\r\nsh ../convertYCCSNPindex.sh $outputPrefix $SNPIndex.tree.txt ../data/YCC_build37/tree.txt\r\n```\r\nwhere outputPrefix is the prefix of the name of generated zip file\r\nAfter conversion, move the whole directory to YHap/data directory\r\n```\r\ncd ..\r\nmv $outputPrefix.zip data/YCC_build37/Y.zip\r\n```\r\nNotice that when specifying data.csv, the location should be adjusted accordingly. Here I assume you replace the build37 version, you can also move $outputPrefix.zip to a different directory under data/, but you need to modify data location direcotry in data.csv accordingly.\r\n## Contributing\r\n\r\n\r\n1. Fork it!\r\n2. Create your feature branch: `git checkout -b my-new-feature`\r\n3. Commit your changes: `git commit -am 'Add some feature'`\r\n4. Push to the branch: `git push origin my-new-feature`\r\n5. Submit a pull request :D\r\n\r\n\r\n## Bug Report\r\n\r\n\r\nfanzhang@umich.edu\r\n\r\n## LICENSE\r\n\r\nThe full YHap package is distributed under LGPL License.\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgriffan%2Fyhap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgriffan%2Fyhap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgriffan%2Fyhap/lists"}