日韩精品一区二区三区高清_久久国产热这里只有精品8_天天做爽夜夜做爽_一本岛在免费一二三区

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

CS 369代做、代寫Python編程語言

時間:2024-05-24  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



CS 369 2024 Assignment 4
See Canvas for due dates
In the ffrst part of this assignment, we use a Hidden Markov Model to model secondary
structure in protein sequences and implement a couple of algorithms we saw in lectures.
In the second part, we simulate sequences down a tree according to the Jukes-Cantor
model then use distance methods to try to reconstruct the tree.
Write your code in Python and present your code embedded in a report in a Jupyter
Notebook. Make sure you test your code thoroughly and write clear, commented code
that others can understand.
Submit two ffles to Canvas: the .ipynb and .html both showing code and results by 10pm
on the due date.
There are 30 marks in total for this assessment.
1. [14 marks total] Suppose we wish to estimate basic secondary structure in protein
(amino acid) sequences. The model we consider is a simplistic rendition of the
model discussed in S C. Schmidler et al. (2004) Bayesian Segmentation of Protein
Secondary Structure, doi:10.1089/10665270050081496
We assume that at each point of the sequence, the residue is associated with one
of three secondary structures: α-helix, β-strand and loops which we label H, S
and T, respectively. To simplify the problem, we classify the amino acids as either
hydrophobic, hydrophilic or neutral (B, I or N, respectively) so a sequence can be
represented by this 3-letter alphabet.
In a α-helix, the residues are 15% neutral, 20% hydrophobic and 65% hydrophilic.
In a β-strand, they are 30%, 60%, 10% and in a loop they are 70%, 15%, 15%.
Assume that all secondary structures have geometrically distributed length with
α-helices having mean 15 residues, β-strands having a mean of 8 residues and loops
a mean of 6 residues. A β-strand is followed by an α-helix 40% of the time and a
loop 60% of the time. An α-helix is followed by a β-strand 30% of the time and a
loop 70% of the time and a loop is equally likely to be followed by a strand or a
helix. At the start of a sequence, any structure is equally likely.
When writing code below, work in natural logarithms throughout to make your
calculations robust to numerical error.
(a) [3 marks] Sketch a diagram of the HMM (a hand-drawn and scanned picture
is ffne). In your diagram, show only state nodes and transitions. Show the
emission probabilities using a separate table.
Note that the transition probabilities of states to themselves (e.g., aHH) are
not given. Derive them by noticing that you are given the expected lengths
of α-helices, β-strands and loops, and that if a quantity L is geometrically
distributed with parameter p then the expected value of L is E[L] = 1/p.
Make sure you use the correct parametrisation of the geometric distribution
1(noting that you can’t have a secondary structure of length 0) and remember
that
P
l
akl = 1 for any state k.
(b) [3 marks] Write a method to simulate state and symbol sequences of arbitrary
length from the HMM. Your method should take sequence length, and model
parameters (a and e) as arguments. Simulate and print out a state and symbol
sequence of length 200.
(c) [3 mark] Write a method to calculate the natural logarithm of the joint probability
P(x, π). Your method should take x, π, and model parameters as
arguments.
Use your method to calculate P(x, π) for π and x given below and for the
sequences you simulated in Q1b.
π = S,S,H,H,H,T,T,S,S,S,H,T,T,H,H,H,S,S,S,S,S,S
x = B,I,B,B,N,I,N,B,N,I,N,B,I,N,B,I,I,N,B,B,N,N
(d) [5 marks] Implement the forward algorithm for HMMs to calculate the natural
logarithm of the probability P(x). Your method should take x as an argument.
Note that we don’t model the end state here.
Use your method to calculate log(P(x)) for π and x given in Q1c and for the
sequences you simulated in Q1b.
How does P(x) compare to P(x, π) for the examples you calculated? Does
this relationship hold in general? Explain your answer.
22. [16 marks total] In this question you will write a method that simulates random
trees, simulates sequences using a mutation process on these trees, calculate a
distance matrix from the simulated sequences and then, using existing code, reconstruct
 the tree from this distance matrix.
(a) [5 marks] Write a method that simulates trees according to the Yule model
(described below) with takes as input the number of leaves, n, and the branching
 parameter, λ. Use the provided Python classes.
The Yule model is a branching process that suggests a method of constructing
trees with n leaves. From each leaf, start a lineage going back in time. Each
lineage coalesces with others at rate λ. When there k lineages, the total rate
of coalescence in the tree is kλ. Thus, we can generate a Yule tree with n
leaves as follows:
Set k = n,t = 0.
Make n leaf nodes with time t and labeled from 1 to n. This is the set of
available nodes.
While k > 1, iterate:
Generate a time tk ∼ Exp (kλ). Set t = t + tk.
Make a new node, m, with height t and choose two nodes, i and j,
uniformly at random from the set of available nodes. Make i and j
the child nodes of m.
Add m to the set of available nodes and remove i and j from this set.
Set k = k-1.
Simulate 1000 trees with λ = 0.5 and n = 10 and check that the mean height
of the trees (that is, the time of the root node) agrees with the theoretical
mean of 3.86.
Use the provided plot tree method to include a picture of a simulated tree
with 10 leaves and λ = 0.5 in your report. To embed the plot in your report,
include in the ffrst cell of your notebook the command %matplotlib inline
(b) [5 marks] The Jukes-Cantor model of DNA sequence evolution is simple:
each site mutates at rate µ and when a mutation occurs, a new base is chosen
uniformly at random from the four possible bases, {A, C, G, T}. If we ignore
mutations from base X to base X, the mutation rate is
3
4
µ. All sites mutate
independently of each other. A sequence that has evolved over time according
to the Jukes-Cantor model has each base equally likely to occur at each site.
The method mutate is provided to simulate the mutation process.
Write a method to simulate sequences down a simulated tree according to the
Jukes-Cantor model.
Your method should take a tree with n leaves, sequence length L, and a
mutation rate µ. It should return either a matrix of sequences corresponding
to nodes in the tree or the tree with sequences stored at the nodes.
3Your method should generate a uniform random sequence of length L at the
root node and recursively mutate it down the branches of the tree, using the
node heights to calculate branch length.
In your report, include a simulated tree with n = 10 and λ = 0.5 and a set
of sequences of length L = 20 and mutation parameter µ = 0.5 simulated on
that tree.
(c) [3 marks] Write a method to calculate the Jukes-Cantor distance matrix, d,
from a set of sequences, where dij is the distance between the ith and the
jth sequences. Recall that the Jukes-Cantor distance for sequences x and y
is deffned by
where fxy is the fraction of differing sites between x and y. Since we will be
dealing with short sequences, use the following deffnition of fxy so that the
distances are well-deffned:
fxy = min
where Dxy is the number of differing sites between x and y and L is the length
of x.
Include a simulated set of sequences of length L = 20 from the tree leaves and
corresponding distance matrix in your report for a tree with n = 10, λ = 0.5
and mutation parameter µ = 0.5.
(d) [3 marks] Now simulate a tree with n = 10 and λ = 0.5 and on that tree,
simulate three sets of sequences with lengths L = 20, L = 50 and L = 200,
respectively, with ffxed µ = 0.1. For each simulated set of sequences, calculate
the distance matrix and print it out.
Then reconstruct the tree using the provided compute upgma tree method.
Use the plot tree method to include a plot of the original tree and a plot of
the reconstructed tree for each distance matrix.
Comment on the quality of the reconstructions and the effect that increasing
the sequence length has on the accuracy of the reconstruction.

請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp










 

掃一掃在手機打開當前頁
  • 上一篇:代寫CS373 COIN、代做Python設計程序
  • 下一篇:CSSE7030代做、代寫Python程序設計
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務-企業/產品研發/客戶要求/設計優化
    有限元分析 CAE仿真分析服務-企業/產品研發
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    日韩精品一区二区三区高清_久久国产热这里只有精品8_天天做爽夜夜做爽_一本岛在免费一二三区

      <em id="rw4ev"></em>

        <tr id="rw4ev"></tr>

        <nav id="rw4ev"></nav>
        <strike id="rw4ev"><pre id="rw4ev"></pre></strike>
        亚洲美女免费精品视频在线观看| 欧美日韩国产91| 国产精品裸体一区二区三区| 亚洲剧情一区二区| 欧美一级淫片播放口| 亚洲激情综合| 亚洲人成77777在线观看网| 夜夜嗨av一区二区三区四区| 最近中文字幕日韩精品| 欧美一区二区三区四区高清| 中日韩视频在线观看| 亚洲美女啪啪| 在线亚洲一区观看| 午夜精品久久久久久久99水蜜桃| 欧美精品大片| 亚洲午夜精品一区二区| 国产精品成人午夜| 国产精品福利在线观看网址| 国产精品天天看| 国产欧美日韩亚洲精品| 国产精品xnxxcom| 男女激情视频一区| 欧美激情第六页| 国产日韩一区在线| 欧美大学生性色视频| 欧美日韩一区二区在线视频| 亚洲开发第一视频在线播放| 国内精品久久久久国产盗摄免费观看完整版| 久久精品一区二区| 久久精品视频99| 久久精品国产免费观看| 欧美午夜视频网站| 欧美精品久久久久久久免费观看| 国产综合婷婷| 欧美激情在线| 欧美激情综合色| 欧美一区二区三区久久精品| 嫩草伊人久久精品少妇av杨幂| 最新成人av网站| 欧美精品福利| 国产精品va在线播放我和闺蜜| 亚洲字幕在线观看| 精品动漫3d一区二区三区免费| 毛片一区二区| 国产精品久久久一区二区三区| 亚洲欧美清纯在线制服| 国产拍揄自揄精品视频麻豆| 亚洲全部视频| a91a精品视频在线观看| 在线亚洲电影| 午夜精品福利电影| 欧美激情网友自拍| 国产精品成人一区二区网站软件| 欧美大片一区| 欧美日韩的一区二区| 久久国产精品99国产精| 国产真实精品久久二三区| 欧美日韩一区二区三| 国产精品久久久久久久久久免费| 亚洲激情电影在线| 在线观看日韩www视频免费| 国产精品网站一区| 亚洲大片精品永久免费| 欧美成人有码| 久久精彩免费视频| 欧美一级二级三级蜜桃| 欧美日韩精品伦理作品在线免费观看| 久久久人人人| 亚洲综合色网站| 一区二区在线免费观看| 亚洲永久免费观看| 久久综合网色—综合色88| 久久精品国产久精国产思思| 一区二区三区不卡视频在线观看| 国产精品自拍小视频| 理论片一区二区在线| 欧美亚洲第一页| 亚洲第一区在线观看| 欧美日韩免费在线观看| 欧美日本网站| 欧美午夜不卡在线观看免费| 亚洲高清中文字幕| 国产欧美日韩一区| 亚洲免费观看高清完整版在线观看熊| 中文精品99久久国产香蕉| 国产亚洲欧美日韩一区二区| 亚洲精品美女91| 国产精品美女视频网站| 亚洲福利视频专区| 一区二区福利| 国产精品免费福利| 久久精品人人做人人爽电影蜜月| 一本色道久久加勒比88综合| 国产精品久久久久aaaa| 老司机凹凸av亚洲导航| 欧美日韩在线高清| 一区二区三区在线不卡| 国产精品性做久久久久久| 99精品国产高清一区二区| 久久精品一本| 欧美另类女人| 亚洲一区视频在线观看视频| 国产精品第13页| 亚洲日本中文字幕免费在线不卡| 欧美精品亚洲一区二区在线播放| 欧美国产日韩一区| 亚洲午夜激情在线| 欧美在线一级视频| 欧美大片在线看免费观看| 亚洲少妇最新在线视频| 一区一区视频| 在线观看91精品国产麻豆| 欧美高清视频在线播放| 国内精品久久久| 一级日韩一区在线观看| 国产精品久久久久久久久久ktv| 一区二区精品国产| 国产精品尤物| 一本色道**综合亚洲精品蜜桃冫| 亚洲制服av| 久久久国产精彩视频美女艺术照福利| 亚洲精品系列| 久久综合久久美利坚合众国| 亚洲缚视频在线观看| 久久久一本精品99久久精品66| 欧美三级在线视频| 亚洲国产欧美一区二区三区丁香婷| 久久久久久网址| 亚洲精品美女久久久久| 久久国产精品色婷婷| 一本大道久久精品懂色aⅴ| 久久久久久香蕉网| 亚洲国产欧美一区| 国产精品美女一区二区在线观看| 欧美区视频在线观看| 一区国产精品| 老司机午夜精品视频在线观看| 最新成人av在线| 久久国产精品久久w女人spa| 欧美一区二区视频在线观看| 欧美视频精品一区| 欧美h视频在线| 国产精品久久久久秋霞鲁丝| 亚洲日本中文字幕区| 亚洲精品国产精品国自产观看| 欧美成人综合在线| 国产伦精品免费视频| 在线观看视频一区二区| 国产一区二区三区免费在线观看| 欧美另类在线播放| 亚洲精品久久久一区二区三区| 极品中文字幕一区| 国产免费成人av| 香蕉免费一区二区三区在线观看| 欧美激情视频一区二区三区不卡| 久久久久久网| 欧美一区二区三区视频免费播放| 国产精品乱人伦一区二区| 亚洲片区在线| 欧美性理论片在线观看片免费| 1024成人网色www| 欧美视频在线免费| 欧美一级视频免费在线观看| 韩国精品主播一区二区在线观看|