[关闭]
@lakesea 2022-03-08T01:45:18.000000Z 字数 3257 阅读 237

Methods to call gene PAVs

pipelines


In this pipeline, I will describe and introduce some based steps to call gene PAVs.

Definition

Methods

Mosdepth

gff to bed and grep those regions with gene feature

  1. module load bedops
  2. gff2bed <MH63_chr_v2.gene.gff >MH63_chr_v2.gene.bed

Running Mosdepth

  1. mosdepth -n -t 6 --thresholds 1 -b MH63_chr_v2.gene.bed B009_test B009.sorted.bam
  2. ###help
  3. -n --no-per-base dont output per-base depth. skipping this output will speed execution
  4. -t --threads <threads> number of BAM decompression threads [default: 0]
  5. -b --by <bed|window> optional BED file or (integer) window-sizes.
  6. other help:
  7. -F --flag <FLAG> exclude reads with any of the bits in FLAG set [default: 1796]
  8. #Sam file flag: 1796
  9. #read unmapped (0x4)
  10. #not primary alignment (0x100)
  11. #read fails platform/vendor quality checks (0x200)
  12. #read is PCR or optical duplicate (0x400)
  13. -q --quantize <segments> write quantized output see docs for description.
  14. -Q --mapq <mapq> mapping quality threshold [default: 0]
  15. -T --thresholds <thresholds> for each interval in --by, write number of bases covered by at
  16. least threshold bases. Specify multiple integer values separated
  17. by ','.
  18. -h --help show help

Look at the results

  1. zcat B009_test.regions.bed.gz |less
  2. Chr01 262169 265985 MH01g0015200 20.14
  3. Chr01 266366 266897 MH01g0015300 0.00
  4. Chr01 272359 275777 MH01g0015400 16.74
  5. Chr01 274349 276712 MH01g0015500 20.18
  6. Chr01 280060 281122 MH01g0015600 20.07
  7. Chr01 284353 284998 MH01g0015700 18.16
  8. Chr01 285481 286360 MH01g0015800 34.02
  9. Chr01 288457 324059 MH01g0015900 18.84

notes:

  1. zcat IRIS_313-8392_gene_pav.regions.bed.gz |awk '{if ($5>= 1) print $6=1; else if ($5 <1) print $6=0;}'
  2. for i in `cat selected.lines.list`;do zcat ${i}.remark.bam_pav.thresholds.bed.gz |grep -v "#"|awk '{$6 = $5/($3 - $2)}1'| awk '{if ($6>= 0.6) print $7=1; else if ($6 <0.6) print $7=0;}' >> ${i}_pav_dec.txt;done

bamcov

install

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

Running

  1. $ ./bamcov/bamcov -m B009.sorted.bam
  2. Chr01 (41.19Mbp)
  3. > 88.72% ▄████▄▄██████ ██▄██ █▄▄████████████████████▄▄│ Number of reads: 8894694
  4. > 78.87% │███████████████ █████ ▄█████████████████████████│ (165808 filtered)
  5. > 69.01% │███████████████ ██████████████████████████████████│ Covered bases: 39.10Mbp
  6. > 59.15% │███████████████▄██████████████████████████████████│ Percent covered: 94.94%
  7. > 49.29% │██████████████████████████████████████████████████│ Average coverage: 17.7x
  8. > 39.43% │██████████████████████████████████████████████████│ Average baseQ: 36
  9. > 29.57% │██████████████████████████████████████████████████│ Average mapQ: 49.1
  10. > 19.72% │██████████████████████████████████████████████████│
  11. > 9.86% │██████████████████████████████████████████████████│ Histo bin width: 823.7Kbp
  12. > 0.00% │██████████████████████████████████████████████████│ Histo max bin: 98.582%
  13. 1 8.24M 16.47M 24.71M 32.95M 41.19M
  14. $ ./bamcov/bamcov -mr Chr01:69650-72886 B009.sorted.bam
  15. Chr01 (41.19Mbp)
  16. > 90.00% ███ ██ Number of reads: 34
  17. > 80.00% ████ ██
  18. > 70.00% █████ ██ Covered bases: 1.1Kbp
  19. > 60.00% █████ ██▄ Percent covered: 34.72%
  20. > 50.00% █████ ███ █▄ ▄█ █▄ █▄│ Average coverage: 0.819x
  21. > 40.00% █████ ███ ██ ██ ██ ██│ Average baseQ: 34.5
  22. > 30.00% │█ █████ ███ ██ ██ ██ ██│ Average mapQ: 3.12
  23. > 20.00% │█ █████ ▄███ ██ ██ ██▄██│
  24. > 10.00% │█ █████ ████ ██ ▄██ ██ ██ █████│ Histo bin width: 64bp
  25. > 0.00% │█ █████ ████ ██ ███ ███ ██▄▄█████│ Histo max bin: 100%
  26. 69.7K 70.3K 70.9K 71.6K 72.2K 72.9K

bedtools genomecov

  1. bedtools genomecov -ibam B009.sorted.bam -bg > bedtools_genomcov.out
  2. ###results
  3. Chr01 99 100 3
  4. Chr01 100 104 17
  5. Chr01 104 106 18
  6. Chr01 106 107 19
  7. Chr01 107 108 20
  8. Chr01 108 109 21
  9. Chr01 109 110 22
  10. Chr01 110 112 23
  11. Chr01 112 120 24
  12. Chr01 120 124 25
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注