Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
24349 committed Feb 2, 2020
0 parents commit 705b39e
Show file tree
Hide file tree
Showing 7 changed files with 951 additions and 0 deletions.
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Callstate
A tool that generates similar results as CallableLoci in GATK3 but runs much faster.

## Algorithm
This tool uses similar depth calculating algorithm in Mosdepth to calculate the raw depth, qc depth and low_mapq depth and then uses the same algorithm in CallableLoci tool in GATK3 to determine the following callable states:

- REF_N
- NO_COVERAGE
- LOW_COVERAGE
- POOR_MAPPING_QUALITY
- EXCESSIVE_COVERAGE
- CALLABLE

For each region in the output file, besides the location of region, Callstate also outputs the mean raw depth, mean QC depth, and the mean Low MAPQ depth

## Usage
```
callstate 0.0.1
Usage: callstate [options] <BED> <BAM>
Arguments:
<BAM> the alignment file for which to calculate callable states
<BED> The BED file that contains regions.
Common Options:
-t --threads <threads> Number of BAM decompression threads [default: 4]
-o --output <output> The output BED file.
-mbq --min-base-qual <mbq> The minimum base quality for a base to contribute to QC depth [default: 10]
-mmq --min-mapq <mmq> The minimum mapping quality of reads to count as QC depth [default: 10]
-mdp --min-depth <mdp> The minimum QC read depth before a read is considered callable [default: 20]
-mlmq --max-low-mapq <mlmq> The maximum value of MAPQ before a read is considered as problematic mapped read. [default: 1]
-mxdp --max-depth <mxdp> The maximum read depth before a locus is considered high coverage [default: -1]
-mdflmq --min-depth-low-mapq <mdflmq> Minimum read depth before a locus is considered candidate for poorly mapped [default: 10]
-frlmq --low-mapq-frac <frlmq> If the fraction of low mapping reads exceeds this value, the site is considered poorly mapped [default: 0.5]
Other options:
-F --flag <FLAG > exclude reads with any of the bits in FLAG set [default: 1796]
-h --help show help
```

## Examples
To run with default values for all parameters:
```
callstate -o <output.bed> <capture.bed> <bam/final.bam>
```

## Sample output
```
#chrom start end call_state raw_depth qc_depth low_mapq_depth
22 17565780 17566404 CALLABLE 309.22 305.61 0.00
22 17577753 17577787 LOW_COVERAGE 10.41 9.76 0.00
22 17577787 17577789 POOR_MAPPING_QUALITY 161.78 31.23 129.76
22 17577789 17577790 LOW_COVERAGE 20.00 19.00 0.00
22 17577790 17578173 CALLABLE 120.22 119.55 0.00
```
19 changes: 19 additions & 0 deletions callstate.nimble
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Package

version = "0.0.1"
author = "Luobin Yang"
description = "GATK3 CallableLoci Replacement"
license = "MIT"

# Dependencies

requires "hts >= 0.2.23", "nim >= 1.0.0", "docopt >= 0.6.8"

srcDir = "src"

bin = @["callstate"]
skipDirs = @["tests"]


task test, "run the tests":
exec "nim c --lineDir:on --debuginfo -r tests/test_state"
Loading

0 comments on commit 705b39e

Please sign in to comment.