{"action":"created","issue":{"url":"https://api.github.com/repos/arq5x/bedtools2/issues/71","labels_url":"https://api.github.com/repos/arq5x/bedtools2/issues/71/labels{/name}","comments_url":"https://api.github.com/repos/arq5x/bedtools2/issues/71/comments","events_url":"https://api.github.com/repos/arq5x/bedtools2/issues/71/events","html_url":"https://github.com/arq5x/bedtools2/issues/71","id":32632465,"number":71,"title":"Question: bedtools genomecov -d output from bam files does not include chromosomes with not coverage","user":{"login":"bchapm5","id":5454129,"avatar_url":"https://avatars.githubusercontent.com/u/5454129?v=3","gravatar_id":"","url":"https://api.github.com/users/bchapm5","html_url":"https://github.com/bchapm5","followers_url":"https://api.github.com/users/bchapm5/followers","following_url":"https://api.github.com/users/bchapm5/following{/other_user}","gists_url":"https://api.github.com/users/bchapm5/gists{/gist_id}","starred_url":"https://api.github.com/users/bchapm5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bchapm5/subscriptions","organizations_url":"https://api.github.com/users/bchapm5/orgs","repos_url":"https://api.github.com/users/bchapm5/repos","events_url":"https://api.github.com/users/bchapm5/events{/privacy}","received_events_url":"https://api.github.com/users/bchapm5/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-05-01T17:50:02Z","updated_at":"2015-03-09T16:29:45Z","closed_at":null,"body":"after creating a BAM file by aligning RNA sequence to a small file of coding sequences bedtools genomecov -d did not report sequences with zero coverage over the entire length.\r\n\r\nIs this a feature or a bug ?\r\n\r\n$samtools idxstats ARC10_.unique.bam > ARC10_.unique.idxstats # get output of idxstats\r\n$cat ARC10_.unique.idxstats | grep -v \"^\\*\" | wc -l # count the number of entries in idxstats\r\n233\r\n$cat ARC10_.unique.idxstats | cut -f3 | grep -v '^0' | wc -l # count the number of entries in idx stats without zero coverage\r\n158\r\n$./bedtools --versionbedtools v2.19.1-41-g656fd84 # show we are using current version of bedtoos\r\n$ ./bedtools genomecov -dz -ibam ARC10_.unique.bam > ARC10_.unique.depth # output all coverage of bedtools\r\n$ cat ARC10_.unique.depth | cut -f1 | uniq | wc -l # count the number of different sequences in bedtools\r\n158\r\n\r\nI hope to get small example fasta and SAM file together to better demonstrate I hope the above is understandable"},"comment":{"url":"https://api.github.com/repos/arq5x/bedtools2/issues/comments/77888879","html_url":"https://github.com/arq5x/bedtools2/issues/71#issuecomment-77888879","issue_url":"https://api.github.com/repos/arq5x/bedtools2/issues/71","id":77888879,"user":{"login":"marcelm","id":724864,"avatar_url":"https://avatars.githubusercontent.com/u/724864?v=3","gravatar_id":"","url":"https://api.github.com/users/marcelm","html_url":"https://github.com/marcelm","followers_url":"https://api.github.com/users/marcelm/followers","following_url":"https://api.github.com/users/marcelm/following{/other_user}","gists_url":"https://api.github.com/users/marcelm/gists{/gist_id}","starred_url":"https://api.github.com/users/marcelm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcelm/subscriptions","organizations_url":"https://api.github.com/users/marcelm/orgs","repos_url":"https://api.github.com/users/marcelm/repos","events_url":"https://api.github.com/users/marcelm/events{/privacy}","received_events_url":"https://api.github.com/users/marcelm/received_events","type":"User","site_admin":false},"created_at":"2015-03-09T16:29:45Z","updated_at":"2015-03-09T16:29:45Z","body":"I’m just seeing the same problem in bedtools 2.21.0. To reproduce it:\r\n```\r\necho -e '@SQ\\tSN:ref1\\tLN:10' > small.sam\r\necho -e '@SQ\\tSN:ref2\\tLN:5' >> small.sam\r\necho -e 'r1\\t0\\tref2\\t1\\t1\\t3M\\t*\\t0\\t0\\tACG\\tFFF' >> small.sam\r\nsamtools view -bS small.sam > small.bam\r\necho -e 'ref1\\t10\\nref2\\t5' > genome.txt\r\nbedtools genomecov -d -ibam small.bam -g genome.txt\r\n```\r\nResult:\r\n```\r\nref2    1       1\r\nref2    2       1\r\nref2    3       1\r\nref2    4       0\r\nref2    5       0\r\n```\r\nThat is, zero coverage on ref1 is not reported although it is listed in `genome.txt`. This also happens with `-bga`.\r\n\r\nI think this is a bug and not a feature: If I use `-d` or `-bga` to get zero coverage regions, then I want *all* those regions. At least that’s what I had expected to get reading the documentation. Would be great to see this fixed!"}}