TickingClock的个人博客分享 http://blog.sciencenet.cn/u/TickingClock

博文

Rosalind 7 - Counting DNA Nucleotides

已有 2938 次阅读 2017-10-23 08:30 |个人分类:Python Learning|系统分类:科研笔记|关键词:学者

Bioinformatics Stronghold - DNA: Counting DNA Nucleotides


A Rapid Introduction to Molecular Biology


细胞cell)是一切生物体功能的基本单位。细胞核nucleus)是真核生物细胞的组分,是细胞活动的中心。细胞核充满了一种叫做染色质chromatin)的大分子,在真核细胞有丝分裂mitosis)时,染色质会凝结浓缩形成长而细的线状物,称为染色体chromosome)。


A 1900 drawing by Edmund Wilson of onion cells at different stages of mitosis. The sample has been dyed, causing chromatin in the cells (which soaks up the dye) to appear in greater contrast to the rest of the cell.


染色质中包含的一类大分子叫做核酸nucleic acid)。20世纪早期对于核酸的化学特性研究显示其为聚合物polymer),或者是结构相似小分子的重复链,这类小分子叫做单体monomer)。因为核酸长而细的特性,一般也叫做strand)。


核酸的单体叫做核苷酸nucleotide),其也被用作stand的基本单位,即nt。每个核苷酸由三部分组成:一个核糖sugar)分子、一个带负电的磷酸phosphate)和一个碱基nucleobase,通常简写为base)。通常,一个核苷酸的核糖与下一个核苷酸的磷酸结合,这样以此类推,逐步就形成了核酸链的糖-磷酸骨架a sugar-phosphate backbone)。关键的是,同一类型的核酸上的核苷酸核糖和磷酸分子是一样的,只是碱基有所不同。因此,两两核酸链之间的差别也仅仅是碱基排序的不一样,而碱基的排序也决定了核酸的一级结构primary structure)。


脱氧核糖核酸deoxyribose nucleic acid),简称为DNA,其核糖分子叫做脱氧核糖deoxyribose),其四种可供选择的碱基分别是腺嘌呤adenine;A)、胞嘧啶cytosine;C)、鸟嘌呤guanine;G)以及胸腺嘧啶thymine;T)。


A sketch of DNA's primary structure.


基因组genome)就是包含所有某个生物所有染色体DNA在内的总称。


Problem


A string is simply an ordered collection of symbols selected from some alphabet and formed into a word; the length of a string is the number of symbols that it contains.


An example of a length 21 DNA string (whose alphabet contains the symbols 'A', 'C', 'G', and 'T') is "ATGCTTCAGAAAGGTCTTACG."


Given: A DNA string s of length at most 1000 nt.


Return: Four integers (separated by spaces) counting the respective number of times that the symbols 'A', 'C', 'G', and 'T' occur in s.


Sample Dataset


AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC


Sample Output


20 12 17 21


Solution


>>> s = 'AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC'

>>> print s.count('A'), s.count('C'), s.count('G'), s.count('T')
20 12 17 21

>>>


Over


Rosalind is a platform for learning bioinformatics and programming through problem solving. Take a tour to get the hang of how Rosalind works.


P.S. 欢迎关注微信公众号:微信号Plant_Frontiers




https://m.sciencenet.cn/blog-3158122-1082035.html

上一篇:Plant Physiology:棉花中长、短绒纤维的转录组研究
下一篇:Nature Genetics:上位性效应在冬小麦籽粒产量杂种优势中的作用

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-3-29 14:28

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部