Python for Bioinformatics 2nd Edition Sebastian Bassi 2024 scribd download
Python for Bioinformatics 2nd Edition Sebastian Bassi 2024 scribd download
https://ebookfinal.com/download/python-for-bioinformatics-chapman-
hall-crc-mathematical-computational-biology-sebastian-bassi/
https://ebookfinal.com/download/python-machine-learning-second-
edition-sebastian-raschka/
https://ebookfinal.com/download/bioinformatics-programming-using-
python-1st-edition-mitchell-l-model/
https://ebookfinal.com/download/black-hat-python-python-programming-
for-hackers-and-pentesters-2nd-edition-justin-seitz-and-tim-arnold/
Clinical Bioinformatics 2nd Edition Ronald Trent (Eds.)
https://ebookfinal.com/download/clinical-bioinformatics-2nd-edition-
ronald-trent-eds/
https://ebookfinal.com/download/raspberry-pi-for-python-programmers-
cookbook-2nd-revised-edition-tim-cox/
https://ebookfinal.com/download/instant-notes-in-bioinformatics-2nd-
edition-charlie-hodgman/
https://ebookfinal.com/download/python-in-easy-steps-covers-
python-3-7-2nd-edition-mike-mcgrath/
https://ebookfinal.com/download/data-mining-for-bioinformatics-1st-
edition-sumeet-dua/
Python for Bioinformatics 2nd Edition Sebastian Bassi
Digital Instant Download
Author(s): Sebastian Bassi
ISBN(s): 9781138035263, 1138035262
Edition: 2nd
File Details: PDF, 4.97 MB
Year: 2017
Language: english
PYTHON FOR
BIOINFORMATICS
SECOND EDITION
CHAPMAN & HALL/CRC
Mathematical and Computational Biology Series
Series Editors
N. F. Britton
Department of Mathematical Sciences
University of Bath
Xihong Lin
Department of Biostatistics
Harvard University
Nicola Mulder
University of Cape Town
South Africa
Mona Singh
Department of Computer Science
Princeton University
Anna Tramontano
Department of Physics
University of Rome La Sapienza
Proposals for the series should be submitted to one of the series editors above or directly to:
CRC Press, Taylor & Francis Group
3 Park Square, Milton Park
Abingdon, Oxfordshire OX14 4RN
UK
Published Titles
An Introduction to Systems Biology: Statistical Methods for QTL Mapping
Design Principles of Biological Circuits Zehua Chen
Uri Alon An Introduction to Physical Oncology:
Glycome Informatics: Methods and How Mechanistic Mathematical
Applications Modeling Can Improve Cancer Therapy
Kiyoko F. Aoki-Kinoshita Outcomes
Computational Systems Biology of Vittorio Cristini, Eugene J. Koay,
Cancer and Zhihui Wang
Emmanuel Barillot, Laurence Calzone, Normal Mode Analysis: Theory and
Philippe Hupé, Jean-Philippe Vert, and Applications to Biological and Chemical
Andrei Zinovyev Systems
Python for Bioinformatics, Second Edition Qiang Cui and Ivet Bahar
Sebastian Bassi Kinetic Modelling in Systems Biology
Quantitative Biology: From Molecular to Oleg Demin and Igor Goryanin
Cellular Systems Data Analysis Tools for DNA Microarrays
Sebastian Bassi Sorin Draghici
Methods in Medical Informatics: Statistics and Data Analysis for
Fundamentals of Healthcare Microarrays Using R and Bioconductor,
Programming in Perl, Python, and Ruby Second Edition
Jules J. Berman Sorin Drăghici
Chromatin: Structure, Dynamics, Computational Neuroscience:
Regulation A Comprehensive Approach
Ralf Blossey Jianfeng Feng
Computational Biology: A Statistical Biological Sequence Analysis Using
Mechanics Perspective the SeqAn C++ Library
Ralf Blossey Andreas Gogol-Döring and Knut Reinert
Game-Theoretical Models in Biology Gene Expression Studies Using
Mark Broom and Jan Rychtář Affymetrix Microarrays
Computational and Visualization Hinrich Göhlmann and Willem Talloen
Techniques for Structural Bioinformatics Handbook of Hidden Markov Models
Using Chimera in Bioinformatics
Forbes J. Burkowski Martin Gollery
Structural Bioinformatics: An Algorithmic Meta-analysis and Combining
Approach Information in Genetics and Genomics
Forbes J. Burkowski Rudy Guerra and Darlene R. Goldstein
Spatial Ecology Differential Equations and Mathematical
Stephen Cantrell, Chris Cosner, and Biology, Second Edition
Shigui Ruan D.S. Jones, M.J. Plank, and B.D. Sleeman
Cell Mechanics: From Single Scale- Knowledge Discovery in Proteomics
Based Models to Multiscale Modeling Igor Jurisica and Dennis Wigle
Arnaud Chauvière, Luigi Preziosi, Introduction to Proteins: Structure,
and Claude Verdier Function, and Motion
Bayesian Phylogenetics: Methods, Amit Kessel and Nir Ben-Tal
Algorithms, and Applications
Ming-Hui Chen, Lynn Kuo, and Paul O. Lewis
Published Titles (continued)
RNA-seq Data Analysis: A Practical Introduction to Bio-Ontologies
Approach Peter N. Robinson and Sebastian Bauer
Eija Korpelainen, Jarno Tuimala, Dynamics of Biological Systems
Panu Somervuo, Mikael Huss, and Garry Wong Michael Small
Introduction to Mathematical Oncology Genome Annotation
Yang Kuang, John D. Nagy, and Jung Soh, Paul M.K. Gordon, and
Steffen E. Eikenberry Christoph W. Sensen
Biological Computation Niche Modeling: Predictions from
Ehud Lamm and Ron Unger Statistical Distributions
Optimal Control Applied to Biological David Stockwell
Models Algorithms for Next-Generation
Suzanne Lenhart and John T. Workman Sequencing
Clustering in Bioinformatics and Drug Wing-Kin Sung
Discovery Algorithms in Bioinformatics: A Practical
John D. MacCuish and Norah E. MacCuish Introduction
Spatiotemporal Patterns in Ecology Wing-Kin Sung
and Epidemiology: Theory, Models, Introduction to Bioinformatics
and Simulation Anna Tramontano
Horst Malchow, Sergei V. Petrovskii, and
The Ten Most Wanted Solutions in
Ezio Venturino
Protein Bioinformatics
Stochastic Dynamics for Systems Anna Tramontano
Biology
Combinatorial Pattern Matching
Christian Mazza and Michel Benaïm
Algorithms in Computational Biology
Statistical Modeling and Machine Using Perl and R
Learning for Molecular Biology Gabriel Valiente
Alan M. Moses
Managing Your Biological Data with
Engineering Genetic Circuits Python
Chris J. Myers Allegra Via, Kristian Rother, and
Pattern Discovery in Bioinformatics: Anna Tramontano
Theory & Algorithms Cancer Systems Biology
Laxmi Parida Edwin Wang
Exactly Solvable Models of Biological Stochastic Modelling for Systems
Invasion Biology, Second Edition
Sergei V. Petrovskii and Bai-Lian Li Darren J. Wilkinson
Computational Hydrodynamics of Big Data Analysis for Bioinformatics and
Capsules and Biological Cells Biomedical Discoveries
C. Pozrikidis Shui Qing Ye
Modeling and Simulation of Capsules Bioinformatics: A Practical Approach
and Biological Cells Shui Qing Ye
C. Pozrikidis
Introduction to Computational
Cancer Modelling and Simulation Proteomics
Luigi Preziosi Golan Yona
PYTHON FOR
BIOINFORMATICS
SECOND EDITION
SEBASTIAN BASSI
MATLAB• is a trademark of The MathWorks, Inc. and is used with permission. The MathWorks does not warrant the
accuracy of the text or exercises in this book. This book’s use or discussion of MATLAB • software or related products
does not constitute endorsement or sponsorship by The MathWorks of a particular pedagogical approach or particular
use of the MATLAB• software.
CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742
This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been
made to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity
of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright
holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this
form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may
rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized
in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying,
microfilming, and recording, or in any information storage or retrieval system, without written permission from the
publishers.
For permission to photocopy or use material electronically from this work, please access www.copyright.com (http://
www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923,
978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety of users. For
organizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged.
Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for
identification and explanation without intent to infringe.
Acknowledgments xxix
Section I Programming
Chapter 1 Introduction 3
1.1 WHO SHOULD READ THIS BOOK 3
1.1.1 What the Reader Should Already Know 4
1.2 USING THIS BOOK 4
1.2.1 Typographical Conventions 4
1.2.2 Python Versions 5
1.2.3 Code Style 5
1.2.4 Get the Most from This Book without Reading It All 6
1.2.5 Online Resources Related to This Book 7
1.3 WHY LEARN TO PROGRAM? 7
1.4 BASIC PROGRAMMING CONCEPTS 8
1.4.1 What Is a Program? 8
1.5 WHY PYTHON? 10
1.5.1 Main Features of Python 10
1.5.2 Comparing Python with Other Languages 11
1.5.3 How Is It Used? 14
1.5.4 Who Uses Python? 15
1.5.5 Flavors of Python 15
1.5.6 Special Python Distributions 16
1.6 ADDITIONAL RESOURCES 17
vii
viii Contents
Section IV Appendices
Index 417
List of Figures
3.1 Intersection. 60
3.2 Union. 61
3.3 Difference. 61
3.4 Symmetric difference. 62
3.5 Case 1. 65
3.6 Case 2. 66
xvii
xviii LIST OF FIGURES
22.1 Product of Listing 22.2, using the demo dataset (NODBDEMO). 356
xxi
Preface to the First Edition
This book is a result of the experience accumulated during several years of working
for an agricultural biotechnology company. As a genomic database curator, I gave
support to staff scientists with a broad range of bioinformatics needs. Some of them
just wanted to automate the same procedure they were already doing by hand, while
others would come to me with biological problems to ask if there were bioinformat-
ics solutions. Most cases had one thing in common: Programming knowledge was
necessary for finding a solution to the problem. The main purpose of this book is to
help those scientists who want to solve their biological problems by helping them
to understand the basics of programming. To this end, I have attempted to avoid
taking for granted any programming-related concepts. The chosen language for this
task is Python.
Python is an easy-to-learn computer language that is gaining traction among
scientists. This is likely because it is easy to use, yet powerful enough to accomplish
most programming goals. With Python the reader can start doing real programming
very quickly. Journals such as Computing in Science and Engineering, Briefings
in Bioinformatics, and PLOS Computational Biology have published introductory
articles about Python. Scientists are using Python for molecular visualization, ge-
nomic annotation, data manipulation, and countless other applications.
In the particular case of the life sciences, the development of Python has been
very important; the best exponent is the Biopython package. For this reason, Section
II is devoted to Biopython. Anyhow, I don’t claim that Biopython is the solution to
every biology problem in the world. Sometimes a simple custom-made solution may
better fit the problem at hand. There are other packages like BioNEB and CoreBio
that the reader may want to try.
The book begins from the very basic, with Section I (“Programming”), teaching
the reader the principles of programming. From the very beginning, I place a special
emphasis on practice, since I believe that programming is something that is best
learned by doing. That is why there are code fragments spread over the book. The
reader is expected to experiment with them, and attempt to internalize them. There
are also some spare comparisons with other languages; they are included only when
doing so enlightens the current topic. I believe that most language comparisons do
more harm than good when teaching a new language. They introduce information
that is incomprehensible and irrelevant for most readers.
In an attempt to keep the interest of the reader, most examples are somehow
related to biology. In spite of that, these examples can be followed even if the reader
doesn’t have any specific knowledge in that field.
To reinforce the practical nature of this book, and also to use as reference
xxiii
xxiv Preface to the First Edition
The first edition of Python for Bioinformatics was written in 2008 and published
in 2009. Even after eight years, the lessons in this book are still valuable. This is
quite an accomplishment in a field that evolves at such a fast pace. In spite of its
usefulness, the book is showing its age and would greatly benefit from a second
edition.
The predominant Python version is 3.6, although Python 2.7 is still in use in
production systems. Since there are incompatibilities between these versions, lot of
effort was made to make all code in the book Python 3 compatible.
Not only has the software changed in these past eight years, but enterprise atti-
tude and support toward Open Source Software in general and Python in particular
has changed dramatically. There are also new computing paradigms that can’t be
ignored such as collaborative development and cloud computing.
In the original book, Chapter 14 was called “Collaborative Development: Version
Control” and was based on Bazaar, a software that follows the currently used
distributed development workflow but is not what is being used by most developers
today. By far the most software development is done with Git at GitHub. This
chapter was rewritten to focus on current practices.
Web development is another area that changed significantly. Although this is
not a book about web development, the chapter “Web Applications” now reflects
current usage of long-running processes and frameworks instead of CGI/WSGI and
middleware-based applications. Frameworks were discussed as a side note in this
chapter, but now the chapter is based around a framework (Bottle) and leave the
old method as a historical footnote.
In databases, the NoSQL gained lot of traction, from being a bullet point in
the first edition, now has its own section using MongoDB, and a Python recipe
was changed to use this NoSQL database.
Graphical libraries have improved since 2009, and there are great quality com-
peting graphic libraries available for Python. There is a whole chapter devoted to
Bokeh, a free interactive visualization library.
Another change that is reflected in this book is the usage of Anaconda and
Jupyter Notebooks (with all code in a cloud notebook provided by Microsoft
Azure1 ).
1
See https://notebooks.azure.com/py4bio/libraries/py3.us
xxv
xxvi Preface to the Second Edition
A project such as this book couldn’t be done by just one person. For this reason,
there is a long list of people who deserve my thanks. In spite of the fact that the
average reader doesn’t care about the names, and at the risk of leaving someone out,
I would like to acknowledge the following people: my wife Virginia Gonzalez (Vicky)
and my son Maximo Bassi, who had to contend with my virtual absence during
more than a year. Vicky also assisted me in uncountable ways during manuscript
preparation. My parents and professors taught me important lessons. My family
(Oscar, Graciela, and Ramiro) helped me with the English copyediting, along with
Hugo and Lucas Bejar. Vicky, Griselda, and Eugenio also helped by providing a
development abstraction layer, which is needed for writers and developers.
I would like to thank the people in the local Python community (http://www.
python.org.ar): Facundo Batista, Lucio Torre, Gabriel Genellina, John Lenton,
Alejandro J. Cura, Manuel Kaufmann, Gabriel Patiño, Alejandro Weil, Marcelo
Fernandez, Ariel Rossanigo, Mariano Draghi, and Buanzo. I would choose Python
again just for this great community. I also thank the people at Biopython: Jeffrey
Chang, Brad Chapman, Peter Cock, Michiel de Hoon, and Iddo Friedberg. Peter
Cock is specially thanked for his comments on the Biopython chapter. I also thank
Shashi Kumar and Pablo Di Napoli who helped me with the LATEX2ε issues, and
Sunil Nair who believed in me from the first moment. Also people at Globant
who trusted in me, like Guido Barosio, Josefina Chausovsky, Lucas Campos, Pablo
Brenner and Guibert Englebienne. Globant co-workers such as Pedro Mourelle,
Chris DeBlois, Rodrigo Obi-Wan Iloro, Carlos Del Rio and Alejandro Valle. People
at PLOS, Jeffrey Gray and Nick Peterson.
xxix
I
Programming
1
CHAPTER 1
Introduction
CONTENTS
1.1 Who Should Read This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1.1 What the Reader Should Already Know . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 Using this Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.1 Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.2 Python Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.3 Code Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.4 Get the Most from This Book without Reading It All . . . . . . . . . 6
1.2.5 Online Resources Related to This Book . . . . . . . . . . . . . . . . . . . . . . . . 7
1.3 Why Learn to Program? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.4 Basic Programming Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.4.1 What Is a Program? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.5 Why Python? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.5.1 Main Features of Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.5.2 Comparing Python with Other Languages . . . . . . . . . . . . . . . . . . . . . 11
Readability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.5.3 How Is It Used? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.5.4 Who Uses Python? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.5.5 Flavors of Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.5.6 Special Python Distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.6 Additional Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Amelia Earhart
3
4 Python for Bioinformatics
• The reader should be working (or at least planning to work) with bioinfor-
matics tools. Even low-scale handmade jobs, such as using the NCBI BLAST
to ID a sequence, aligning proteins, primer searching, or estimating a phy-
logenetic tree will be useful to follow the examples. The more familiar the
reader is with bioinformatics, the better he will be able to apply the concepts
learned in this book.
text, it marks a new word or concept. For example “One such fundamental data
structure is a dictionary.”
The content of lines starting with $ (dollar sign) are meant to be typed in your
operating system console (also called command prompt in Windows or terminal
in macOS).
←֓ : Break line. Some lines are longer than the available space in a printed
page, so this symbol is inserted to mean that what is on the next line in the page
represents the same line on the computer screen. Inside code, the symbol used is
<=.
def GetAverage(X):
avG=sum(X)/len(X)
" Calculate the average "
return avG
def get_average(items):
""" Calculate the average
"""
average = sum(items) / len(items)
return average
The former code sample follows most accepted coding styles for Python.2
Throughout the book you will find mostly code formatted as the second sample.
Some code in the book will not follow accepted coding styles for the following
reasons:
• There are some instances where the most didactic way to show a particular
piece of code conflicts with the style guide. On those few occasions, I choose
to deviate from the style guide in favor of clarity.
• Due to size limitation in a printed book, some names were shortened and
other minor drifts from the coding styles have been introduced.
• To show that there is more than one way to write the same code. Coding
style is a guideline, and enforcement is not made at a language level, so some
programmers don’t follow it thoroughly. You should be able to read “bad”
code, since sooner or later you will have to read other people’s code.
1.2.4 Get the Most from This Book without Reading It All
• If you want to learn how to program, read the first section, from Chapter
1 to Chapter 8. The Regular Expressions (REGEX) chapter (Chapter 13) can
be skipped if you don’t need to deal with REGEX.
• If you know Python and just want to know about Biopython, read first
Chapter 9 (from page 158 to page 209). It is about Biopython modules and
functions. Then try to follow programs found in Section III (from page 315
to page 363).
• There are three appendixes that can be read in an independent way. Appendix
A (Collaborative Development: Version Control with GitHub) reproduces a
paper called “A Quick Introduction to Version Control with Git and GitHub.”
Appendix B shows how to install a web application using Python Anywhere.
Appendix C is a reference material that can be used as a cheat sheet when
you need a quick answer without having to read a chapter.
2
The official Python style guide is located at https://www.python.org/dev/peps/pep-0008,
and a more easy-to-read style guide is located at http://docs.python-guide.org/en/latest/
writing/style.
Introduction 7
Not only can it automate the procedures that we do manually, but it will also
be able to do things that would otherwise not be possible.
Sometimes it is not very clear if a particular task can be done by a program.
Reading a book such as this one (including the examples) will help you identify
which tasks are feasible to automate with software and which ones are better done
manually.
Materials
4
There are declarative languages that state what the program should accomplish, rather than
describing how to accomplish it. Most computer languages (Python included) are imperative instead
of declarative.
Introduction 9
Procedure
1 seq_1 = ’Hello,’
2 seq_2 = ’ you!’
3 total = seq_1 + seq_2
4 seq_size = len(total)
5 print(seq_size)
Note: The numbers at the beginning of the each line are for reference only,
they are not meant to be typed.
This small program can be read as “Name the string Hello, as seq_1. Name
the string you! as seq_2. Add the strings named seq_1 and seq_2 and call the
result as total. Get the length of the string called total and name this value as
seq_size. Print the value of seq_size.” This program prints the number 11.
As shown, there are different types of data (often called “data types” or just
“types”). Numbers (integers or float), text string, and other data types are covered
in Chapter 3. In print(seq_size), the instruction is print and seq_size is the
name of the data. Data is often represented as variables. A variable is a name
that stands for a value that may vary during program execution. With variables,
a programmer can represent a generic command like “round n” instead of “round
2.9.” This way he can take into account a non-fixed (hence variable) value. When
Exploring the Variety of Random
Documents with Different Content
"She has to stay three days with her husband," Edward took it upon
himself to answer; "then the wedding will be finished and she can come
here for a day. That is our custom. Even though our father is dead, they will
not permit her to come before three days."
With this promise safely gained, Ronald told Edward to gather up his
things. It was not healthy for the boy to stay a minute longer than necessary
in a household where everyone's thoughts dwelt round the corpse of the
dead master. Edward went to his work listlessly and came back sniffing and
weeping after the woebegone task of dismantling the room he had occupied
so long. Neither the sympathetic help of his amah cheered him nor the
welcome of his new home, where David, awed by the distinction of one
who had lost his father, tried cautiously to say the appropriate word.
Edward wanted Nancy; his heart was hungering for her even when he
thought he mourned for his father.
On the third day he went with his Uncle Ronald, as already he had been
taught to call his guardian, to see the sister who had become a bride.
His own eagerness, if he had known it, did not exceed Ronald's. The
intervening day had been a busy one. Ronald had been to the legation to
have Herrick's will admitted to probate. He found friends who had known
Herrick long ago and who were avid for every last detail of Herrick's story,
but they could suggest no scheme for saving Nancy. It was a rotten
business, they agreed with some emphasis, but a matter which could not be
helped, for Nancy, by wedding a Chinese husband, had forfeited British
protection. Ronald might use pressure, and they hoped he would, to get the
girl away from her husband,—there was not one of them who expected the
marriage to end in any way except drastic misery,—but he had no lawful
right to divert any of Herrick's estate for the purpose. The estate, through
remarkably clever investments, had once been close to a fortune, but
recently Herrick's intemperate withdrawals had reduced it till it was barely
enough to cover the terms of his will.
It was the first chance Nancy had had to yield to her passionate misery:
for three days she had struggled against tears, trying to preserve some
semblance of joy in a family which paid no heed to the death of her father.
The rites of the wedding were dragged out till she was on the point of
fainting under the cruel burden. She felt no love for the husband who had
been goaded into claiming her, and suffered bridal intimacies from one who
became worse than a stranger in her eyes. Beneath his treatment she felt the
hostility of a youth who had not desired this foreigner for his wife, and
beneath the treatment she met from her new mother she felt the
exasperation over delay in the payment of her dowry, disappointment taking
unkind shapes because the woman had never forgiven herself for selling her
son into what was likely to prove a bad bargain. For three days the family
had been most deliberately merry, trying to face out their regrets in the sight
of the world; they had been reckless of how they spent money, but thrifty of
a single friendly word to the girl whose heart was breaking while she
pretended to smile. At last they had let her go home to weep.
When Nancy, who had comforted herself before marriage with the hope
of coming back to see her father, realized that he too had deserted her and
that she had not won him a single day's peace by her sacrifice, she threw
herself down beside his coffin and wept till her body seemed torn apart by
her grief. Edward, who in his turn was ready to break down, understood the
sudden need to control himself, so that when the time came he could
comfort his sister in his affectionate boyish manner and bring her away to
the room where Ronald was waiting.
Nancy was dazed at seeing Ronald. She did not seem to know why he
was there. Her mind still lingered with her father. She had only perfunctory
words to spare for the living, while Ronald could hardly check the
temptation to carry her away by force, to carry her out of sight and sound of
this baneful household. Everything he wanted to say froze on his lips. He
had no heart to reproach the girl for persisting in the wedding she might
have stopped. With her face marred by grief, he could not ask her if she
were happy, if she were contented with her new home. The words would
have mocked their own meaning.
She was quieter now, but the hysterical stillness of her manner
frightened Ronald.
He was annoyed by the girl's obstinacy, which she had inherited in too
full measure from her father.
"You surely can be frank with me," he added, "because I may never
again be in such a position to help you. You know that I have your father's
estate to divide. As long as the money, which includes ten thousand taels
which were to be paid at your wedding, as long as this remains in my hands
I can make almost any terms you may wish with the t'ai-t'ai. But when it has
been divided, then my power will be gone. Now do you regret your
bargain? Are you sorry you kept to this marriage? Do tell me now, when I
can help you."
How could she tell him the shame of the last three days? How could she
relate the scornful treatment of her new family? She might have told Kuei-
lien; she had no words to speak of it to Ronald. She could not run to him
like a weakling tired of her promise. To endure the mischances of her
marriage was no more than keeping faith with her father's good name. She
was a wife; that was the end of it. But Ronald seemed to read her thoughts.
"I don't know what your new home is like," he argued, "but I do know
what you are like, and I can hardly imagine you happy under the conditions
you will find there. Just now your sorrow for your father makes everything
else seem of small account, but the time will come when the sharpness will
wear off and you will have to think of the man you have married and the
life you have adopted. For it is an adopted life; it is not natural to you. Now
your father is dead, don't make a mistake of your loyalty to him and think
you have to embrace years of misery merely to gratify his memory. That's
not good enough. They don't want you—I can see that; they only want the
money that was promised with you. Nothing would please them better than
to get this money without the necessity of taking you. You are a foreigner
and always will be a foreigner to them. Can't you come home with Edward
and me, and I will promise, if I have to move heaven and earth, to get your
marriage annulled."
"If they want my money, they have to take me," said Nancy stubbornly.
She was not doing justice to Ronald's proposal, while the man, in his
turn, was far from seeing her marriage as she saw it. She could not
appreciate how in his foreign eyes her marriage was no marriage, nor could
he see how to her Chinese eyes it was a bond from which there was but one
honorable escape for the wife, the extreme measure of suicide. Ronald had
been reading deeply in the customs of the Chinese the better to understand
Nancy's case, but he missed the essential fact of her attitude, the value she
set by her good name. To have run away because she was displeased with
her first three days of wedded life seemed an act of intolerable cowardice.
Nancy's every thought was Chinese, more Chinese than Kuei-lien's: she had
an inbred fear of disgrace, not only for her own sake but for her father's
whose reputation rested helplessly in her care. So she met Ronald's most
persuasive entreaties with the same blank answer. If she had grounds for
quarreling with her husband or with his parents it was no business of an
outsider to know of them.
Nancy trembled a little beneath the touch of his lips, but the kiss came
so naturally that she had no time to be surprised and could only wonder
long afterward at the trance which had held her silent under so strange a
greeting, so strange a token of farewell.
CHAPTER XXX
Ronald did not see Nancy again until the day of Timothy Herrick's
funeral. On that dreary day she was more remote than ever, wearing her
headdress of white sackcloth and weeping loudly. Even Edward, who had
thrown off many vestiges of his Chinese upbringing in the short time he had
lived with the Ferrises, fell back disconcertingly into old habits and was as
Chinese as Herrick's half-caste children when he had donned his coat of
coarse bleached calico.
All this Ronald heard in the weird music of the procession, as the coffin
and its mourners moved slowly toward the gates of the city; he felt that the
road Timothy Herrick was traveling, this same road there was no one to
prevent his daughter from taking, despite all her lovable instincts for joy
and for beauty—no one good enough to prevent her from following in her
own desolate hour.
After Herrick had been buried, there was nothing to keep him from
dividing what remained of his money. Ronald was anxious to be done with
the task. He exacted but one promise, a promise from the t'ai-t'ai that when
Nancy's first month of married life was complete and the girl, as custom
allowed, was able to sleep a few nights under another roof than her
husband's, she should come to his sister's home instead of the father's house
she ought to have visited. This was reasonable, for Edward was the only
kinsman left to her.
To their consternation they learned that the t'ai-t'ai had broken her
promise. She had gone with her brother and his whole family back to their
native town of Paoling. And Nancy, as naturally she must do, had gone with
them. It was the last blow.
As for poor Nancy, the King and Parliament of Great Britain had lost
interest in her. The secluded Chihli village of Paoling kept her as hidden
from prying strangers as the fastnesses of Turkestan. Nancy had never been
told of the promise that she should visit Edward in his new home. She was
saved this disappointment. But she knew it was the last step away from her
friends when her mother-in-law summoned her to pack and to get up long
before dawn for the cold dark ride to the station. Long as she had lived in
Peking, the city was a place strange and unfamiliar to the girl, yet she
conceived a fondness even for the arches and walls she barely could descry
in the darkness, for she felt she should never set eyes upon them again.
With the rest of her husband's family she bundled uncomfortably into a
third-class carriage, squeezing herself so tightly between baskets and
bedding that she sat as though cramped stiffly in a vise. Everyone spoke
shrilly; the early hour, the bitterly frosty morning, had set their tempers on
edge. No one was in a mood to enjoy the novelty of a railway ride. Nancy
looked wearily at the dingy houses they passed, wondered if their occupants
could be unhappier than she was; she saw in the distance the blue roofs of
the Temple of Heaven, but paid no heed; if her legs had not been so stiff,
her whole body aching from the need of movement, she might have gone to
sleep counting the numbers of the telegraph poles. Her mind did go to
sleep; her body persisted in staying painfully awake.
She was grateful to get off the train, grateful to shake her numb legs into
life, pulling boxes and bales quickly out of the car. The t'ai-t'ai and her
mother-in-law gave contradictory orders, they wrangled and shouted,
pulling servants helter-skelter, scolding Nancy, scolding her husband; they
were only one of many groups invoking heaven and hell in their panic lest
the train should start before the last bundle had been rolled out of the
window.
By a miracle they got themselves untangled and down to the platform,
where the women sank breathless on rolls of bedding, waiting for a bargain
to be struck with the mule-drivers. This was not quickly nor quietly done
and Nancy, used to having these small matters arranged without her
presence, despaired of its ever being done at all. To the mule-drivers and
their opponents, however, the hiring of a cart was more heady business than
speech in a public forum. Not till vulgar interest was diverted to Nancy,
whose presence in this company became an eighth day's wonder, did the
arguing parties see that their prominence of the moment had passed; they
made the same bargain they could have made half an hour back. Chou
hsien-sheng swore he was cheated, the drivers swore they were robbed, but
the price they fixed had been the unchanging rate for a decade.
Nancy was glad to get into her cart, even to be thriftily crowded among
three women servants and a suffocating mass of baggage. She had not
enjoyed the ring of staring eyes which had surveyed her nor the coarse
guesses of the people as to her history, guesses loudly and impudently
debated with many rustic guffaws over the joke of a foreigner reduced to
Chinese clothes and the whims of a Chinese master.
All day long the carts moved slowly forward, lumbering in ruts, shaking
the teeth of their passengers on miles of chipped highway, ploughing deep
through sand. Nancy was acutely mindful of other mule-cart journeys, the
rides to the Western Hills, when Edward and Kuei-lien had been her
comrades and each new turn of the road had tempted their eyes to objects of
joyful interest. She was scornful of the ignorant maids squashed into this
unpleasant contact, closed her eyes to avoid seeing their puffy faces; their
few monosyllables were like a parody of human speech. They wheezed and
grunted and reeked of garlic till Nancy wondered why she could not
withdraw all her senses, as she had withdrawn her sense of sight, and shut
herself from these clownish wenches like a mussel in its shell.
Shortly before dark the carts lurched down the sunken streets of
Paoling. It was like all the other villages they had passed, dusty and poor.
Dikes of baked mud served for walls. Two policemen lounged at the gate as
though the place were not worth their vain offer of protection. Mud and
gray tile and leafless trees, streets without shops, worn into deep trenches,
people clothed in rags so dirty that the very patches were blended to a
greasy uniformity of color—not an item relieved the drab scene. And the
home of her husband, Nancy found, was a consistent part of its
surroundings. It was filthy, musty, and cold, a huge ramshackle place
replete with tottering chairs and tables, its stone floors overlaid with grime,
its courtyards heaped with dung. Only rats and spiders seemed fit to inhabit
such a place and Nancy's heart became chill with dismay when she thought
of dragging out her life in this cheerless hole.
Nancy knelt and kowtowed three times before the august personage to
whose face she had not yet presumed to raise her eyes. She waited, prostrate
on the floor.
"Lift her, you fools," cried a voice that showed by its testiness it was
used to being obeyed. "Can't you see she is worn with weariness?"
The other women hastened to help Nancy to her feet. The girl looked
wonderingly at the little old woman who sat muffled in quilted satin on the
k'ang. From a face crossed and transcrossed with wrinkles burned eyes
whose haughtiness spoke an older and a finer generation than the women to
whom Nancy had been subjected. Her mother-in-law's were dog's eyes
compared with them. Nancy lost her fear. The eyes brought memories of
her father. They seemed to pierce, with their sadness, their cynical
discontent, the very mysteries of life.
"Come here, my child," said the old woman gently. "Come and sit with
me and tell me how you are. I have waited a long, long time to welcome
you."
CHAPTER XXXI
In the first relief that followed this kindly greeting, Nancy nearly broke
down. Tears welled to her eyes, do what she would to hold them back. She
could not help sobbing, but the old woman stroked her hands as though she
knew the misery pent up in the heart of this alien bride.
"My husband and your father were friends," she said, "and I am glad
that his daughter has become my granddaughter. But it's hard, isn't it?"
Nancy would have suffered much from the women, from her mother-in-
law and from her stepmother—for the latter visited on the daughter her
anger over the justice of Timothy Herrick's will—and even at the hands of
lesser people, who took their pattern from this spiteful pair, but she had
hoped for some measure of sympathy, some pity, even if there could not be
love, from the youthful stranger, Ming-te, who had been given the rights of
a husband over her life.
In this she was disappointed. Ming-te felt that there was no one with a
grievance comparable to his own. His parents, however much they might
dislike this foreigner in the family, had invited her by their own choice. But
he had been given no choice.
So Ming-te, the handsome, spoiled idol of his parents, took his marriage
in bad grace and vented his spleen on Nancy. He did not take the trouble to
see whether here might not be the ideal comrade of whom he had prated so
freely in the safe company of his friends; he had made up his mind to
dislike the girl long before he set eyes upon her. The disgrace of his bridal
night, his sheepishness, the mockery of his family, of which he still heard
the echoes, were an added score to be wiped out. And because he could not
avenge himself on her mind he tried to avenge himself on her body, for at
heart he was afraid of Nancy; at heart he realized her contempt for his
shallowness and conceit; he seemed to see her eyes despising him as a
weakling, a petulant small boy, till she challenged him to ecstasies of
cruelty to prove that he was indeed her master.
Nancy had learned many undreamed-of things during this month, but
nothing more dumbfounding than the fact that real sorrow is an experience
without appeal; it has no glamour, no romance. It is like a headache which
goes on forever. She wondered at the vernal innocent person she had been,
blithely offering herself for a life of torture, as though it were no more than
one of those tempestuous black tragedies of childhood which last for an
hour, then ripple peacefully away like bird notes after a storm. It seemed so
splendid to sacrifice herself, against the protests of Ronald and his nieces
and Edward and Kuei-lien and even her father himself; she had been
thrilled by her own daring even when her heart was cold with the prospect,
so that, while she entered the bridal chair sad and afraid, longing to cling to
everything she was forsaking, some small part of her could not forbear
standing aside to gloat over the picturesque courage of her deed.
But she had been wakened too unmercifully from her dream; her vanity,
so excusable, so childishly serious, broken by a punishment out of all
justice to what it deserved. Her days of shyness were passing. She was
putting off the bride to put on the shrew—in that hard-mouthed family no
other role was safe—when her regrets for the folly of her sacrifice suddenly
dissolved and her heart swelled with pride, with thankfulness, because she
had kept faith with an old lady she had never met, who greeted her in the
twilight of a gray day, saying, "I have waited a long, long time to welcome
you."
The t'ai-t'ai and her sister-in-law were more surprised than Nancy. They
were dismayed. What the old t'ai-t'ai said, she meant; she had come to an
age when she did not trouble to hide her thoughts of other people, but ruled
her clan, as the last of the oldest generation, with an unsparing frankness
such as made them quail. Hers was a witty, biting tongue which she found
life too short to think of bridling; she did not like her daughter, still less her
daughter-in-law, thought none too highly of her sons, and, as for her
grandchildren, she called them a litter of gaping puppies. Her mind was a
catalogue of their faults; she could make the best of them wince with a
single sharply prodding phrase, for there was nothing ridiculous that any of
them had done, and wished with all his heart to forget, that she could not
recall when the occasion suited her. Grown men writhed for a pretext to get
beyond earshot of her chuckle.
Yet she did not welcome Nancy kindly—as the t'ai-t'ai and her sister-in-
law concluded—merely to annoy them. Her instinct, which always was
extravagantly right, had told her that Nancy would be a friend. She did not
care whether Ming-te had a wife or not, but she longed for someone young,
someone talented and pretty, to whom she could talk and be kind. Her own
family bored her. She yawned when she thought of them. They were a
small, petty-minded generation, while her memory dwelt upon the large
days of the past. Her loyalty was all to the past, to her husband and his
father, to the family in its time of splendor, before its name had been
dragged in the dust by a progeny that forsook their books and squabbled
over cash like beggars fighting in the street. So she had ruled them with a
testy loneliness, glad to be alive only because she knew they would be glad
if she were dead.
Her first glimpse of Nancy satisfied the keen-sighted old tyrant. She
drew the pale girl to her side like a child.
"It's a long time since I've seen anyone really young," she said, "young
and wise together as they used to be. Now we have a republic; men don't
trouble about wisdom and they think they can rule the eighteen provinces
before they have left off their mother's milk. You have read books, I have
heard, and can write poems. Your father would see to that. He knew our
customs. He was one of us."
She could be tactful when she chose; in her questions about the death of
Nancy's father she soothed rather than irritated the quick feelings of the
daughter.
"To die on the day of your wedding, ai, that was a strange thing. I have
lived many years, but I have never heard the like. That was a proof that he
loved you, my child. You must remember such a father. And you have a
brother, too; where is he?"
"So you have Western friends. How did you come to make them?"
Paragraph by paragraph she drew from Nancy's lips the tale of how they
had met and visited the Ferrises. The old lady enjoyed the freshness of the
girl's story. She wanted most exact details of how these foreigners lived.
"It must have surprised them to see one of their own blood living in the
fashion of a Chinese. Did you like their ways?"
"Don't be afraid of me," she said, patting the girl's hand from pleasure at
her own jest. "I shall be your father and your mother from this time forth—
hm-m, just like a magistrate, remember. You can tell your troubles to me as
freely as you please and, even if the walls have ears, they won't dare speak
till I let them."
Her words lulled Nancy into a pleasing warmth of security. She forgot
her weariness, the despair with which she had risen this very morning to
start on a hopeless journey, for the old t'ai-t'ai's words were spoken with the
authority of one who could promise peace when she wished and protection
to those she liked. And she really liked Nancy.
"Your Western friends," she resumed, "they must have been appalled by
your marrying a Chinese. Did they try to dissuade you?"
"Ah, of course, they wouldn't understand. And perhaps they were right.
You may go back to them some day; who knows?"
"Oh no, I shall never go back to them," Nancy protested, dreading lest
the woman should doubt her loyalty to the promise she had made.
"Young people, my daughter, should never use the word 'never.' When
you are as old as I am and have to think soberly of the spring winds as not
just a chance to fly kites, then 'never' means something; ah, it means too
much. There is so much happiness I shall never know again, so many faces
I shall never see. But you, with your handful of years, there is no 'never' for
you. You thought to-day you would never smile again. You had heard of
me, hadn't you, and trembled to meet a bad-tempered old grandmother;
don't deny it—I saw it in your face when they made you kneel. I shall not
be bad-tempered to you, child. We old people like to have flowers about us.
I shall be selfish of your company and most surely will begrudge you to
others. And will you be sorry? Aha, I don't think you will. Your father must
have taught you wisely for you remind me of children as they used to be
when I was young. I am tired of being waited on by servant maids or by
people who wonder when I'm going to die. Why should I die just to make
fools more comfortable in their folly! No, I shall not be bad-tempered to
you, because you are the first person I have had round me for years who
really wished me to live. But I'm not going to share you."
How firm were her intentions was soon shown, for Nancy's mother-in-
law came in to say, in a voice too carefully matter-of-fact, that if the old t'ai-
t'ai had been gracious to say all she wished to the 'hsi-fu,' they hoped she
would give her permission to withdraw, for there was much work to be
done and her room to be set right.
"And whose work, indeed, is she to do, if not mine?" asked the old t'ai-
t'ai. "Her room we can discuss later, but to-night her room will be here."
"Oh, but that would not be convenient," faintly protested the younger
woman; "we must not separate the bride from her husband. My mother
speaks this out of her kind heart, but surely it would make my mother
uncomfortable."
"Very well, that is only what we wished to be sure of," said Ming-te's
mother hastily, "we wanted to make sure of your comfort."
Yet the next day she was still so far from being satisfied of the old t'ai-
t'ai's comfort that she asked her sister-in-law to intercede and to get Nancy
out of the old lady's clutches before it was too late. Hai t'ai-t'ai, Nancy's
step-mother, was more than ready to try, for she knew that while the old
lady lived, if they did not make a stand quickly, Nancy would be lost to
their control. She had a portion of her mother's independence and did not
cringe in the august presence as her sister-in-law was apt to do. Waiting a
chance when Nancy was absent, she went boldly into the den.
"You have come to ask after my health, have you?" inquired her mother
brusquely. "My health is excellent, this morning. It has done me great good
to meet someone new.
"We are so glad that the foreign hsi-fu meets with your favor," lied the
daughter cheerfully. "I thought of your comfort when I began to arrange the
match."
"Your companion, by all means," agreed Hai t'ai-t'ai, "but not too much
your companion. We can never permit her to tire you with her prattle. She
might become spoiled and think you were indulging her in liberties only fit
for yourself. I have known her for many years and I speak the truth when I
say she is difficult to control. She puts forward a good face at first, but she
is an obstinate, self-willed child, not always obedient to her elders. Her
training was sadly neglected because she was left to the charge of an
indulgent old amah—"
"Oh no, not at all, but we trembled to put the burden of her training in
your hands."
"You are all very busy people. What is there for an old woman like
myself to do? I shall be happy to take the burden of her training into my
hands. When I weary of it, I have a tongue; I can tell you."
"But he has had his bride only for a month. Is it right to leave the boy
lonely without a mate for his bed? These things mean so much to the young.
If he is lonely, he may go out to drink and to gamble with evil companions.
He did not want to marry, yet for our sake he did even more: he married a
foreigner to help his family. And now, when he is beginning to understand
her excellent qualities—"
"Like a sparrow and a phœnix," suggested the mother wickedly. Hai t'ai-
t'ai flushed in annoyance, but the dowager stopped her from speaking.
"How will they learn to live together in peace and harmony?" she
echoed. "Ah, my daughter, you are old enough to answer that question, or
must I answer it for you and say they never will learn. If you could have got
fifteen thousand taels without this girl, would you have taken her? No,
indeed not. But I would have taken her without a cash. So she belongs to
me. She will never be of any use to this family because I am the only one
who knows how to use her. And I am old—and I have no husband to give
her. She will be safer with me. If Ming-te wants a bedfellow, get him one.
You can afford to spend on him a little of the money he has earned. Buy
him a nice, good-tempered, pretty wife; the country is full of them. He will
be happy, you will be happy, and I shall have peace."
CHAPTER XXXII
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookfinal.com