{"action":"created","issue":{"url":"https://api.github.com/repos/pysam-developers/pysam/issues/738","repository_url":"https://api.github.com/repos/pysam-developers/pysam","labels_url":"https://api.github.com/repos/pysam-developers/pysam/issues/738/labels{/name}","comments_url":"https://api.github.com/repos/pysam-developers/pysam/issues/738/comments","events_url":"https://api.github.com/repos/pysam-developers/pysam/issues/738/events","html_url":"https://github.com/pysam-developers/pysam/issues/738","id":376197505,"node_id":"MDU6SXNzdWUzNzYxOTc1MDU=","number":738,"title":"FastxFile truncates gzip compressed fastq files","user":{"login":"davidtsao","id":28017271,"node_id":"MDQ6VXNlcjI4MDE3Mjcx","avatar_url":"https://avatars1.githubusercontent.com/u/28017271?v=4","gravatar_id":"","url":"https://api.github.com/users/davidtsao","html_url":"https://github.com/davidtsao","followers_url":"https://api.github.com/users/davidtsao/followers","following_url":"https://api.github.com/users/davidtsao/following{/other_user}","gists_url":"https://api.github.com/users/davidtsao/gists{/gist_id}","starred_url":"https://api.github.com/users/davidtsao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidtsao/subscriptions","organizations_url":"https://api.github.com/users/davidtsao/orgs","repos_url":"https://api.github.com/users/davidtsao/repos","events_url":"https://api.github.com/users/davidtsao/events{/privacy}","received_events_url":"https://api.github.com/users/davidtsao/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-10-31T23:25:35Z","updated_at":"2019-04-30T04:10:11Z","closed_at":null,"author_association":"NONE","body":"I've noticed that using pysam.FastxFile to iterate over a bgzip'd fastq file only returns a subset of fastq records. The expected result is that all records are iterated over. \r\n\r\nExample:\r\n\r\nexample.fastq.gz contains 1,009,470 reads. \r\n\r\nWhen I iterate over the compressed fastq file using pysam, I only get 26,107 reads instead of the expected 1,009,470 reads. \r\n\r\n```\r\nIn [1]: import pysam\r\n\r\nIn [2]: len([x for x in pysam.FastxFile('example.fastq.gz')])\r\nOut[2]: 26107\r\n```\r\n\r\nI've traced the issue back to bgzip not decompressing all the contents of the fastq file.\r\n\r\nFor example, I get the expected ~4M lines using gunzip to decompress:\r\n```\r\n$ bgzip -c -d example.fastq.gz | wc -l \r\n 4037880\r\n```\r\n\r\nBut using bgzip to decompress only returns ~104k lines, which is the same result obtained from pysam (26107 * 4 = 104428):\r\n\r\n```\r\n$ bgzip -c -d example.fastq.gz | wc -l\r\n  104428\r\n```\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/pysam-developers/pysam/issues/comments/487816119","html_url":"https://github.com/pysam-developers/pysam/issues/738#issuecomment-487816119","issue_url":"https://api.github.com/repos/pysam-developers/pysam/issues/738","id":487816119,"node_id":"MDEyOklzc3VlQ29tbWVudDQ4NzgxNjExOQ==","user":{"login":"cgjosephlee","id":12654602,"node_id":"MDQ6VXNlcjEyNjU0NjAy","avatar_url":"https://avatars2.githubusercontent.com/u/12654602?v=4","gravatar_id":"","url":"https://api.github.com/users/cgjosephlee","html_url":"https://github.com/cgjosephlee","followers_url":"https://api.github.com/users/cgjosephlee/followers","following_url":"https://api.github.com/users/cgjosephlee/following{/other_user}","gists_url":"https://api.github.com/users/cgjosephlee/gists{/gist_id}","starred_url":"https://api.github.com/users/cgjosephlee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgjosephlee/subscriptions","organizations_url":"https://api.github.com/users/cgjosephlee/orgs","repos_url":"https://api.github.com/users/cgjosephlee/repos","events_url":"https://api.github.com/users/cgjosephlee/events{/privacy}","received_events_url":"https://api.github.com/users/cgjosephlee/received_events","type":"User","site_admin":false},"created_at":"2019-04-30T04:10:11Z","updated_at":"2019-04-30T04:10:11Z","author_association":"NONE","body":"Any flow-ups of this issue?"}}
{"actor":{"display_login":"cgjosephlee"}}