代写CS CM121/221 Final代做留学生R程序

CS CM121/221

Final

Problem 1

Pseudoalignment

[30 points]

Consider the two following isoforms:

t1 = AGGAT A

t2 = AT GAT A

t3 = T T GAT A

In this problem, assume we are only generating data from the forward strand, so you don’t need to consider the reverse strand. Why? Because I am nice, dammit.

(a) Draw a transcript. de Bruijn graph with k = 3. You can pick colors if you’d like, otherwise, annotate the equivalence classes with labels 1, 2, or 3.

(b) Assume reads are of length 4 and a read can start at any position (given sufficient length, of course). What are the possible equivalence classes for possible reads from (a)? Further, generate a table with the equivalence class label, and the number of occurrences from possible reads of length 4.

(c) Does your answer in part (b) qualitatively change if the reads are of length 5? Please explain.

(d) Draw the transcript. de Bruijn graph with k = 4 and generate a table like you in did (b) for this graph.

(e) Do you think using a larger k = 4 helps disambiguate reads of length 4 in this case?

Problem 2

Expectation-Maximization Algorithm

[30 points]

Let there be two isoforms, tA and tB with known sequences sampled by RNA-seq and unknown abundances θA and θB. Isoform. tA has effective length l and isoform. tB has effective length 2l.

And now, the problem:

(a) Consider three reads, (r1, r2, r3). r1 is compatible with both tA and tB. r2 is compatible only with tA and r3 is compatible with only tB. Using the standard RSEM algorithm described in class, derive one iteration of the EM algorithm updates assuming you start with abundance θA = θB = 1/2.

(b) Implement the EM algorithm with the following input specification:

1. a compatibility matrix with each row being a read, and each column being an isoform.

2. effective lengths of the isoforms

3. a starting proportion for each transcript.

4. an integer for number of iterations

Output: relative abundances (θ).

(c) Run the EM with the configuration from (a) for 100 iterations where l = 10.

(d) Run the EM with the configuration from (a) for 100 iterations, but with effective lengths equal to each other (both are 10).

(e) Interpret the results from (c) and (d).

Problem 3

Non-linear dimension reduction

[50 points] There is some data on BruinLearn in final/tsne.tsv you need to load for this problem.

You don’t need to know the generating process for the data, but in case it is helpful, here it is. Rows 1 to 100 correspond to the first ‘cluster’ and rows 101 to 200 correspond the second ‘cluster’. The data is generated by:

xi ∼ Normal2(µk(i) , I2),

where k(i) = 1 for i = {1, 2, . . . , 100} and k(i) = 2 for i = {101, 101, . . . , 200}. µ1 = (0, 0) and µ2 = (10, 10).

You are going to implement some components of t-SNE to get some intuition about how different components of the algorithm work. Please add a screenshot of your code, or a notebook printout anytime you are asked for an implementation.

Finally, everything you need to know is in the non-linear dimension reduction slides.

(a) (Page 33) Implement the pj|i matrix. Do yourself a favor and make it a function because

you’re going to use it quite a bit. You can make your function take a single shared = σ 2 . Sanity check: each row should sum to 1. Side note: if you decide to do the extra credit (see (k)), you should allow your algorithm to utilize different otherwise you’re gonna have a bad time. For completeness, the equation,

(b) (Page 33) Implement the pij matrix. Sanity check: the entire matrix should sum to 1. Again, the equation,

where N is the number of samples (200 in this case).

(c) Using σ2 = 1, plot the entire dataset and color the points based on their probability relative to the first data point. To be rigorous: p1j is the vector of probabilities of “j picking 1 as its neighbor”. A reasonable color scale might be: wj ∝ p1j/maxk(p1k). Your plot should show a change of color away from the first data point. Do the same for σ 2 = {0.1, 10, 100}. Each plot might look something like this:

(d) (Page 35) Implement the qij matrix. Sanity check: the entire matrix should sum to 1. The equation:

(e) Using yi = xi (the original data is projected using the identity), plot the entire dataset and color the points based on their q1j probability relative to the first data point. How is it different than the p1j plot from (c) when = 1?

(f) (Page 25) Implement the KL-divergence. Note, the contribution of {ij} is zero when pij = 0. Please use log-sum-exp and logs where appropriate.

(g) Using the real data as the low-dimensional projection, compute the KL-divergence when:

i. σ2 = 0.1.

ii. σ2 = 1.

iii. σ2 = 100.

Any thoughts on what might be happening?

(h) Summarize your thoughts on how these hyper-parameters matter.

(i) Extra credit (3 points): Using σ2 = 1, can you find a projection that reduces the KL-divergence? Note, there are plenty linear or non-linear ones. The easiest might be to do might be ‘move’ one cluster. Plot the projection and report the KL-divergence.

(j) Extra credit (5 points): implement the Perplexity and recompute the KL-divergence from the previous projections you made using the you get for Perplexity {5, 25, 50, 100}. To implement the Perplexity, find the value of that approximately satisfies the equa-tion Perplexity(Pi) = 2H(Pi) where Pi is the i-th row in the pj|i matrix and H(Pi) is the Shannon entropy. Plot a histogram of your values and how did your results change?




热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图