{"id":28436052,"url":"https://github.com/immunogenomics/goshifter","last_synced_at":"2025-08-12T21:02:51.867Z","repository":{"id":42074107,"uuid":"51954220","full_name":"immunogenomics/goshifter","owner":"immunogenomics","description":"GoShifter","archived":false,"fork":false,"pushed_at":"2018-01-04T19:57:55.000Z","size":3289,"stargazers_count":11,"open_issues_count":4,"forks_count":7,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-06-05T21:09:51.606Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.broadinstitute.org/mpg/goshifter/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/immunogenomics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-17T20:46:59.000Z","updated_at":"2024-04-22T20:55:49.000Z","dependencies_parsed_at":"2022-09-15T17:22:38.288Z","dependency_job_id":null,"html_url":"https://github.com/immunogenomics/goshifter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/immunogenomics/goshifter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/immunogenomics%2Fgoshifter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/immunogenomics%2Fgoshifter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/immunogenomics%2Fgoshifter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/immunogenomics%2Fgoshifter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/immunogenomics","download_url":"https://codeload.github.com/immunogenomics/goshifter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/immunogenomics%2Fgoshifter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262311065,"owners_count":23291671,"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":[],"created_at":"2025-06-05T21:10:01.182Z","updated_at":"2025-08-12T21:02:51.835Z","avatar_url":"https://github.com/immunogenomics.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GoShifter\n\nGoShifter is a method to determine enrichment of annotations in GWAS significant loci. The manual can be found in the GoShifter_manual.pdf file. These files were taken from http://www.broadinstitute.org/mpg/goshifter/, and may have small updates and bugfixes. \n\n**update June 26th, 2017:** You can input LD files precalculated with ProxyFinder (see below).\n\n# Manual\n\n## Requirements\nGoShifter is written for **Python 2.7**. It uses the following modules:\n* bisect\n* subprocess\n* chromtree (provided)\n* bx-python\n* numpy\n\nNumpy and bx-python can be installed using pip.\n\n## Usage\nGoShifter is divided into two scripts: \n1. **goshifter.py**, which tests for enrichment of a provided set of SNPs with one genomic annotation of interest\n2. **goshifter.strat.py**, which tests for the significance of an overlap of a provided set of SNPs with annotation A stratifying on secondary, possibly colocalizing annotation B.\n\n## **goshifter.py**\n### Input files\n\n**snpmap file** - with mappings for the tested set of SNPs, tab delimited, with columns SNP, Chrom, BP. Chromosome in the format ‘chrN’. Must include header. Example: ```cat GoShifter/test_data/bc.snpmappings.hg19.txt```\n\u003cpre\u003e\nSNP\tChrom\tBP\nrs10069690\tchr5\t1279790\nrs1045485\tchr2\t202149589\nrs3757318\tchr6\t151914113\nrs10941679\tchr5\t44706498\nrs13281615\tchr8\t128355618\nrs2823093\tchr21\t16520832\nrs17530068\tchr6\t82193109\nrs2380205\tchr10\t5886734\nrs3803662\tchr16\t52586341\n\u003c/pre\u003e\n\n**annotation** – mappings of the annotation which will be tested for enrichment with the SNP set. Must be in BED format (gzipped), includes Chrom, Start, End columns (no header required). Chromosome in the format ‘chrN’. Example: ```zcat GoShifter/test_data/UCSF-UBC.Breast_vHMEC.bed.gz```\n\u003cpre\u003e\nchrY 128031 128231\nchrY 142761 142961\nchrY 231491 231691\nchrY 231983 232183\nchrY 233430 233630\nchrY 285237 285437\nchrY 296657 296857\nchrY 1318260 1318460\nchrY 1459641 1459841\n\u003c/pre\u003e\n\n**ld files** \nWhen testing for enrichment GoShifter uses LD information for the set of provided SNPs. There are now two options to input LD information:\n* precomputed LD files provided by us\n* LD files calculated using ProxyFinder\n\n**Precomputed LD files provided by us**\nTo obtain this information please download precomputed pairwise SNP LD information from (these files are large!): [Location of LD files](https://www.broadinstitute.org/~slowikow/tgp/pairwise_ld/). These path to these files can be specified using the ```--ld``` command line switch (see below). In these files, each pair of variants should be on a single line, values should be tab-separated, and the files should be indexed with [Tabix](http://www.htslib.org/doc/tabix.html). Also, this program requires Tabix to be in the $PATH. These LD files are headerless.\n\nFormat of LD files (chrA\\tposA\\trsIdA\\tposB\\trsIdB\\tRsquared\\tDPrime), e.g.:\n\u003cpre\u003e\nchr7\t143099133\trs10808026\t143103481\trs56402156\t0.970556\t0.992515\n\u003c/pre\u003e\n\n**ProxyFinder LD files**\nAnother option to specify LD is to generate an LD proxy file using a program such as [ProxyFinder](https://github.com/immunogenomics/harmjan/releases). The path to this file can be specified using the ```--proxies``` command line switch (see below). The output of the ProxyFinder program is slightly different than the above LD files, but has as a benefit that it only includes LD information for the SNPs that are of your interest (so that GoShifter doesn't have to do the same tabix queries over and over again). Also, this allows you to generate LD files for other populations easily. To generate these files, please refer to the [ProxyFinder readme.md](https://github.com/immunogenomics/harmjan/tree/master/ProxyFinder).\n\nFormat of proxy LD files (chrA\\tposA\\trsIdA\\tchrB\\tposB\\trsIdB\\tDistance\\tRsquared\\tDPrime), e.g.:\n\u003cpre\u003e\nChromA\tPosA\tRsIdA\tChromB\tPosB\tRsIdB\tDistance\tRSquared\tDprime\nChr2\t202149589\trs1045485\tChr2\t202149589\trs1045485\t0\t0.9999999999999981\t0.999999999999999\nChr2\t202149589\trs1045485\tChr2\t202150914\trs35550815\t1325\t0.9999999999999981\t0.999999999999999\n\u003c/pre\u003e\n\n\n### Command line\nGoshifter can be run using a single command line:\n```./goshifter.py --snpmap FILE --annotation FILE --permute INT --ld DIR --out FILE [--rsquared NUM --window NUM --min-shift NUM --max-shift NUM --ld-extend NUM --nold]```\n\n**Options:**\n\u003cpre\u003e\nUsage:\n    ./goshifter.py --snpmap FILE --annotation FILE --permute INT [--ld DIR --proxies FILE] --out FILE [--rsquared NUM --window NUM --min-shift NUM --max-shift NUM --ld-extend NUM --no-ld]\n\nOptions:\n    -h, --help              Print this message and exit.\n    -v, --version           Print the version and exit.\n\n    -s, --snpmap FILE       File with SNP mappings, tab delimited, must include header: SNP, CHR, BP. Chromosomes in format chrN.\n    -a, --annotation FILE   File with annotations, bed format. No header.\n    -p, --permute INT       Number of permutations.\n    -i, --proxies FILE      File with proxy information for snps in --snpmap; takes precedence over --ld\n    -l, --ld DIR            Directory with LD files\n    \n    -r, --rsquared NUM      Include LD SNPs at rsquared \u003e= NUM [default: 0.8]\n    -w, --window NUM        Window size to find LD SNPs [default: 5e5]\n    -n, --min-shift NUM     Minimum shift [default: False]\n    -x, --max-shift NUM     Maximum shift [default: False]\n    -e, --ld-extend NUM     Fixed value by which to extend LD boundries [default: False]\n    -n, --no-ld             Do not include SNPs in LD [default: False]\n\n    -o, --out FILE          Write output file.\n\u003c/pre\u003e\n\n### Example usage:\n```./goshifter.py --snpmap test_data/bc.snpmappings.hg19.txt --annotation test_data /UCSF-UBC.Breast_vHMEC.bed.gz --permute 1000 --ld 1kG-beaglerelease3/pairwise_ld/ --out test_data/bc.H3K4me1_vHMEC3```\n\nIf you make use of LD files precalculated by ProxyFinder, replace ```--ld 1kG-beaglerelease3/pairwise_ld/``` with ```--proxies /path/to/proxyfinderoutput.txt```\n\nGoShifter will output a message on the screen (and print the P-value corresponding to the significance of an overlap). The following output files will be created: \n\n***.enrich** – output file with observed and permuted overlap values\n\u003cpre\u003e\nnperm nSnpOverlap allSnps enrichment\n0 29 68 0.42647\n1 17 68 0.25\n2 26 68 0.38235\n3 25 68 0.36765\n4 23 68 0.33824\n5 17 68 0.25\n6 21 68 0.30882\n7 25 68 0.36765\n8 17 68 0.25\n\u003c/pre\u003e\n\nnperm = 0 is the observed overlap\nnSnpOverlap – number of loci where at least one SNP overlaps an annotation\nallSnps – total number of tested loci\nenrichment – nSnpOverlap/allSnps\n\nNote, P-value is the number of times the “enrichment” is greater or equal to the observed overlap divided by total number of permutations.\n\n***.locusscore** – the likelihood of a locus to overlap an annotation under the null. The smaller the value the more likely a locus overlaps an annotation not by chance. Loci not overlapping any annotation are denoted as “N/A”.\n\u003cpre\u003e\nlocus overlap score\nrs11780156 1 0.609\nrs4808801 1 0.996\nrs10069690 N/A N/A\nrs12493607 1 0.888\nrs1045485 N/A N/A\nrs204247 1 0.678\nrs3757318 N/A N/A\nrs2943559 N/A N/A\nrs11552449 N/A N/A\n\u003c/pre\u003e\n\n***.snpscore** – defines which LD SNPs are overlapping an annotation in the observed data\n\u003cpre\u003e\nlocus ld_snp overlap\nrs11780156 rs11780156 1\nrs11780156 rs1016578 0\nrs11780156 rs12542202 0\nrs11780156 rs11776569 0\nrs11780156 rs7836152 0\nrs11780156 rs10956414 0\nrs11780156 rs67397162 0\nrs11780156 rs11778142 1\nrs11780156 rs11997192 0\n\u003c/pre\u003e\n\n## **goshifter.strat.py**\n\n### Input files:\n\nsnpmap – see above\nannotation-a – mappings of the primary annotation which will be tested for enrichment with the SNP set. See above for format details for the annotation input file.\nannotation-b – mappings of the secondary annotation. Assessment of enrichment for annotation-a will be tested stratifying on this annotation-b. See above for format details for the annotation input file.\n\n### Usage:\n\n```./goshifter.strat.py --snpmap FILE --annotation-a FILE --annotation-b FILE --permute INT --ld DIR --out FILE [--rsquared NUM --window NUM --min-shift NUM --max-shift NUM --ld-extend NUM --no-ld]```\n\nIf you make use of LD files precalculated by ProxyFinder, replace ```--ld 1kG-beaglerelease3/pairwise_ld/``` with ```--proxies /path/to/proxyfinderoutput.txt```\n\n### Options\nSame options as goshifter.py, with the exception:\n\u003cpre\u003e\n-a, --annotation-a\tFILE\tFile with primary annotations, bed format. Gzipped. No header.\n-b, --annotation-b\tFILE\tFile with annotation to stratify on, bed format. Gzipped. No header.\n\u003c/pre\u003e\n\n## Example usage\n\n```./goshifter.strat.py --snpmap test_data/bc.snpmappings.hg19.txt --annotation-a test_data/UCSFUBC. Breast_vHMEC.bed.gz --annotation-b test_data/UCSFUBC.Breast_Myoepithelial_Cells.bed.gz --permute 1000 --ld 1kG-beaglerelease3/pairwise_ld/ --out test_data/bc.H3K4me1_vHMEC_strat_Myoepithelial_Cells```\n\nThis will output a message on the screen (and print the P-value corresponding to the significance of an overlap) and write results to *.enrich (see above for explanation of the format).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimmunogenomics%2Fgoshifter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimmunogenomics%2Fgoshifter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimmunogenomics%2Fgoshifter/lists"}