Errata

Bioinformatics Programming Using Python

Errata for Bioinformatics Programming Using Python

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
PDF Page 6
top

The comment on the top of page 6 is wrong. The top of the page reads:

>>> 11 % 4 # remainder of 11 // 3
3


The comment should read "remainder of 11 // 4", which is of course the definition of 11 % 4

aboudreau  Jan 24, 2017 
PDF Page 8
Second code entry, near top of page

In the section on Logical Operations, the following example is given:

>>> '' and 'A'
'' # Not False: '' is a false value
>>> 0 and 1 or 2 # Read as (0 and 1) or 2
2 # Not True: 2 is a false value



The comments here are confusing (and the last part of the second comment is completely incorrect). By the comment "# Not False", I believe the author is really intending to say (in the first example) " # Note that the result of this logical operation is not the boolean 'False' " and (in the second example) "# Note that the result of these two logical operations is not the boolean 'True' "

** the REAL problem is the very last part of the second comment "2 is a false value". In fact 2 IS NOT a false value, as in any version of Python,

>>> bool(2)
True

aboudreau  Jan 23, 2017 
Printed Page 10
top of page, 3rd interactive prompt

For the amino acid sequence 'MNKMDL...'[7//2] the example shows the return as 'K'. It should be 'M'. 7//2 = 3. Indexing from 0 'K' is [2], whereas 'M' is [3]

Barry G. Hall  Jan 22, 2015 
Other Digital Version 33
Example 2-11

This appears to be a general problem with the Mobipocket version. Whenever text is highlighted in a different background color (light gray in the PDF version), it is entirely absent in the Mobipocket version (at least on a Kindle DX there is only blank space). This occurs in all program examples and makes the Mobipocket version unusable. So in this example, the texts ", RNAflag" and "if RNAflag else 'T'" are missing.

Tim Pietzcker  Aug 16, 2010 
Other Digital Version 33
Example 2-11

Followup to the previously reported problem with the Mobipocket version: This problem doesn't manifest in Calibre, but definitely on the Kindle DX. So it's possibly a Kindle problem.

Tim Pietzcker  Sep 30, 2010 
Printed Page 39
Example 2-18

The code in printed version does not correspond to the code in online example script. Running the script from printed version would raise an AssertionError in lines

assert validate_base_sequence('ACUG', False)
assert not validate_base_sequence('ACUG', True)
assert validate_base_sequence('ACTG', True).

Katarina  Sep 19, 2013 
Printed Page 94
3rd code snippet

l.sort(key=lambda seq: (len(seq), seq.lower())))

should be

l.sort(key=lambda seq: (len(seq[1]), seq[1].lower()))

One too many closing brackets in original and index missing from tuple.

Anonymous  Jan 28, 2015 
Printed Page 116-117
bottom of page 116 to top of page 117

The commented out line results in multiple incomplete duplicates of each sequence being stored in sequences[]

def read_FASTA_iteration(filename):
sequences = []
descr = None
with open(filename) as file:
for line in file:
if line[0] == '>':
if descr:
sequences.append((descr, seq))
descr = line[1:-1].split('|')
seq = ''
else:
seq += line[:-1]
#sequences.append((descr, seq))
return sequences

Anonymous  Feb 02, 2015 
Other Digital Version 122
Erratum for Page 122 Table 4-3

On the *right* side of the table? not the left side?

Anonymous  Mar 07, 2012 
PDF Page 124
Example 4-18 examples code

Hello,
I tried running the code for example 4-18 and it does not run. Line 22 "#def test():" needs to be removed and the subsequent lines indentions removed to run.

R. Burke Squires  Apr 25, 2013 
Printed Page 183
first @classmethod definition

instead of
"return (value for value in self.Instance.keys())"
should be
"return (value for value in self.Instances.keys())"

Katarina  Sep 27, 2013 
Printed Page 303
Suggestion/General Not

code example

import re
pat = re.compile(r'</([A-za-z-_]+)')
with open(filename) as file:
closetags = pat.findall(file.read())
print('The number of total tags was {}, ' +
'of which {b} were distinct'.format(len(closetags), len(set(closetags)))

should be read

import re
pat = re.compile(r'</([A-za-z-_]+)')
with open(filename) as file:
closetags = pat.findall(file.read())
print('The number of total tags was {}, '.format(len(closetags)) +
'of which {} were distinct'.format(len(set(closetags))))

(missing one closing ')' and problems with .format)

Anonymous  Nov 03, 2018 
Printed Page 370
botton line of Table 10.11

I think the foreign key is supposed to be Reference.RefID instead of Organism.OrgID.

Phillip Wilmarth  Mar 09, 2013