程序代写 IFN647 Workshop (Week 2)

Objectives:
IFN647 Workshop (Week 2)
Python Introduction
• Getting familiar with Python for doing practical questions.

Copyright By PowCoder代写 加微信 powcoder

• UnderstandPythonBasics(week2lecturenotes): o Python commands and statements
o Data structures: list and dictionary
o Functions and Classes
o Reading and writing files
• Please note that this unit assumes that you have programming language experience (e.g., IFN555 Introduction to Programming). Please contact the unit coordinator or the tutor if you have any difficulties for using Python since we will use it for workshop questions, lecture notes and the assessment items.
Task 1: Read through week 2 lecture notes and test all programs used in the lecture notes and discuss any problems with your tutor, use IFN647 Slack or send emails to the unit coordinator:
Task 2: Define a function get_seqs(fname) to open the file fname and read its contents by characters, select all DNA sequences and return a list of DNA sequences. For example,
Sample Data in a file:

>Rosalind_1
>Rosalind_2
>Rosalind_3
>Rosalind_4
>Rosalind_5
>Rosalind_6
>Rosalind_7
Sample Output:
[‘ATCCAGCT’, ‘GGGCAACT’, ‘ATGGATCT’, ‘AAGCAACC’,
‘TTGGAACT’, ‘ATGCCATT’, ‘ATGGCACT’]
Please test the function using seq1.txt and seq3.txt files.
Task 3 (Optional): Design a python solution for generating a consensus string.
A consensus string
is a string of length
formed from a
collection by taking the most common symbol at each
position; the
th symbol of
profile matrix. Of course, there may be more than one most
therefore corresponds to the
th column of the
symbol having the maximum value in the
common symbol, leading to multiple possible consensus
For example,

Given: A collection of DNA strings of equal length (see the attached file seq1.tex and seq3.tex).
Return: A consensus string and profile matrix for the collection (If several possible consensus strings exist, then you may return any one of them). For the above example, the outcomes are:
A: 5 1 0 0 5 5 0 0
C: 0 0 1 4 2 0 6 1
T: 1 5 0 0 0 1 1 6
G: 1 1 6 3 0 1 0 0

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com