{"action":"created","issue":{"url":"https://api.github.com/repos/biopython/biopython/issues/491","labels_url":"https://api.github.com/repos/biopython/biopython/issues/491/labels{/name}","comments_url":"https://api.github.com/repos/biopython/biopython/issues/491/comments","events_url":"https://api.github.com/repos/biopython/biopython/issues/491/events","html_url":"https://github.com/biopython/biopython/issues/491","id":63255149,"number":491,"title":"ZeroDivisionError","user":{"login":"quiqua","id":823090,"avatar_url":"https://avatars.githubusercontent.com/u/823090?v=3","gravatar_id":"","url":"https://api.github.com/users/quiqua","html_url":"https://github.com/quiqua","followers_url":"https://api.github.com/users/quiqua/followers","following_url":"https://api.github.com/users/quiqua/following{/other_user}","gists_url":"https://api.github.com/users/quiqua/gists{/gist_id}","starred_url":"https://api.github.com/users/quiqua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quiqua/subscriptions","organizations_url":"https://api.github.com/users/quiqua/orgs","repos_url":"https://api.github.com/users/quiqua/repos","events_url":"https://api.github.com/users/quiqua/events{/privacy}","received_events_url":"https://api.github.com/users/quiqua/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-03-20T16:05:20Z","updated_at":"2015-05-25T14:26:08Z","closed_at":null,"body":"I m loading ~ 150 aligned sequences and want to generate a Phylotree,\r\nyet at some point, a `ZeroDivisionError` is raised.\r\n\r\nThe stacktrace:\r\n\r\n```bash\r\nTraceback (most recent call last):\r\n  File \"/Users/marcel/dev/prototype/wrapper.py\", line 56, in tree\r\n    self._tree = DistanceTreeConstructor().nj(self.distance_matrix)\r\n  File \"/Users/marcel/dev/prototype/wrapper.py\", line 49, in distance_matrix\r\n    self._distance_matrix = DistanceCalculator('blosum62').get_distance(self.msa)\r\n  File \"/Users/marcel/dev/venv/prototype/lib/python2.7/site-packages/Bio/Phylo/TreeConstruction.py\", line 465, in get_distance\r\n    dm[seq1.id, seq2.id] = self._pairwise(seq1, seq2)\r\n  File \"/Users/marcel/dev/venv/prototype/lib/python2.7/site-packages/Bio/Phylo/TreeConstruction.py\", line 448, in _pairwise\r\n    return 1 - (score * 1.0 / max_score)\r\nZeroDivisionError: float division by zero\r\n```\r\n\r\nThe sequences which seem to fail are the following:\r\nseq1:\r\n\r\n```\r\n-------------------------------------------------------GCTTGCTGCTTGGCTGACGAGTGGCGGACGGGTGAGTAATGT-CTGGGAAACTG-----CCTGATGGAGGGGGATAAC-TACTGGAAACGGT-AGCTAATA--CCGCATAA----TGT----CGCAAGA--CCAAAGAGGGGGAC--CTTCGGGCCTCTTGCCAT-CGGATGTGCCC-AGATGGGATTAGC-TAGTTGGTGGGGT---AACGGCTC---ACCTAGGCGACG--ATCCCTAGCTGGTCTGAGA-GGATGAC--CAGCCACA--CTGGAACTGAGACAC---GGTCCAGACTCCTACGGGAGGCAGCAG-TGGGGAATAT--------TGCACAA--TGGGCG---CAAGCCTG-ATGCAGC-------CATGCCGCGTGTATGAA-GAAGGCCTTCGGGTTGTAAAGTACTTTCAGCGGGGAGGAAGGG-AGTAAAGTT-AATACCTTT----GCTCATTGACGTTACCCGCAGAAGAAGCACC-GGCTAAC-TCCGTGCCAGCAGCCGCGGTAATACGG-A-GGGTGC-AAGCGTTAATCGG-AATTACT-GGGCGTAAAGCGC-ACGC-AGGC-GGT--TTGTT-AAGTC-AGATGTGAAATC-----CCCG-GGCT----CAA-CCTGGGAACTGCATCTGATAC--TGG-CAA--------GCTTGAGTCT---CGTAGAGGGGGGTAGAA-TTCCAGGTGT-AGCGGTGAAATGCGTAGAGATCTGG-AGGAATA---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\r\n```\r\n\r\nseq2:\r\n```\r\n------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CCGGAGCTAACGCGTT-AAGTCGACCGCC-TGGG-----------GAGTACGGCCGCAAGGTTAAAACTCAAATGAATTGACG-----GGGGCCCGCACAAGCGGT-GGAGCA-TGTGGTTTAATTCGATGCAACGCGAAGAACCTTA-CCTACTC-TTGACATCCAGA-GAACTTAGCAGAG-ATG--CTATGGTGCCTTCGGG-AACTCTGAGACA-GGTGCT-GCAT-GGCTGTCGTCAGCTCGTGTTGTG-AAATGTT-GGGTTAAGTCCCGCAACGA-GCGC-AACCCTTATCCTTTGTTGCCAGCG-GTTCGGTCGGGAACTCAAAGGAGACTGCCAGTGATAAACTGGAGGAAGGTGGGGATGACGTCAAGTCATCATGGCCC-TTACGAGTAGGGCTACACACGTGCTACAATGGC-ATATACAAAGAGAAGC-GACCTCGCGAGAGCAA-GCGGACCTCATAAAGTAT-GTCGTAGTCCGGATCGGAGTCTGCAACTCG-ACTCCGTGAAGTCGGAAT-CGCTAGTAATCGTGGATCA-GAATGCCA-----CGGTGAATACGTTCCCGGGCCTTGTACACACCGCCCGTCACACCATGGGAGTGGGTTGCAAAAGAA------------------------------------------------------------------\r\n```"},"comment":{"url":"https://api.github.com/repos/biopython/biopython/issues/comments/105243034","html_url":"https://github.com/biopython/biopython/issues/491#issuecomment-105243034","issue_url":"https://api.github.com/repos/biopython/biopython/issues/491","id":105243034,"user":{"login":"peterjc","id":63959,"avatar_url":"https://avatars.githubusercontent.com/u/63959?v=3","gravatar_id":"","url":"https://api.github.com/users/peterjc","html_url":"https://github.com/peterjc","followers_url":"https://api.github.com/users/peterjc/followers","following_url":"https://api.github.com/users/peterjc/following{/other_user}","gists_url":"https://api.github.com/users/peterjc/gists{/gist_id}","starred_url":"https://api.github.com/users/peterjc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterjc/subscriptions","organizations_url":"https://api.github.com/users/peterjc/orgs","repos_url":"https://api.github.com/users/peterjc/repos","events_url":"https://api.github.com/users/peterjc/events{/privacy}","received_events_url":"https://api.github.com/users/peterjc/received_events","type":"User","site_admin":false},"created_at":"2015-05-25T14:26:07Z","updated_at":"2015-05-25T14:26:07Z","body":"Yes, please @kianho - another set of eyes on this code would be great."}}