{"action":"created","issue":{"url":"https://api.github.com/repos/mdshw5/pyfaidx/issues/129","repository_url":"https://api.github.com/repos/mdshw5/pyfaidx","labels_url":"https://api.github.com/repos/mdshw5/pyfaidx/issues/129/labels{/name}","comments_url":"https://api.github.com/repos/mdshw5/pyfaidx/issues/129/comments","events_url":"https://api.github.com/repos/mdshw5/pyfaidx/issues/129/events","html_url":"https://github.com/mdshw5/pyfaidx/issues/129","id":281773004,"number":129,"title":"FastaVariant example not working","user":{"login":"daquang","id":3432272,"avatar_url":"https://avatars1.githubusercontent.com/u/3432272?v=4","gravatar_id":"","url":"https://api.github.com/users/daquang","html_url":"https://github.com/daquang","followers_url":"https://api.github.com/users/daquang/followers","following_url":"https://api.github.com/users/daquang/following{/other_user}","gists_url":"https://api.github.com/users/daquang/gists{/gist_id}","starred_url":"https://api.github.com/users/daquang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daquang/subscriptions","organizations_url":"https://api.github.com/users/daquang/orgs","repos_url":"https://api.github.com/users/daquang/repos","events_url":"https://api.github.com/users/daquang/events{/privacy}","received_events_url":"https://api.github.com/users/daquang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-13T14:41:56Z","updated_at":"2017-12-13T21:20:04Z","closed_at":null,"author_association":"NONE","body":"I'm trying to run the FastaVariant example in the README, but I'm getting the following error:\r\n\r\n```\r\nIn [1]: from pyfaidx import FastaVariant\r\n\r\nIn [2]: consensus = FastaVariant('tests/data/chr22.fasta', 'tests/data/chr22.vcf\r\n   ...: .gz', het=True, hom=True)\r\n/home/daquang/Software/pyfaidx/pyfaidx/__init__.py:959: RuntimeWarning: Using sample NA06984 genotypes.\r\n  warnings.warn(\"Using sample {0} genotypes.\".format(self.sample), RuntimeWarning)\r\n\r\nIn [3]: consensus['22'].variant_sites\r\n---------------------------------------------------------------------------\r\nKeyError                                  Traceback (most recent call last)\r\n~/Software/pyfaidx/pyfaidx/__init__.py in __getitem__(self, rname)\r\n    868         try:\r\n--> 869             return self.records[rname]\r\n    870         except KeyError:\r\n\r\nKeyError: '22'\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nKeyError                                  Traceback (most recent call last)\r\n<ipython-input-3-0c3cd66e8fab> in <module>()\r\n----> 1 consensus['22'].variant_sites\r\n\r\n~/Software/pyfaidx/pyfaidx/__init__.py in __getitem__(self, rname)\r\n    869             return self.records[rname]\r\n    870         except KeyError:\r\n--> 871             raise KeyError(\"{0} not in {1}.\".format(rname, self.filename))\r\n    872 \r\n    873     def __repr__(self):\r\n\r\nKeyError: '22 not in tests/data/chr22.fasta.'\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/mdshw5/pyfaidx/issues/comments/351528331","html_url":"https://github.com/mdshw5/pyfaidx/issues/129#issuecomment-351528331","issue_url":"https://api.github.com/repos/mdshw5/pyfaidx/issues/129","id":351528331,"user":{"login":"mdshw5","id":819554,"avatar_url":"https://avatars3.githubusercontent.com/u/819554?v=4","gravatar_id":"","url":"https://api.github.com/users/mdshw5","html_url":"https://github.com/mdshw5","followers_url":"https://api.github.com/users/mdshw5/followers","following_url":"https://api.github.com/users/mdshw5/following{/other_user}","gists_url":"https://api.github.com/users/mdshw5/gists{/gist_id}","starred_url":"https://api.github.com/users/mdshw5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdshw5/subscriptions","organizations_url":"https://api.github.com/users/mdshw5/orgs","repos_url":"https://api.github.com/users/mdshw5/repos","events_url":"https://api.github.com/users/mdshw5/events{/privacy}","received_events_url":"https://api.github.com/users/mdshw5/received_events","type":"User","site_admin":false},"created_at":"2017-12-13T21:20:04Z","updated_at":"2017-12-13T21:20:04Z","author_association":"OWNER","body":"Did you first run `tests/data/download_gene_fasta.py`? If so could you please inspect the file to make sure it's not empty? I have a test for this, and it's passing currently so I suspect it's an issue with your chr22.fasta file.\r\n\r\nhttps://github.com/mdshw5/pyfaidx/blob/7b4d8d7aceadaa1fde05846e854e6eccdba38b77/tests/test_FastaVariant.py#L21-L28"}}
{"actor":{"display_login":"mdshw5"}}