生信工具推荐之(1) bamcov

bamcov:一个基于命令行的可视化bam文件深度的工具。

软件采用C语言编写,下载附带测试数据,参数较少,使用方便。

github :

https://github.com/fbreitwieser/bamcov

install :

git clone --recurse-submodules https://github.com/fbreitwieser/bamcov
cd bamcov
make
make test

help :

Usage: bamcov [options] in1.bam [in2.bam [...]]

Input options:
  -l, --min-read-len INT  ignore reads shorter than INT bp [0]
  -q, --min-MQ INT        base quality threshold [0]
  -Q, --min-BQ INT        mapping quality threshold [0]
  --rf <int|str>          required flags: skip reads with mask bits unset []
  --ff <int|str>          filter flags: skip reads with mask bits set 
                                      [UNMAP,SECONDARY,QCFAIL,DUP]
Output options:
  -m, --histogram         show histogram instead of tabular output
  -o, --output FILE       write output to FILE [stdout]
  -H, --no-header         don't print a header in tabular mode
  -U, --full-utf          full UTF8 mode for histogram for finer resolution
  -w, --n-bins INT        number of bins in histogram. If 0, use terminal width [50]
  -r, --region REG        show specified region. Format: chr:start-end. 
  -h, --help              help (this page)

See manpage for additional details. Tabular format columns::
  rname       Reference name / chromosome
  startpos    Start position
  endpos      End position (or sequence length)
  numreads    Number reads aligned to the region (after filtering)
  covbases    Number of covered bases with depth >= 1
  coverage    Proportion of covered bases [0..1]
  meandepth   Mean depth of coverage
  meanbaseq   Mean baseQ in covered region
  meanmapq    Mean mapQ of selected reads

usage :


  • 格式化输出bam文件统计信息, -H 参数不输出头部信息
v./bamcov  xx.bam

#rname	startpos	endpos	numreads	covbases	coverage	meandepth	meanbaseq	meanmapq
NC_000962.3	1	4411532	69754	3078	0.0697717	2.17499	35.6	60


* 获得bam文件全基因组范围内深度分布图
./bamcov -m test.bam

image

  • 获得指定区域深度信息
./bamcov -mr NW_002477246.1:1000-200000 test.bam

NW_002477246.1 (2.01Mbp)
>  22.27% │   █                                             ▄│ Number of reads: 354
>  19.80% │   █                                       ▄     █│     (3 filtered)
>  17.32% │ ▄ █                               ▄       █     █│ Covered bases:   21.0Kbp
>  14.85% │ █ █   █  ▄      █            █    █       █▄  █ █│ Percent covered: 10.56%
>  12.37% │ █ █ ▄██  █     ▄█▄       ▄ █ █  █ █       ██  █ █│ Mean coverage:   0.133x
>   9.90% │ █ █████  █     ███▄  █  ▄█ █ █▄ █▄█    ▄  ██▄ █ █│ Mean baseQ:      34.5
>   7.42% │ █ █████  ██    ████  █ ███ █ ██ ███ █▄ █▄ █████ █│ Mean mapQ:       43.2
>   4.95% │██ █████  ██  ███████ █ ███▄█ █████████ ██ █████ █│ 
>   2.47% │████████▄▄██▄ ███████▄█ █████▄█████████ ██ █████ █│ Histo bin width: 4.0Kbp
>   0.00% │█████████████ █████████ ███████████████ ██ █████ █│ Histo max bin:   24.749%
         1.0K     40.8K     80.6K     120.4K    160.2K     200.0K 

image

posted @ 2022-10-10 16:51  天使不设防  阅读(203)  评论(0编辑  收藏  举报