Recent Releases of https://github.com/brentp/mosdepth

https://github.com/brentp/mosdepth - d4: write sfi index

  • write sfi index in d4 files (#243 thanks @cademirch)

- Nim
Published by brentp over 1 year ago

https://github.com/brentp/mosdepth - fix for d4

v0.3.9

  • fix d4 output (#237)
  • (thanks for @kojix2 for fixes on docopt and for nim >=2)

- Nim
Published by brentp almost 2 years ago

https://github.com/brentp/mosdepth - fix for bams/crams with *many* contigs

v0.3.8

  • mosdepth is now much faster on bams/crams with a large number of contigs (#229)

thanks @ohickl for reporting and providing a test-case.

- Nim
Published by brentp about 2 years ago

https://github.com/brentp/mosdepth - support cram v 3.1

v0.3.7

  • support CRAM v3.1. only updates htslib that binary is built with to v1.19.1 (#224 thanks @adthrasher for reporting and testing)

- Nim
Published by brentp over 2 years ago

https://github.com/brentp/mosdepth - filter on fragment length

v0.3.6

  • allow filtering on fragment length thanks @LudvigOlsen for implementing! (#214)
  • fix bug where empty chromosomes are not reported as having 0 depth (#216)

The new optional arguments: -l --min-frag-len <min-frag-len> minimum insert size. reads with a smaller insert size than this are ignored [default: -1] -u --max-frag-len <max-frag-len> maximum insert size. reads with a larger insert size than this are ignored. [default: -1]

- Nim
Published by brentp over 2 years ago

https://github.com/brentp/mosdepth - summary min_depth on regions

v0.3.5

  • fix bug with summary min for regions (#207 thanks to Xavier for supplying test-case)

- Nim
Published by brentp almost 3 years ago

https://github.com/brentp/mosdepth - v0.3.4

v0.3.4

  • bump version for build supporting gs:// urls
  • dont error on regions larger than chromosome.

- Nim
Published by brentp about 3 years ago

https://github.com/brentp/mosdepth - custom index location

v0.3.3

  • allow specifying a custom index by passing '/path/to/bam##idx##/other-path/to/index.bai'

- Nim
Published by brentp over 4 years ago

https://github.com/brentp/mosdepth - readgroups fix

when using read-groups, there was an intermittent error that would sometimes skip reads. thanks @chrisamiller for reporting and providing a test-case.

- Nim
Published by brentp almost 5 years ago

https://github.com/brentp/mosdepth - bugfix

  • fix bug with regions and d4 that would cause error even when --d4 was not used.

- Nim
Published by brentp almost 6 years ago

https://github.com/brentp/mosdepth - D4 support!

This release adds support for writing d4 files. See Aaron's poster here

d4 is awesome

d4 is a toolset and format written by Hao Hou from the Quinlan Lab.

mosdepth provides many options while calculating depth because it is slow to re-parse the per-base.bed.gz files. In many cases, it's faster to re-parse a cram file than to scan large regions from the per-base bed files. In addition, writing per-base.bed.gz has always been a bottleneck in mosdepth even after it was optimized some in last release.

This release has a static d4utils binary for linux below that will allow users to manipulate d4 files.

d4 is much faster to write:

Here are mosdepth run times on a smallish cram test-case:

  • mosdepth without per-base: 5.9s
  • mosdepth with per-base bed.gz: 24.8s
  • mosdepth with per-base d4: 7.7s

Note that using d4 output greatly mitigates the cost of writing the per-base output. With d4 mosdepth can write per-base output for a 23X CRAM in 2m15s

d4 output is much more useful.

Once the d4 file is created, it is much faster to access. d4 includes command line utilities to view, get stats, and manipulate d4 files. These eventually will replace much of the functionality in mosdepth like quantize, histogram (dist.txt), regions.bed.gz etc since the operations are so fast.

why not bigwig

I made several pull requests to Devon Ryan's excellent BigWig library to improve speed and attempt to reduce memory usage: #41, #42, #43.

I also wrote a bigwig library for nim that uses libBigWig and used that to prototype bigwig output for mosdepth. However, bigwig output dramatically increased the memory usage in mosdepth such that it was not viable.

We will show in the coming manuscript (and see the poster) that d4 is much faster to create and use than bigwig and results in smaller file sizes.

- Nim
Published by brentp almost 6 years ago

https://github.com/brentp/mosdepth - speed and region.dist.txt coverage

0.2.9

  • modifies region.dist.txt to contain the aggregate coverage of each window when -b (integer) is specified (otherwise region.dist.txt and global.disk.txt are identical with -b (integer) )
  • improve speed by ~30% when using per-base output with better int2str method (see below fore more details)

| Command | Mean [s] | Min [s] | Max [s] | Relative | |:---|---:|---:|---:|---:| | mosdepth_v028 -x $exome | 231.300 ± 8.175 | 222.166 | 242.883 | 1.73 ± 0.07 | | mosdepth_v029 -x $exome | 184.653 ± 7.520 | 176.238 | 192.636 | 1.38 ± 0.07 | | mosdepth_v028 -x -t 4 $exome | 170.924 ± 3.811 | 166.359 | 175.284 | 1.28 ± 0.04 | | mosdepth_v029 -x -t 4 $exome | 133.504 ± 3.151 | 129.220 | 138.062 | 1.00 |

- Nim
Published by brentp over 6 years ago

https://github.com/brentp/mosdepth - fix indexing

0.2.8

  • fix off-by-one error in CSI index (but not data) of output bed files (#98)

- Nim
Published by brentp over 6 years ago

https://github.com/brentp/mosdepth - htslib 1.10

this release updates mosdepth to work with htslib 1.10 and the static binary is built with htslib 1.10. this fixes several bugs opened for mosdepth.

0.2.7

  • small optimizations
  • exit with 1 on bad help #80
  • fix check on remote bam (brentp/hts-nim#48)
  • fix erroneous assert #99
  • update static binary to htslib 1.10 (this fixes other bugs reported and closed in mosdepth)

- Nim
Published by brentp over 6 years ago

https://github.com/brentp/mosdepth - median and summary file

  • this release adds a new *.mosdepth.summary.txt output file added by @danielecook. It reports some statistics for each chromosome.
  • it also adds a --median flag to be applied to the regions given in --by. The default is to use mean. This mode is recommended for more stable estimate of depth.
  • fix for #54 for quantize.

To get started, use: wget https://github.com/brentp/mosdepth/releases/download/v0.2.6/mosdepth && chmod +x ./mosdepth && ./mosdepth -h

That is the (recommended) static binary. To use one that depends on your local htslib (libhts.so), download this binary

- Nim
Published by brentp about 7 years ago

https://github.com/brentp/mosdepth - static build. pair overlap edge-cases.

0.2.5

  • remove dependency on PCRE (this makes it easier to run on many older systems)
  • don't double count fully overlapping reads (thanks to @jaudoux for the fix in #73)
  • static binary : the binary is completely static but will not allow access over S3/Http

wget https://github.com/brentp/mosdepth/releases/download/v0.2.5/mosdepth && chmod +x ./mosdepth && ./mosdepth -h

should work on all linux 64 bit systems.

- Nim
Published by brentp over 7 years ago

https://github.com/brentp/mosdepth - fast mode

this release adds a --fast-mode flag that makes mosdepth almost twice as fast. It does not look at mate overlap and it doesn't look at insertion or deletion events in the cigar -- it will still show large deletions with coverage changes and it still skips soft clipped portions of reads. This behavior is likely desirable in many cases and will result in an additional 2X speedup.

0.2.4

  • Add optional --include-flag to allow counting only reads that have some bits in the specified flag set. This will only be used rarely--e.g. to count only supplemental reads, use -F 0 --include-flag 2048.
  • Fix case when only a single argument was given to --quantize
  • add --read-groups option to allow specifying that only certain read-groups should be used in the depth calculation. (#60)
  • add --fast-mode that does not look at internal cigar operations like (I)insertions or (D)eletions, but does consider soft and hard-clips at the end of the alignment. Also does not correct for mate overlap. This makes mosdepth as much as 2X faster for CRAM and is likely the desired mode for people using the depth for CNV or general coverage values as drops in coverage due to CIGAR operations are often not of interest for coverage-based analyses.

- Nim
Published by brentp over 7 years ago

https://github.com/brentp/mosdepth - large chroms and region.dist bug.

0.2.3

  • fix bug in region.dist with chromosomes in bam header, but without any reads. thanks (@vladsaveliev for reporting)
  • support for chromosomes larger than 2^29. (thanks @kaspernie for reporting #41)

- Nim
Published by brentp about 8 years ago

https://github.com/brentp/mosdepth - dist changes!

This contains a bugfix for a very rare (but major) bug that occurs when successive chromosomes have the same length. The data from the first chrom was not cleared and then polluted the counts for the subsequent chrom. Thanks to Kate B. for reporting and providing a simple test-case.

It also changes the dist output file name(s). Before only a single dist file was created. Now, there will always be a $prefix.global.dist.txt and if --by is specified, there will also be a $prefix.region.dist.txt. Thanks to Alistair W for suggesting.

See below for more details.

0.2.2

  • fix overflow with huge intervals to --by
  • NOTE change to output file name of *.dist.txt. A file named $prefix.mosdepth.global.dist.txt will always be created and $prefix.mosdepth.region.dist.txt will be created if --by is specified. Previously, there was only a single file named $prefix.mosdepth.dist.txt which no longer exists. This allows users to, for example, use --by to see coverage of gene regions for WGS, and to see the global WGS coverage and the coverage in their genes of interest.
  • fix bug that would manifest with consecutive chromosomes of the same length. chromosomes other than the first of a given length would have incorrect values.

- Nim
Published by brentp over 8 years ago

https://github.com/brentp/mosdepth -

v0.2.1

  • allow unsorted bed as input to --by
  • allow setting precision with env var, e.g. MOSDEPTH_PRECISION=5
  • moderate performance increase.
  • build using holy-build box to better support systems with older libc.

- Nim
Published by brentp over 8 years ago

https://github.com/brentp/mosdepth - thresholds argument and CRAM

0.2.0

  • ~2X speed improvement for CRAM by not decoding unused base-qualities.
  • add new --thresholds argument. See README for usage. thresholds and quantization are highly recommended over
  • when using quantize, labels now indicate the range of depths encompassed by that region.
  • for quantize and per-base, mosdepth will output all chromosomes in the bam header, even if they have no alignments. this makes it so that mosdepth output for files aligned to the same reference have the same number and order of chromosomes and same total base coverage per-base output when possible as they are more compact and faster to output.
  • fix bug with dist output for chroms larger than 2.1 billion bases that also affected total output in some cases.

- Nim
Published by brentp over 8 years ago

https://github.com/brentp/mosdepth - mosdepth prefix

This is a breaking release. A given output will be unchanged, but the command-line usage to get it will be different. I apologize for the change in use, but not for the increase in utility. In order to expose the utility of mosdepth across more (and multiple simultaneous) uses, mosdepth now requires a prefix for outputs rather than sending it to stdout. Usage as of this release looks as below. Where previous usage was e.g.

mosdepth $bam > $output

current usage becomes:

mosdepth $output_prefix $bam

This is explained in more detail in the help:

``` mosdepth 0.1.9

Usage: mosdepth [options]

Arguments:

outputs: {prefix}.mosdepth.dist.txt {prefix}.per-base.bed.gz (unless -n/--no-per-base is specified) {prefix}.regions.bed.gz (if --by is specified) {prefix}.quantized.bed.gz (if --quantize is specified)

the alignment file for which to calculate depth.

Common Options:

-t --threads number of BAM decompression threads [default: 0] -c --chrom chromosome to restrict depth calculation. -b --by optional BED file or (integer) window-sizes. -n --no-per-base dont output per-base depth (skipping this output will speed execution). -f --fasta fasta file for use with CRAM files.

Other options:

-F --flag exclude reads with any of the bits in FLAG set [default: 1796] -q --quantize write quantized output, see docs for description. -Q --mapq mapping quality threshold [default: 0] -h --help show help ```

- Nim
Published by brentp almost 9 years ago

https://github.com/brentp/mosdepth - better support for beds with non-region lines

  • handle track lines
  • report message on bad bed lines (and skip).

NOTE that the default binary below requires a fairly modern version of GLIBC. If that fails for you with an error like: /lib64/libc.so.6: versionGLIBC_2.14' not found`

then use the mosdepth_old_glibc binary.

- Nim
Published by brentp almost 9 years ago

https://github.com/brentp/mosdepth - remove extra tab

when using --by, there was an extra tab between the chrom and start columns. This fixes that.

- Nim
Published by brentp almost 9 years ago

https://github.com/brentp/mosdepth - bugfixes related to `distribution` and large window sizes

  • fixed when a window-size larger than the chromosome length was specified, windows would be output until overflow.
  • limit size of dist file by only reporting novel values
  • cap memory use even for very deep coverage.

thanks to @tomsasani for reporting several issues.

- Nim
Published by brentp almost 9 years ago

https://github.com/brentp/mosdepth - MT

fix off-by-1 error that affected MT chromosome.

- Nim
Published by brentp almost 9 years ago

https://github.com/brentp/mosdepth - options

see: https://github.com/brentp/mosdepth/issues/3#issuecomment-325764806

  • new -F flag allows setting exclude flag
  • if --by argument is a bed file with >= 4 columns, the 4th column is transferred to the output.

- Nim
Published by brentp almost 9 years ago

https://github.com/brentp/mosdepth - usability improvements

linux binary below.

- Nim
Published by brentp almost 9 years ago

https://github.com/brentp/mosdepth - mosdepth inital release.

the binary below is for linux.

- Nim
Published by brentp almost 9 years ago