We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
lcc.lcc_mult returns extra zero value
### Setup

I am reporting a problem with Biopython version, Python version, and operating
system as follows:

```python
import sys; print(sys.version)
import platform; print(platform.python_implementation()); print(platform.platform())
import Bio; print(Bio.__version__)
```

[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
CPython
Linux-3.10.0-957.1.3.el7.x86_64-x86_64-with-centos-7.6.1810-Core
1.78

### Expected behaviour

[1.9056390622295662]

### Actual behaviour

[0, 1.9056390622295662]

### Steps to reproduce

lcc.lcc_mult('ACGATAGC', 8)

In addition according the [article](https://www.researchgate.net/publication/229964618_Sequence_Complexity_and_Composition), the calculation of LCC uses log base 4 but the implementation uses log base 2.  That is why for the example sequence 5 in Table 1 the value shown is half the function value.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `Bio/SeqUtils/lcc.py`
Content:
```
1 # Copyright 2003, 2007 by Sebastian Bassi. sbassi@genesdigitales.com
2 # All rights reserved.
3 #
4 # This file is part of the Biopython distribution and governed by your
5 # choice of the "Biopython License Agreement" or the "BSD 3-Clause License".
6 # Please see the LICENSE file that should have been included as part of this
7 # package.
8 """Local Composition Complexity."""
9 
10 import math
11 
12 
13 def lcc_mult(seq, wsize):
14     """Calculate Local Composition Complexity (LCC) values over sliding window.
15 
16     Returns a list of floats, the LCC values for a sliding window over
17     the sequence.
18 
19     seq - an unambiguous DNA sequence (a string or Seq object)
20     wsize - window size, integer
21 
22     The result is the same as applying lcc_simp multiple times, but this
23     version is optimized for speed. The optimization works by using the
24     value of previous window as a base to compute the next one.
25     """
26     l2 = math.log(2)
27     tamseq = len(seq)
28     upper = str(seq).upper()
29     compone = [0]
30     lccsal = [0]
31     for i in range(wsize):
32         compone.append(
33             ((i + 1) / float(wsize)) * ((math.log((i + 1) / float(wsize))) / l2)
34         )
35     window = seq[0:wsize]
36     cant_a = window.count("A")
37     cant_c = window.count("C")
38     cant_t = window.count("T")
39     cant_g = window.count("G")
40     term_a = compone[cant_a]
41     term_c = compone[cant_c]
42     term_t = compone[cant_t]
43     term_g = compone[cant_g]
44     lccsal.append(-(term_a + term_c + term_t + term_g))
45     tail = seq[0]
46     for x in range(tamseq - wsize):
47         window = upper[x + 1 : wsize + x + 1]
48         if tail == window[-1]:
49             lccsal.append(lccsal[-1])
50         elif tail == "A":
51             cant_a -= 1
52             if window.endswith("C"):
53                 cant_c += 1
54                 term_a = compone[cant_a]
55                 term_c = compone[cant_c]
56                 lccsal.append(-(term_a + term_c + term_t + term_g))
57             elif window.endswith("T"):
58                 cant_t += 1
59                 term_a = compone[cant_a]
60                 term_t = compone[cant_t]
61                 lccsal.append(-(term_a + term_c + term_t + term_g))
62             elif window.endswith("G"):
63                 cant_g += 1
64                 term_a = compone[cant_a]
65                 term_g = compone[cant_g]
66                 lccsal.append(-(term_a + term_c + term_t + term_g))
67         elif tail == "C":
68             cant_c -= 1
69             if window.endswith("A"):
70                 cant_a += 1
71                 term_a = compone[cant_a]
72                 term_c = compone[cant_c]
73                 lccsal.append(-(term_a + term_c + term_t + term_g))
74             elif window.endswith("T"):
75                 cant_t += 1
76                 term_c = compone[cant_c]
77                 term_t = compone[cant_t]
78                 lccsal.append(-(term_a + term_c + term_t + term_g))
79             elif window.endswith("G"):
80                 cant_g += 1
81                 term_c = compone[cant_c]
82                 term_g = compone[cant_g]
83                 lccsal.append(-(term_a + term_c + term_t + term_g))
84         elif tail == "T":
85             cant_t -= 1
86             if window.endswith("A"):
87                 cant_a += 1
88                 term_a = compone[cant_a]
89                 term_t = compone[cant_t]
90                 lccsal.append(-(term_a + term_c + term_t + term_g))
91             elif window.endswith("C"):
92                 cant_c += 1
93                 term_c = compone[cant_c]
94                 term_t = compone[cant_t]
95                 lccsal.append(-(term_a + term_c + term_t + term_g))
96             elif window.endswith("G"):
97                 cant_g += 1
98                 term_t = compone[cant_t]
99                 term_g = compone[cant_g]
100                 lccsal.append(-(term_a + term_c + term_t + term_g))
101         elif tail == "G":
102             cant_g -= 1
103             if window.endswith("A"):
104                 cant_a += 1
105                 term_a = compone[cant_a]
106                 term_g = compone[cant_g]
107                 lccsal.append(-(term_a + term_c + term_t + term_g))
108             elif window.endswith("C"):
109                 cant_c += 1
110                 term_c = compone[cant_c]
111                 term_g = compone[cant_g]
112                 lccsal.append(-(term_a + term_c + term_t + term_g))
113             elif window.endswith("T"):
114                 cant_t += 1
115                 term_t = compone[cant_t]
116                 term_g = compone[cant_g]
117                 lccsal.append(-(term_a + term_c + term_t + term_g))
118         tail = window[0]
119     return lccsal
120 
121 
122 def lcc_simp(seq):
123     """Calculate Local Composition Complexity (LCC) for a sequence.
124 
125     seq - an unambiguous DNA sequence (a string or Seq object)
126 
127     Returns the Local Composition Complexity (LCC) value for the entire
128     sequence (as a float).
129 
130     Reference:
131     Andrzej K Konopka (2005) Sequence Complexity and Composition
132     https://doi.org/10.1038/npg.els.0005260
133     """
134     wsize = len(seq)
135     upper = str(seq).upper()
136     l2 = math.log(2)
137     if "A" not in seq:
138         term_a = 0
139         # Check to avoid calculating the log of 0.
140     else:
141         term_a = ((upper.count("A")) / float(wsize)) * (
142             (math.log((upper.count("A")) / float(wsize))) / l2
143         )
144     if "C" not in seq:
145         term_c = 0
146     else:
147         term_c = ((upper.count("C")) / float(wsize)) * (
148             (math.log((upper.count("C")) / float(wsize))) / l2
149         )
150     if "T" not in seq:
151         term_t = 0
152     else:
153         term_t = ((upper.count("T")) / float(wsize)) * (
154             (math.log((upper.count("T")) / float(wsize))) / l2
155         )
156     if "G" not in seq:
157         term_g = 0
158     else:
159         term_g = ((upper.count("G")) / float(wsize)) * (
160             (math.log((upper.count("G")) / float(wsize))) / l2
161         )
162     return -(term_a + term_c + term_t + term_g)
163
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/Bio/SeqUtils/lcc.py b/Bio/SeqUtils/lcc.py
--- a/Bio/SeqUtils/lcc.py
+++ b/Bio/SeqUtils/lcc.py
@@ -23,14 +23,14 @@
     version is optimized for speed. The optimization works by using the
     value of previous window as a base to compute the next one.
     """
-    l2 = math.log(2)
+    l4 = math.log(4)
     tamseq = len(seq)
     upper = str(seq).upper()
     compone = [0]
-    lccsal = [0]
+    lccsal = []
     for i in range(wsize):
         compone.append(
-            ((i + 1) / float(wsize)) * ((math.log((i + 1) / float(wsize))) / l2)
+            ((i + 1) / float(wsize)) * ((math.log((i + 1) / float(wsize))) / l4)
         )
     window = seq[0:wsize]
     cant_a = window.count("A")
@@ -133,30 +133,30 @@
     """
     wsize = len(seq)
     upper = str(seq).upper()
-    l2 = math.log(2)
+    l4 = math.log(4)
+    # Check to avoid calculating the log of 0.
     if "A" not in seq:
         term_a = 0
-        # Check to avoid calculating the log of 0.
     else:
         term_a = ((upper.count("A")) / float(wsize)) * (
-            (math.log((upper.count("A")) / float(wsize))) / l2
+            (math.log((upper.count("A")) / float(wsize))) / l4
         )
     if "C" not in seq:
         term_c = 0
     else:
         term_c = ((upper.count("C")) / float(wsize)) * (
-            (math.log((upper.count("C")) / float(wsize))) / l2
+            (math.log((upper.count("C")) / float(wsize))) / l4
         )
     if "T" not in seq:
         term_t = 0
     else:
         term_t = ((upper.count("T")) / float(wsize)) * (
-            (math.log((upper.count("T")) / float(wsize))) / l2
+            (math.log((upper.count("T")) / float(wsize))) / l4
         )
     if "G" not in seq:
         term_g = 0
     else:
         term_g = ((upper.count("G")) / float(wsize)) * (
-            (math.log((upper.count("G")) / float(wsize))) / l2
+            (math.log((upper.count("G")) / float(wsize))) / l4
         )
     return -(term_a + term_c + term_t + term_g)

{"golden_diff": "diff --git a/Bio/SeqUtils/lcc.py b/Bio/SeqUtils/lcc.py\n--- a/Bio/SeqUtils/lcc.py\n+++ b/Bio/SeqUtils/lcc.py\n@@ -23,14 +23,14 @@\n     version is optimized for speed. The optimization works by using the\n     value of previous window as a base to compute the next one.\n     \"\"\"\n-    l2 = math.log(2)\n+    l4 = math.log(4)\n     tamseq = len(seq)\n     upper = str(seq).upper()\n     compone = [0]\n-    lccsal = [0]\n+    lccsal = []\n     for i in range(wsize):\n         compone.append(\n-            ((i + 1) / float(wsize)) * ((math.log((i + 1) / float(wsize))) / l2)\n+            ((i + 1) / float(wsize)) * ((math.log((i + 1) / float(wsize))) / l4)\n         )\n     window = seq[0:wsize]\n     cant_a = window.count(\"A\")\n@@ -133,30 +133,30 @@\n     \"\"\"\n     wsize = len(seq)\n     upper = str(seq).upper()\n-    l2 = math.log(2)\n+    l4 = math.log(4)\n+    # Check to avoid calculating the log of 0.\n     if \"A\" not in seq:\n         term_a = 0\n-        # Check to avoid calculating the log of 0.\n     else:\n         term_a = ((upper.count(\"A\")) / float(wsize)) * (\n-            (math.log((upper.count(\"A\")) / float(wsize))) / l2\n+            (math.log((upper.count(\"A\")) / float(wsize))) / l4\n         )\n     if \"C\" not in seq:\n         term_c = 0\n     else:\n         term_c = ((upper.count(\"C\")) / float(wsize)) * (\n-            (math.log((upper.count(\"C\")) / float(wsize))) / l2\n+            (math.log((upper.count(\"C\")) / float(wsize))) / l4\n         )\n     if \"T\" not in seq:\n         term_t = 0\n     else:\n         term_t = ((upper.count(\"T\")) / float(wsize)) * (\n-            (math.log((upper.count(\"T\")) / float(wsize))) / l2\n+            (math.log((upper.count(\"T\")) / float(wsize))) / l4\n         )\n     if \"G\" not in seq:\n         term_g = 0\n     else:\n         term_g = ((upper.count(\"G\")) / float(wsize)) * (\n-            (math.log((upper.count(\"G\")) / float(wsize))) / l2\n+            (math.log((upper.count(\"G\")) / float(wsize))) / l4\n         )\n     return -(term_a + term_c + term_t + term_g)\n", "issue": "lcc.lcc_mult returns extra zero value\n### Setup\r\n\r\nI am reporting a problem with Biopython version, Python version, and operating\r\nsystem as follows:\r\n\r\n```python\r\nimport sys; print(sys.version)\r\nimport platform; print(platform.python_implementation()); print(platform.platform())\r\nimport Bio; print(Bio.__version__)\r\n```\r\n\r\n[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]\r\nCPython\r\nLinux-3.10.0-957.1.3.el7.x86_64-x86_64-with-centos-7.6.1810-Core\r\n1.78\r\n\r\n### Expected behaviour\r\n\r\n[1.9056390622295662]\r\n\r\n### Actual behaviour\r\n\r\n[0, 1.9056390622295662]\r\n\r\n### Steps to reproduce\r\n\r\nlcc.lcc_mult('ACGATAGC', 8)\r\n\r\nIn addition according the [article](https://www.researchgate.net/publication/229964618_Sequence_Complexity_and_Composition), the calculation of LCC uses log base 4 but the implementation uses log base 2.  That is why for the example sequence 5 in Table 1 the value shown is half the function value.\r\n\n", "before_files": [{"content": "# Copyright 2003, 2007 by Sebastian Bassi. sbassi@genesdigitales.com\n# All rights reserved.\n#\n# This file is part of the Biopython distribution and governed by your\n# choice of the \"Biopython License Agreement\" or the \"BSD 3-Clause License\".\n# Please see the LICENSE file that should have been included as part of this\n# package.\n\"\"\"Local Composition Complexity.\"\"\"\n\nimport math\n\n\ndef lcc_mult(seq, wsize):\n    \"\"\"Calculate Local Composition Complexity (LCC) values over sliding window.\n\n    Returns a list of floats, the LCC values for a sliding window over\n    the sequence.\n\n    seq - an unambiguous DNA sequence (a string or Seq object)\n    wsize - window size, integer\n\n    The result is the same as applying lcc_simp multiple times, but this\n    version is optimized for speed. The optimization works by using the\n    value of previous window as a base to compute the next one.\n    \"\"\"\n    l2 = math.log(2)\n    tamseq = len(seq)\n    upper = str(seq).upper()\n    compone = [0]\n    lccsal = [0]\n    for i in range(wsize):\n        compone.append(\n            ((i + 1) / float(wsize)) * ((math.log((i + 1) / float(wsize))) / l2)\n        )\n    window = seq[0:wsize]\n    cant_a = window.count(\"A\")\n    cant_c = window.count(\"C\")\n    cant_t = window.count(\"T\")\n    cant_g = window.count(\"G\")\n    term_a = compone[cant_a]\n    term_c = compone[cant_c]\n    term_t = compone[cant_t]\n    term_g = compone[cant_g]\n    lccsal.append(-(term_a + term_c + term_t + term_g))\n    tail = seq[0]\n    for x in range(tamseq - wsize):\n        window = upper[x + 1 : wsize + x + 1]\n        if tail == window[-1]:\n            lccsal.append(lccsal[-1])\n        elif tail == \"A\":\n            cant_a -= 1\n            if window.endswith(\"C\"):\n                cant_c += 1\n                term_a = compone[cant_a]\n                term_c = compone[cant_c]\n                lccsal.append(-(term_a + term_c + term_t + term_g))\n            elif window.endswith(\"T\"):\n                cant_t += 1\n                term_a = compone[cant_a]\n                term_t = compone[cant_t]\n                lccsal.append(-(term_a + term_c + term_t + term_g))\n            elif window.endswith(\"G\"):\n                cant_g += 1\n                term_a = compone[cant_a]\n                term_g = compone[cant_g]\n                lccsal.append(-(term_a + term_c + term_t + term_g))\n        elif tail == \"C\":\n            cant_c -= 1\n            if window.endswith(\"A\"):\n                cant_a += 1\n                term_a = compone[cant_a]\n                term_c = compone[cant_c]\n                lccsal.append(-(term_a + term_c + term_t + term_g))\n            elif window.endswith(\"T\"):\n                cant_t += 1\n                term_c = compone[cant_c]\n                term_t = compone[cant_t]\n                lccsal.append(-(term_a + term_c + term_t + term_g))\n            elif window.endswith(\"G\"):\n                cant_g += 1\n                term_c = compone[cant_c]\n                term_g = compone[cant_g]\n                lccsal.append(-(term_a + term_c + term_t + term_g))\n        elif tail == \"T\":\n            cant_t -= 1\n            if window.endswith(\"A\"):\n                cant_a += 1\n                term_a = compone[cant_a]\n                term_t = compone[cant_t]\n                lccsal.append(-(term_a + term_c + term_t + term_g))\n            elif window.endswith(\"C\"):\n                cant_c += 1\n                term_c = compone[cant_c]\n                term_t = compone[cant_t]\n                lccsal.append(-(term_a + term_c + term_t + term_g))\n            elif window.endswith(\"G\"):\n                cant_g += 1\n                term_t = compone[cant_t]\n                term_g = compone[cant_g]\n                lccsal.append(-(term_a + term_c + term_t + term_g))\n        elif tail == \"G\":\n            cant_g -= 1\n            if window.endswith(\"A\"):\n                cant_a += 1\n                term_a = compone[cant_a]\n                term_g = compone[cant_g]\n                lccsal.append(-(term_a + term_c + term_t + term_g))\n            elif window.endswith(\"C\"):\n                cant_c += 1\n                term_c = compone[cant_c]\n                term_g = compone[cant_g]\n                lccsal.append(-(term_a + term_c + term_t + term_g))\n            elif window.endswith(\"T\"):\n                cant_t += 1\n                term_t = compone[cant_t]\n                term_g = compone[cant_g]\n                lccsal.append(-(term_a + term_c + term_t + term_g))\n        tail = window[0]\n    return lccsal\n\n\ndef lcc_simp(seq):\n    \"\"\"Calculate Local Composition Complexity (LCC) for a sequence.\n\n    seq - an unambiguous DNA sequence (a string or Seq object)\n\n    Returns the Local Composition Complexity (LCC) value for the entire\n    sequence (as a float).\n\n    Reference:\n    Andrzej K Konopka (2005) Sequence Complexity and Composition\n    https://doi.org/10.1038/npg.els.0005260\n    \"\"\"\n    wsize = len(seq)\n    upper = str(seq).upper()\n    l2 = math.log(2)\n    if \"A\" not in seq:\n        term_a = 0\n        # Check to avoid calculating the log of 0.\n    else:\n        term_a = ((upper.count(\"A\")) / float(wsize)) * (\n            (math.log((upper.count(\"A\")) / float(wsize))) / l2\n        )\n    if \"C\" not in seq:\n        term_c = 0\n    else:\n        term_c = ((upper.count(\"C\")) / float(wsize)) * (\n            (math.log((upper.count(\"C\")) / float(wsize))) / l2\n        )\n    if \"T\" not in seq:\n        term_t = 0\n    else:\n        term_t = ((upper.count(\"T\")) / float(wsize)) * (\n            (math.log((upper.count(\"T\")) / float(wsize))) / l2\n        )\n    if \"G\" not in seq:\n        term_g = 0\n    else:\n        term_g = ((upper.count(\"G\")) / float(wsize)) * (\n            (math.log((upper.count(\"G\")) / float(wsize))) / l2\n        )\n    return -(term_a + term_c + term_t + term_g)\n", "path": "Bio/SeqUtils/lcc.py"}], "after_files": [{"content": "# Copyright 2003, 2007 by Sebastian Bassi. sbassi@genesdigitales.com\n# All rights reserved.\n#\n# This file is part of the Biopython distribution and governed by your\n# choice of the \"Biopython License Agreement\" or the \"BSD 3-Clause License\".\n# Please see the LICENSE file that should have been included as part of this\n# package.\n\"\"\"Local Composition Complexity.\"\"\"\n\nimport math\n\n\ndef lcc_mult(seq, wsize):\n    \"\"\"Calculate Local Composition Complexity (LCC) values over sliding window.\n\n    Returns a list of floats, the LCC values for a sliding window over\n    the sequence.\n\n    seq - an unambiguous DNA sequence (a string or Seq object)\n    wsize - window size, integer\n\n    The result is the same as applying lcc_simp multiple times, but this\n    version is optimized for speed. The optimization works by using the\n    value of previous window as a base to compute the next one.\n    \"\"\"\n    l4 = math.log(4)\n    tamseq = len(seq)\n    upper = str(seq).upper()\n    compone = [0]\n    lccsal = []\n    for i in range(wsize):\n        compone.append(\n            ((i + 1) / float(wsize)) * ((math.log((i + 1) / float(wsize))) / l4)\n        )\n    window = seq[0:wsize]\n    cant_a = window.count(\"A\")\n    cant_c = window.count(\"C\")\n    cant_t = window.count(\"T\")\n    cant_g = window.count(\"G\")\n    term_a = compone[cant_a]\n    term_c = compone[cant_c]\n    term_t = compone[cant_t]\n    term_g = compone[cant_g]\n    lccsal.append(-(term_a + term_c + term_t + term_g))\n    tail = seq[0]\n    for x in range(tamseq - wsize):\n        window = upper[x + 1 : wsize + x + 1]\n        if tail == window[-1]:\n            lccsal.append(lccsal[-1])\n        elif tail == \"A\":\n            cant_a -= 1\n            if window.endswith(\"C\"):\n                cant_c += 1\n                term_a = compone[cant_a]\n                term_c = compone[cant_c]\n                lccsal.append(-(term_a + term_c + term_t + term_g))\n            elif window.endswith(\"T\"):\n                cant_t += 1\n                term_a = compone[cant_a]\n                term_t = compone[cant_t]\n                lccsal.append(-(term_a + term_c + term_t + term_g))\n            elif window.endswith(\"G\"):\n                cant_g += 1\n                term_a = compone[cant_a]\n                term_g = compone[cant_g]\n                lccsal.append(-(term_a + term_c + term_t + term_g))\n        elif tail == \"C\":\n            cant_c -= 1\n            if window.endswith(\"A\"):\n                cant_a += 1\n                term_a = compone[cant_a]\n                term_c = compone[cant_c]\n                lccsal.append(-(term_a + term_c + term_t + term_g))\n            elif window.endswith(\"T\"):\n                cant_t += 1\n                term_c = compone[cant_c]\n                term_t = compone[cant_t]\n                lccsal.append(-(term_a + term_c + term_t + term_g))\n            elif window.endswith(\"G\"):\n                cant_g += 1\n                term_c = compone[cant_c]\n                term_g = compone[cant_g]\n                lccsal.append(-(term_a + term_c + term_t + term_g))\n        elif tail == \"T\":\n            cant_t -= 1\n            if window.endswith(\"A\"):\n                cant_a += 1\n                term_a = compone[cant_a]\n                term_t = compone[cant_t]\n                lccsal.append(-(term_a + term_c + term_t + term_g))\n            elif window.endswith(\"C\"):\n                cant_c += 1\n                term_c = compone[cant_c]\n                term_t = compone[cant_t]\n                lccsal.append(-(term_a + term_c + term_t + term_g))\n            elif window.endswith(\"G\"):\n                cant_g += 1\n                term_t = compone[cant_t]\n                term_g = compone[cant_g]\n                lccsal.append(-(term_a + term_c + term_t + term_g))\n        elif tail == \"G\":\n            cant_g -= 1\n            if window.endswith(\"A\"):\n                cant_a += 1\n                term_a = compone[cant_a]\n                term_g = compone[cant_g]\n                lccsal.append(-(term_a + term_c + term_t + term_g))\n            elif window.endswith(\"C\"):\n                cant_c += 1\n                term_c = compone[cant_c]\n                term_g = compone[cant_g]\n                lccsal.append(-(term_a + term_c + term_t + term_g))\n            elif window.endswith(\"T\"):\n                cant_t += 1\n                term_t = compone[cant_t]\n                term_g = compone[cant_g]\n                lccsal.append(-(term_a + term_c + term_t + term_g))\n        tail = window[0]\n    return lccsal\n\n\ndef lcc_simp(seq):\n    \"\"\"Calculate Local Composition Complexity (LCC) for a sequence.\n\n    seq - an unambiguous DNA sequence (a string or Seq object)\n\n    Returns the Local Composition Complexity (LCC) value for the entire\n    sequence (as a float).\n\n    Reference:\n    Andrzej K Konopka (2005) Sequence Complexity and Composition\n    https://doi.org/10.1038/npg.els.0005260\n    \"\"\"\n    wsize = len(seq)\n    upper = str(seq).upper()\n    l4 = math.log(4)\n    # Check to avoid calculating the log of 0.\n    if \"A\" not in seq:\n        term_a = 0\n    else:\n        term_a = ((upper.count(\"A\")) / float(wsize)) * (\n            (math.log((upper.count(\"A\")) / float(wsize))) / l4\n        )\n    if \"C\" not in seq:\n        term_c = 0\n    else:\n        term_c = ((upper.count(\"C\")) / float(wsize)) * (\n            (math.log((upper.count(\"C\")) / float(wsize))) / l4\n        )\n    if \"T\" not in seq:\n        term_t = 0\n    else:\n        term_t = ((upper.count(\"T\")) / float(wsize)) * (\n            (math.log((upper.count(\"T\")) / float(wsize))) / l4\n        )\n    if \"G\" not in seq:\n        term_g = 0\n    else:\n        term_g = ((upper.count(\"G\")) / float(wsize)) * (\n            (math.log((upper.count(\"G\")) / float(wsize))) / l4\n        )\n    return -(term_a + term_c + term_t + term_g)\n", "path": "Bio/SeqUtils/lcc.py"}]}