{"action":"opened","issue":{"url":"https://api.github.com/repos/pysam-developers/pysam/issues/259","repository_url":"https://api.github.com/repos/pysam-developers/pysam","labels_url":"https://api.github.com/repos/pysam-developers/pysam/issues/259/labels{/name}","comments_url":"https://api.github.com/repos/pysam-developers/pysam/issues/259/comments","events_url":"https://api.github.com/repos/pysam-developers/pysam/issues/259/events","html_url":"https://github.com/pysam-developers/pysam/issues/259","id":143247870,"number":259,"title":"Error loading empty VCFs","user":{"login":"brendanofallon","id":425575,"avatar_url":"https://avatars.githubusercontent.com/u/425575?v=3","gravatar_id":"","url":"https://api.github.com/users/brendanofallon","html_url":"https://github.com/brendanofallon","followers_url":"https://api.github.com/users/brendanofallon/followers","following_url":"https://api.github.com/users/brendanofallon/following{/other_user}","gists_url":"https://api.github.com/users/brendanofallon/gists{/gist_id}","starred_url":"https://api.github.com/users/brendanofallon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendanofallon/subscriptions","organizations_url":"https://api.github.com/users/brendanofallon/orgs","repos_url":"https://api.github.com/users/brendanofallon/repos","events_url":"https://api.github.com/users/brendanofallon/events{/privacy}","received_events_url":"https://api.github.com/users/brendanofallon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-24T13:38:31Z","updated_at":"2016-03-24T13:38:31Z","closed_at":null,"body":"Looks like there's an issue when attempting to create a VariantFile for a VCF with no records:\r\n\r\n    >>> import pysam\r\n    >>> print pysam.__version__\r\n    0.9.0\r\n    >>> v = pysam.VariantFile(\"empty.vcf.gz\")\r\n    Traceback (most recent call last):\r\n      File \"<stdin>\", line 1, in <module>\r\n      File \"pysam/cbcf.pyx\", line 3273, in pysam.cbcf.VariantFile.__init__ (pysam/cbcf.c:48009)\r\n      File \"pysam/cbcf.pyx\", line 3524, in pysam.cbcf.VariantFile.open (pysam/cbcf.c:51665)\r\n      File \"pysam/cbcf.pyx\", line 3022, in pysam.cbcf.makeTabixIndex (pysam/cbcf.c:45377)\r\n      File \"pysam/cbcf.pyx\", line 3002, in pysam.cbcf.TabixIndex.__init__ (pysam/cbcf.c:44918)\r\n    ValueError: Cannot retrieve reference sequence names\r\n\r\n'empty.vcf.gz' contains a valid header, etc., but no records. That should be OK, right? "}}