Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

Một tập hợp các tập với video, mã và bài tập để học những điều cơ bản của ngôn ngữ lập trình Python thông qua các ví dụ về bộ gen.

Lời chào hỏi! Cảm ơn bạn đã tham gia cùng chúng tôi.

Ở đây, bạn sẽ tìm thấy một loạt các tập phim có các ví dụ từ Genomics để giúp bạn tìm hiểu những điều cơ bản của ngôn ngữ lập trình Python. Không có kinh nghiệm lập trình trước hoặc kiến ​​thức về di truyền học là bắt buộc.

Mỗi tập phim bao gồm một video và một mã làm việc làm nổi bật một khía cạnh cụ thể của Python trong bối cảnh của một vấn đề về genomics. Sự tiến triển từ tập này sang tập khác là gần tuyến tính. Sau khi hoàn thành tập cuối cùng, bạn sẽ có thể tải xuống một tệp bộ gen từ NCBI, và tìm kiếm và kiểm đếm các họa tiết phức tạp.

Nắm vững ngôn ngữ lập trình được thực hiện tốt nhất thông qua sự tham gia tích cực. Khi bạn xem mỗi video, vui lòng mã hóa cùng với chúng tôi, dừng lại khi cần thiết. Điều quan trọng là phải hoàn thành tất cả các bài tập, vì chúng cho phép bạn đánh giá tiến trình của bạn để trở thành một nhà khoa học tính toán độc lập.

Kết thúc, chúng tôi muốn bày tỏ lòng biết ơn của mình đến những người đã đóng góp cho cả quan niệm và hiện thực hóa Python cho các nhà sinh học. Các đồng nghiệp Dimitris Papamichail và Burt Rosenberg, cũng như các cựu trợ lý tốt nghiệp Andreas Seekircher và Justin Stoecker, đã giúp phát triển và thử nghiệm các phiên bản trước đó của tài liệu này. Thông qua sự tham gia nhiệt tình của họ, các sinh viên của chúng tôi đã hỗ trợ chúng tôi sửa chữa ý tưởng của chúng tôi và thiết lập giới hạn thực tế cho sự nhiệt tình của chính chúng tôi. Trong giai đoạn cuối của dự án, chúng tôi được hưởng lợi từ sự hỗ trợ của Ziya Arnavut, Brian Coomes, Jason Glick, Denizen Kocak, Nancy Lawther, Joseph Masterjohn, Kenneth Palmer, Odelia Schwartz và Stefan Wuchty.

Khoa học tính toán là một biên giới hưng thịnh. Chúng tôi hy vọng rằng Python cho các tập phim sinh học sẽ cho phép chủ đề sinh học tính toán trở nên sống động và cám dỗ bạn khám phá nó hơn nữa.

Hüseyin Koçak, Khoa Khoa học Máy tính, Đại học Miami Basar Koc, Khoa Khoa học Máy tính, Đại học Stetson
Basar Koc, Department of Computer Science, Stetson University

Giới thiệu về Python

Chào mừng

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

# ------------------------------------------------------------------
# File name: welcome.py
#
# A line starting with # character is a comment and not interpreted
# by Python. Use comments liberally in your codes.
#
# This is a customary first program to test if your computer is ready
# for Python. Our program will simply print:
#                    Welcome to Python for Biologists!
#
# Version: 2.1
# Authors: H. Kocak and B. Koc
#          University of Miami and Stetson University
# References:
# http://www.python.org
# https://www.python.org/about/gettingstarted/
# ------------------------------------------------------------------

print('Welcome to Python for Biologists!')
 

[csc210@boston myPython]$ python3 welcome.py
Welcome to Python for Biologists!


Download

Bắt đầu

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

# -------------------------------------------------------------------
# File name: beginnings.py
#
# Variable names in Python start with a letter followed by
# combination of letters, digits or underscore (no white spaces).
#
# Four of the basic variable types in Python are
# numeric (integers and floats), string, list, and tuple.
# The code below introduces examples of these variable types.
#
# Version: 2.1
# Authors: H. Kocak and B. Koc
#          University of Miami and Stetson University
# References:
# https://docs.python.org/3/tutorial/introduction.html#an-informal-introduction-to-python
# https://www.ncbi.nlm.nih.gov/nuccore/U00096
# https://en.wikipedia.org/wiki/Chargaff%27s_rules
# ------------------------------------------------------------------

# String variable
organism = "Escherichia coli"        # NCBI accession number U00096
strain = 'str. K-12 substr. MG1665'
print("DEFINITION: " + organism + " " + strain)

# Integer variable
number_of_bps = 4641652
print('Number of base pairs:', number_of_bps)

# Float variable
percent_A = 24.7
percent_T = 23.6

# List variable
percents_AGCT = [percent_A, 26.0, 25.7, percent_T]
print("[A, G, C, T] =", percents_AGCT)

# Computing ratios A/T and G/C
ratio_AT = percent_A / percent_T
ratio_GC = percents_AGCT[1] / percents_AGCT[2]

# Tuple variable
E_Coli = (organism, ratio_AT, ratio_GC)
print(E_Coli)
 

[csc210@boston myPython]$ python3 beginnings.py
DEFINITION: Escherichia coli str. K-12 substr. MG1665
Number of base pairs: 4641652
[A, G, C, T] = [24.7, 26.0, 25.7, 23.6]
('Escherichia coli', 1.0466101694915253, 1.0116731517509727)


Download

In

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

# ------------------------------------------------------------------
# File name: print.py
#
# print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
# The print() function writes the value of the argument(s) it is given.
# It handles multiple arguments, floating point quantities, and strings.
# Strings are printed without quotes, and a space is inserted between items.
# The keyword argument end can be used to avoid the newline (\n) after the output
# or end the output with a different string.
#
# You can escape (overrule its special meaning) a character by
# prefixing it with backslash \
#
# The code below illustrates some of the basic usages of the print() function.
#
# Version: 2.1
# Authors: H. Kocak and B. Koc
#          University of Miami and Stetson University
# References:
# https://docs.python.org/3/library/functions.html#print
# https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting
# https://en.wikipedia.org/wiki/ASCII
# ------------------------------------------------------------------

import math

human_genes = 20000
print('You have', human_genes, 'genes')
print()

# Replacing \n with a string
print('You have', end =' ')
print(human_genes, end = '? ')
print('genes')

# Spreading over lines
print('You have',
      human_genes,
      'genes')

# Escaping with \ and string concatenation
print('You have ' + '\'' + str(human_genes) + '\'' + ' genes')

# printf style string formatting
print('The value of pi is %10s %5.3f' %('--->',  math.pi))

print(chr(7))
 

[csc210@boston myPython]$ python3 print.py
You have 20000 genes

You have 20000? genes
You have 20000 genes
You have '20000' genes
The value of pi is       ---> 3.142


Download

Có lỗi

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

# ------------------------------------------------------------------
# File name: buggy.py
#
  This short Python code contains a number of interntional bugs. Correct
# them with the help of the error messages.
#
# Version: 2.1
# Authors: H. Kocak and B. Koc
#          University of Miami and Stetson University
# References:
# https://americanhistory.si.edu/collections/search/object/nmah_334663
# https://en.wikipedia.org/wiki/Software_bug
# ------------------------------------------------------------------

human genes = 20,000

 protein-name = "GFP';

print('You have', human_genes, 'genes')
print("protein-name stands for
      green fluorescent protein")
 

[csc210@boston myPython]$ python3 buggy.py
  File "buggy.py", line 4
    This short Python code contains a number of interntional bugs. Correct
    ^
IndentationError: unexpected indent


Download


  1. ASCII Art: Viết một chương trình Python in hình ảnh dưới đây.
     __               
    |  \   |\ |    /\ 
    |__/   | \|   /--\
    
    Lưu ý: Bạn có thể sao chép hình ảnh và dán nó vào trình soạn thảo của bạn. Để in ký tự thoát \, bạn cần sử dụng \\. Thử thách cá nhân: Thiết kế các chữ cái của riêng bạn để in ra tên viết tắt của bạn.
    Write a Python program that prints out the image below.
     __               
    |  \   |\ |    /\ 
    |__/   | \|   /--\
    

    Note: You can copy the image and paste it into your editor. To print the escape character \ you need to use \\ .
    Personal challenge: Design your own letters to print out your initials.
  2. Tìm lỗi: Tìm và tiêu diệt các lỗi trong mã Python bên dưới
    # Please correct my errors. 
    first_10_bp = "gggtgcgacg'
    second 10_bp = "attcattgtt"
    gene = first_10-bp + second 10_bp
    
     print('The first 20 bp of BRAC2 gene are gene']
    
    để nó in ra:
    [csc210@boston myPython]$ python3 welcome.py
    Welcome to Python for Biologists!
    
    0
    Find and exterminate the bugs in the Python code below
    # Please correct my errors. 
    first_10_bp = "gggtgcgacg'
    second 10_bp = "attcattgtt"
    gene = first_10-bp + second 10_bp
    
     print('The first 20 bp of BRAC2 gene are gene']
    
    so that it prints out:
    [csc210@boston myPython]$ python3 welcome.py
    Welcome to Python for Biologists!
    
    0
  3. Các bản in đẹp: Khi cần điều khiển chính xác với đầu ra của chương trình của bạn là cần thiết (xếp hàng các cột, điểm thập phân, v.v.), chức năng in của Python là công cụ của bạn. Phải mất hai đối số:
    [csc210@boston myPython]$ python3 welcome.py
    Welcome to Python for Biologists!
    
    1 Ví dụ định dạng là: %15S trường chiều rộng 15 cho một chuỗi; %6D cho một số nguyên có chiều rộng 6; %4.2f cho một số nổi với 4 chữ số bên trái và 2 chữ số ở bên phải của dấu thập phân.
    When precise control with the output of your program is needed (lining up columns, decimal points, etc.), the print function of Python is your tool. It takes two arguments:
    [csc210@boston myPython]$ python3 welcome.py
    Welcome to Python for Biologists!
    
    1 FORMAT examples are: %15s field of width 15 for a string; %6d for an integer of width 6; %4.2f for a floating number with 4 digits to the left and 2 digits to the right of the decimal point.

    Bây giờ, sử dụng câu lệnh

    [csc210@boston myPython]$ python3 welcome.py
    Welcome to Python for Biologists!
    
    2 Là một mẫu, hãy viết mã Python in ra bảng
    [csc210@boston myPython]$ python3 welcome.py
    Welcome to Python for Biologists!
    
    3

Loại dữ liệu

Số

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

[csc210@boston myPython]$ python3 welcome.py
Welcome to Python for Biologists!
4

[csc210@boston myPython]$ python3 welcome.py
Welcome to Python for Biologists!
5


Download

Dây

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

[csc210@boston myPython]$ python3 welcome.py
Welcome to Python for Biologists!
6

[csc210@boston myPython]$ python3 welcome.py
Welcome to Python for Biologists!
7


Download

Danh sách

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

[csc210@boston myPython]$ python3 welcome.py
Welcome to Python for Biologists!
8

[csc210@boston myPython]$ python3 welcome.py
Welcome to Python for Biologists!
9


Download

Tuple

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

# -------------------------------------------------------------------
# File name: beginnings.py
#
# Variable names in Python start with a letter followed by
# combination of letters, digits or underscore (no white spaces).
#
# Four of the basic variable types in Python are
# numeric (integers and floats), string, list, and tuple.
# The code below introduces examples of these variable types.
#
# Version: 2.1
# Authors: H. Kocak and B. Koc
#          University of Miami and Stetson University
# References:
# https://docs.python.org/3/tutorial/introduction.html#an-informal-introduction-to-python
# https://www.ncbi.nlm.nih.gov/nuccore/U00096
# https://en.wikipedia.org/wiki/Chargaff%27s_rules
# ------------------------------------------------------------------

# String variable
organism = "Escherichia coli"        # NCBI accession number U00096
strain = 'str. K-12 substr. MG1665'
print("DEFINITION: " + organism + " " + strain)

# Integer variable
number_of_bps = 4641652
print('Number of base pairs:', number_of_bps)

# Float variable
percent_A = 24.7
percent_T = 23.6

# List variable
percents_AGCT = [percent_A, 26.0, 25.7, percent_T]
print("[A, G, C, T] =", percents_AGCT)

# Computing ratios A/T and G/C
ratio_AT = percent_A / percent_T
ratio_GC = percents_AGCT[1] / percents_AGCT[2]

# Tuple variable
E_Coli = (organism, ratio_AT, ratio_GC)
print(E_Coli)
 
0

# -------------------------------------------------------------------
# File name: beginnings.py
#
# Variable names in Python start with a letter followed by
# combination of letters, digits or underscore (no white spaces).
#
# Four of the basic variable types in Python are
# numeric (integers and floats), string, list, and tuple.
# The code below introduces examples of these variable types.
#
# Version: 2.1
# Authors: H. Kocak and B. Koc
#          University of Miami and Stetson University
# References:
# https://docs.python.org/3/tutorial/introduction.html#an-informal-introduction-to-python
# https://www.ncbi.nlm.nih.gov/nuccore/U00096
# https://en.wikipedia.org/wiki/Chargaff%27s_rules
# ------------------------------------------------------------------

# String variable
organism = "Escherichia coli"        # NCBI accession number U00096
strain = 'str. K-12 substr. MG1665'
print("DEFINITION: " + organism + " " + strain)

# Integer variable
number_of_bps = 4641652
print('Number of base pairs:', number_of_bps)

# Float variable
percent_A = 24.7
percent_T = 23.6

# List variable
percents_AGCT = [percent_A, 26.0, 25.7, percent_T]
print("[A, G, C, T] =", percents_AGCT)

# Computing ratios A/T and G/C
ratio_AT = percent_A / percent_T
ratio_GC = percents_AGCT[1] / percents_AGCT[2]

# Tuple variable
E_Coli = (organism, ratio_AT, ratio_GC)
print(E_Coli)
 
1


Download

Từ điển

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

# -------------------------------------------------------------------
# File name: beginnings.py
#
# Variable names in Python start with a letter followed by
# combination of letters, digits or underscore (no white spaces).
#
# Four of the basic variable types in Python are
# numeric (integers and floats), string, list, and tuple.
# The code below introduces examples of these variable types.
#
# Version: 2.1
# Authors: H. Kocak and B. Koc
#          University of Miami and Stetson University
# References:
# https://docs.python.org/3/tutorial/introduction.html#an-informal-introduction-to-python
# https://www.ncbi.nlm.nih.gov/nuccore/U00096
# https://en.wikipedia.org/wiki/Chargaff%27s_rules
# ------------------------------------------------------------------

# String variable
organism = "Escherichia coli"        # NCBI accession number U00096
strain = 'str. K-12 substr. MG1665'
print("DEFINITION: " + organism + " " + strain)

# Integer variable
number_of_bps = 4641652
print('Number of base pairs:', number_of_bps)

# Float variable
percent_A = 24.7
percent_T = 23.6

# List variable
percents_AGCT = [percent_A, 26.0, 25.7, percent_T]
print("[A, G, C, T] =", percents_AGCT)

# Computing ratios A/T and G/C
ratio_AT = percent_A / percent_T
ratio_GC = percents_AGCT[1] / percents_AGCT[2]

# Tuple variable
E_Coli = (organism, ratio_AT, ratio_GC)
print(E_Coli)
 
2

# -------------------------------------------------------------------
# File name: beginnings.py
#
# Variable names in Python start with a letter followed by
# combination of letters, digits or underscore (no white spaces).
#
# Four of the basic variable types in Python are
# numeric (integers and floats), string, list, and tuple.
# The code below introduces examples of these variable types.
#
# Version: 2.1
# Authors: H. Kocak and B. Koc
#          University of Miami and Stetson University
# References:
# https://docs.python.org/3/tutorial/introduction.html#an-informal-introduction-to-python
# https://www.ncbi.nlm.nih.gov/nuccore/U00096
# https://en.wikipedia.org/wiki/Chargaff%27s_rules
# ------------------------------------------------------------------

# String variable
organism = "Escherichia coli"        # NCBI accession number U00096
strain = 'str. K-12 substr. MG1665'
print("DEFINITION: " + organism + " " + strain)

# Integer variable
number_of_bps = 4641652
print('Number of base pairs:', number_of_bps)

# Float variable
percent_A = 24.7
percent_T = 23.6

# List variable
percents_AGCT = [percent_A, 26.0, 25.7, percent_T]
print("[A, G, C, T] =", percents_AGCT)

# Computing ratios A/T and G/C
ratio_AT = percent_A / percent_T
ratio_GC = percents_AGCT[1] / percents_AGCT[2]

# Tuple variable
E_Coli = (organism, ratio_AT, ratio_GC)
print(E_Coli)
 
3


Download


  1. Câu đố số học: Tạo hai biến số float số
    # -------------------------------------------------------------------
    # File name: beginnings.py
    #
    # Variable names in Python start with a letter followed by
    # combination of letters, digits or underscore (no white spaces).
    #
    # Four of the basic variable types in Python are
    # numeric (integers and floats), string, list, and tuple.
    # The code below introduces examples of these variable types.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://docs.python.org/3/tutorial/introduction.html#an-informal-introduction-to-python
    # https://www.ncbi.nlm.nih.gov/nuccore/U00096
    # https://en.wikipedia.org/wiki/Chargaff%27s_rules
    # ------------------------------------------------------------------
    
    # String variable
    organism = "Escherichia coli"        # NCBI accession number U00096
    strain = 'str. K-12 substr. MG1665'
    print("DEFINITION: " + organism + " " + strain)
    
    # Integer variable
    number_of_bps = 4641652
    print('Number of base pairs:', number_of_bps)
    
    # Float variable
    percent_A = 24.7
    percent_T = 23.6
    
    # List variable
    percents_AGCT = [percent_A, 26.0, 25.7, percent_T]
    print("[A, G, C, T] =", percents_AGCT)
    
    # Computing ratios A/T and G/C
    ratio_AT = percent_A / percent_T
    ratio_GC = percents_AGCT[1] / percents_AGCT[2]
    
    # Tuple variable
    E_Coli = (organism, ratio_AT, ratio_GC)
    print(E_Coli)
     
    
    4 In ra giá trị của
    # -------------------------------------------------------------------
    # File name: beginnings.py
    #
    # Variable names in Python start with a letter followed by
    # combination of letters, digits or underscore (no white spaces).
    #
    # Four of the basic variable types in Python are
    # numeric (integers and floats), string, list, and tuple.
    # The code below introduces examples of these variable types.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://docs.python.org/3/tutorial/introduction.html#an-informal-introduction-to-python
    # https://www.ncbi.nlm.nih.gov/nuccore/U00096
    # https://en.wikipedia.org/wiki/Chargaff%27s_rules
    # ------------------------------------------------------------------
    
    # String variable
    organism = "Escherichia coli"        # NCBI accession number U00096
    strain = 'str. K-12 substr. MG1665'
    print("DEFINITION: " + organism + " " + strain)
    
    # Integer variable
    number_of_bps = 4641652
    print('Number of base pairs:', number_of_bps)
    
    # Float variable
    percent_A = 24.7
    percent_T = 23.6
    
    # List variable
    percents_AGCT = [percent_A, 26.0, 25.7, percent_T]
    print("[A, G, C, T] =", percents_AGCT)
    
    # Computing ratios A/T and G/C
    ratio_AT = percent_A / percent_T
    ratio_GC = percents_AGCT[1] / percents_AGCT[2]
    
    # Tuple variable
    E_Coli = (organism, ratio_AT, ratio_GC)
    print(E_Coli)
     
    
    5 Bạn có chắc bạn đã không phạm sai lầm không? CƯỜI
    Create two numeric float variables
    # -------------------------------------------------------------------
    # File name: beginnings.py
    #
    # Variable names in Python start with a letter followed by
    # combination of letters, digits or underscore (no white spaces).
    #
    # Four of the basic variable types in Python are
    # numeric (integers and floats), string, list, and tuple.
    # The code below introduces examples of these variable types.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://docs.python.org/3/tutorial/introduction.html#an-informal-introduction-to-python
    # https://www.ncbi.nlm.nih.gov/nuccore/U00096
    # https://en.wikipedia.org/wiki/Chargaff%27s_rules
    # ------------------------------------------------------------------
    
    # String variable
    organism = "Escherichia coli"        # NCBI accession number U00096
    strain = 'str. K-12 substr. MG1665'
    print("DEFINITION: " + organism + " " + strain)
    
    # Integer variable
    number_of_bps = 4641652
    print('Number of base pairs:', number_of_bps)
    
    # Float variable
    percent_A = 24.7
    percent_T = 23.6
    
    # List variable
    percents_AGCT = [percent_A, 26.0, 25.7, percent_T]
    print("[A, G, C, T] =", percents_AGCT)
    
    # Computing ratios A/T and G/C
    ratio_AT = percent_A / percent_T
    ratio_GC = percents_AGCT[1] / percents_AGCT[2]
    
    # Tuple variable
    E_Coli = (organism, ratio_AT, ratio_GC)
    print(E_Coli)
     
    
    4 Print out the value of
    # -------------------------------------------------------------------
    # File name: beginnings.py
    #
    # Variable names in Python start with a letter followed by
    # combination of letters, digits or underscore (no white spaces).
    #
    # Four of the basic variable types in Python are
    # numeric (integers and floats), string, list, and tuple.
    # The code below introduces examples of these variable types.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://docs.python.org/3/tutorial/introduction.html#an-informal-introduction-to-python
    # https://www.ncbi.nlm.nih.gov/nuccore/U00096
    # https://en.wikipedia.org/wiki/Chargaff%27s_rules
    # ------------------------------------------------------------------
    
    # String variable
    organism = "Escherichia coli"        # NCBI accession number U00096
    strain = 'str. K-12 substr. MG1665'
    print("DEFINITION: " + organism + " " + strain)
    
    # Integer variable
    number_of_bps = 4641652
    print('Number of base pairs:', number_of_bps)
    
    # Float variable
    percent_A = 24.7
    percent_T = 23.6
    
    # List variable
    percents_AGCT = [percent_A, 26.0, 25.7, percent_T]
    print("[A, G, C, T] =", percents_AGCT)
    
    # Computing ratios A/T and G/C
    ratio_AT = percent_A / percent_T
    ratio_GC = percents_AGCT[1] / percents_AGCT[2]
    
    # Tuple variable
    E_Coli = (organism, ratio_AT, ratio_GC)
    print(E_Coli)
     
    
    5 Are you sure you did not make a mistake? LOL
  2. Brac2 mRNA: Truy cập trang web http://www.ncbi.nlm.nih.gov/nuccore/224004157?report=GenBank chứa một chuỗi mã hóa một phần của gen ung thư vú Brac2. Bạn có thể đọc thêm về gen này tại https://ghr.nlm.nih.gov/gene/brca2 quan sát rằng 60 nucleotide đầu tiên của gen này là:
    # -------------------------------------------------------------------
    # File name: beginnings.py
    #
    # Variable names in Python start with a letter followed by
    # combination of letters, digits or underscore (no white spaces).
    #
    # Four of the basic variable types in Python are
    # numeric (integers and floats), string, list, and tuple.
    # The code below introduces examples of these variable types.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://docs.python.org/3/tutorial/introduction.html#an-informal-introduction-to-python
    # https://www.ncbi.nlm.nih.gov/nuccore/U00096
    # https://en.wikipedia.org/wiki/Chargaff%27s_rules
    # ------------------------------------------------------------------
    
    # String variable
    organism = "Escherichia coli"        # NCBI accession number U00096
    strain = 'str. K-12 substr. MG1665'
    print("DEFINITION: " + organism + " " + strain)
    
    # Integer variable
    number_of_bps = 4641652
    print('Number of base pairs:', number_of_bps)
    
    # Float variable
    percent_A = 24.7
    percent_T = 23.6
    
    # List variable
    percents_AGCT = [percent_A, 26.0, 25.7, percent_T]
    print("[A, G, C, T] =", percents_AGCT)
    
    # Computing ratios A/T and G/C
    ratio_AT = percent_A / percent_T
    ratio_GC = percents_AGCT[1] / percents_AGCT[2]
    
    # Tuple variable
    E_Coli = (organism, ratio_AT, ratio_GC)
    print(E_Coli)
     
    
    6 Tạo một chương trình Python lưu trữ chuỗi này mà không có khoảng trống trong một chuỗi và in ra chuỗi trong chữ thường và cả trong các chữ cái trên.
    Visit the Web page
    http://www.ncbi.nlm.nih.gov/nuccore/224004157?report=genbank
    containing a partial coding mRNA sequence of the breast cancer gene BRAC2. You can read more about this gene at https://ghr.nlm.nih.gov/gene/BRCA2
    Observe that the first 60 nucleotides of this gene are:
    # -------------------------------------------------------------------
    # File name: beginnings.py
    #
    # Variable names in Python start with a letter followed by
    # combination of letters, digits or underscore (no white spaces).
    #
    # Four of the basic variable types in Python are
    # numeric (integers and floats), string, list, and tuple.
    # The code below introduces examples of these variable types.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://docs.python.org/3/tutorial/introduction.html#an-informal-introduction-to-python
    # https://www.ncbi.nlm.nih.gov/nuccore/U00096
    # https://en.wikipedia.org/wiki/Chargaff%27s_rules
    # ------------------------------------------------------------------
    
    # String variable
    organism = "Escherichia coli"        # NCBI accession number U00096
    strain = 'str. K-12 substr. MG1665'
    print("DEFINITION: " + organism + " " + strain)
    
    # Integer variable
    number_of_bps = 4641652
    print('Number of base pairs:', number_of_bps)
    
    # Float variable
    percent_A = 24.7
    percent_T = 23.6
    
    # List variable
    percents_AGCT = [percent_A, 26.0, 25.7, percent_T]
    print("[A, G, C, T] =", percents_AGCT)
    
    # Computing ratios A/T and G/C
    ratio_AT = percent_A / percent_T
    ratio_GC = percents_AGCT[1] / percents_AGCT[2]
    
    # Tuple variable
    E_Coli = (organism, ratio_AT, ratio_GC)
    print(E_Coli)
     
    
    6 Create a Python program that stores this sequence without the blank spaces in a string and prints out the string in lower case and also in upper case letters.
  3. Danh sách các codon cho axit axit: Tạo một biến danh sách giữ các codon DNA cho axit glutamic. Tiếp theo, thêm vào danh sách này các codon DNA mã cho axit aspartic. Danh sách mới của bạn bây giờ nên chứa tất cả các codon DNA cho axit axit. In các codon cho axit axit, một trên mỗi dòng. Bạn sẽ cần phải tra cứu các codon cần thiết trong bảng codon DNA. Create a list variable that holds the DNA codons for Glutamic acid. Next, add to this list the DNA codons that code for Aspartic acid. Your new list now should hold all the DNA codons for acidic acids. Print the codons for acidic acids, one per line. You will need to look up the necessary codons in a DNA codon table.
  4. append () và pop (): Đôi khi, thuận tiện để thêm hoặc trừ khỏi danh sách mà không phải lo lắng về sự bất chính. Hàm append () thêm (các) phần tử vào cuối danh sách:
    # -------------------------------------------------------------------
    # File name: beginnings.py
    #
    # Variable names in Python start with a letter followed by
    # combination of letters, digits or underscore (no white spaces).
    #
    # Four of the basic variable types in Python are
    # numeric (integers and floats), string, list, and tuple.
    # The code below introduces examples of these variable types.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://docs.python.org/3/tutorial/introduction.html#an-informal-introduction-to-python
    # https://www.ncbi.nlm.nih.gov/nuccore/U00096
    # https://en.wikipedia.org/wiki/Chargaff%27s_rules
    # ------------------------------------------------------------------
    
    # String variable
    organism = "Escherichia coli"        # NCBI accession number U00096
    strain = 'str. K-12 substr. MG1665'
    print("DEFINITION: " + organism + " " + strain)
    
    # Integer variable
    number_of_bps = 4641652
    print('Number of base pairs:', number_of_bps)
    
    # Float variable
    percent_A = 24.7
    percent_T = 23.6
    
    # List variable
    percents_AGCT = [percent_A, 26.0, 25.7, percent_T]
    print("[A, G, C, T] =", percents_AGCT)
    
    # Computing ratios A/T and G/C
    ratio_AT = percent_A / percent_T
    ratio_GC = percents_AGCT[1] / percents_AGCT[2]
    
    # Tuple variable
    E_Coli = (organism, ratio_AT, ratio_GC)
    print(E_Coli)
     
    
    7 Bây giờ, hãy làm lại vấn đề trước đó bằng cách sử dụng hàm append ().
    Sometimes it is convenient to add to or subtract from a list without worrying about indecies. The append() function adds an element(s) to the end of a list:
    # -------------------------------------------------------------------
    # File name: beginnings.py
    #
    # Variable names in Python start with a letter followed by
    # combination of letters, digits or underscore (no white spaces).
    #
    # Four of the basic variable types in Python are
    # numeric (integers and floats), string, list, and tuple.
    # The code below introduces examples of these variable types.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://docs.python.org/3/tutorial/introduction.html#an-informal-introduction-to-python
    # https://www.ncbi.nlm.nih.gov/nuccore/U00096
    # https://en.wikipedia.org/wiki/Chargaff%27s_rules
    # ------------------------------------------------------------------
    
    # String variable
    organism = "Escherichia coli"        # NCBI accession number U00096
    strain = 'str. K-12 substr. MG1665'
    print("DEFINITION: " + organism + " " + strain)
    
    # Integer variable
    number_of_bps = 4641652
    print('Number of base pairs:', number_of_bps)
    
    # Float variable
    percent_A = 24.7
    percent_T = 23.6
    
    # List variable
    percents_AGCT = [percent_A, 26.0, 25.7, percent_T]
    print("[A, G, C, T] =", percents_AGCT)
    
    # Computing ratios A/T and G/C
    ratio_AT = percent_A / percent_T
    ratio_GC = percents_AGCT[1] / percents_AGCT[2]
    
    # Tuple variable
    E_Coli = (organism, ratio_AT, ratio_GC)
    print(E_Coli)
     
    
    7 Now, redo the previous problem using the append() function.

    Hàm pop () của python pops và trả về giá trị cuối cùng của danh sách, rút ​​ngắn danh sách theo một yếu tố:

    # -------------------------------------------------------------------
    # File name: beginnings.py
    #
    # Variable names in Python start with a letter followed by
    # combination of letters, digits or underscore (no white spaces).
    #
    # Four of the basic variable types in Python are
    # numeric (integers and floats), string, list, and tuple.
    # The code below introduces examples of these variable types.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://docs.python.org/3/tutorial/introduction.html#an-informal-introduction-to-python
    # https://www.ncbi.nlm.nih.gov/nuccore/U00096
    # https://en.wikipedia.org/wiki/Chargaff%27s_rules
    # ------------------------------------------------------------------
    
    # String variable
    organism = "Escherichia coli"        # NCBI accession number U00096
    strain = 'str. K-12 substr. MG1665'
    print("DEFINITION: " + organism + " " + strain)
    
    # Integer variable
    number_of_bps = 4641652
    print('Number of base pairs:', number_of_bps)
    
    # Float variable
    percent_A = 24.7
    percent_T = 23.6
    
    # List variable
    percents_AGCT = [percent_A, 26.0, 25.7, percent_T]
    print("[A, G, C, T] =", percents_AGCT)
    
    # Computing ratios A/T and G/C
    ratio_AT = percent_A / percent_T
    ratio_GC = percents_AGCT[1] / percents_AGCT[2]
    
    # Tuple variable
    E_Coli = (organism, ratio_AT, ratio_GC)
    print(E_Coli)
     
    
    8
  5. Sắp xếp một danh sách các chuỗi: Sắp xếp các mục của danh sách là một nhiệm vụ phổ biến. Hàm Sắp xếp () của Python lấy một danh sách và trả về danh sách được sắp xếp:
    # -------------------------------------------------------------------
    # File name: beginnings.py
    #
    # Variable names in Python start with a letter followed by
    # combination of letters, digits or underscore (no white spaces).
    #
    # Four of the basic variable types in Python are
    # numeric (integers and floats), string, list, and tuple.
    # The code below introduces examples of these variable types.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://docs.python.org/3/tutorial/introduction.html#an-informal-introduction-to-python
    # https://www.ncbi.nlm.nih.gov/nuccore/U00096
    # https://en.wikipedia.org/wiki/Chargaff%27s_rules
    # ------------------------------------------------------------------
    
    # String variable
    organism = "Escherichia coli"        # NCBI accession number U00096
    strain = 'str. K-12 substr. MG1665'
    print("DEFINITION: " + organism + " " + strain)
    
    # Integer variable
    number_of_bps = 4641652
    print('Number of base pairs:', number_of_bps)
    
    # Float variable
    percent_A = 24.7
    percent_T = 23.6
    
    # List variable
    percents_AGCT = [percent_A, 26.0, 25.7, percent_T]
    print("[A, G, C, T] =", percents_AGCT)
    
    # Computing ratios A/T and G/C
    ratio_AT = percent_A / percent_T
    ratio_GC = percents_AGCT[1] / percents_AGCT[2]
    
    # Tuple variable
    E_Coli = (organism, ratio_AT, ratio_GC)
    print(E_Coli)
     
    
    9 Theo mặc định, các phần tử được sắp xếp theo thứ tự so sánh chuỗi tiêu chuẩn.
    Sorting entries of a list is a common task. The sorted() function of Python takes a list and returns the sorted list:
    # -------------------------------------------------------------------
    # File name: beginnings.py
    #
    # Variable names in Python start with a letter followed by
    # combination of letters, digits or underscore (no white spaces).
    #
    # Four of the basic variable types in Python are
    # numeric (integers and floats), string, list, and tuple.
    # The code below introduces examples of these variable types.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://docs.python.org/3/tutorial/introduction.html#an-informal-introduction-to-python
    # https://www.ncbi.nlm.nih.gov/nuccore/U00096
    # https://en.wikipedia.org/wiki/Chargaff%27s_rules
    # ------------------------------------------------------------------
    
    # String variable
    organism = "Escherichia coli"        # NCBI accession number U00096
    strain = 'str. K-12 substr. MG1665'
    print("DEFINITION: " + organism + " " + strain)
    
    # Integer variable
    number_of_bps = 4641652
    print('Number of base pairs:', number_of_bps)
    
    # Float variable
    percent_A = 24.7
    percent_T = 23.6
    
    # List variable
    percents_AGCT = [percent_A, 26.0, 25.7, percent_T]
    print("[A, G, C, T] =", percents_AGCT)
    
    # Computing ratios A/T and G/C
    ratio_AT = percent_A / percent_T
    ratio_GC = percents_AGCT[1] / percents_AGCT[2]
    
    # Tuple variable
    E_Coli = (organism, ratio_AT, ratio_GC)
    print(E_Coli)
     
    
    9 By default, the elements are sorted lexically in standard string comparison order.

    Sửa đổi mã python của bạn trong vấn đề trước đó để mã của bạn in ra các codon được sắp xếp từ vựng.

  6. Sắp xếp (tại chỗ) một danh sách các số: hàm sort () của python có thể được thực hiện để sắp xếp tại chỗ theo so sánh mong muốn; Bạn nên tham khảo tài liệu Python để biết thêm thông tin. Để sắp xếp danh sách các số bằng số, hãy sử dụng
    [csc210@boston myPython]$ python3 beginnings.py
    DEFINITION: Escherichia coli str. K-12 substr. MG1665
    Number of base pairs: 4641652
    [A, G, C, T] = [24.7, 26.0, 25.7, 23.6]
    ('Escherichia coli', 1.0466101694915253, 1.0116731517509727)
    
    0
    The sort() function of Python can be made to sort in-place according to desired comparisons; you should consults the Python documentation for further information. To sort a list of numbers numerically, use
    [csc210@boston myPython]$ python3 beginnings.py
    DEFINITION: Escherichia coli str. K-12 substr. MG1665
    Number of base pairs: 4641652
    [A, G, C, T] = [24.7, 26.0, 25.7, 23.6]
    ('Escherichia coli', 1.0466101694915253, 1.0116731517509727)
    
    0

    Bây giờ, hãy viết một chương trình Python để sắp xếp danh sách các số chưa được phân loại ở trên và in danh sách được sắp xếp. Thử nghiệm có hoặc không có loại đối số tùy chọn (đảo ngược = true).

  7. Từ điển codon cho axit axit: tạo biến từ điển bằng cách sử dụng các codon RNA mã hóa axit amin axit làm khóa và tên của axit axit là giá trị: (khóa, giá trị) là (codon, axit amin). Trích xuất danh sách các phím từ điển của bạn và in nó. Trích xuất danh sách các giá trị của từ điển của bạn và in nó. Bạn sẽ cần phải tìm kiếm các codon cần thiết trong bảng codon RNA. Create a dictionary variable using the RNA codons that codes for acidic amino acids as keys and the names of the acidic acids as values: (key, value) are (codon, amino acid). Extract the keys list of your dictionary and print it. Extract the values list of your dictionary and print it. You will need to look up for the necessary codons in a RNA codon table.
  8. Từ điển codon cho tất cả các axit amin: Tạo một biến từ điển bằng cách sử dụng các codon RNA mã hóa cho tất cả các axit amin làm khóa và tên của các axit amin là giá trị: (khóa, giá trị) là (UUU, phenylalanine). Cần có 64 mục trong từ điển của bạn. Create a dictionary variable using the RNA codons that codes for all amino acids as keys and the names of the amino acids as values: (key, value) are (UUU, Phenylalanine). There should be 64 items in your dictionary.
  9. Sắp xếp từ điển theo các khóa hoặc theo giá trị: Mã sau minh họa cách sắp xếp từ điển theo các khóa hoặc theo giá trị.
    [csc210@boston myPython]$ python3 beginnings.py
    DEFINITION: Escherichia coli str. K-12 substr. MG1665
    Number of base pairs: 4641652
    [A, G, C, T] = [24.7, 26.0, 25.7, 23.6]
    ('Escherichia coli', 1.0466101694915253, 1.0116731517509727)
    
    1 Sửa đổi mã Python trong bài tập trước để sắp xếp từ điển của bạn về tất cả các codon và axit amin của chúng theo các giá trị. Đầu ra của bạn sẽ bắt đầu như sau:
    [csc210@boston myPython]$ python3 beginnings.py
    DEFINITION: Escherichia coli str. K-12 substr. MG1665
    Number of base pairs: 4641652
    [A, G, C, T] = [24.7, 26.0, 25.7, 23.6]
    ('Escherichia coli', 1.0466101694915253, 1.0116731517509727)
    
    2
    The following code illustrates how to sort a dictionary by keys or by values.
    [csc210@boston myPython]$ python3 beginnings.py
    DEFINITION: Escherichia coli str. K-12 substr. MG1665
    Number of base pairs: 4641652
    [A, G, C, T] = [24.7, 26.0, 25.7, 23.6]
    ('Escherichia coli', 1.0466101694915253, 1.0116731517509727)
    
    1 Modify the Python code in the previous exercise to sort your dictionary of all codons and their amino acids by values. Your output should start as follows:
    [csc210@boston myPython]$ python3 beginnings.py
    DEFINITION: Escherichia coli str. K-12 substr. MG1665
    Number of base pairs: 4641652
    [A, G, C, T] = [24.7, 26.0, 25.7, 23.6]
    ('Escherichia coli', 1.0466101694915253, 1.0116731517509727)
    
    2

Thao tác chuỗi

Chiều dài

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

[csc210@boston myPython]$ python3 beginnings.py
DEFINITION: Escherichia coli str. K-12 substr. MG1665
Number of base pairs: 4641652
[A, G, C, T] = [24.7, 26.0, 25.7, 23.6]
('Escherichia coli', 1.0466101694915253, 1.0116731517509727)
3

[csc210@boston myPython]$ python3 beginnings.py
DEFINITION: Escherichia coli str. K-12 substr. MG1665
Number of base pairs: 4641652
[A, G, C, T] = [24.7, 26.0, 25.7, 23.6]
('Escherichia coli', 1.0466101694915253, 1.0116731517509727)
4


Download

Kết nối

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

[csc210@boston myPython]$ python3 beginnings.py
DEFINITION: Escherichia coli str. K-12 substr. MG1665
Number of base pairs: 4641652
[A, G, C, T] = [24.7, 26.0, 25.7, 23.6]
('Escherichia coli', 1.0466101694915253, 1.0116731517509727)
5

[csc210@boston myPython]$ python3 beginnings.py
DEFINITION: Escherichia coli str. K-12 substr. MG1665
Number of base pairs: 4641652
[A, G, C, T] = [24.7, 26.0, 25.7, 23.6]
('Escherichia coli', 1.0466101694915253, 1.0116731517509727)
6


Download

Tìm thấy

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

[csc210@boston myPython]$ python3 beginnings.py
DEFINITION: Escherichia coli str. K-12 substr. MG1665
Number of base pairs: 4641652
[A, G, C, T] = [24.7, 26.0, 25.7, 23.6]
('Escherichia coli', 1.0466101694915253, 1.0116731517509727)
7

[csc210@boston myPython]$ python3 beginnings.py
DEFINITION: Escherichia coli str. K-12 substr. MG1665
Number of base pairs: 4641652
[A, G, C, T] = [24.7, 26.0, 25.7, 23.6]
('Escherichia coli', 1.0466101694915253, 1.0116731517509727)
8


Download

Lát cắt

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

[csc210@boston myPython]$ python3 beginnings.py
DEFINITION: Escherichia coli str. K-12 substr. MG1665
Number of base pairs: 4641652
[A, G, C, T] = [24.7, 26.0, 25.7, 23.6]
('Escherichia coli', 1.0466101694915253, 1.0116731517509727)
9

# ------------------------------------------------------------------
# File name: print.py
#
# print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
# The print() function writes the value of the argument(s) it is given.
# It handles multiple arguments, floating point quantities, and strings.
# Strings are printed without quotes, and a space is inserted between items.
# The keyword argument end can be used to avoid the newline (\n) after the output
# or end the output with a different string.
#
# You can escape (overrule its special meaning) a character by
# prefixing it with backslash \
#
# The code below illustrates some of the basic usages of the print() function.
#
# Version: 2.1
# Authors: H. Kocak and B. Koc
#          University of Miami and Stetson University
# References:
# https://docs.python.org/3/library/functions.html#print
# https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting
# https://en.wikipedia.org/wiki/ASCII
# ------------------------------------------------------------------

import math

human_genes = 20000
print('You have', human_genes, 'genes')
print()

# Replacing \n with a string
print('You have', end =' ')
print(human_genes, end = '? ')
print('genes')

# Spreading over lines
print('You have',
      human_genes,
      'genes')

# Escaping with \ and string concatenation
print('You have ' + '\'' + str(human_genes) + '\'' + ' genes')

# printf style string formatting
print('The value of pi is %10s %5.3f' %('--->',  math.pi))

print(chr(7))
 
0


Download

Dịch

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

# ------------------------------------------------------------------
# File name: print.py
#
# print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
# The print() function writes the value of the argument(s) it is given.
# It handles multiple arguments, floating point quantities, and strings.
# Strings are printed without quotes, and a space is inserted between items.
# The keyword argument end can be used to avoid the newline (\n) after the output
# or end the output with a different string.
#
# You can escape (overrule its special meaning) a character by
# prefixing it with backslash \
#
# The code below illustrates some of the basic usages of the print() function.
#
# Version: 2.1
# Authors: H. Kocak and B. Koc
#          University of Miami and Stetson University
# References:
# https://docs.python.org/3/library/functions.html#print
# https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting
# https://en.wikipedia.org/wiki/ASCII
# ------------------------------------------------------------------

import math

human_genes = 20000
print('You have', human_genes, 'genes')
print()

# Replacing \n with a string
print('You have', end =' ')
print(human_genes, end = '? ')
print('genes')

# Spreading over lines
print('You have',
      human_genes,
      'genes')

# Escaping with \ and string concatenation
print('You have ' + '\'' + str(human_genes) + '\'' + ' genes')

# printf style string formatting
print('The value of pi is %10s %5.3f' %('--->',  math.pi))

print(chr(7))
 
1

# ------------------------------------------------------------------
# File name: print.py
#
# print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
# The print() function writes the value of the argument(s) it is given.
# It handles multiple arguments, floating point quantities, and strings.
# Strings are printed without quotes, and a space is inserted between items.
# The keyword argument end can be used to avoid the newline (\n) after the output
# or end the output with a different string.
#
# You can escape (overrule its special meaning) a character by
# prefixing it with backslash \
#
# The code below illustrates some of the basic usages of the print() function.
#
# Version: 2.1
# Authors: H. Kocak and B. Koc
#          University of Miami and Stetson University
# References:
# https://docs.python.org/3/library/functions.html#print
# https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting
# https://en.wikipedia.org/wiki/ASCII
# ------------------------------------------------------------------

import math

human_genes = 20000
print('You have', human_genes, 'genes')
print()

# Replacing \n with a string
print('You have', end =' ')
print(human_genes, end = '? ')
print('genes')

# Spreading over lines
print('You have',
      human_genes,
      'genes')

# Escaping with \ and string concatenation
print('You have ' + '\'' + str(human_genes) + '\'' + ' genes')

# printf style string formatting
print('The value of pi is %10s %5.3f' %('--->',  math.pi))

print(chr(7))
 
2


Download

Đảo ngược

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

# ------------------------------------------------------------------
# File name: print.py
#
# print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
# The print() function writes the value of the argument(s) it is given.
# It handles multiple arguments, floating point quantities, and strings.
# Strings are printed without quotes, and a space is inserted between items.
# The keyword argument end can be used to avoid the newline (\n) after the output
# or end the output with a different string.
#
# You can escape (overrule its special meaning) a character by
# prefixing it with backslash \
#
# The code below illustrates some of the basic usages of the print() function.
#
# Version: 2.1
# Authors: H. Kocak and B. Koc
#          University of Miami and Stetson University
# References:
# https://docs.python.org/3/library/functions.html#print
# https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting
# https://en.wikipedia.org/wiki/ASCII
# ------------------------------------------------------------------

import math

human_genes = 20000
print('You have', human_genes, 'genes')
print()

# Replacing \n with a string
print('You have', end =' ')
print(human_genes, end = '? ')
print('genes')

# Spreading over lines
print('You have',
      human_genes,
      'genes')

# Escaping with \ and string concatenation
print('You have ' + '\'' + str(human_genes) + '\'' + ' genes')

# printf style string formatting
print('The value of pi is %10s %5.3f' %('--->',  math.pi))

print(chr(7))
 
3

# ------------------------------------------------------------------
# File name: print.py
#
# print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
# The print() function writes the value of the argument(s) it is given.
# It handles multiple arguments, floating point quantities, and strings.
# Strings are printed without quotes, and a space is inserted between items.
# The keyword argument end can be used to avoid the newline (\n) after the output
# or end the output with a different string.
#
# You can escape (overrule its special meaning) a character by
# prefixing it with backslash \
#
# The code below illustrates some of the basic usages of the print() function.
#
# Version: 2.1
# Authors: H. Kocak and B. Koc
#          University of Miami and Stetson University
# References:
# https://docs.python.org/3/library/functions.html#print
# https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting
# https://en.wikipedia.org/wiki/ASCII
# ------------------------------------------------------------------

import math

human_genes = 20000
print('You have', human_genes, 'genes')
print()

# Replacing \n with a string
print('You have', end =' ')
print(human_genes, end = '? ')
print('genes')

# Spreading over lines
print('You have',
      human_genes,
      'genes')

# Escaping with \ and string concatenation
print('You have ' + '\'' + str(human_genes) + '\'' + ' genes')

# printf style string formatting
print('The value of pi is %10s %5.3f' %('--->',  math.pi))

print(chr(7))
 
4


Download

Thay thế

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

# ------------------------------------------------------------------
# File name: print.py
#
# print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
# The print() function writes the value of the argument(s) it is given.
# It handles multiple arguments, floating point quantities, and strings.
# Strings are printed without quotes, and a space is inserted between items.
# The keyword argument end can be used to avoid the newline (\n) after the output
# or end the output with a different string.
#
# You can escape (overrule its special meaning) a character by
# prefixing it with backslash \
#
# The code below illustrates some of the basic usages of the print() function.
#
# Version: 2.1
# Authors: H. Kocak and B. Koc
#          University of Miami and Stetson University
# References:
# https://docs.python.org/3/library/functions.html#print
# https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting
# https://en.wikipedia.org/wiki/ASCII
# ------------------------------------------------------------------

import math

human_genes = 20000
print('You have', human_genes, 'genes')
print()

# Replacing \n with a string
print('You have', end =' ')
print(human_genes, end = '? ')
print('genes')

# Spreading over lines
print('You have',
      human_genes,
      'genes')

# Escaping with \ and string concatenation
print('You have ' + '\'' + str(human_genes) + '\'' + ' genes')

# printf style string formatting
print('The value of pi is %10s %5.3f' %('--->',  math.pi))

print(chr(7))
 
5

# ------------------------------------------------------------------
# File name: print.py
#
# print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
# The print() function writes the value of the argument(s) it is given.
# It handles multiple arguments, floating point quantities, and strings.
# Strings are printed without quotes, and a space is inserted between items.
# The keyword argument end can be used to avoid the newline (\n) after the output
# or end the output with a different string.
#
# You can escape (overrule its special meaning) a character by
# prefixing it with backslash \
#
# The code below illustrates some of the basic usages of the print() function.
#
# Version: 2.1
# Authors: H. Kocak and B. Koc
#          University of Miami and Stetson University
# References:
# https://docs.python.org/3/library/functions.html#print
# https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting
# https://en.wikipedia.org/wiki/ASCII
# ------------------------------------------------------------------

import math

human_genes = 20000
print('You have', human_genes, 'genes')
print()

# Replacing \n with a string
print('You have', end =' ')
print(human_genes, end = '? ')
print('genes')

# Spreading over lines
print('You have',
      human_genes,
      'genes')

# Escaping with \ and string concatenation
print('You have ' + '\'' + str(human_genes) + '\'' + ' genes')

# printf style string formatting
print('The value of pi is %10s %5.3f' %('--->',  math.pi))

print(chr(7))
 
6


Download


  1. Các codon trong danh sách: Tạo một chương trình Python lưu trữ chuỗi mã hóa DNA dài 15 cơ sở trong một biến chuỗi và sau đó trích xuất tất cả 5 codon bao gồm chuỗi DNA và lưu trữ chúng trong danh sách. Việc sử dụng cắt lát là bắt buộc. Chương trình của bạn nên in chuỗi và, trên một dòng mới, các codon bao gồm nó, được phân tách bằng các tab. Create a Python program that stores a 15-base long DNA coding sequence in a string variable and then extracts all 5 codons comprising the DNA sequence and stores them in a list. The use of slicing is mandatory. Your program should print the sequence and, on a new line, the codons comprising it, separated by tabs.
  2. Fore-and-Aft: Sử dụng cắt, trích xuất và in ra 3 và 3 codon cuối cùng của phân đoạn gen brac2 bên dưới:
    # -------------------------------------------------------------------
    # File name: beginnings.py
    #
    # Variable names in Python start with a letter followed by
    # combination of letters, digits or underscore (no white spaces).
    #
    # Four of the basic variable types in Python are
    # numeric (integers and floats), string, list, and tuple.
    # The code below introduces examples of these variable types.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://docs.python.org/3/tutorial/introduction.html#an-informal-introduction-to-python
    # https://www.ncbi.nlm.nih.gov/nuccore/U00096
    # https://en.wikipedia.org/wiki/Chargaff%27s_rules
    # ------------------------------------------------------------------
    
    # String variable
    organism = "Escherichia coli"        # NCBI accession number U00096
    strain = 'str. K-12 substr. MG1665'
    print("DEFINITION: " + organism + " " + strain)
    
    # Integer variable
    number_of_bps = 4641652
    print('Number of base pairs:', number_of_bps)
    
    # Float variable
    percent_A = 24.7
    percent_T = 23.6
    
    # List variable
    percents_AGCT = [percent_A, 26.0, 25.7, percent_T]
    print("[A, G, C, T] =", percents_AGCT)
    
    # Computing ratios A/T and G/C
    ratio_AT = percent_A / percent_T
    ratio_GC = percents_AGCT[1] / percents_AGCT[2]
    
    # Tuple variable
    E_Coli = (organism, ratio_AT, ratio_GC)
    print(E_Coli)
     
    
    6
    Using slicing, extract and print out the first 3 and the last 3 codons of the BRAC2 gene segment below:
    # -------------------------------------------------------------------
    # File name: beginnings.py
    #
    # Variable names in Python start with a letter followed by
    # combination of letters, digits or underscore (no white spaces).
    #
    # Four of the basic variable types in Python are
    # numeric (integers and floats), string, list, and tuple.
    # The code below introduces examples of these variable types.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://docs.python.org/3/tutorial/introduction.html#an-informal-introduction-to-python
    # https://www.ncbi.nlm.nih.gov/nuccore/U00096
    # https://en.wikipedia.org/wiki/Chargaff%27s_rules
    # ------------------------------------------------------------------
    
    # String variable
    organism = "Escherichia coli"        # NCBI accession number U00096
    strain = 'str. K-12 substr. MG1665'
    print("DEFINITION: " + organism + " " + strain)
    
    # Integer variable
    number_of_bps = 4641652
    print('Number of base pairs:', number_of_bps)
    
    # Float variable
    percent_A = 24.7
    percent_T = 23.6
    
    # List variable
    percents_AGCT = [percent_A, 26.0, 25.7, percent_T]
    print("[A, G, C, T] =", percents_AGCT)
    
    # Computing ratios A/T and G/C
    ratio_AT = percent_A / percent_T
    ratio_GC = percents_AGCT[1] / percents_AGCT[2]
    
    # Tuple variable
    E_Coli = (organism, ratio_AT, ratio_GC)
    print(E_Coli)
     
    
    6
  3. Tìm họa tiết: Tạo một chương trình Python tính toán và in số lượng nucleotide tách biệt lần đầu tiên và cuối cùng của họa tiết Agag ở trường hợp, chữ hoa hoặc kết hợp, trong chuỗi DNA
    # ------------------------------------------------------------------
    # File name: print.py
    #
    # print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
    # The print() function writes the value of the argument(s) it is given.
    # It handles multiple arguments, floating point quantities, and strings.
    # Strings are printed without quotes, and a space is inserted between items.
    # The keyword argument end can be used to avoid the newline (\n) after the output
    # or end the output with a different string.
    #
    # You can escape (overrule its special meaning) a character by
    # prefixing it with backslash \
    #
    # The code below illustrates some of the basic usages of the print() function.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://docs.python.org/3/library/functions.html#print
    # https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting
    # https://en.wikipedia.org/wiki/ASCII
    # ------------------------------------------------------------------
    
    import math
    
    human_genes = 20000
    print('You have', human_genes, 'genes')
    print()
    
    # Replacing \n with a string
    print('You have', end =' ')
    print(human_genes, end = '? ')
    print('genes')
    
    # Spreading over lines
    print('You have',
          human_genes,
          'genes')
    
    # Escaping with \ and string concatenation
    print('You have ' + '\'' + str(human_genes) + '\'' + ' genes')
    
    # printf style string formatting
    print('The value of pi is %10s %5.3f' %('--->',  math.pi))
    
    print(chr(7))
     
    
    8
    Create a Python program that computes and prints the number of nucleotides that separate the first and last appearance of the motif AGAG in lower case, upper case, or combination, in the DNA sequence
    # ------------------------------------------------------------------
    # File name: print.py
    #
    # print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
    # The print() function writes the value of the argument(s) it is given.
    # It handles multiple arguments, floating point quantities, and strings.
    # Strings are printed without quotes, and a space is inserted between items.
    # The keyword argument end can be used to avoid the newline (\n) after the output
    # or end the output with a different string.
    #
    # You can escape (overrule its special meaning) a character by
    # prefixing it with backslash \
    #
    # The code below illustrates some of the basic usages of the print() function.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://docs.python.org/3/library/functions.html#print
    # https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting
    # https://en.wikipedia.org/wiki/ASCII
    # ------------------------------------------------------------------
    
    import math
    
    human_genes = 20000
    print('You have', human_genes, 'genes')
    print()
    
    # Replacing \n with a string
    print('You have', end =' ')
    print(human_genes, end = '? ')
    print('genes')
    
    # Spreading over lines
    print('You have',
          human_genes,
          'genes')
    
    # Escaping with \ and string concatenation
    print('You have ' + '\'' + str(human_genes) + '\'' + ' genes')
    
    # printf style string formatting
    print('The value of pi is %10s %5.3f' %('--->',  math.pi))
    
    print(chr(7))
     
    
    8
  4. Bổ sung ngược: Tạo một chương trình Python tính toán bổ sung ngược của chuỗi DNA bên dưới và in trình tự và bổ sung ngược của nó:
    # ------------------------------------------------------------------
    # File name: print.py
    #
    # print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
    # The print() function writes the value of the argument(s) it is given.
    # It handles multiple arguments, floating point quantities, and strings.
    # Strings are printed without quotes, and a space is inserted between items.
    # The keyword argument end can be used to avoid the newline (\n) after the output
    # or end the output with a different string.
    #
    # You can escape (overrule its special meaning) a character by
    # prefixing it with backslash \
    #
    # The code below illustrates some of the basic usages of the print() function.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://docs.python.org/3/library/functions.html#print
    # https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting
    # https://en.wikipedia.org/wiki/ASCII
    # ------------------------------------------------------------------
    
    import math
    
    human_genes = 20000
    print('You have', human_genes, 'genes')
    print()
    
    # Replacing \n with a string
    print('You have', end =' ')
    print(human_genes, end = '? ')
    print('genes')
    
    # Spreading over lines
    print('You have',
          human_genes,
          'genes')
    
    # Escaping with \ and string concatenation
    print('You have ' + '\'' + str(human_genes) + '\'' + ' genes')
    
    # printf style string formatting
    print('The value of pi is %10s %5.3f' %('--->',  math.pi))
    
    print(chr(7))
     
    
    8
    Create a Python program that computes the reverse complement of the DNA sequence below and prints the sequence and its reverse complement:
    # ------------------------------------------------------------------
    # File name: print.py
    #
    # print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
    # The print() function writes the value of the argument(s) it is given.
    # It handles multiple arguments, floating point quantities, and strings.
    # Strings are printed without quotes, and a space is inserted between items.
    # The keyword argument end can be used to avoid the newline (\n) after the output
    # or end the output with a different string.
    #
    # You can escape (overrule its special meaning) a character by
    # prefixing it with backslash \
    #
    # The code below illustrates some of the basic usages of the print() function.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://docs.python.org/3/library/functions.html#print
    # https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting
    # https://en.wikipedia.org/wiki/ASCII
    # ------------------------------------------------------------------
    
    import math
    
    human_genes = 20000
    print('You have', human_genes, 'genes')
    print()
    
    # Replacing \n with a string
    print('You have', end =' ')
    print(human_genes, end = '? ')
    print('genes')
    
    # Spreading over lines
    print('You have',
          human_genes,
          'genes')
    
    # Escaping with \ and string concatenation
    print('You have ' + '\'' + str(human_genes) + '\'' + ' genes')
    
    # printf style string formatting
    print('The value of pi is %10s %5.3f' %('--->',  math.pi))
    
    print(chr(7))
     
    
    8
  5. DNA đến RNA: Viết một chương trình Python in ra chuỗi RNA tương ứng của một chuỗi DNA đã cho. Đảm bảo xử lý các chuỗi cả chữ thường và chữ hoa (bản đồ t -> u, t -> u). Write a Python program that prints out the corresponding RNA sequence of a given DNA sequence. Make sure to handle sequences both in lowercase and uppercase (map t -> u, T -> U).
  6. Đếm các cặp cơ sở: Viết mã Python in ra tỷ lệ phần trăm của bốn nucleotide A, C, G, T trong phân đoạn sau của gen ung thư vú Brac2:
    [csc210@boston myPython]$ python3 print.py
    You have 20000 genes
    
    You have 20000? genes
    You have 20000 genes
    You have '20000' genes
    The value of pi is       ---> 3.142
    
    0
    Write a Python code that prints out the percentages of the four nucleotides A, C, G, T in the following segment of the breast cancer gene BRAC2:
    [csc210@boston myPython]$ python3 print.py
    You have 20000 genes
    
    You have 20000? genes
    You have 20000 genes
    You have '20000' genes
    The value of pi is       ---> 3.142
    
    0
  7. Sửa đổi chuỗi: Trong ngôn ngữ lập trình Python, các biến chuỗi là bất biến (không thể thay đổi) nhưng các biến danh sách là có thể thay đổi. Tuy nhiên, có thể chuyển đổi một chuỗi thành một danh sách, sửa đổi danh sách và chuyển đổi danh sách đã sửa đổi trở lại một chuỗi. Viết mã Python lấy chuỗi
    [csc210@boston myPython]$ python3 print.py
    You have 20000 genes
    
    You have 20000? genes
    You have 20000 genes
    You have '20000' genes
    The value of pi is       ---> 3.142
    
    1 và gây ra hai đột biến: Thay thế "G" thứ 4 bằng "A" và xóa thứ 4 "T".
    In the Python programming language, string variables are immutable (cannot be changed) but list variables are mutable. However, it is possible to convert a string to a list, modify the list, and convert the modified list back to a string. Write a Python code that takes the string
    [csc210@boston myPython]$ python3 print.py
    You have 20000 genes
    
    You have 20000? genes
    You have 20000 genes
    You have '20000' genes
    The value of pi is       ---> 3.142
    
    1 and causes two mutations: replace the 4th "g" with an "a" and delete the 4th "t".

Điều kiện và vòng lặp

Nếu khác

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

[csc210@boston myPython]$ python3 print.py
You have 20000 genes

You have 20000? genes
You have 20000 genes
You have '20000' genes
The value of pi is       ---> 3.142
2

[csc210@boston myPython]$ python3 print.py
You have 20000 genes

You have 20000? genes
You have 20000 genes
You have '20000' genes
The value of pi is       ---> 3.142
3


Download

Nếu Elif

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

[csc210@boston myPython]$ python3 print.py
You have 20000 genes

You have 20000? genes
You have 20000 genes
You have '20000' genes
The value of pi is       ---> 3.142
4

[csc210@boston myPython]$ python3 print.py
You have 20000 genes

You have 20000? genes
You have 20000 genes
You have '20000' genes
The value of pi is       ---> 3.142
5


Download

Trong khi

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

[csc210@boston myPython]$ python3 print.py
You have 20000 genes

You have 20000? genes
You have 20000 genes
You have '20000' genes
The value of pi is       ---> 3.142
6

[csc210@boston myPython]$ python3 print.py
You have 20000 genes

You have 20000? genes
You have 20000 genes
You have '20000' genes
The value of pi is       ---> 3.142
7


Download

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

[csc210@boston myPython]$ python3 print.py
You have 20000 genes

You have 20000? genes
You have 20000 genes
You have '20000' genes
The value of pi is       ---> 3.142
8

[csc210@boston myPython]$ python3 print.py
You have 20000 genes

You have 20000? genes
You have 20000 genes
You have '20000' genes
The value of pi is       ---> 3.142
9


Download

Phạm vi

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

# ------------------------------------------------------------------
# File name: buggy.py
#
  This short Python code contains a number of interntional bugs. Correct
# them with the help of the error messages.
#
# Version: 2.1
# Authors: H. Kocak and B. Koc
#          University of Miami and Stetson University
# References:
# https://americanhistory.si.edu/collections/search/object/nmah_334663
# https://en.wikipedia.org/wiki/Software_bug
# ------------------------------------------------------------------

human genes = 20,000

 protein-name = "GFP';

print('You have', human_genes, 'genes')
print("protein-name stands for
      green fluorescent protein")
 
0

# ------------------------------------------------------------------
# File name: buggy.py
#
  This short Python code contains a number of interntional bugs. Correct
# them with the help of the error messages.
#
# Version: 2.1
# Authors: H. Kocak and B. Koc
#          University of Miami and Stetson University
# References:
# https://americanhistory.si.edu/collections/search/object/nmah_334663
# https://en.wikipedia.org/wiki/Software_bug
# ------------------------------------------------------------------

human genes = 20,000

 protein-name = "GFP';

print('You have', human_genes, 'genes')
print("protein-name stands for
      green fluorescent protein")
 
1


Download

Đếm với từ điển

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

# ------------------------------------------------------------------
# File name: buggy.py
#
  This short Python code contains a number of interntional bugs. Correct
# them with the help of the error messages.
#
# Version: 2.1
# Authors: H. Kocak and B. Koc
#          University of Miami and Stetson University
# References:
# https://americanhistory.si.edu/collections/search/object/nmah_334663
# https://en.wikipedia.org/wiki/Software_bug
# ------------------------------------------------------------------

human genes = 20,000

 protein-name = "GFP';

print('You have', human_genes, 'genes')
print("protein-name stands for
      green fluorescent protein")
 
2

# ------------------------------------------------------------------
# File name: buggy.py
#
  This short Python code contains a number of interntional bugs. Correct
# them with the help of the error messages.
#
# Version: 2.1
# Authors: H. Kocak and B. Koc
#          University of Miami and Stetson University
# References:
# https://americanhistory.si.edu/collections/search/object/nmah_334663
# https://en.wikipedia.org/wiki/Software_bug
# ------------------------------------------------------------------

human genes = 20,000

 protein-name = "GFP';

print('You have', human_genes, 'genes')
print("protein-name stands for
      green fluorescent protein")
 
3


Download


  1. Tìm kiếm các mẫu: Tạo một chương trình Python có thể kiểm tra xem một chuỗi DNA nhất định có chứa mẫu
    # ------------------------------------------------------------------
    # File name: buggy.py
    #
      This short Python code contains a number of interntional bugs. Correct
    # them with the help of the error messages.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://americanhistory.si.edu/collections/search/object/nmah_334663
    # https://en.wikipedia.org/wiki/Software_bug
    # ------------------------------------------------------------------
    
    human genes = 20,000
    
     protein-name = "GFP';
    
    print('You have', human_genes, 'genes')
    print("protein-name stands for
          green fluorescent protein")
     
    
    4 trong đó XXX có thể là ba cơ sở DNA liên tiếp hay không. Điều đó có nghĩa là chương trình của bạn, được đưa ra một số chuỗi, nên xác định nếu TATA, theo sau là bất kỳ ba cặp cơ sở DNA nào, theo sau là ATG, theo sau là ba cặp cơ sở DNA nào, tiếp theo là T có thể được tìm thấy trong chuỗi đã cho. Kiểm tra cả chuỗi bổ sung chuyển tiếp và đảo ngược (bổ sung ngược). Tạo ba ví dụ, một ví dụ có chuỗi DNA chứa mẫu trong chuỗi chuyển tiếp, một ví dụ chứa mẫu trong chuỗi bổ sung ngược và một mẫu không chứa nó trong chuỗi, để chứng minh cách thức hoạt động của chương trình. Vui lòng bao gồm các câu lệnh in xác định từng trường hợp khác nhau và vị trí của mẫu trong chuỗi, nếu được tìm thấy.
    Create a Python program that can check whether a given DNA sequence contains the pattern
    # ------------------------------------------------------------------
    # File name: buggy.py
    #
      This short Python code contains a number of interntional bugs. Correct
    # them with the help of the error messages.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://americanhistory.si.edu/collections/search/object/nmah_334663
    # https://en.wikipedia.org/wiki/Software_bug
    # ------------------------------------------------------------------
    
    human genes = 20,000
    
     protein-name = "GFP';
    
    print('You have', human_genes, 'genes')
    print("protein-name stands for
          green fluorescent protein")
     
    
    4 where xxx can be any three consecutive DNA bases. That means your program, given some string, should identify if TATA, followed by any three DNA base pairs, followed by ATG, followed by any three DNA base pairs, followed by T can be found in the given string. Check both the forward and reverse complementary strand (reverse complement). Create three examples, one with a DNA string that contains the pattern in the forward strand, one that contains the pattern in the reverse complement strand and one that does not contain it in either strand, to demonstrate how the program works. Please include print statements that identify each different case and the position of the pattern in the string, if found.
  2. Các codon trong mảng: Tạo một chương trình Python lưu trữ chuỗi DNA có độ dài nào, trích xuất tất cả các codon trong chuỗi và lưu trữ chúng trong một danh sách. In trình tự và các codon, một trên mỗi dòng, bao gồm nó. Chương trình của bạn nên xử lý trường hợp độ dài trình tự không phải là bội số của 3. Kiểm tra chương trình của bạn với một số chuỗi. Create a Python program that stores a DNA sequence of any length, extracts all codons in the sequence, and stores them in a list. Print the sequence and the codons, one per line, comprising it. Your program should handle the case where the sequence length is not a multiple of 3. Test your program with several sequences.
  3. Tăng trưởng hậu cần với trong khi và với phạm vi: Xem xét mô hình logistic riêng biệt
    # ------------------------------------------------------------------
    # File name: buggy.py
    #
      This short Python code contains a number of interntional bugs. Correct
    # them with the help of the error messages.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://americanhistory.si.edu/collections/search/object/nmah_334663
    # https://en.wikipedia.org/wiki/Software_bug
    # ------------------------------------------------------------------
    
    human genes = 20,000
    
     protein-name = "GFP';
    
    print('You have', human_genes, 'genes')
    print("protein-name stands for
          green fluorescent protein")
     
    
    5 điều chỉnh sự tăng trưởng của một dân số duy nhất với các thế hệ không chồng chéo. Ở đây, R là tốc độ tăng trưởng và x [n] là mật độ của thế hệ N-th. Khắc phục tốc độ tăng trưởng và mật độ dân số ban đầu là
    # ------------------------------------------------------------------
    # File name: buggy.py
    #
      This short Python code contains a number of interntional bugs. Correct
    # them with the help of the error messages.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://americanhistory.si.edu/collections/search/object/nmah_334663
    # https://en.wikipedia.org/wiki/Software_bug
    # ------------------------------------------------------------------
    
    human genes = 20,000
    
     protein-name = "GFP';
    
    print('You have', human_genes, 'genes')
    print("protein-name stands for
          green fluorescent protein")
     
    
    6 Viết một chương trình Python tính toán mật độ dân số trong 12 thế hệ bằng cách sử dụng một tuyên bố một thời gian và in ra mỗi thế hệ và mật độ dân số của nó trên một dòng riêng cho tất cả 12 thế hệ.
    Consider the discrete logistic model
    # ------------------------------------------------------------------
    # File name: buggy.py
    #
      This short Python code contains a number of interntional bugs. Correct
    # them with the help of the error messages.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://americanhistory.si.edu/collections/search/object/nmah_334663
    # https://en.wikipedia.org/wiki/Software_bug
    # ------------------------------------------------------------------
    
    human genes = 20,000
    
     protein-name = "GFP';
    
    print('You have', human_genes, 'genes')
    print("protein-name stands for
          green fluorescent protein")
     
    
    5 governing the growth of a single population with non-overlapping generations. Here, r is the growth rate and x[n] is the density of the n-th generation. Fix the growth rate and the initial population density as
    # ------------------------------------------------------------------
    # File name: buggy.py
    #
      This short Python code contains a number of interntional bugs. Correct
    # them with the help of the error messages.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://americanhistory.si.edu/collections/search/object/nmah_334663
    # https://en.wikipedia.org/wiki/Software_bug
    # ------------------------------------------------------------------
    
    human genes = 20,000
    
     protein-name = "GFP';
    
    print('You have', human_genes, 'genes')
    print("protein-name stands for
          green fluorescent protein")
     
    
    6 Write a Python program that computes the population densities for 12 generations using a while statement, and prints out each generation and its population density on a separate line for all 12 generations.

    Bây giờ, hãy viết một chương trình Python thứ hai hoàn thành cùng một nhiệm vụ bằng cách sử dụng câu lệnh cho phạm vi.

  4. Định vị chuỗi con: Mã python trong khi.py tính toán số lượng xảy ra của cơ sở nucleotide trong chuỗi DNA. Sửa đổi mã này để đếm số lần xuất hiện của một chuỗi con nhất định trong chuỗi DNA. Python code while.py computes the number of occurances of a nucleotide base in a DNA string. Modify this code to count the number of occurances of a given substring in a DNA string.
  5. Trong khi hoặc cho: mã python trong khi.py tính toán số lượng xảy ra của cơ sở nucleotide trong chuỗi DNA. Thay thế vòng lặp bằng một vòng cho vòng để đạt được kết quả tương tự. Python code while.py computes the number of occurances of a nucleotide base in a DNA string. Replace the while loop with a for loop to achieve the same result.
  6. Tất cả các codon: Sử dụng càng nhiều câu lệnh khi cần thiết, hãy viết một chương trình Python in tất cả 64 codon. Using as many for statements as necessary, write a Python program that prints out all 64 codons.
  7. Định vị các vị trí cắt các enzyme hạn chế: Trong tập trên từ điển, chúng tôi đã tạo ra một biến thể chính thức với tên của các enzyme hạn chế là các khóa và trình tự nhận dạng tương ứng như các giá trị:
    # ------------------------------------------------------------------
    # File name: buggy.py
    #
      This short Python code contains a number of interntional bugs. Correct
    # them with the help of the error messages.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://americanhistory.si.edu/collections/search/object/nmah_334663
    # https://en.wikipedia.org/wiki/Software_bug
    # ------------------------------------------------------------------
    
    human genes = 20,000
    
     protein-name = "GFP';
    
    print('You have', human_genes, 'genes')
    print("protein-name stands for
          green fluorescent protein")
     
    
    7 Viết mã python để xác định xem trình tự DNA
    # ------------------------------------------------------------------
    # File name: buggy.py
    #
      This short Python code contains a number of interntional bugs. Correct
    # them with the help of the error messages.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://americanhistory.si.edu/collections/search/object/nmah_334663
    # https://en.wikipedia.org/wiki/Software_bug
    # ------------------------------------------------------------------
    
    human genes = 20,000
    
     protein-name = "GFP';
    
    print('You have', human_genes, 'genes')
    print("protein-name stands for
          green fluorescent protein")
     
    
    8 Bất kỳ enzyme hạn chế nào. In ra vị trí (chỉ mục) của các trang web nhận dạng trong chuỗi DNA. Đối với vấn đề này, bạn nên lặp qua các khóa của biến Dict.
    In the episode on dictionaries, we created a dict varible with the names of restriction enzymes as keys and the corresponding recognition sequences as values:
    # ------------------------------------------------------------------
    # File name: buggy.py
    #
      This short Python code contains a number of interntional bugs. Correct
    # them with the help of the error messages.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://americanhistory.si.edu/collections/search/object/nmah_334663
    # https://en.wikipedia.org/wiki/Software_bug
    # ------------------------------------------------------------------
    
    human genes = 20,000
    
     protein-name = "GFP';
    
    print('You have', human_genes, 'genes')
    print("protein-name stands for
          green fluorescent protein")
     
    
    7 Write a Python code to determine if the DNA sequence
    # ------------------------------------------------------------------
    # File name: buggy.py
    #
      This short Python code contains a number of interntional bugs. Correct
    # them with the help of the error messages.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://americanhistory.si.edu/collections/search/object/nmah_334663
    # https://en.wikipedia.org/wiki/Software_bug
    # ------------------------------------------------------------------
    
    human genes = 20,000
    
     protein-name = "GFP';
    
    print('You have', human_genes, 'genes')
    print("protein-name stands for
          green fluorescent protein")
     
    
    8 will be cut with any of these restriction enzymes. Print out the location (index) of the recognition sites in the DNA sequence. For this problem, you should loop through the keys of the dict variable.
  8. Tạo chuỗi DNA ngẫu nhiên: Tạo chuỗi DNA ngẫu nhiên 1001 cơ sở dài và lưu trữ nó trong một biến chuỗi. Để làm điều này, hãy sử dụng danh sách các nucleotide và hàm ngẫu nhiên.randint () từ mô -đun ngẫu nhiên của pyhon. In ra tỷ lệ phần trăm của bốn nucleotide trong chuỗi DNA ngẫu nhiên của bạn. Generate a random DNA string of 1001 bases long and store it in a string variable. To do this, use a list of nucleotides and the random.randint() function from the random module of Pyhon. Print out the percentages of the four nucleotides in your random DNA string.

    Chạy chương trình của bạn nhiều lần. Bạn có nhận được cùng một chuỗi ngẫu nhiên? Không thể! Đối với một số mô phỏng nhất định, có thể cần phải sử dụng cùng một chuỗi ngẫu nhiên. Tham khảo tài liệu về cách đặt hạt giống của chức năng Python ngẫu nhiên.Seed ().

  9. Đếm K-MERS: Trích xuất tất cả các chuỗi con có độ dài 4 (4-mers) từ chuỗi
    # ------------------------------------------------------------------
    # File name: buggy.py
    #
      This short Python code contains a number of interntional bugs. Correct
    # them with the help of the error messages.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://americanhistory.si.edu/collections/search/object/nmah_334663
    # https://en.wikipedia.org/wiki/Software_bug
    # ------------------------------------------------------------------
    
    human genes = 20,000
    
     protein-name = "GFP';
    
    print('You have', human_genes, 'genes')
    print("protein-name stands for
          green fluorescent protein")
     
    
    9 và lưu trữ chúng trong một từ điển. Sử dụng 4-mers làm khóa và số lần xuất hiện làm giá trị trong từ điển. In ra tất cả 4-mers trong DNA_SEQ.
    Extract all substrings of length 4 (4-mers) from the sequence
    # ------------------------------------------------------------------
    # File name: buggy.py
    #
      This short Python code contains a number of interntional bugs. Correct
    # them with the help of the error messages.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://americanhistory.si.edu/collections/search/object/nmah_334663
    # https://en.wikipedia.org/wiki/Software_bug
    # ------------------------------------------------------------------
    
    human genes = 20,000
    
     protein-name = "GFP';
    
    print('You have', human_genes, 'genes')
    print("protein-name stands for
          green fluorescent protein")
     
    
    9 and store them in a dictionary. Use the 4-mers as keys and the number of appearances as values in the dictionary. Print out all 4-mers in DNA_seq.
  10. Tạo các chuỗi DNA ngẫu nhiên của con người: Quy tắc Chargaff nói rằng "một phân tử DNA sợi kép trên toàn cầu có tỷ lệ phần trăm cân bằng cặp cơ sở: %a = %t và %g = %c." Tuy nhiên, %a và %g thay đổi theo sinh vật. Ví dụ, con người có, khoảng 29% A và 21% C. Viết một chương trình Python tạo ra các chuỗi DNA ngẫu nhiên với tỷ lệ phần trăm của A, T, C và G của DNA người. Chargaff rule states that "a double-stranded DNA molecule globally has percentage base pair equality: %A = %T and %G = %C." However, %A and %G varies with organisms. For instance, humans have, approximately, 29% A and 21% C. Write a Python program that generates random DNA sequences with percentages of A, T, C, and G of human DNA.
  11. Đột biến ngẫu nhiên: Viết chương trình Python gây ra ba đột biến ngẫu nhiên trong chuỗi DNA sau
    [csc210@boston myPython]$ python3 buggy.py
      File "buggy.py", line 4
        This short Python code contains a number of interntional bugs. Correct
        ^
    IndentationError: unexpected indent
    
    0 đảm bảo rằng cả vị trí và loại đột biến (thay thế, chèn và xóa) là ngẫu nhiên.
    Write a Python program that causes three random mutations in the following DNA sequence
    [csc210@boston myPython]$ python3 buggy.py
      File "buggy.py", line 4
        This short Python code contains a number of interntional bugs. Correct
        ^
    IndentationError: unexpected indent
    
    0 Make sure that both the locations and mutation types (replacement, insertion, and deletion) are random.

Tiện ích

Argv

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

[csc210@boston myPython]$ python3 buggy.py
  File "buggy.py", line 4
    This short Python code contains a number of interntional bugs. Correct
    ^
IndentationError: unexpected indent
1

[csc210@boston myPython]$ python3 buggy.py
  File "buggy.py", line 4
    This short Python code contains a number of interntional bugs. Correct
    ^
IndentationError: unexpected indent
2


Download

Đầu vào

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

[csc210@boston myPython]$ python3 buggy.py
  File "buggy.py", line 4
    This short Python code contains a number of interntional bugs. Correct
    ^
IndentationError: unexpected indent
3

[csc210@boston myPython]$ python3 buggy.py
  File "buggy.py", line 4
    This short Python code contains a number of interntional bugs. Correct
    ^
IndentationError: unexpected indent
4


Download

Try/except

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

[csc210@boston myPython]$ python3 buggy.py
  File "buggy.py", line 4
    This short Python code contains a number of interntional bugs. Correct
    ^
IndentationError: unexpected indent
5

[csc210@boston myPython]$ python3 buggy.py
  File "buggy.py", line 4
    This short Python code contains a number of interntional bugs. Correct
    ^
IndentationError: unexpected indent
6


Download

Hàm số

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

[csc210@boston myPython]$ python3 buggy.py
  File "buggy.py", line 4
    This short Python code contains a number of interntional bugs. Correct
    ^
IndentationError: unexpected indent
7

[csc210@boston myPython]$ python3 buggy.py
  File "buggy.py", line 4
    This short Python code contains a number of interntional bugs. Correct
    ^
IndentationError: unexpected indent
8


Download


  1. Đầu vào bàn phím: Viết chương trình Python yêu cầu người dùng nhập chuỗi DNA từ bàn phím và chụp chuỗi trong một biến. Tiếp theo, chương trình của bạn nên yêu cầu người dùng cho chuỗi DNA ngắn hơn thứ hai được nhập. Bây giờ, chương trình của bạn sẽ báo cáo nếu chuỗi thứ hai là một chuỗi con của chuỗi đầu tiên. Write a Python program that asks the user to enter a DNA sequence from the keyboard and captures the sequence in a variable. Next, your program should ask the user for a second shorter DNA sequence to be entered. Now, your program should report if the second sequence is a substring of the first string.
  2. Các đối số như đầu vào: Viết một chương trình Python lấy hai chuỗi làm đối số dòng lệnh và báo cáo nếu đối số thứ hai là phần phụ của đối số đầu tiên. Write a Python program that takes two strings as command-line arguments and reports if the second argument is a substring of the first argument.
  3. Nó làm gì? Tham khảo tài liệu về cách sử dụng hàm sys.stdin () Python. Mã Python dưới đây làm gì?
    [csc210@boston myPython]$ python3 buggy.py
      File "buggy.py", line 4
        This short Python code contains a number of interntional bugs. Correct
        ^
    IndentationError: unexpected indent
    
    9
    Consult the documentation on how to use the sys.stdin() Python function. What does the Python code below do?
    [csc210@boston myPython]$ python3 buggy.py
      File "buggy.py", line 4
        This short Python code contains a number of interntional bugs. Correct
        ^
    IndentationError: unexpected indent
    
    9
  4. Số của tôi ở đâu? Sửa đổi mã đầu vào.py để bắt các ngoại lệ nếu các số nhập vào người dùng không thể được chuyển đổi thành số nguyên. Kiểm tra mã của bạn với các đầu vào bên dưới:
     __               
    |  \   |\ |    /\ 
    |__/   | \|   /--\
    
    0
    Modify the input.py code to catch exceptions if the user-entered numbers cannot be converted to integers. Test your code with the inputs below:
     __               
    |  \   |\ |    /\ 
    |__/   | \|   /--\
    
    0
  5. Một hàm trả về một chuỗi ngẫu nhiên: Viết hàm Python lấy làm tham số độ dài và trả về một chuỗi DNA ngẫu nhiên với độ dài được yêu cầu. Write a Python function that takes as a parameter the length and returns a random DNA sequence with the requested length.
  6. Một chức năng cho sự phát triển của cần cẩu Sandhill Florida: Trong tập phim phạm vi, chúng tôi đã gặp phải vấn đề sau: Dân số của Sếu Sandhill Florida ở đầm lầy Okefenokee, trong điều kiện môi trường hiện tại, tăng 1,94% mỗi năm. Nếu chúng ta bắt đầu với dân số 425 con chim, dân số sẽ lớn như thế nào sau 28 năm? Bây giờ, tạo ra một chức năng Python, với quy mô dân số ban đầu, tốc độ tăng trưởng và một số năm, có thể tính toán và trả lại quy mô dân số cần cẩu Sandhill Florida sau khoảng thời gian đó. In the range episode, we encountered the following problem: The population of Florida sandhill cranes in the Okefenokee swamp, under the current environmental conditions, grows by 1.94% annually. If we start with a population of 425 birds, how big will the population be after 28 years? Now, create a Python function that, given an initial population size, growth rate, and a number of years, can calculate and return the Florida sandhill crane population size after that time period.
  7. Các mô -đun: Python có cách đặt các định nghĩa chức năng vào một tệp và sử dụng chúng trong một tập lệnh. Một tập tin như vậy được gọi là một mô -đun. Các định nghĩa từ một mô -đun có thể được nhập vào các mô -đun khác hoặc vào chương trình chính. Tham khảo các mô -đun hướng dẫn Python để biết thêm thông tin. Python has a way to put function definitions in a file and use them in a script. Such a file is called a module. Definitions from a module can be imported into other modules or into the main program. Consult the Python tutorial Modules for further information.

    Bây giờ, hãy tạo một mô -đun có tên DNA_RNA.py bao gồm hai định nghĩa hàm dnatorna () và rnatodna (). Viết chương trình Python để thực hiện như sau:

     __               
    |  \   |\ |    /\ 
    |__/   | \|   /--\
    
    1
  8. Tỷ lệ phần trăm: Viết hàm Python lấy phân đoạn DNA làm chuỗi và trả về tỷ lệ phần trăm của a, c, g, t làm danh sách. Đảm bảo rằng chức năng của bạn xử lý cả trên và dưới. Write a Python function that takes a DNA segment as a string and returns the percentages of A,C,G,T as a list. Make sure that your function handles both upper and lowercases.
  9. Bổ sung ngược: Viết hàm Python lấy chuỗi DNA làm chuỗi và trả về phần bổ sung ngược của nó. Write a Python function that takes a DNA sequence as a string and returns its reverse complement.
  10. Hai tham số: Viết hàm python lấy chuỗi DNA làm chuỗi và nucleotide và trả về số lần xuất hiện của nucleotide trong chuỗi. Write a Python function that takes a DNA sequence as a string and a nucleotide and returns the number of occurrences of the nucleotide in the sequence.
  11. Chuỗi tài liệu: Chuỗi tài liệu của một chức năng, hoặc DocString, chứa thông tin về hàm, cách sử dụng của nó, v.v. Tham khảo tại đây về các hướng dẫn để viết các chuỗi tài liệu. Bây giờ, hãy viết một tài liệu cho chức năng của bạn trong vấn đề trước đó. A function's documentation string, or docstring, contains information about the function, its usage, etc. Consult here on guidelines for writing documentations strings. Now, write a docstring for your function in the previous problem.

Các tập tin

Ghi vào tệp

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

 __               
|  \   |\ |    /\ 
|__/   | \|   /--\
2

 __               
|  \   |\ |    /\ 
|__/   | \|   /--\
3


Download

Đọc từ tập tin

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

 __               
|  \   |\ |    /\ 
|__/   | \|   /--\
4

 __               
|  \   |\ |    /\ 
|__/   | \|   /--\
5


Download

Đọc tệp Fasta

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

 __               
|  \   |\ |    /\ 
|__/   | \|   /--\
6

 __               
|  \   |\ |    /\ 
|__/   | \|   /--\
7


Download


  1. Đếm hội chứng hô hấp nghiêm trọng Hội chứng hô hấp Coronavirus 2 BPS: Tải xuống tệp FASTA (NC_045512.2) chứa chuỗi tham chiếu SARS-CoV-2. . Kết thúc dòng, v.v.) và in ra số lượng nucleotide (BPS) trong bộ gen SARS-CoV-2 hoàn chỉnh. Download the FASTA file (NC_045512.2) containing the SARS-CoV-2 reference sequence. (You can use the "Send" widget on the upper-right corner of the NCBI Web page containing the genome to download a FASTA file.) Now, write a Python program that reads the file, stores the sequence without white characters (spaces, end-of-line, etc.), and prints out the number of nucleotides (bps) in the complete SARS-CoV-2 genome.

  2. Bắt đầu các codon trong bộ gen SARS-CoV-2: Sửa đổi mã Python của bạn trong vấn đề trước đó để mã của bạn in ra các vị trí xuất hiện đầu tiên của codon bắt đầu ATG và một trong những codon dừng (TAA, TAG, TGA) Trong bộ gen SARS-CoV-2. Modify your Python code in the previous problem so that your code prints out the locations of the first appearances of the start codon ATG and one of the stop codons (TAA, TAG, TGA) afterwords in the SARS-CoV-2 genome.

  3. Các biến thể bộ gen của SARS-CoV-2: Các mẫu virus này từ các vị trí địa lý khác nhau hiển thị các biến thể trong trình tự bộ gen. Có vài trăm chuỗi như vậy tại GenBank, như được liên kết trong các tài liệu tham khảo. Dưới đây là bốn ví dụ: & nbsp; & nbsp; & nbsp; Wuhan-Hu-1: NC_045512.2 (được coi là tham chiếu) & nbsp; & nbsp; Ấn Độ: MT050493.1 & NBSP; & NBSP; Ý: MT066156.1 & nbsp; & nbsp; Hoa Kỳ .: MN985325.1 Samples of this virus from various geographical locations display variations in the genomic sequences. There are several hundred such sequences at GenBank, as linked in the References. Here are four examples:     Wuhan-Hu-1: NC_045512.2 (considered the Reference)    India: MT050493.1    Italy: MT066156.1    U.S.A.: MN985325.1
    • Tải xuống các chuỗi Wuhan-Hu-1 và U.S.A ở định dạng Fasta.
    • Viết một chương trình Python đọc các tệp này và lưu các chuỗi dưới dạng chuỗi.
    • Chương trình của bạn nên so sánh các chuỗi nucleotide và in ra các vị trí (vô phân hóa) nơi chúng khác nhau và sự khác biệt. Lưu ý rằng các chuỗi này có độ dài khác nhau; So sánh chúng chỉ cho đến chiều dài của cái ngắn hơn.

  4. BLAST (Công cụ tìm kiếm căn chỉnh cục bộ cơ bản): "BLAST tìm thấy các vùng tương tự giữa các chuỗi sinh học. Chương trình so sánh trình tự nucleotide hoặc protein với cơ sở dữ liệu trình tự và tính toán ý nghĩa thống kê." "BLAST finds regions of similarity between biological sequences. The program compares nucleotide or protein sequences to sequence databases and calculates the statistical significance."
    • Truy cập trang web Blast được liên kết ở trên và chọn biểu tượng cho "Nucleotide Blast".
    • Trong hộp "Nhập chuỗi truy vấn", hãy nhập một trong các số SARS-CoV-2`Accession từ Danh sách & NBSP; & NBSP; Wuhan-Hu-1: NC_045512.2 (được coi là tham chiếu) & nbsp; & nbsp; Ấn Độ: MT050493.1 & NBSP; & NBSP; Ý: MT066156.1 & nbsp; & nbsp; Hoa Kỳ .: MN985325.1
    • Kiểm tra "Căn chỉnh hai hoặc nhiều chuỗi."
    • Trong hộp "Nhập chuỗi chủ đề" mới được mở, một số SARS-CoV-2`Accession khác từ danh sách.
    • Nhấn nút "BLAST" ở cuối trang.
    • Chọn tùy chọn "Sắp xếp" để xem so sánh hai chuỗi.
    • Chọn cho "Chế độ xem căn chỉnh", tùy chọn "Cặp đôi với các dấu chấm cho danh tính", cuộn xuống và tìm kiếm sự khác biệt trong hai chuỗi.
    • Báo cáo sự khác biệt trong trình tự bộ gen.

  5. Mô hình tăng trưởng hậu cần: Xem xét mô hình logistic rời rạc
    # ------------------------------------------------------------------
    # File name: buggy.py
    #
      This short Python code contains a number of interntional bugs. Correct
    # them with the help of the error messages.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://americanhistory.si.edu/collections/search/object/nmah_334663
    # https://en.wikipedia.org/wiki/Software_bug
    # ------------------------------------------------------------------
    
    human genes = 20,000
    
     protein-name = "GFP';
    
    print('You have', human_genes, 'genes')
    print("protein-name stands for
          green fluorescent protein")
     
    
    5 chi phối sự tăng trưởng của một dân số duy nhất với các thế hệ không chồng chéo. Ở đây, R là tốc độ tăng trưởng và x [n] là mật độ của thế hệ N-th. Khắc phục tốc độ tăng trưởng r = 3,1 và mật độ dân số ban đầu x [0] = 0,43. Viết một chương trình Python tính toán mật độ dân số trong 12 thế hệ và viết chúng ra một tập tin, mỗi thế hệ và mật độ dân số của nó trên một dòng riêng biệt, như dưới đây:
     __               
    |  \   |\ |    /\ 
    |__/   | \|   /--\
    
    9
    Consider the discrete logistic model
    # ------------------------------------------------------------------
    # File name: buggy.py
    #
      This short Python code contains a number of interntional bugs. Correct
    # them with the help of the error messages.
    #
    # Version: 2.1
    # Authors: H. Kocak and B. Koc
    #          University of Miami and Stetson University
    # References:
    # https://americanhistory.si.edu/collections/search/object/nmah_334663
    # https://en.wikipedia.org/wiki/Software_bug
    # ------------------------------------------------------------------
    
    human genes = 20,000
    
     protein-name = "GFP';
    
    print('You have', human_genes, 'genes')
    print("protein-name stands for
          green fluorescent protein")
     
    
    5 governing the growth of a single population with non-overlapping generations. Here, r is the growth rate and x[n] is the density of the n-th generation. Fix the growth rate r = 3.1 and initial population density x[0] = 0.43. Write a Python program that computes the population densities for 12 generations and writes them out to a file, each generation and its population density on a separate line, as below:
     __               
    |  \   |\ |    /\ 
    |__/   | \|   /--\
    
    9
  6. Sao chép một tệp: Viết chương trình Python lấy hai tên tệp làm đối số dòng lệnh và sao chép tệp FASTA đầu tiên vào tệp thứ hai. Bây giờ, sử dụng lệnh Unix Diff để kiểm tra đầu ra của chương trình của bạn. Write a Python program that takes two file names as a command line argument and copies the first FASTA file into the second file. Now, use the Unix command diff to test the output of your program.

  7. So sánh K-MERS trong bộ gen của virus: Tạo chương trình Python để thực hiện như sau: Create a Python program to do the following:

    • Mở một tệp fasta có tên được cung cấp dưới dạng đối số dòng lệnh, kết hợp các dòng chuỗi trong một chuỗi.
    • Trích xuất tất cả các chuỗi con có độ dài 9 (9-mers) từ chuỗi và lưu trữ tất cả 9 mer trong một từ điển, cùng với số lần chúng xuất hiện trong chuỗi. Sử dụng 9-mers làm khóa và số lần xuất hiện làm giá trị trong từ điển. Cuối cùng, chương trình nên in tất cả 9 mer và số lượng của họ.
    • Bây giờ, chỉnh sửa chương trình trước đó (hoặc tạo một chương trình mới) mở ra và xử lý hai bộ gen virus riêng biệt ở định dạng FASTA. Mục tiêu của bạn là so sánh hai bộ gen và xác định số lượng chuỗi con có độ dài 9 (9-mers) mà họ chia sẻ. Vui lòng in tất cả 9-mers mà hai bộ gen chia sẻ và tổng số của chúng (đếm). Chọn hai bộ gen ngẫu nhiên, tốt nhất là không dài hơn 10000 nucleotide mỗi nucleotide. Bạn nên cung cấp cho các tệp FASTA các chuỗi bộ gen virus dưới dạng các đối số dòng lệnh cho chương trình của bạn và sử dụng danh sách sys.argv để nhập các chuỗi.
    • Hai bộ gen virus có thể được tải xuống từ NCBI. Đối với một điểm bắt đầu, bạn có thể sử dụng trang web này. Vui lòng bao gồm các lựa chọn của bạn tên virus và số gia nhập trong khả năng giao hàng của bạn.
    • Bạn có mong đợi nhận được kết quả tương tự nếu đây không phải là trình tự bộ gen của virus mà là chuỗi DNA/RNA ngẫu nhiên không?

Biểu cảm thường xuyên

Tìm kiếm mô -đun

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

# Please correct my errors. 
first_10_bp = "gggtgcgacg'
second 10_bp = "attcattgtt"
gene = first_10-bp + second 10_bp

 print('The first 20 bp of BRAC2 gene are gene']
0

# Please correct my errors. 
first_10_bp = "gggtgcgacg'
second 10_bp = "attcattgtt"
gene = first_10-bp + second 10_bp

 print('The first 20 bp of BRAC2 gene are gene']
1


Download

Các nhóm tìm kiếm họa tiết

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

# Please correct my errors. 
first_10_bp = "gggtgcgacg'
second 10_bp = "attcattgtt"
gene = first_10-bp + second 10_bp

 print('The first 20 bp of BRAC2 gene are gene']
2

# Please correct my errors. 
first_10_bp = "gggtgcgacg'
second 10_bp = "attcattgtt"
gene = first_10-bp + second 10_bp

 print('The first 20 bp of BRAC2 gene are gene']
3


Download

Motif tìm thấy tất cả

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

# Please correct my errors. 
first_10_bp = "gggtgcgacg'
second 10_bp = "attcattgtt"
gene = first_10-bp + second 10_bp

 print('The first 20 bp of BRAC2 gene are gene']
4

# Please correct my errors. 
first_10_bp = "gggtgcgacg'
second 10_bp = "attcattgtt"
gene = first_10-bp + second 10_bp

 print('The first 20 bp of BRAC2 gene are gene']
5


Download

Motif tìm ITER

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

# Please correct my errors. 
first_10_bp = "gggtgcgacg'
second 10_bp = "attcattgtt"
gene = first_10-bp + second 10_bp

 print('The first 20 bp of BRAC2 gene are gene']
6

# Please correct my errors. 
first_10_bp = "gggtgcgacg'
second 10_bp = "attcattgtt"
gene = first_10-bp + second 10_bp

 print('The first 20 bp of BRAC2 gene are gene']
7


Download

Tương tác tìm kiếm họa tiết

Hướng dẫn python for biologists - trăn cho các nhà sinh vật học

# Please correct my errors. 
first_10_bp = "gggtgcgacg'
second 10_bp = "attcattgtt"
gene = first_10-bp + second 10_bp

 print('The first 20 bp of BRAC2 gene are gene']
8

# Please correct my errors. 
first_10_bp = "gggtgcgacg'
second 10_bp = "attcattgtt"
gene = first_10-bp + second 10_bp

 print('The first 20 bp of BRAC2 gene are gene']
9


Download


  1. Giải mã các biểu thức chính quy: Đưa ra bản dịch tiếng Anh và một ví dụ về từng biểu thức thông thường sau:
    [csc210@boston myPython]$ python3 welcome.py
    Welcome to Python for Biologists!
    
    00
    Give an English translation and an example of each of the following regular expressions:
    [csc210@boston myPython]$ python3 welcome.py
    Welcome to Python for Biologists!
    
    00
  2. Dịch tiếng Anh sang các biểu thức thông thường: Dịch các câu tiếng Anh sau đây mô tả các họa tiết sang biểu thức thông thường:
    [csc210@boston myPython]$ python3 welcome.py
    Welcome to Python for Biologists!
    
    01
    Translate the following English sentences describing motifs to regular expressions:
    [csc210@boston myPython]$ python3 welcome.py
    Welcome to Python for Biologists!
    
    01
  3. Nó có còn sống không? Viết mã python để kiểm tra xem một chuỗi nhất định (chuỗi) là chuỗi DNA (bao gồm chỉ, chỉ A, C, G, T). Bạn có thể kiểm tra mã của mình trên chuỗi SARS-CoV-2 (MT233521.1) với các khoảng trống. Làm tương tự cho một chuỗi protein. Write a Python code to test if a given sequence (string) is a DNA sequence (consisting of A,C,G,T only). You can test your code on the SARS-CoV-2 sequence (MT233521.1) with gaps. Do the same for a protein sequence.
  4. Thay thế bằng các biểu thức thông thường: Chúng tôi đã thấy trong tập thay thế cách sử dụng hàm str.replace () để thay thế tất cả các tình trạng của chuỗi con trong một chuỗi. Hàm re.subn () thực hiện một hàm tương tự nhưng cho phép chuỗi con được chỉ định với các biểu thức thông thường. Mã Python dưới đây làm gì?
    [csc210@boston myPython]$ python3 welcome.py
    Welcome to Python for Biologists!
    
    02
    We saw in the episode Replace how to use the function str.replace() to replace all occurances of a substring in a string. The function re.subn() performs a similar function but allows the substring to be specified with regular expressions. What does the Python code below do?
    [csc210@boston myPython]$ python3 welcome.py
    Welcome to Python for Biologists!
    
    02
  5. Tìm kiếm các mẫu: Tạo một chương trình Python có thể kiểm tra xem một chuỗi DNA nhất định có chứa mẫu
    [csc210@boston myPython]$ python3 welcome.py
    Welcome to Python for Biologists!
    
    03 trong đó XXX có thể là ba cơ sở DNA liên tiếp hay không. Điều đó có nghĩa là chương trình của bạn, được đưa ra một số chuỗi, nên xác định nếu TATA, theo sau là bất kỳ ba cặp cơ sở DNA nào, theo sau là ATG, theo sau là ba cặp cơ sở DNA nào, tiếp theo là T có thể được tìm thấy trong chuỗi đã cho. Kiểm tra cả chuỗi bổ sung chuyển tiếp và đảo ngược (bổ sung ngược). Tạo ba ví dụ, một ví dụ có chuỗi DNA chứa mẫu trong chuỗi chuyển tiếp, một ví dụ chứa mẫu trong chuỗi bổ sung ngược và một mẫu không chứa nó trong chuỗi, để chứng minh cách thức hoạt động của chương trình. Vui lòng bao gồm các câu lệnh in xác định từng trường hợp khác nhau và vị trí của mẫu trong chuỗi, nếu được tìm thấy.
    Create a Python program that can check whether a given DNA sequence contains the pattern
    [csc210@boston myPython]$ python3 welcome.py
    Welcome to Python for Biologists!
    
    03 where xxx can be any three consecutive DNA bases. That means your program, given some string, should identify if TATA, followed by any three DNA base pairs, followed by ATG, followed by any three DNA base pairs, followed by T can be found in the given string. Check both the forward and reverse complementary strand (reverse complement). Create three examples, one with a DNA string that contains the pattern in the forward strand, one that contains the pattern in the reverse complement strand and one that does not contain it in either strand, to demonstrate how the program works. Please include print statements that identify each different case and the position of the pattern in the string, if found.
  6. Các mẫu chồng chéo: Viết chương trình Python có thể in số lần một chuỗi con với năm ký tự bắt đầu bằng 'AT' và kết thúc bằng 'A' xuất hiện trong một chuỗi nhất định. Điều này có nghĩa là bạn nên nhận ra sự xuất hiện của mọi mẫu 'atxxa', trong đó 'x' có thể là bất kỳ ký tự nào. Kiểm tra chương trình của bạn với chuỗi sau:
    [csc210@boston myPython]$ python3 welcome.py
    Welcome to Python for Biologists!
    
    04 Gợi ý: Sử dụng cách xem sau
    [csc210@boston myPython]$ python3 welcome.py
    Welcome to Python for Biologists!
    
    05
    Write a Python program that can print the number of times a substring with five characters that starts with 'AT' and ends with 'A' appears in a given string. This means that you should recognize the appearance of every pattern 'ATxxA', where 'x' can be any character. Test your program with the following string:
    [csc210@boston myPython]$ python3 welcome.py
    Welcome to Python for Biologists!
    
    04 Hint: Use the following look-ahead
    [csc210@boston myPython]$ python3 welcome.py
    Welcome to Python for Biologists!
    
    05

    Trả lời: Số lần mà mẫu đã nói ở trên xuất hiện trong chuỗi trên là 9.

  7. Các vị trí liên kết trong mRNA: Trình tự Shine-Dalgarno là một vị trí ràng buộc trong mRNA, thường là 8 cặp cơ sở ngược dòng của codon bắt đầu Aug. Trình tự đồng thuận là Aggagg. Tạo một chương trình có thể kiểm tra bất kỳ chuỗi FASTA nhất định nào cho các lần xuất hiện của chuỗi Shine-Dalgarno ngược dòng của một codon bắt đầu. Bạn sẽ phải kiểm tra cả các chuỗi chuyển tiếp và bổ sung. Bạn phải báo cáo sự xuất hiện của mẫu AGGAGG trước bất kỳ ATG nào, với 0-20 cơ sở ngăn cách chúng. Shine-Dalgarno sequence is a binding site in the mRNA, usually located 8 base pairs upstream of the start codon AUG. The concensus sequence is AGGAGG. Create a program that can examine any given FASTA sequence for occurences of the Shine-Dalgarno sequence upstream of a start codon. You will have to examine both the forward and complementary strands. You have to report the occurence of the AGGAGG pattern before any ATG, with 0-20 bases separating them.

    Báo cáo riêng biệt số lượng xảy ra cho từng giá trị độ dài của phân đoạn giữa hai chuỗi. Ví dụ: bạn nên báo cáo số lần AGGAGG xuất hiện trực tiếp trước ATG, số lần AGGAGG xuất hiện một cơ sở trước ATG, v.v., tối đa 20 cơ sở giữa chúng.

    Bây giờ kiểm tra mã của bạn với bộ gen của hai nhiễm sắc thể vi khuẩn, cả hai đều lớn hơn 5MB, một từ vi khuẩn gram âm và một từ vi khuẩn gram dương. Đối với một gram âm, bạn có thể tải xuống bộ gen của pseudomonas aeruginosa, nơi có gram dương, bạn có thể sử dụng desulfitobacterium hafniense hoặc chọn bộ gen khác mà bạn chọn.

  8. Mô phỏng scanf (): Python hiện không có tương đương với scanf (). Tham khảo ý kiến ​​tại đây để biết một số ánh xạ tương đương hoặc ít hơn giữa các mã thông báo định dạng scanf () và các biểu thức thông thường. Bây giờ, sửa đổi mã input.py để đọc trong hai số được nhập trên một dòng, sau đó in ra tổng của chúng. Python does not currently have an equivalent to scanf(). Consult here for some more-or-less equivalent mappings between scanf() format tokens and regular expressions. Now, modify input.py code to read in two numbers entered on one line, then print out their sum.

  1. Mô hình tăng trưởng hậu cần: Xem xét mô hình logistic rời rạc
    [csc210@boston myPython]$ python3 welcome.py
    Welcome to Python for Biologists!
    
    06 Mô hình hóa sự tăng trưởng của một dân số duy nhất, trong đó x [n] là mật độ của dân số ở thế hệ N-th và R là tốc độ tăng trưởng. Khắc phục tốc độ tăng trưởng r = 3,1 và mật độ dân số ban đầu x [0] = 0,43. Viết một chương trình Python tính toán mật độ dân số trong 20 thế hệ và đưa chúng vào danh sách. Sau đó, in ra mỗi thế hệ và mật độ dân số của nó trên một dòng riêng cho tất cả 20 thế hệ.
    Consider the discrete logistic model
    [csc210@boston myPython]$ python3 welcome.py
    Welcome to Python for Biologists!
    
    06 modeling the growth of a single population, where x[n] is the density of the population at n-th generation and r is the growth rate. Fix the growth rate r = 3.1 and initial population density x[0] = 0.43. Write a Python program that computes the population densities for 20 generations and puts them in a list. Then, print out each generation and its population density on a separate line for all 20 generations.
  2. Fasta to GenBank: Viết hàm Python lấy tham số tên của tệp FASTA và viết nội dung của tệp ở định dạng GenBank. Write a Python function that takes as a parameter the name of a FASTA file and writes out the content of the file in GenBank format.
  3. Tata-pribnow Box: Motifs Tataaa hoặc Tataat của sáu nucleotide, được gọi là hộp Tata, là một phần thiết yếu của trang web quảng bá về DNA để phiên mã xảy ra. Viết một chương trình Python tìm thấy tất cả các hộp Tata theo trình tự DNA và báo cáo các loại và vị trí của chúng. Nếu không có một hộp như vậy, chương trình của bạn cũng nên báo cáo điều đó. Kiểm tra chương trình của bạn trên một số chuỗi DNA không có và với một số hộp Tata của cả hai loại. Motifs TATAAA or TATAAT of six nucleotides, known as TATA boxes, are an essential part of a promoter site on DNA for transcription to occur. Write a Python program that finds all the TATA boxes in a DNA sequence and reports their types and locations. If there is no such a box, your program should report that as well. Test your program on several DNA sequences with none, and with several TATA boxes of both types.
  4. Các hộp Tata trong bộ gen virus Ebola: Tải xuống tệp FASTA (số gia nhập KC545393) chứa bộ gen virus Ebola. . bộ gen. Download the FASTA file (accession number KC545393) containing the ebola virus genome. (You can use the "Send" widget on the upper-right corner of the NCBI Web page containing the genome to download a FASTA file.) Now, modify your program from the previous problem to produce the same TATA box report of the ebola virus genome.
  5. Các vị trí hạn chế palindromic trong bộ gen của virus Zika: Các enzyme hạn chế là các enzyme cắt DNA sợi đôi ở các chuỗi nucleotide nhận dạng cụ thể được gọi là vị trí hạn chế. Rất thường xuyên, các trang web này là palindromic, đối với DNA sợi kép có nghĩa là chúng đọc giống nhau trên chuỗi ngược như chúng trên chuỗi chuyển tiếp khi cả hai được đọc theo cùng một hướng. Ví dụ, sau đây là trang web hạn chế palindromic:
    [csc210@boston myPython]$ python3 welcome.py
    Welcome to Python for Biologists!
    
    07
    Restriction enzymes are enzymes that cut double-stranded DNA at specific recognition nucleotide sequences known as restriction sites. Quite often, these sites are palindromic, which for double-stranded DNA means they read the same on the reverse strand as they do on the forward strand when both are read in the same orientation. For example, the following is a palindromic restriction site:
    [csc210@boston myPython]$ python3 welcome.py
    Welcome to Python for Biologists!
    
    07

    Tạo một chương trình, được đưa ra một chuỗi DNA, sẽ xuất ra tất cả các vị trí DNA palindromic có độ dài 6 và vị trí của chúng. Kiểm tra chương trình của bạn với:

    • Trình tự: "GCTAGTGTATGCATGAGCGTAGGCGA TGTGGCGCGAGCTGAGGTGATCACGTGATGTGCTAGTCG".
    • Bộ gen virus Zika: Tải xuống tệp FASTA (NC_012532.1) chứa bộ gen virus Zika. (Bạn có thể sử dụng tiện ích "Gửi" ở góc trên bên phải của trang web NCBI chứa bộ gen để tải xuống tệp FASTA.)

Ký tự đặc biệtNghĩa
.bất kỳ nhân vật nào, ngoại trừ dòng mới
\Ndòng mới
\ tchuyển hướng
\SBất kỳ ký tự khoảng trắng nào (không gian, dòng mới, tab)
\SBất kỳ nhân vật không phải là màu trắng
\ dbất kỳ ký tự chữ số
\ Dbất kỳ ký tự không chữ số
\ wbất kỳ ký tự một từ nào (chữ và số cộng với _)
\ WBất kỳ một ký tự không từ nào
*khớp 0 hoặc nhiều lần trước ký tự hoặc nhóm
+khớp với 1 lần trở lên nhân vật hoặc nhóm trước
?khớp 0 hoặc 1 lần
?khớp 0 hoặc 1 lần
Trận đấu ngắn nhất (không xanh){}
sự lặp lại{,}
sự lặp lại, tối thiểu đến tối đa()
sự lặp lại, tối thiểu đến tối đa()
chiếm lấynhóm
\ 1Nhớ lại lần bắt đầu
\Ndòng mới
\ tchuyển hướng
\SBất kỳ ký tự khoảng trắng nào (không gian, dòng mới, tab)
\SBất kỳ nhân vật không phải là màu trắng
\ dbất kỳ ký tự chữ số
\ Dbất kỳ ký tự không chữ số
\ wbất kỳ ký tự một từ nào (chữ và số cộng với _)
\ WBất kỳ một ký tự không từ nào
*khớp 0 hoặc nhiều lần trước ký tự hoặc nhóm
+khớp với 1 lần trở lên nhân vật hoặc nhóm trướcNghĩa
.bất kỳ nhân vật nào, ngoại trừ dòng mớiAGATC \N
dòng mới\ tTGC chuyển hướng
\SBất kỳ ký tự khoảng trắng nào (không gian, dòng mới, tab)TAA \S
Bất kỳ nhân vật không phải là màu trắng\ dACTG bất kỳ ký tự chữ số
\ Dbất kỳ ký tự không chữ sốATATCT \ w
bất kỳ ký tự một từ nào (chữ và số cộng với _)\ WATATCT Bất kỳ một ký tự không từ nào
*\ WATATCT Bất kỳ một ký tự không từ nào
*khớp 0 hoặc nhiều lần trước ký tự hoặc nhómAAAAATC +
khớp với 1 lần trở lên nhân vật hoặc nhóm trước?TAAACGA khớp 0 hoặc 1 lần
Trận đấu ngắn nhất (không xanh){}TCGA sự lặp lại
{,}sự lặp lại, tối thiểu đến tối đaCCCGTA ()
chiếm lấynhómACGCGCGTA \ 1
Nhớ lại lần bắt đầu\ 2ATTAC Nhớ lại lần bắt thứ hai
Nhớ lại lần chụp N-Th^A.TAA bắt đầu chuỗi
$Kết thúc chuỗiAAATGAT []
  • Bất kỳ một trong các bộ ký tự
    • [^]
      A gentle introductory tutorial to using regular expressions in Python with the re module.
    • Module của Python cho các biểu thức thường xuyên.



  • Liên kết hữu ích:
    • Ngôn ngữ lập trình Python Đây là trang web chính thức cho Python. Bạn có thể tải xuống trình thông dịch Python và thư viện tiêu chuẩn mở rộng được tự do cho tất cả các nền tảng chính từ trang web này.
      This is the official Web site for Python. You can download the Python interpreter and the extensive standard library are freely for all major platforms from this site.
    • Hướng dẫn kiểu để lập trình Python Các hướng dẫn được cung cấp ở đây nhằm cải thiện khả năng đọc mã và làm cho nó nhất quán trên phổ rộng của mã Python.
      The guidelines provided here are intended to improve the readability of code and make it consistent across the wide spectrum of Python code.
    • Hướng dẫn chính thức của Python hướng dẫn này giới thiệu nhiều đặc điểm đáng chú ý nhất của Python, và sẽ cung cấp cho bạn một ý tưởng tốt về hương vị và phong cách ngôn ngữ.
      This tutorial introduces many of Python’s most noteworthy features, and will give you a good idea of the language’s flavor and style.
    • Tóm tắt biểu cảm thường xuyên với các ví dụ
    • Biopython Biopython là một tập hợp các công cụ có sẵn miễn phí để tính toán sinh học được viết bằng Python bởi một nhóm các nhà phát triển quốc tế.
      Biopython is a set of freely available tools for biological computation written in Python by an international team of developers.
    • Perl cho các nhà sinh học một hình ảnh phản chiếu của trang web hiện tại trong ngôn ngữ lập trình Perl.
      A mirror image of the current website in the Perl programming language.
    • Perl để khám phá DNA, của Mark D. LeBlanc và Betsey Dexter Dyer, Nhà xuất bản Đại học Oxford, 2007.
    • Bắt đầu Perl cho tin sinh học, bởi James Tisdall, O'Reilly Press, 2001.
    • Trang web bộ gen NCBI
    • NCBI Hội chứng hô hấp cấp tính nghiêm trọng Coronavirus 2 phân lập Wuhan-Hu-1, bộ gen hoàn chỉnh (SARS-CoV-2) (NC_045512.2)
    • NCBI SARS-CoV-2 (Trình tự hội chứng hô hấp cấp tính nghiêm trọng 2) Trình tự từ NIH Genbank.
    • Thông tin nghiên cứu mới nhất về coronavirus từ NIH
    • Virus NCBI Zika, bộ gen hoàn chỉnh (NC_012532.1)
    • NCBI Bundibugyo Ebolavirus phân lập EBOBUND-112 2012, bộ gen hoàn chỉnh (KC545393.1)
    • NCBI Thalassiosira Pseudonana CCMP1335 nhiễm sắc thể 7 ung thư vú 2 Khởi phát sớm (BRAC2) mRNA, CD một phần (XM_002295694.2)
    • Pan troglodytes verus phân lập mabel ty thể D-loop (tinh tinh (AF176731.1)
    • H.Sapiens DNA ty thể cho D-loop (con người) (x90314.1)
    • Các nghệ sĩ giải trí, bởi Scott Joplin.