5. Install Extra Packages … finance ?
pip is the preferred installer program.
Starting with Python 3.4, it is included
by default with the Python binary
installers.
pip3.5 install Biopython
#pip3.5 install yahoo_finance
from yahoo_finance import Share
yahoo = Share('AAPL')
print (yahoo.get_open())
6.
7. Numpy – SciPy – Matplib
• Numpy: Fundamental open source package for
scientific computing with Python.
– N-dimensional array object
Linear algebra, Fourier transform, random
number capabilities
• SciPy (prono1unced “Sigh Pie”) is a Python-based
ecosystem of open-source software for
mathematics, science, and engineering.
• Matplotlib is a python 2D plotting library which
produces publication quality figures in a variety of
hardcopy formats and interactive environments
across platforms.
8. Numpy – SciPy – Matplib -- > PANDAS ?
• Python Data Analysis Library, similar to:
– R
– MATLAB
– SAS
• Combined with the IPython toolkit
• Built on top of NumPy, SciPy, to some extent
matplotlib
• Panel Data System
– Open source, BSD-licensed
• Key Components
– Series is a named Python list (dict with list as value).
{ ‘grades’ : [50,90,100,45] }
– DataFrame is a dictionary of Series (dict of series):
{ { ‘names’ : [‘bob’,’ken’,’art’,’joe’]}
{ ‘grades’ : [50,90,100,45] }
}
11. Install Extra Packages …matplotlib …
T = +1
A = -1
C = +1G = -1
2D – random walk
1D – random walk
u(i)=1 for pyrimidines (C or T) and u(i)=-1 for purines (A or G)
13. Extra Questions (2)
• How many human proteins in Swiss Prot ?
• What is the longest human protein ? The shortest ?
• Calculate for all human proteins their MW and pI, display as
two histograms (2D scatter ?)
• How many human proteins have “cancer” in their
description?
• Which genes has the highest number of SNPs/somatic
mutations (COSMIC)
• How many human DNA-repair enzymes are represented in
Swiss Prot (using description / GO)?
• List proteins that only contain alpha-helices based on the
Chou-Fasman algorithm
• List proteins based on the number of predicted
transmembrane regions (Kyte-Doollittle)
14. Amino acid sequences fold onto themselves to become a
biologically active molecule.
There are three types of local segments:
Helices: Where protein residues seem to be following the shape
of a spring. The most common are the so-called alpha helices
Extended or Beta-strands: Where residues are in line and
successive residues turn back to each other
Random coils: When the amino acid chain is neither helical nor
extended
Secondary structure of protein
15. Chou-Fasman Algorithm
Chou, P.Y. and Fasman, G.D. (1974). Conformational parameters for amino acids in helical,
b-sheet, and random coil regions calculated from proteins.Biochemistry 13, 211-221.
Chou, P.Y. and Fasman, G.D. (1974). Prediction of protein conformation. Biochemistry 13,
222-245.
Analyzed the frequency of the 20 amino acids in alpha helices,
Beta sheets and turns.
• Ala (A), Glu (E), Leu (L), and Met (M) are strong predictors of
helices
• Pro (P) and Gly (G) break helices.
• When 4 of 5 amino acids have a high probability of being in an alpha helix, it predicts a
alpha helix.
• When 3 of 5 amino acids have a high probability of being in a
b strand, it predicts a b strand.
• 4 amino acids are used to predict turns.
16. Calculation of Propensities
Pr[i|b-sheet]/Pr[i], Pr[i|-helix]/Pr[i], Pr[i|other]/Pr[i]
determine the probability that amino acid i is in
each structure, normalized by the background
probability that i occurs at all.
Example.
let's say that there are 20,000 amino acids in the database, of
which 2000 are serine, and there are 5000 amino acids in
helical conformation, of which 500 are serine. Then the
helical propensity for serine is: (500/5000) / (2000/20000) =
1.0
17. Calculation of preference parameters
• Preference parameter > 1.0 specific
residue has a preference for the specific
secondary structure.
• Preference parameter = 1.0 specific
residue does not have a preference for, nor
dislikes the specific secondary structure.
• Preference parameter < 1.0 specific
residue dislikes the specific secondary
structure.
18. Calculation of Propensities
Pr[i|b-sheet]/Pr[i], Pr[i|-helix]/Pr[i], Pr[i|other]/Pr[i]
determine the probability that amino acid i is in
each structure, normalized by the background
probability that i occurs at all.
Example.
let's say that there are 20,000 amino acids in the database, of
which 2000 are serine, and there are 5000 amino acids in
helical conformation, of which 500 are serine. Then the
helical propensity for serine is: (500/5000) / (2000/20000) =
1.0
19. Calculation of preference parameters
• Preference parameter > 1.0 specific
residue has a preference for the specific
secondary structure.
• Preference parameter = 1.0 specific
residue does not have a preference for, nor
dislikes the specific secondary structure.
• Preference parameter < 1.0 specific
residue dislikes the specific secondary
structure.
21. Applying algorithm
1. Assign parameters (propensities) to residue.
2. Identify regions (nucleation sites) where 4 out of 6 residues have
P(a)>100: a-helix. Extend helix in both directions until four
contiguous residues have an average P(a)<100: end of a-helix. If
segment is longer than 5 residues and P(a)>P(b): a-helix.
3. Repeat this procedure to locate all of the helical regions.
4. Identify regions where 3 out of 5 residues have P(b)>100: b-
sheet. Extend sheet in both directions until four contiguous
residues have an average P(b)<100: end of b-sheet. If P(b)>105
and P(b)>P(a): b-sheet.
5. Rest: P(a)>P(b) a-helix. P(b)>P(a) b-sheet.
6. To identify a bend at residue number i, calculate the following
value: p(t) = f(i)f(i+1)f(i+2)f(i+3)
If: (1) p(t) > 0.000075; (2) average P(t)>1.00 in the tetrapeptide;
and (3) averages for tetrapeptide obey P(a)<P(t)>P(b): b-turn.
22. Additional fun
• Find proteins of at least 250aa that contain the fewest
secondary – structure elements ? Are they candidates
for being IDP ?
• Find proteins that contain no prosite patterns (using
scanner from previous exercise) ?
• Calculate for all human proteins their MW and pI (display
as 2D gel)