{"id":16636639,"url":"https://github.com/aquaskyline/clairvoyante","last_synced_at":"2025-04-13T06:41:43.741Z","repository":{"id":71052731,"uuid":"97897312","full_name":"aquaskyline/Clairvoyante","owner":"aquaskyline","description":"Clairvoyante: a multi-task convolutional deep neural network for variant calling in Single Molecule Sequencing","archived":false,"fork":false,"pushed_at":"2023-12-26T16:09:30.000Z","size":937474,"stargazers_count":169,"open_issues_count":0,"forks_count":27,"subscribers_count":15,"default_branch":"rbDev","last_synced_at":"2025-03-26T23:08:37.263Z","etag":null,"topics":["bioinformatics","computational-biology","deep-learning","variant-calling"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aquaskyline.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2017-07-21T02:28:26.000Z","updated_at":"2025-02-20T08:13:11.000Z","dependencies_parsed_at":"2024-10-12T06:22:26.468Z","dependency_job_id":"3ec70834-20d9-4d8b-b11f-260bcec8d1cc","html_url":"https://github.com/aquaskyline/Clairvoyante","commit_stats":{"total_commits":251,"total_committers":10,"mean_commits":25.1,"dds":0.3745019920318725,"last_synced_commit":"891d6ef051a4e833985ca3eebd5b1bc87bfc483a"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquaskyline%2FClairvoyante","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquaskyline%2FClairvoyante/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquaskyline%2FClairvoyante/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquaskyline%2FClairvoyante/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aquaskyline","download_url":"https://codeload.github.com/aquaskyline/Clairvoyante/tar.gz/refs/heads/rbDev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248675434,"owners_count":21143763,"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":["bioinformatics","computational-biology","deep-learning","variant-calling"],"created_at":"2024-10-12T06:22:19.728Z","updated_at":"2025-04-13T06:41:43.721Z","avatar_url":"https://github.com/aquaskyline.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Clairvoyante - A deep neural network based variant caller\n[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)  \nContact: Ruibang Luo  \nEmail: rbluo@cs.hku.hk  \n\n***\n\n## The successor of Clairvoyante\nIs called [Clair](https://github.com/HKU-BAL/Clair).\nClair is published in [Nature Machine Intelligence](https://www.nature.com/articles/s42256-020-0167-4).\nA preprint is available in [bioRxiv](https://biorxiv.org/cgi/content/short/865782v1)\n\n***\n\n## Introduction\nIdentifying the variants of DNA sequences sensitively and accurately is an important but challenging task in the field of genomics. This task is particularly difficult when dealing with Single Molecule Sequencing, the error rate of which is still tens to hundreds of times higher than Next Generation Sequencing. With the increasing prevalence of Single Molecule Sequencing, an efficient variant caller will not only expedite basic research but also enable various downstream applications. To meet this demand, we developed Clairvoyante, a multi-task five-layer convolutional neural network model for predicting variant type, zygosity, alternative allele and Indel length. On NA12878, Clairvoyante achieved 99.73%, 97.68% and 95.36% accuracy on known variants, and achieved 98.65%, 92.57%, 87.26% F1 score on the whole genome, in Illumina, PacBio, and Oxford Nanopore data, respectively. Training Clairvoyante with a sample and call variant on another shows that Clairvoyante is sample agnostic and general for variant calling. A slim version of Clairvoyante with reduced model parameters produced a much lower F1, suggesting the full model's power in disentangling subtle details in read alignment. Clairvoyante is the first method for Single Molecule Sequencing to finish a whole genome variant calling in two hours on a 28 CPU-core machine, with top-tier accuracy and sensitivity. A toolset was developed to train, utilize and visualize the Clairvoyante model easily, and is publically available here is this repo.  \n\nClairvoyante is published in [Nature Communications](https://www.nature.com/articles/s41467-019-09025-z)\n\n## A PyTorch version of Clairvoyante\nA PyTorch implementation of Clairvoyante is available at [HKU-BAL/Clairvoyante-PyTroch](https://github.com/HKU-BAL/Clairvoyante-PyTroch).\n\n## Gallery\n### Network topology\n![Network Topology](http://www.bio8.cs.hku.hk/gallery/Clairvoyantev3.png)\n### Tensor examples\n![Tensor examples](http://www.bio8.cs.hku.hk/gallery/Tensors.png)\n### Activations of the conv1 hidden layer to a non-variant tensor\n![conv1](http://www.bio8.cs.hku.hk/gallery/Conv1.png)\n\n***\n\n## Installation\n### Step by step\n```shell\ngit clone --depth=1 https://github.com/aquaskyline/Clairvoyante.git\ncd Clairvoyante\ncurl http://www.bio8.cs.hku.hk/trainedModels.tbz | tar -jxf -\n```\n\nMake sure you have Tensorflow ≥ 1.0.0 installed, the following commands install the lastest CPU version of Tensorflow as well as other dependencies:  \n\n```shell\npip install tensorflow==1.9.0\npip install blosc\npip install intervaltree==2.1.0\npip install numpy\n```\n\nTo check the version of Tensorflow you have installed:  \n\n```shell\npython -c 'import tensorflow as tf; print(tf.__version__)'\n```\n\nTo do variant calling using trained models, CPU will suffice. Clairvoyante uses all available CPU cores by default in `callVar.py`, 4 threads by default in `callVarBam.py`. The number of threads to be used can be controlled using the parameter `--threads`. To train a new model, a high-end GPU and the GPU version of Tensorflow is needed. To install the GPU version of tensorflow:  \n\n```shell\npip install tensorflow-gpu\n```\n\nThe installation of the `blosc` library might fail if your CPU doesn't support the AVX2 instruction set. Alternatively, you can compile and install from the latest source code available in [GitHub](https://github.com/Blosc/python-blosc) with the \"DISABLE_BLOSC_AVX2\" environment variable set.\n\nClairvoyante was written in Python2 (tested on Python 2.7.10 in Linux and Python 2.7.13 in MacOS). For Python3.X user, run `python port23.py` which does a quickfix using `2to3` and inserts package namespace to `sys.path` to tackle python2-style import problem under python3.\n\nUsing pure Python interpreter on Clairvoyante is slow. Please refer to the **Speed up with PyPy** section for speed up.  \n\n### Using bioconda\n\n```shell\nconda create -n clairvoyante-conda-env -c bioconda clairvoyante\nconda activate clairvoyante-conda-env\nclairvoyante.py\n```\n\nThe conda environment has the Pypy intepreter installed, but doesn't have the required package `intervaltree`. The reason why the package is not installed by default is because it is not available in any conda repositories. To install the `intervaltree` for Pypy, after activation, please use the following commands:\n\n```\nwget https://bootstrap.pypa.io/get-pip.py\npypy get-pip.py\npypy -m pip install --no-cache-dir intervaltree==2.1.0\n```\n\nDownload the models to a folder.  \n\n```shell\ncurl http://www.bio8.cs.hku.hk/trainedModels.tbz | tar -jxf -\n```\n\nThe commands above install the CPU version of TensorFlow in the virtual environment thus support only variant calling. To train a model, please install the GPU version of Tensorflow in the virtual environment:  \n\n```shell\nconda remove tensorflow\nconda install tensorflow-gpu\n```\n\nUse `conda deactivate` to exit the virtual environment.  \nUse `conda activate clairvoyante-conda-env` to re-enter the virtual environment.  \n\n### Speed up with PyPy\nWithout a change to the code, using PyPy python interpreter on some tensorflow independent modules such as `dataPrepScripts/ExtractVariantCandidates.py` and `dataPrepScripts/CreateTensor.py` gives a 5-10 times speed up. Pypy python interpreter can be installed by apt-get, yum, Homebrew, MacPorts, etc. If you have no root access to your system, the official website of Pypy provides a portable binary distribution for Linux. Following is a rundown extracted from Pypy's website (pypy-5.8 in this case) on how to install the binaries.  \n\n```shell\nwget https://bitbucket.org/squeaky/portable-pypy/downloads/pypy-5.8-1-linux_x86_64-portable.tar.bz2\ntar -jxf pypy-5.8-1-linux_x86_64-portable.tar.bz2\ncd pypy-5.8-linux_x86_64-portable/bin\n./pypy -m ensurepip\n./pip install -U pip wheel intervaltree\n# Use pypy as an inplace substitution of python to run the scripts in dataPrepScripts/\n```\n\nAlternatively, if you can use apt-get or yum in your system, please install both `pypy` and `pypy-dev` packages. And then install the pip for pypy.  \n\n```shell\nsudo apt-get install pypy pypy-dev\nwget https://bootstrap.pypa.io/get-pip.py\nsudo pypy get-pip.py \nsudo pypy -m pip install intervaltree \n```\n\nTo guarantee a good user experience (good speed), pypy must be installed to run `callVarBam.py` (call variants from BAM), and `callVarBamParallel.py` that generate parallelizable commands to run `callVarBam.py`.  \nTensorflow is optimized using Cython thus not compatible with `pypy`. For the list of scripts compatible to `pypy`, please refer to the **Folder Stucture and Program Descriptions** section.  \n*Pypy is an awesome Python JIT intepreter, you can donate to [the project](https://pypy.org).*  \n\n***\n\n## Quick Start with Variant Calling\nYou have a slow way and a quick way to get some demo variant calls. The slow way generates required files from VCF and BAM files. The fast way downloads the required files.  \n### Download testing dataset\n#### I have plenty of time\n\n```shell\nwget 'http://www.bio8.cs.hku.hk/testingData.tar'\ntar -xf testingData.tar\ncd dataPrepScripts\nsh PrepDataBeforeDemo.sh\n```\n\n#### I need some results now\n\n```shell\nwget 'http://www.bio8.cs.hku.hk/training.tar'\ntar -xf training.tar\n```\n\n### Call variants\n#### Call variants from at known variant sites using a BAM file and a trained model\n\n```shell\ncd training\npython ../clairvoyante/callVarBam.py \\\n       --chkpnt_fn ../trainedModels/fullv3-illumina-novoalign-hg001+hg002-hg38/learningRate1e-3.epoch500 \\\n       --bam_fn ../testingData/chr21/chr21.bam \\\n       --ref_fn ../testingData/chr21/chr21.fa \\\n       --bed_fn ../testingData/chr21/chr21.bed \\\n       --call_fn chr21_calls.vcf \\\n       --ctgName chr21\nless chr21_calls.vcf\n```\n\n#### Call variants from the tensors of candidate variant and a trained model\n\n```shell\ncd training\npython ../clairvoyante/callVar.py --chkpnt_fn ../trainedModels/fullv3-illumina-novoalign-hg001+hg002-hg38/learningRate1e-3.epoch500 --tensor_fn tensor_can_chr21 --call_fn tensor_can_chr21.vcf\nless tensor_can_chr21.vcf\n```\n\n***\n\n## How to call variant directly from BAM\n\n### Input example\n| Input | File name |\n| :---: | :---: |\n| BAM | `GIAB_v3.2.2_Illumina_50x_GRCh38_HG001.bam` | \n| Reference Genome | `GRCh38_full_analysis_set_plus_decoy_hla.fa` |\n| BED for where to call variants | `GRCh38_high_confidence_interval.bed` |\n\n* If no BED file was provided, Clairvoyante will call variants on the whole genome\n\n### Commands\n```shell\npython clairvoyante/callVarBamParallel.py \\\n       --chkpnt_fn trainedModels/fullv3-illumina-novoalign-hg001+hg002-hg38/learningRate1e-3.epoch500 \\\n       --ref_fn GRCh38_full_analysis_set_plus_decoy_hla.fa \\\n       --bam_fn GIAB_v3.2.2_Illumina_50x_GRCh38_HG001.bam \\\n       --bed_fn GRCh38_high_confidence_interval.bed \\\n       --sampleName HG001 \\\n       --output_prefix hg001 \\\n       --threshold 0.125 \\\n       --minCoverage 4 \\\n       --tensorflowThreads 4 \\\n       \u003e commands.sh\nexport CUDA_VISIBLE_DEVICES=\"\"\ncat commands.sh | parallel -j4\nvcfcat hg001*.vcf | vcfstreamsort | bgziptabix hg001.vcf.gz\n```\n\n* `parallel -j4` will run 4 commands in parallel. Each command using at most `--tensorflowThreads 4` threads. `vcfcat`, `vcfstreamsort` and `bgziptabix` are a part of **vcflib**.  \n* If you don't have `parallel` installed on your computer, try `awk '{print \"\\\"\"$0\"\\\"\"}' commands.sh | xargs -P4 -L1 sh -c`.  \n* `CUDA_VISIBLE_DEVICES=\"\"` makes GPUs invisible to Clairvoyante so it will use CPU only. Please notice that unless you want to run `commands.sh` in serial, you cannot use GPU because one running copy of Clairvoyante will occupy all available memory of a GPU. While the bottleneck of `callVarBam.py` is at the CPU only `CreateTensor.py` script, the effect of GPU accelerate is insignificant (roughly about 15% faster). But if you have multiple GPU cards in your system, and you want to utilize them in variant calling, you may want split the `commands.sh` in to parts, and run the parts by firstly `export CUDA_VISIBLE_DEVICES=\"$i\"`, where `$i` is an integer from 0 identifying the seqeunce of the GPU to be used.  \n\n***\n\n## VCF Output Format\n`clairvoyante/callVar.py` outputs variants in VCF format with version 4.1 specifications.  \nClairvoyante can predict the exact length of insertions and deletions shorter than or equal to 4bp. For insertions and deletions with a length between 5bp to 15bp, callVar guesses the length from input tensors. The indels with guessed length are denoted with a `LENGUESS` info tag. Although the guessed indel length might be incorrect, users can still benchmark Clairvoyante's sensitivity by matching the indel positions to other callsets. For indels longer than 15bp, `callVar.py` outputs them as SV without providing an alternative allele. To fit into a different usage scenario, Clairvoyante allows users to extend its model easily to support exact length prediction on longer indels by adding categories to the model output. However, this requires additional training data on the new categories. Users can also increase the length limit from where an indel is outputted as a SV by increasing the parameter flankingBaseNum from 16bp to a higher value. This extends the flanking bases to be considered with a candidate variant.  \n\n***\n\n## Build a Model\n### Quick start with a model training demo\n\n```\nwget 'http://www.bio8.cs.hku.hk/testingData.tar'\ntar -xf testingData.tar\ncd clairvoyante\npython demoRun.py\n```\n\n### Jupyter notebook interactive training\n\nPlease visit: `jupyter_nb/demo.ipynb`\n\n***\n\n## Visualization\n### Interactively visualizing Input Tensors, Activation in Hidden Layers and Comparing Predicted Results (Suggested)\n`jupyter_nb/visualization.ipynb`\n\n### Output tensors and layer activations to PNG figures\n`getTensorAndLayerPNG.py`. You will need to input a model, a file with one or more tensors created by `CreateTensor.py` and optionally a file with the truth variants created by `GetTruth.py`. The script will create 7 PNG figures for each line of tensor, including 1) input tensors; 2) conv1 layer activations; 3) conv2 layer activations; 4) conv3 layer activations; 5) fc4 layer activations; 6) fc5 layer activations and 7) output predictions and the truth.  \n\n### Tensorboard\nThe `--olog_dir` option provided in the training scripts outputs a folder of log files readable by the Tensorboard. It can be used to visualize the dynamics of parameters during training at each epoch.  \nYou can also use the PCA and t-SNE algorithms provided by TensorBoard in the `Embedding` page to analyze the predictions made by a model. `clairvoyante/getEmbedding.py` helps you to prepare a folder for the purpose.  \n\n***\n\n## Folder Stucture and Program Descriptions\n*You can also run the program to get the parameter details.*  \n\n`dataPrepScripts/` | Data Preparation Scripts. Outputs are gzipped unless using standard output. Scripts in this folder are compatible with `pypy`.\n--- | ---\n`ExtractVariantCandidates.py`| Extract the position of variant candidates. Input: BAM; Reference FASTA. Important options: --threshold \"Minimum alternative allelic fraction to report a candidate\"; --minCoverage \"Minimum coverage to report a candidate\".\n`GetTruth.py`| Extract the variants from a truth VCF. Input: VCF.\n`CreateTensor.py`| Create tensors for candidates or truth variants. Input: A candidate list; BAM; Reference FASTA. Important option: --considerleftedge \"Count the left-most base-pairs of a read for coverage even if the starting position of a read is after the starting position of a tensor. Enable if you are 1) using reads shorter than 100bp, 2) using a tensor with flanking length longer than 16bp, and 3) you are using amplicon sequencing or other sequencing technologies, in which reads starting positions are random is not a basic assumption\".\n`PairWithNonVariants.py`| Pair truth variant tensors with non-variant tensors. Input: Truth variants tensors; Candidate variant tensors. Important options: --amp x \"1-time truth variants + x-time non-variants\".\n`ChooseItemInBed.py`| Helper script. Output the items overlapping with input the BED file.\n`CountNumInBed.py`| Helper script. Count the number of items overlapping with the input BED file.\n`param.py`| Global parameters for the scripts in the folder.\n`PrepDataBeforeDemo.sh`| A **Demo** showing how to prepare data for model training.\n`PrepDataBeforeDemo.pypy.sh`| The same demo but using pypy in place of python. `pypy` is highly recommended. It's easy to install, and makes the scripts run 5-10 times faster.\n`CombineMultipleDatasetsForTraining.sh`| Use chr21 and chr22 to exemplify how to maunually combine multiple datasets for model training.\n`CombineMultipleDatasetsForTraining.py`| A helper script for combining multiple datasets. You still need to run PairWithNonVariants.py and tensor2Bin.py after this script.\n\n\n`clairvoyante/` | Model Training and Variant Caller Scripts. Scripts in this folder are NOT compatible with `pypy`. Please run with `python`.\n--- | ---\n`callVar.py `| Call variants using candidate variant tensors.\n`callVarBam.py` | Call variants directly from a BAM file.\n`callVarBamParallel.py` | Generate `callVarBam.py` commands that can be run in parallel. A BED file is required to specify the regions for variant calling. `--refChunkSize` set the genome chuck size per job.\n`demoRun.py` | A **Demo** showing how to train a model from scratch.\n`evaluate.py` | Evaluate a model in terms of base change, zygosity, variant type and indel length.\n`param.py` |  Hyperparameters for model training and other global parameters for the scripts in the folder.\n`tensor2Bin.py` |  Create a compressed binary tensors file to facilitate and speed up future usage. Input: Mixed tensors by PairWithNonVariants.py; Truth variants by GetTruth.py and a BED file marks the high confidence regions in the reference genome.\n`train.py` |  Training a model using adaptive learning rate decay. By default, the learning rate will decay for three times. Input a binary tensors file created by Tensor2Bin.py is highly recommended.\n`trainNonstop.py` |  Helper script. Train a model continuously using the same learning rate and l2 regularization lambda.\n`trainWithoutValidationNonstop.py` | Helper script. Train a model continuously using the same learning rate and l2 regularization lambda. Take all the input tensors as training data and do not calculate loss in the validation data.\n`calTrainDevDiff.py` | Helper script. Calculate the training loss and validation loss on a trained model.\n`getTensorAndLayerPNG.py` | Create high resolution PNG figures to visualize input tensor, layer activations and output.\n`getEmbedding.py` | Prepare a folder readable by Tensorboard for visualizing predicted results.\n`clairvoyante_v3.py` | Clairvoyante network topology v3.\n`clairvoyante_v3_slim.py` | Clairvoyante network topology v3 slim. With ten times fewer parameters than the full network, it trains about 1.5 times faster than the full network. It performs only about 1% less in precision and recall rates for Illumina data.\n`utils_v2.py` | Helper functions to the network.\n\n\n*GIAB provides a BED file that marks the high confidence regions in the reference. The models perform better by using only the truth variants in these regions for training. If you don't have such a BED file, you can use a BED file that covers the whole genome.*  \n\n***\n\n## About the Trained Models\nThe trained models are in the `trainedModels/` folder.  \n\n\nFolder | Tech | Aligner | Ref | Sample |\n--- |:---:|:---:|:---:|:---:|\n`fullv3-illumina-novoalign`\u003cbr\u003e`-hg001+hg002-hg38` | Illumina HiSeq2500\u003csup\u003e1\u003c/sup\u003e | Novoalign 3.02.07 | hg38 | NA12878+NA24385 |\n`fullv3-illumina-novoalign`\u003cbr\u003e`-hg001-hg38` | Illumina HiSeq2500\u003csup\u003e1\u003c/sup\u003e | Novoalign 3.02.07 | hg38 | NA12878 |\n`fullv3-illumina-novoalign`\u003cbr\u003e`-hg002-hg38` | Illumina HiSeq2500\u003csup\u003e1\u003c/sup\u003e | Novoalign 3.02.07 | hg38 | NA24385 |\n`fullv3-pacbio-ngmlr`\u003cbr\u003e`-hg001+hg002+hg003+hg004-hg19` | mainly PacBio P6-C4\u003csup\u003e2\u003c/sup\u003e | NGMLR 0.2.6 | hg19 | NA12878+NA24385+NA24149\u003cbr\u003e+NA24143 |\n`fullv3-pacbio-ngmlr`\u003cbr\u003e`-hg001+hg002-hg19` | PacBio P6-C4\u003csup\u003e2\u003c/sup\u003e | NGMLR 0.2.6 | hg19 | NA12878+NA24385 |\n`fullv3-pacbio-ngmlr`\u003cbr\u003e`-hg001-hg19` | PacBio P6-C4\u003csup\u003e2\u003c/sup\u003e | NGMLR 0.2.6 | hg19 | NA12878 |\n`fullv3-pacbio-ngmlr`\u003cbr\u003e`-hg002-hg19` | PacBio P6-C4\u003csup\u003e2\u003c/sup\u003e | NGMLR 0.2.6 | hg19 | NA24385 |\n`fullv3-ont-ngmlr`\u003cbr\u003e`-hg001-hg19` | Oxford Nanopore Minion R9.4\u003csup\u003e3\u003c/sup\u003e | NGMLR 0.2.6 | hg19 | NA12878 |\n\n\u003csup\u003e1\u003c/sup\u003e Also using Illumina TruSeq (LT) DNA PCR-Free Sample Prep Kits. *Zook et al. Extensive sequencing of seven human genomes to characterize benchmark reference materials. 2016*  \n\n\u003csup\u003e2\u003c/sup\u003e *Pendelton et al. Assembly and diploid architecture of an individual human genome via single-molecule technologies. 2015*  \n\n\u003csup\u003e3\u003c/sup\u003e [Nanopore WGS Consortium](https://github.com/nanopore-wgs-consortium/NA12878)  \n\n\u003csup\u003e\\*\u003c/sup\u003e Each folder contains one or more models. Each model contains three files suffixed `data-00000-of-00001`, `index` and `meta`, respectively. Only the prefix is needed when using the model with Clairvoyante. Using the prefix `learningRate1e-3.epoch999.learningRate1e-4.epoch1499` as an example, it means that the model has trained for 1000 epochs at learning rate 1e\u003csup\u003e-3\u003c/sup\u003e, then another 500 epochs at learning rate 1e\u003csup\u003e-4\u003c/sup\u003e. Lambda for L2 regularization was set the same as learning rate.  \n\n***\n\n## Performance of GPUs in model training\nEquiptment | Seconds per Epoch per 11M Variant Tensors |\n:---: |:---:|\nTesla V100 | 90 |\nGTX 1080 Ti | 170 |\nGTX 980 | 350 |\nGTX Titan | 520 |\nTesla K40 (-ac 3004,875) | 580 |\nTesla K40 | 620 |\nTesla K80 (one socket) | 600 |\nGTX 680 | 780 |\nIntel Xeon E5-2680 v4 28-core | 2900\n\n***\n\n## About Setting the Alternative Allele Frequency Cutoff\nDifferent from model training, in which all genome positions are candidates but randomly subsampled for training, variant calling using a trained model will require the user to define a minimal alternative allele frequency cutoff for a genome position to be considered as a candidate for variant calling. For all sequencing technologies, the lower the cutoff, the lower the speed. Setting a cutoff too low will increase the false positive rate significantly, while too high will increase the false negative rate significantly. The option `--threshold` controls the cutoff in these three scripts `callVarBam.py`, `callVarBamParallel.py` and `ExtractVariantCandidates.py`. The suggested cutoff is listed below for different sequencing technologies. A higher cutoff will increase the accuracy of datasets with poor sequencing quality, while a lower cutoff will increase the sensitivity in applications like clinical research. Setting a lower cutoff and further filter the variants by their quality is also a good practice.  \n\nSequencing Technology | Alt. AF Cutoff |\n:---: |:---:|\nIllumina | 0.125 |\nPacBio P6-C4 | 0.2 |\nONT R9.4 | 0.25 |\n\n***\n\n## About the Testing Data\nThe testing dataset 'testingData.tar' includes:  \n1) the Illumina alignments of chr21 and chr22 on GRCh38 from [GIAB Github](ftp://ftp-trace.ncbi.nlm.nih.gov/giab/ftp/data/NA12878/NIST_NA12878_HG001_HiSeq_300x/NHGRI_Illumina300X_novoalign_bams/HG001.GRCh38_full_plus_hs38d1_analysis_set_minus_alts.300x.bam), downsampled to 50x.  \n2) the truth variants v3.3.2 from [GIAB](ftp://ftp-trace.ncbi.nlm.nih.gov/giab/ftp/release/NA12878_HG001/NISTv3.3.2/GRCh38).  \n\n***\n\n## Limitations\n### On variants with two alternative alleles (GT: 1/2)\nClairvoyante network version 3 can only output one of the two possible alternative alleles at a position. We will further extend the network to support genome variants with two alternative alleles.  \n\n### On training\nIn rare cases, the model training will stuck early at a local optimal and cannot be further optimized without a higher learning rate. As we observed ,the problem only happens at the very beginning of model training, and can be predicated if the loss remains stable in the first few training epochs.  \n\n***\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faquaskyline%2Fclairvoyante","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faquaskyline%2Fclairvoyante","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faquaskyline%2Fclairvoyante/lists"}