Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

ENGR220: Week6 In-Class Exercise

ENGR220: Week6 Developing


Computational Solutions
In-Class Exercise

Introduction
This in-class exercise provides practice with bringing to bear the Python language
constructs, various data types, and your problem solving skills to develop
acceptable computational solutions. Now that you have knowledge of some
important python language constructs under your belt, this in-class exercise will
give you practice with how you can use the constructs that you have learned
about to date to take a description of a problem to solve through constructing an
acceptable computational solution of the problem of interest. Developing skills to
build computational solutions, in many respects, will be a continuous lifelong
learning and evolutionary process. This in-class exercise supplements and
reinforces the same topic that is presented in the corresponding video. This
exercise will help to provide you with a good foundation and knowledge of the
best practices for developing effective computational solutions.
This in-class exercise is a long exercise. The instructor might extend this exercise
to make it part of Week 7s in-class exercise. An announcement will be made in
class, if necessary.

Objectives of This Exercise


Gain experience with
o Applying seven steps and methods to develop the six characteristics
of a computational solution.
o Applying these methods and steps to a real statistical analysis
application.
o Documenting code

Page 1 of 11

ENGR220: Week6 In-Class Exercise

What to Upload To Week6 Python Constructing Computational Solutions


You will be developing a problem decomposition, analysis, design, etc. of an
application to conduct a statistical analysis of outcome data that has been
produced from conducting a druggable stent clinical trial. Throughout the in-class
exercise, you will be generating documents that represent your decomposition of
the problem, your analysis, your design, and so forth. Eventually you will get to
the part of the exercise where you start to implement your computational
solution. What you upload depends on how far you get. So, in terms of what to
upload to the week6 in-class assignment, when you complete the
1. Problem Decomposition step, upload your MS Word (or WordPad, or .txt
file) with your problem decomposition
2. Problem Analysis step, upload your MS Word (or WordPad, or .txt file) with
your problem analysis
3. Problem Design step, upload your MS Word (or WordPad, or .txt file) with
your problem design
4. Implementation step, upload your MS Word (or WordPad, or .txt and or
.py files) with your implementation pseudo code and python code
Lets Get Started
1. Create a working Directory, if needed, launch the Enthought Canopy Python
editor and interactive window. Then change your current working directory to
the desired location. This will be the first task/step in almost all in-class
exercises.
2. Before starting to develop a computational solution, we begin with some
background about the medical condition, called renal stenosis and high blood
pressure (BP), that a proposed druggable stent is intended to address.
a. Renal Stenosis Background:
i. REFERENCE:
eMedicine, "Renal Artery Stenosis." eMedicine, "Renal
Artery Stenosis/Renovascular Hypertension." Previous
contributing author and editor: Dwight Makoff, M.D. and
Leslie J. Schoenfield, M.D., Ph.D.

Page 2 of 11

ENGR220: Week6 In-Class Exercise

www.medicinenet.com/renal_artery_stenosis/article.htm
Last Editorial Review: 10/7/2008

ii. What are renal arteries? Renal refers to anything related to


the kidneys. Renal arteries carry blood from the heart to the
kidneys. They branch directly from the aorta (the main artery
coming off the heart) on either side and extend to each kidney.
These arteries take a very large volume of blood to the kidneys
to be filtered.
iii. The heart pumps out approximately 5 liters of blood per
minute, and about 1-1.5 liters (25%) of the total volume of
blood pumped by the heart passes through the kidneys every
minute.
iv. What is renal stenosis? Renal artery stenosis (narrowing) is a
decrease in the diameter of the renal arteries. The resulting
restriction of blood flow to the kidneys may lead to impaired
kidney function (renal failure) and high blood pressure
(hypertension), referred to as renovascular hypertension, or
RVHT ("reno" for kidney and "vascular" for blood vessel). Renal
artery stenosis is a major cause of RVHT and accounts for 1%10% of the 50 million cases of hypertension in the United
States.
v. Renovascular hypertension occurs when the artery to one of
the kidneys is narrowed (unilateral, or one-sided, stenosis),
while renal failure occurs when the arteries to both kidneys
are narrowed (bilateral, or two-sided, stenosis). The decreased
blood flow to both kidneys increasingly impairs renal function.
vi. What causes renal stenosis? The majority of renal artery
stenosis is caused by atherosclerosis (hardening and narrowing
Page 3 of 11

ENGR220: Week6 In-Class Exercise

of blood vessel wall from the inside) similar to the process that
occurs in blood vessels in the heart and other parts of the
body.

vii. Risk factors for atherosclerosis include: high cholesterol levels,


high blood pressure, age, cigarette smoking, and diabetes.
Less common causes of renal artery stenosis are fibromuscular
dysplasia of the vessels (narrowing of the vessel due to internal
thickening of the blood vessel wall), arteritis (inflammation of
the blood vessel), or dissection (tearing and division of the
blood vessel wall).
viii. How common is renal stenosis? Narrowing of the kidney
arteries is more common in individuals 50 years of age and
older. It is estimated that some degree of narrowing (greater
than 50%) is found in about 18% of adults between 65-75 years
of age and 42% of those older than 75 years of age. This may
be due to the fact that atherosclerosis is more common in this
age group.
ix. In younger patients, the narrowing of the renal artery usually is
due to the thickening of the artery (fibromuscular dysplasia)
and it is more common in women than men.
x. It is estimated that renal artery stenosis accounts for
approximately 1% of mild to moderate cases of high blood
pressure. It may be responsible for more than 10% of cases of
severely elevated or difficult to treat high blood pressure
(hypertension).
xi. What are the symptoms of renal stenosis? In general, renal
artery stenosis is not associated with any obvious or specific
symptoms. Suspicious signs for renal artery stenosis include (1)
high blood pressure that responds poorly to treatment, (2)
Page 4 of 11

ENGR220: Week6 In-Class Exercise

severe high blood pressure that develops prior to age 30 or


greater than age 50, and (3) an incidental finding (discovered
through routine tests or tests performed for another
condition) of one small kidney compared to a normal sized one
on the other side.
xii. Typically, unilateral (one-sided) renal artery stenosis may be
related to high blood pressure whereas bilateral (two-sided)
renal artery stenosis is more often related to diminished
kidney function.
xiii. What problems does renal stenosis cause? When the
circulating blood volume becomes depleted as a result of, for
example, dehydration or bleeding, the blood flow to the
kidneys is likewise reduced. The normal physiologic reaction to
a decrease in blood flow to the kidneys is a complex hormonal
response by the kidneys, called the renin-angiotensinaldosterone system.
xiv. This hormonal system is activated as a defense against low
blood pressure and low circulating blood volume. The kidney
senses a possible decrease in the circulating blood when blood
flow through these vessels is reduced. As a result, there are
increased blood levels of the hormone angiotensin 2, which
causes narrowing of the small blood vessels in the kidneys.
xv. This, together with increased blood aldosterone levels
(another hormone), promotes salt retention by the kidneys,
and works to maintain blood pressure and restore blood
volume. Accordingly, this hormonal system is protective in
response to reduced circulation of blood to the kidneys that is
caused either by volume depletion, as described, or by
reduced blood pressure.
xvi. This otherwise normal hormonal response can become
abnormal (pathologic) when the decreased blood flow to the
Page 5 of 11

ENGR220: Week6 In-Class Exercise

kidneys results from a narrowing of diseased renal arteries. In


this situation, the kidneys receive less blood flow, which then
signals a sense of depletion of the circulating blood volume,
despite the fact that the blood volume is actually normal. So,
the diminished renal blood flow, by stimulating the production
of angiotensin 2 and aldosterone, can lead to an abnormal
increase of blood pressure (renovascular hypertension).
xvii. What are medical treatments for renal artery stenosis? In
bilateral (both-sided) and unilateral (one-sided) renal artery
stenosis associated with high blood pressure, controlling the
blood pressure with usual blood pressure medications is the
first and the safest treatment. ACE inhibitors or ARB
medications with or without a diuretic (water pill) may be tried
first. This approach may be associated in some patients with
worsening of their kidney function. Therefore, kidney function
needs to be followed closely and if worsening of kidney
function is evident, these medications may need to be
stopped.
xviii. It is worth noting that if renal artery stenosis is found
incidentally when performing a test for another disease and
there is no evidence of kidney dysfunction or high blood
pressure, then no treatment may be necessary. Sometimes
even significant stenosis may not be associated with high
blood pressure or kidney dysfunction. In these situations,
periodic monitoring of blood pressure and kidney function may
be advised.
xix. What surgical procedures are available for renal artery
stenosis? If the results of any of these screening tests suggest
an abnormality of the renal artery, an x-ray angiography is
then performed. A 75% or greater narrowing of the renal
artery seen on the angiogram has been termed treatable renal
artery stenosis. Treatable means that the stenosis of the
artery is severe (75% or greater narrowing), the artery needs
to be widened (dilated), and it has a good chance of
Page 6 of 11

ENGR220: Week6 In-Class Exercise

responding favorably to the dilatation. Usually right at the time


of the angiography, an angioplasty is done. In this procedure a
tiny balloon is inflated in the interior space in the artery (the
lumen) to dilate the narrowed artery. Additionally, as part of
the angioplasty procedure, a stent (tubular device to prevent
recurrence of the narrowing) may be placed in the artery.
xx. In rare cases, vascular surgery (on the blood vessels) may be
done for renal artery stenosis. In these situations, typically
another vascular surgery near the renal arteries, for example
the aorta, is the main procedure. If renal artery stenosis is also
present, then a bypass renal artery surgery may be done at the
same time.
xxi. These invasive procedures are typically reserved for cases that
do not respond to medical treatment and where it has been
determined that the stenosis is causing or contributing to the
uncontrolled high blood pressure. These invasive procedures
may only be done if it is thought that the kidney dysfunction or
elevated blood pressure can be effectively treated with the
procedures.

Page 7 of 11

ENGR220: Week6 In-Class Exercise

3. Clinical Trial Study NCT00631540 Endpoints/Criteria For Success


In 2011, a medical device company in San Francisco (the name to remain
anonymous) conducted a clinical trial of a proposed druggable stent as a
treatment (Tx) of renal stenosis. Before a medical device or proposed drug
is approved by the FDA, the data from an approved clinical trial must
demonstrate that device or drug has met its approved end point(s). A
clinical trial end point, generally refers to occurrence of a disease,
symptom, sign or laboratory abnormality that constitutes one of the target
outcomes of the trial, (REF: Humane Endpoints From Netherlands
Association for Laboratory Animal Science (NVP). Retrieved April 2011.)
4. Clinical trial Endpoints/Criteria For Success has the following endpoints:
Endpoint #1 (Primary Endpoint): Achieve primary patency at 9 months
after treatment. Primary patency is defined as not needing a lesion
Page 8 of 11

ENGR220: Week6 In-Class Exercise

revascularization, and less than 60% stenosis measured by either duplex


ultrasonography or angiography. DEF: Patency is the condition of being
open, expanded, or unobstructed.
Endpoint #2: Lowering of dystolic blood pressure by at least 10mmHg.
5. Problem Description:
Your must write a Python program that analyzes the clinical trial data to
determine if the druggable stent has statistically reached none, one, or both of
the above two stated end points. It begins by reading in the clinical trial data
from a .csv file 1 such as shown in Figure 1 below.

Figure 1: Sample druggable stent Clinical trial data.


Then to determine if endpoint #1 has been met, it statistically analyzes the
patient data labeled
Percent_Stenosis_at_Baseline_Site_Reported
and
Renal_Artery_Stenting_Result_Primary_Patency_Value_Achieved_9Mon
ths

Info and possible code examples will be provided on how to read .csv files.
Page 9 of 11

ENGR220: Week6 In-Class Exercise

The Percent_Stenosis_at_Baseline_Site_reported data represents the degree


of renal stenosis of a subject at the start of a clinical trial. The
Renal_Artery_Stenting_Result data represents the percentage reduction in
stenosis (i.e., patency) of the subject nine months from the start of Tx. The
program must determine which t-statistic to use to help determine if endpoint #1
has been met. It accomplishes this by calculating a t-statistic for the stenosis &
patency data. Then it compares the calculated t-statistic with something called a
t-critical value that the program will look up from a table that will be provided. If
the t-statistic value is less than the t-critical value for a given alpha () value of
0.05 and 1-tail test, 2 AND the average stenosis of the subjects is below 60%, then
the observed data is deemed not to be the result of random events, and the end
point has been met. If, for instance, the calculated t-statistic is greater than tcritical, then the alternative hypothesis (H A) that states using a druggable stent
will increase renal artery patency to the point where stenosis is below 60% cannot
be, using statistical language, admitted. In such a case, the end point has not
been met.
A similar statistical analysis needs to be done for BP. That is, the data in columns
Dystolic_BP_mmHg_Baseline
and
Dystolic_BP_mmHg_9Months
where Dystolic_BP_mmHg_Baseline is the subjects dystolic BP at the start of
the clinical trial, and Dystolic_BP_mmHg_9Months is the patients dystolic BP
at the end of the clinical trial. If, for instance, the t-statistic value is less than the tcritical value for a given alpha () value of 0.05 and 1-tail test, 3 AND the average
dystolic BP is 10mmHg lower than the average BP at the start of the clinical trial,
then endpoint #2 has been met. If not, then the endpoint has not been met. That
is, if the calculated t-statistic is greater than t-critical, then the alternative
hypothesis (H A) that states using a druggable stent will decrease the average
dystolic BP by 10mmHg cannot be, using statistical language, admitted. In
such a case, the end point has not been met.
The Python program that you write must prompt the user to enter two values.
One value is the average percentage stenosis below which the druggable stent
2
3

Alpha values and t-critical, and 1-tail t-statistic will be explained in class.
Alpha values and t-critical, and 1-tail t-statistic will be explained in class.

Page 10 of 11

ENGR220: Week6 In-Class Exercise

must achieve by the end of the clinical trial. The second number is the minimum
average decrease, in mmHg, that the druggable stent must achieve by the end of
the clinical trial. An alpha () value of 0.05 can be assumed and hard wired
into the Python program. The t-critical table will be provided as a dictionary.
Looking up the appropriate t-critical value will also require the program to
calculate a degree of freedom value, as specified in the t-statistic formulas given
to you in previous in-class exercises.
6. NOW FOR THE REAL WORK:
a. Write down, in a MS Word or WordPad file a decomposition of the
problem.
b. Analyze the problem in terms of all necessary and important
requirements. In other words, describe WHAT needs to be done.
c. Design your computational solution. In other words, describe HOW
(using English) the WHAT will be accomplished.
d. Implementation, in pseudo code first the design. Then translate the
pseudo code into Python code.
e. Testing we will leave for another in-class exercise.
7. As you complete each step in 6 above, upload your document to the Week6
in-class Assignment. As you progress though each step, you might want or
need to change something in a previous step. That is perfectly fine and
probably the norm rather than the exception. In such a case, simply make
the change and re-upload the document.

DONE!

Page 11 of 11

You might also like