{"id":38674516,"url":"https://github.com/wglab/contextsv","last_synced_at":"2026-01-17T10:00:46.409Z","repository":{"id":198570537,"uuid":"531601714","full_name":"WGLab/ContextSV","owner":"WGLab","description":"An alignment-based, generalized structural variant caller for long-read sequencing/mapping data ","archived":false,"fork":false,"pushed_at":"2025-09-18T19:22:39.000Z","size":19759,"stargazers_count":2,"open_issues_count":5,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-18T21:58:41.100Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://wglab.openbioinformatics.org/ContextSV/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WGLab.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-09-01T16:33:33.000Z","updated_at":"2025-08-01T19:53:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"2fc79c5a-e76f-41b6-80d9-48b482eafbcd","html_url":"https://github.com/WGLab/ContextSV","commit_stats":null,"previous_names":["wglab/contextsv"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/WGLab/ContextSV","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WGLab%2FContextSV","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WGLab%2FContextSV/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WGLab%2FContextSV/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WGLab%2FContextSV/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WGLab","download_url":"https://codeload.github.com/WGLab/ContextSV/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WGLab%2FContextSV/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28505570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T06:57:29.758Z","status":"ssl_error","status_checked_at":"2026-01-17T06:56:03.931Z","response_time":85,"last_error":"SSL_read: 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":[],"created_at":"2026-01-17T10:00:23.997Z","updated_at":"2026-01-17T10:00:46.404Z","avatar_url":"https://github.com/WGLab.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![build\r\ntests](https://github.com/WGLab/ContextSV/actions/workflows/build-tests.yml/badge.svg)](https://github.com/WGLab/ContextSV/actions/workflows/build-tests.yml)\r\n\r\n# ContextSV\r\n\r\n\u003cp\u003e\r\n\u003cimg src=\"https://github.com/user-attachments/assets/03603ad1-df9d-438d-911c-81af0cf612e3\" alt=\"ContextSV\" align=\"left\" style=\"width:100px;\"/\u003e\r\nA long-read, whole-genome structural variant (SV) caller. It takes as input long read alignments (BAM), the \r\ncorresponding reference genome (FASTA), a VCF with high-quality SNPs \r\n (e.g. via GATK, Deepvariant, \u003ca href=\"https://github.com/WGLab/NanoCaller\"\u003eNanoCaller\u003c/a\u003e, and \u003ca href=\"https://gnomad.broadinstitute.org/downloads\"\u003egnomAD\u003c/a\u003e database\r\n VCF files with SNP population frequencies for each chromosome.\r\nClass documentation is available at \u003ca href=\"https://wglab.openbioinformatics.org/ContextSV\"\u003ehttps://wglab.openbioinformatics.org/ContextSV\u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n## Installation\r\n### Anaconda\r\nFirst, install [Anaconda](https://www.anaconda.com/).\r\n\r\nNext, create a new environment. This installation has been tested with Python 3.9, Linux 64-bit.\r\n\r\n```\r\nconda create -n contextsv python=3.9\r\nconda activate contextsv\r\n```\r\n\r\nContextSV and its dependencies can then be installed using the following command:\r\n\r\n```\r\nconda install -c wglab -c conda-forge -c bioconda contextsv\r\n```\r\n\r\n### Docker\r\nFirst, install [Docker](https://docs.docker.com/engine/install/).\r\nPull the latest image from Docker hub, which contains the latest release and its dependencies.\r\n\r\n```\r\ndocker pull genomicslab/contextsv\r\n```\r\n\r\n\r\n## Building from source (for testing/development)\r\nContextSV requires HTSLib as a dependency that can be installed using  [Anaconda](https://www.anaconda.com/). Create an environment\r\ncontaining HTSLib: \r\n\r\n```\r\nconda create -n htsenv -c bioconda -c conda-forge htslib\r\nconda activate htsenv\r\n```\r\n\r\nThen follow the instructions below to build ContextSV:\r\n\r\n```\r\ngit clone https://github.com/WGLab/ContextSV\r\ncd ContextSV\r\nmake\r\n```\r\n\r\nContextSV can then be run:\r\n```\r\n./build/contextsv --help\r\n\r\nUsage: ./build/contextsv [options]\r\nOptions:\r\n  -b, --bam \u003cbam_file\u003e          Long-read BAM file (required)\r\n  -r, --ref \u003cref_file\u003e          Reference genome FASTA file (required)\r\n  -s, --snp \u003cvcf_file\u003e          SNPs VCF file (required)\r\n  -o, --outdir \u003coutput_dir\u003e     Output directory (required)\r\n  -c, --chr \u003cchromosome\u003e        Chromosome\r\n  -t, --threads \u003cthread_count\u003e  Number of threads\r\n  -h, --hmm \u003chmm_file\u003e          HMM file\r\n  -n, --sample-size \u003csize\u003e      Sample size for HMM predictions\r\n     --min-cnv \u003cmin_length\u003e     Minimum CNV length\r\n     --eps \u003cepsilon\u003e             DBSCAN epsilon\r\n     --min-pts-pct \u003cmin_pts_pct\u003e Percentage of mean chr. coverage to use for DBSCAN minimum points\r\n  -e, --eth \u003ceth_file\u003e          ETH file\r\n  -p, --pfb \u003cpfb_file\u003e          PFB file\r\n     --save-cnv                 Save CNV data\r\n     --debug                    Debug mode with verbose logging\r\n     --version                  Print version and exit\r\n  -h, --help                    Print usage and exit\r\n```\r\n\r\n## Downloading gnomAD SNP population frequencies\r\nSNP population allele frequency\r\ninformation is used for copy number predictions in this tool (see\r\n[PennCNV](http://www.genome.org/cgi/doi/10.1101/gr.6861907) for specifics). We\r\nrecommend downloading this data from the Genome Aggregation Database (gnomAD).\r\n\r\nDownload links for genome VCF files are located here (last updated April 3,\r\n2024):\r\n\r\n - **gnomAD v4.0.0 (GRCh38)**: https://gnomad.broadinstitute.org/downloads#4\r\n\r\n - **gnomAD v2.1.1 (GRCh37)**: https://gnomad.broadinstitute.org/downloads#2\r\n\r\n\r\n### Script for downloading gnomAD VCFs\r\n```\r\ndownload_dir=\"~/data/gnomad/v4.0.0/\"\r\n\r\nchr_list=(\"1\" \"2\" \"3\" \"4\" \"5\" \"6\" \"7\" \"8\" \"9\" \"10\" \"11\" \"12\" \"13\" \"14\" \"15\" \"16\" \"17\" \"18\" \"19\" \"20\" \"21\" \"22\" \"X\" \"Y\")\r\n\r\nfor chr in \"${chr_list[@]}\"; do\r\n    echo \"Downloading chromosome ${chr}...\"\r\n    wget \"https://storage.googleapis.com/gcp-public-data--gnomad/release/4.0/vcf/genomes/gnomad.genomes.v4.0.sites.chr${chr}.vcf.bgz\" -P \"${download_dir}\"\r\ndone\r\n```\r\n\r\nFinally, create a text file that specifies the chromosome and its corresponding\r\ngnomAD filepath. This file will be passed in as an argument:\r\n\r\n**gnomadv4_filepaths.txt**\r\n```\r\n1=~/data/gnomad/v4.0.0/gnomad.genomes.v4.0.sites.chr1.vcf.bgz\r\n2=~/data/gnomad/v4.0.0/gnomad.genomes.v4.0.sites.chr2.vcf.bgz\r\n3=~/data/gnomad/v4.0.0/gnomad.genomes.v4.0.sites.chr3.vcf.bgz\r\n...\r\nX=~/data/gnomad/v4.0.0/gnomad.genomes.v4.0.sites.chrX.vcf.bgz\r\nY=~/data/gnomad/v4.0.0/gnomad.genomes.v4.0.sites.chrY.vcf.bgz\r\n```\r\n\r\n## Revision history\r\nFor release history, please visit [here](https://github.com/WGLab/ContextSV/releases). \r\n\r\n## Getting help\r\nPlease refer to the [contextSV issue pages](https://github.com/WGLab/ContextSV/issues) for posting your issues. We will also respond your questions quickly. Your comments are critical to improve our tool and will benefit other users.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwglab%2Fcontextsv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwglab%2Fcontextsv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwglab%2Fcontextsv/lists"}