|
| 1 | +# DeepSomatic WES tumor-only case study |
| 2 | + |
| 3 | +In this case study, we show an example of running DeepSomatic on WES |
| 4 | +on tumor-only data. We use HCC1395 as an example for this case study. |
| 5 | + |
| 6 | +## Data details |
| 7 | + |
| 8 | +For this case-study, we use HCC1395 as an example. We run the analysis on `chr1` |
| 9 | +that we hold out during training. |
| 10 | + |
| 11 | +Please see the [metrics page](metrics.md) for details on runtime and data. |
| 12 | + |
| 13 | +## Prepare environment |
| 14 | + |
| 15 | +### Tools |
| 16 | + |
| 17 | +[Docker](https://docs.docker.com/get-docker/) will be used to run DeepSomatic |
| 18 | +and [hap.py](https://github.com/illumina/hap.py), |
| 19 | + |
| 20 | +### Download input data |
| 21 | + |
| 22 | +We will be using GRCh38 for this case study. |
| 23 | + |
| 24 | + |
| 25 | +```bash |
| 26 | +BASE="${HOME}/deepsomatic-wes-tumor-only-case-study" |
| 27 | + |
| 28 | +# Set up input and output directory data |
| 29 | +INPUT_DIR="${BASE}/input/data" |
| 30 | +OUTPUT_DIR="${BASE}/output" |
| 31 | + |
| 32 | +## Create local directory structure |
| 33 | +mkdir -p "${INPUT_DIR}" |
| 34 | +mkdir -p "${OUTPUT_DIR}" |
| 35 | +mkdir -p "${OUTPUT_DIR}/sompy_output" |
| 36 | + |
| 37 | +# Download bam files to input directory |
| 38 | +HTTPDIR=https://storage.googleapis.com/deepvariant/deepsomatic-case-studies/deepsomatic-chr1-case-studies |
| 39 | +# Download the reference files |
| 40 | +curl ${HTTPDIR}/GCA_000001405.15_GRCh38_no_alt_analysis_set.chr1.fna > ${INPUT_DIR}/GCA_000001405.15_GRCh38_no_alt_analysis_set.chr1.fna |
| 41 | +curl ${HTTPDIR}/GCA_000001405.15_GRCh38_no_alt_analysis_set.chr1.fna.fai > ${INPUT_DIR}/GCA_000001405.15_GRCh38_no_alt_analysis_set.chr1.fna.fai |
| 42 | + |
| 43 | +# Download the bam files |
| 44 | +curl ${HTTPDIR}/HCC1395_wes.tumor.chr1.bam > ${INPUT_DIR}/HCC1395_wes.tumor.chr1.bam |
| 45 | +curl ${HTTPDIR}/HCC1395_wes.tumor.chr1.bam.bai > ${INPUT_DIR}/HCC1395_wes.tumor.chr1.bam.bai |
| 46 | + |
| 47 | +# Download truth VCF |
| 48 | +DATA_HTTP_DIR=https://storage.googleapis.com/deepvariant/deepsomatic-case-studies/SEQC2-S1395-truth |
| 49 | +wget -P ${INPUT_DIR} "${DATA_HTTP_DIR}"/High-Confidence_Regions_v1.2.bed |
| 50 | +wget -P ${INPUT_DIR} "${DATA_HTTP_DIR}"/high-confidence_sINDEL_sSNV_in_HC_regions_v1.2.1.merged.vcf.gz |
| 51 | +wget -P ${INPUT_DIR} "${DATA_HTTP_DIR}"/high-confidence_sINDEL_sSNV_in_HC_regions_v1.2.1.merged.vcf.gz.tbi |
| 52 | +wget -P ${INPUT_DIR} "${DATA_HTTP_DIR}"/seqc2_hg38.exome_regions.bed |
| 53 | +``` |
| 54 | + |
| 55 | +## Running DeepSomatic with one command |
| 56 | + |
| 57 | +DeepVariant pipeline consists of 3 steps: `make_examples_somatic`, `call_variants`, and |
| 58 | +`postprocess_variants`. You can run DeepSomatic with one command using the |
| 59 | +`run_deepvariant` script. |
| 60 | + |
| 61 | +### Running on a CPU-only machine |
| 62 | + |
| 63 | +```bash |
| 64 | +BIN_VERSION="1.10.0" |
| 65 | + |
| 66 | +sudo docker pull google/deepsomatic:"${BIN_VERSION}" |
| 67 | + |
| 68 | +sudo docker run \ |
| 69 | +-v ${INPUT_DIR}:${INPUT_DIR} \ |
| 70 | +-v ${OUTPUT_DIR}:${OUTPUT_DIR} \ |
| 71 | +google/deepsomatic:"${BIN_VERSION}" \ |
| 72 | +run_deepsomatic \ |
| 73 | +--model_type=WES_TUMOR_ONLY \ |
| 74 | +--ref=${INPUT_DIR}/GCA_000001405.15_GRCh38_no_alt_analysis_set.chr1.fna \ |
| 75 | +--reads_tumor=${INPUT_DIR}/HCC1395_wes.tumor.chr1.bam \ |
| 76 | +--output_vcf=${OUTPUT_DIR}/HCC1395_deepsomatic_output.vcf.gz \ |
| 77 | +--sample_name_tumor="HCC1395Tumor" \ |
| 78 | +--num_shards=$(nproc) \ |
| 79 | +--logging_dir=${OUTPUT_DIR}/logs \ |
| 80 | +--intermediate_results_dir=${OUTPUT_DIR}/intermediate_results_dir \ |
| 81 | +--use_default_pon_filtering=true \ |
| 82 | +--regions=chr1 |
| 83 | +``` |
| 84 | + |
| 85 | +NOTE: If you want to run each of the steps separately, add `--dry_run=true` |
| 86 | +to the command above to figure out what flags you need in each step. Based on |
| 87 | +the different model types, different flags are needed in the `make_examples` |
| 88 | +step. |
| 89 | + |
| 90 | +`--intermediate_results_dir` flag is optional. By specifying it, the |
| 91 | +intermediate outputs of `make_examples_somatic` and `call_variants` stages can |
| 92 | +be found in the directory. |
| 93 | + |
| 94 | +```bash |
| 95 | +sudo docker pull pkrusche/hap.py:latest |
| 96 | +# Run hap.py |
| 97 | +sudo docker run \ |
| 98 | +-v ${INPUT_DIR}:${INPUT_DIR} -v ${OUTPUT_DIR}:${OUTPUT_DIR} \ |
| 99 | +pkrusche/hap.py:latest \ |
| 100 | +/opt/hap.py/bin/som.py \ |
| 101 | +-N ${INPUT_DIR}/high-confidence_sINDEL_sSNV_in_HC_regions_v1.2.1.merged.vcf.gz \ |
| 102 | +${OUTPUT_DIR}/HCC1395_deepsomatic_output.vcf.gz \ |
| 103 | +-r ${INPUT_DIR}/GCA_000001405.15_GRCh38_no_alt_analysis_set.chr1.fna \ |
| 104 | +-o ${OUTPUT_DIR}/sompy_output/deepsomatic.chr1.sompy.output \ |
| 105 | +--feature-table generic \ |
| 106 | +-R ${INPUT_DIR}/High-Confidence_Regions_v1.2.bed \ |
| 107 | +-T ${INPUT_DIR}/seqc2_hg38.exome_regions.bed \ |
| 108 | +-l chr1 |
| 109 | +``` |
| 110 | + |
| 111 | +The output: |
| 112 | + |
| 113 | +``` |
| 114 | + type total.truth total.query tp fp fn unk ambi recall recall_lower recall_upper recall2 precision precision_lower precision_upper na ambiguous fp.region.size fp.rate |
| 115 | +0 indels 7 5 4 1 3 0 0 0.571429 0.234501 0.861136 0.571429 0.800000 0.371374 1.000000 0 0 248956422 0.004017 |
| 116 | +1 SNVs 145 56 47 9 98 0 0 0.324138 0.252009 0.403209 0.324138 0.839286 0.727202 0.917389 0 0 248956422 0.036151 |
| 117 | +5 records 152 61 51 10 101 0 0 0.335526 0.264116 0.413134 0.335526 0.836066 0.728674 0.912475 0 0 248956422 0.040168 |
| 118 | +``` |
0 commit comments