brentp / mosdepth

fast BAM/CRAM depth calculation for WGS, exome, or targeted sequencing
MIT License
694 stars 100 forks source link

Wrong calculation of minimum coverage? #207

Closed xsoleacha closed 1 year ago

xsoleacha commented 1 year ago

Hi,

I am using mosdepth v0.3.3 and I'm afraid I may not understand the calculation of the minimum coverage reported in the .mosdepth.summary.txt file. I am using a bed file with a single region of interest (1508 bp long), and mosdepth reports that the minimum coverage in this region of interest is 0:

chrom length bases mean min max ID_CAR19_eF1A-WPRE 2442 21487006 8798.94 0 22234 ID_CAR19_eF1A-WPRE_region 1508 21465952 14234.72 0 22234 total 24422 1487006 8798.94 0 22234 total_region 1508 21465952 14234.72 0 22234

However, when I look at the .per-base.bed.gz flie there are no zeros in the region of interest specified in the BED file, from base 369 to 1876 (attached).

As I said, the BED file (zero-based) has a single region of interest and looks like this:

ID_CAR19_eF1A-WPRE 368 1876 CAR19 1 +

Is this an error or am I missing something?

Thanks! LV_11.sorted.per-base.bed.gz

brentp commented 1 year ago

can you share the full command that you ran? and if you can share the first part of the bam/cram file the recreates the issue, that would be very helpful.

xsoleacha commented 1 year ago

Hi Brent, this is the full command. I am computing the coverage for a lentivirus. For simplicity I have shortened the file names:

mosdepth -t 4 -b file.bed -f genome.fa -T 0,1,100,500,1000 LV11 file.cram

What part of the CRAM file do you specifically need?

Thanks!

brentp commented 1 year ago

From your report, it looks like the first 2000 bases of the cram along with the matching section from the reference would be sufficient.

xsoleacha commented 1 year ago

I can send you both the genome and the cram files in private. Should I email you a link with the two files?

brentp commented 1 year ago

Yes bpederse@gmail.com thanks

xsoleacha commented 1 year ago

I just sent you an e-mail with the files.

Thanks a lot!

Xavi.

brentp commented 1 year ago

Thank Xavi, I made a fix and a new release. https://github.com/brentp/mosdepth/releases/tag/v0.3.5

xsoleacha commented 1 year ago

Thanks for the quick fix Brent!

Best regards,

XS.


Xavier Solé Acha, Ph.D. Consultor 1 CORE Biologia Molecular Centre de Diagnòstic Biomèdic (CDB) Hospital Clínic de Barcelona Villarroel 170, Escala 5 Planta 5, 08036 Barcelona Tel: 932 275 400 ext. 1798 @.*** http://cdb.hospitalclinic.org


De: Brent Pedersen @.> Enviat el: divendres, 15 de setembre de 2023 10:24 Per a: brentp/mosdepth @.> A/c: SOLE, XAVIER (CDB) @.>; Author @.> Tema: Re: [brentp/mosdepth] Wrong calculation of minimum coverage? (Issue #207)

Thank Xavi, I made a fix and a new release. https://github.com/brentp/mosdepth/releases/tag/v0.3.5 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you [ADVERTIMENT] Aquest correu electrònic s’ha originat fora de l'organització. Verifiqui que el remitent i el contingut són segurs sophospsmartbannerend

Thank Xavi, I made a fix and a new release. https://github.com/brentp/mosdepth/releases/tag/v0.3.5https://eu-central-1.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL2JyZW50cC9tb3NkZXB0aC9yZWxlYXNlcy90YWcvdjAuMy41&i=NjE2NzJkYWNhN2IwOGQwZTY1OWVkM2Jl&t=ckFyYXl1R2lkQnlnN1lxSEpIeDg2b2tWTTl1alFCWnAzelpwa2Q2QUx5Zz0=&h=0a9a73a1692049c38e3cf0e29f787984&s=AVNPUEhUT0NFTkNSWVBUSVY6K0T94M0wPyDMzKN9BocAHrXlbSFJ3THbbw-AzQ3TEw

— Reply to this email directly, view it on GitHubhttps://eu-central-1.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL2JyZW50cC9tb3NkZXB0aC9pc3N1ZXMvMjA3I2lzc3VlY29tbWVudC0xNzIwODc4OTI2&i=NjE2NzJkYWNhN2IwOGQwZTY1OWVkM2Jl&t=ODlXL1J3N3hhOWRMelNDeGtMb0ZNblpESlNlMCtDWEhuaUdmTmNNdmVrST0=&h=0a9a73a1692049c38e3cf0e29f787984&s=AVNPUEhUT0NFTkNSWVBUSVY6K0T94M0wPyDMzKN9BocAHrXlbSFJ3THbbw-AzQ3TEw, or unsubscribehttps://eu-central-1.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL25vdGlmaWNhdGlvbnMvdW5zdWJzY3JpYmUtYXV0aC9BTklDTkJJT0lHV0M2M1VBR081RTRCM1gyUUdGVEFOQ05GU002QUFBQUFBNFVTTTI3VQ==&i=NjE2NzJkYWNhN2IwOGQwZTY1OWVkM2Jl&t=ZlN5OVlwU1FsS3pVSFF5aXp4cHVsWVZWK1NBQU9qRmdEaWdJRlArUU5YRT0=&h=0a9a73a1692049c38e3cf0e29f787984&s=AVNPUEhUT0NFTkNSWVBUSVY6K0T94M0wPyDMzKN9BocAHrXlbSFJ3THbbw-AzQ3TEw. You are receiving this because you authored the thread.Message ID: @.***>