03 Complementing a Strand of DNA
Problem
In DNA strings, symbols 'A' and 'T' are complements of each other, as are 'C' and 'G'.
The reverse complement of a DNA string ss is the string scsc formed by reversing the symbols of ss, then taking the complement of each symbol (e.g., the reverse complement of "GTCA" is "TGAC").
Given: A DNA string ss of length at most 1000 bp.
Return: The reverse complement scsc of ss.
Sample Dataset
AAAACCCGGT
Sample Output
ACCGGGTTTT 方法一
def reverse(seq):
dict = {'A': 'T', 'C': 'G', 'T': 'A', 'G': 'C'} revSeqList = list(reversed(seq)) #['T', 'G', 'G', 'C', 'C', 'C', 'A', 'A', 'A', 'A']
revComSeqList = [dict[k] for k in revSeqList] # ['A', 'C', 'C', 'G', 'G', 'G', 'T', 'T', 'T', 'T']
revComSeq = ''.join(revComSeqList) # ACCGGGTTTT
return revComSeq seq = 'AAAACCCGGT' print (reverse(seq))
03 Complementing a Strand of DNA的更多相关文章
- 3.Complementing a Strand of DNA
Problem In DNA strings, symbols 'A' and 'T' are complements of each other, as are 'C' and 'G'. The r ...
- CHAPTER 38 Reading ‘the Book of Life’ The Human Genome Project 第38章 阅读生命之书 人体基因组计划
CHAPTER 38 Reading ‘the Book of Life’ The Human Genome Project 第38章 阅读生命之书 人体基因组计划 Humans have about ...
- TOJ 2641 Gene
描述 How can millions of different and complex structures be built using only a few simple building bl ...
- Longest common subsequence(LCS)
问题 说明该问题在生物学中的实际意义 Biological applications often need to compare the DNA of two (or more) different ...
- 2. Transcribing DNA into RNA
Problem An RNA string is a string formed from the alphabet containing 'A', 'C', 'G', and 'U'. Given ...
- AC日记——基因相关性 openjudge 1.7 03
03:基因相关性 总时间限制: 1000ms 内存限制: 65536kB 描述 为了获知基因序列在功能和结构上的相似性,经常需要将几条不同序列的DNA进行比对,以判断该比对的DNA是否具有相关性 ...
- POJ 2778 DNA Sequence(AC自动机+矩阵加速)
DNA Sequence Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9899 Accepted: 3717 Desc ...
- uva1368 DNA Consensus String
<tex2html_verbatim_mark> Figure 1. DNA (Deoxyribonucleic Acid) is the molecule which contains ...
- 深圳共创力咨询《成功的产品经理DNA》公开课3月29~30日在深圳开课!
课时:13小时(2天) 成功的产品经理DNA 讲师: 冯老师 时间:2019.03.29~30 举办单位:深圳市共创力企业管理咨询有限公司 举办地点:深圳 [课程背景] 当今时代,供过于求. ...
随机推荐
- kubernetes 学习 常用命令
1 kubectl get nodes #查看nodes节点情况 2 kubectl describe node node_name_XXXX # 查看nodes详 ...
- 使用nginx反向代理进行负载均衡
在这里简单记录一下,我使用Nginx反向代理进行负载均衡,将请求发送到两台tomcat上. 首先解压两个tomcat,解压Nginx,一台tomcat配置可以不用动,但是我为了更方便只是将它的端口改为 ...
- 解决IIS无响应假死状态
方法一: 临时解决办法:在IIS中选择你的网站,右击->属性,选择主目录选项卡,最下面有个应用程序池选项,记住该处的名字,然后在IIS中找到应用程序池并展开,选择你刚才看到的那个名字,右击-&g ...
- OrhtoMCL 使用方法
OrthoMCL的使用分13步进行,如下: 1. 安装和配置数据库 Orthomcl可以使用Oracle和Mysql数据库,而在这里只介绍使用Mysql数据库.修改配置文件/etc/my.cnf,对M ...
- Python的urllib和urllib2模块
Python的urllib和urllib2模块都做与请求URL相关的操作,但他们提供不同的功能.他们两个最显着的差异如下: urllib2可以接受一个Request对象,并以此可以来设置一个URL的h ...
- 编码转换(UTF8->GBK)
WCHAR woutstr[]; ]; , value, -, NULL, ); MultiByteToWideChar(CP_UTF8, , value, -, woutstr, len); len ...
- c++ 字符输入读取
cin.clear()重置输入流 cin.get()锁住屏幕直到获取输入 while(cin) cin.get(ch) 方法返回的是一个cin对象,istream类提供了可以将istream对象转换为 ...
- ce
一,什么是epel 如果既想获得 RHEL 的高质量.高性能.高可靠性,又需要方便易用(关键是免费)的软件包更新功能,那么 Fedora Project 推出的 EPEL(Extra Packages ...
- 关于PHP导出excel文件名乱码的问题
关于PHP导出excel文件名乱码的问题 对于中文的文件名使用,urlencode即可避免此问题 urlencode() 申请的urlencode()
- Delphi C++Builder RAD XE Ver 版本 官方发布时间
RAD 新版本发布时间记录 代号,官方发布时间 RIO 10.3.1,VER330,Product Ver 26 Program File 20,2019.2.14 发布 24周年 RIO 10.3, ...