Problem

In DNA stringssymbols '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的更多相关文章

  1. 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 ...

  2. 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 ...

  3. TOJ 2641 Gene

    描述 How can millions of different and complex structures be built using only a few simple building bl ...

  4. Longest common subsequence(LCS)

    问题 说明该问题在生物学中的实际意义 Biological applications often need to compare the DNA of two (or more) different ...

  5. 2. Transcribing DNA into RNA

    Problem An RNA string is a string formed from the alphabet containing 'A', 'C', 'G', and 'U'. Given ...

  6. AC日记——基因相关性 openjudge 1.7 03

    03:基因相关性 总时间限制:  1000ms 内存限制:   65536kB 描述 为了获知基因序列在功能和结构上的相似性,经常需要将几条不同序列的DNA进行比对,以判断该比对的DNA是否具有相关性 ...

  7. POJ 2778 DNA Sequence(AC自动机+矩阵加速)

    DNA Sequence Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9899   Accepted: 3717 Desc ...

  8. uva1368 DNA Consensus String

    <tex2html_verbatim_mark> Figure 1. DNA (Deoxyribonucleic Acid) is the molecule which contains ...

  9. 深圳共创力咨询《成功的产品经理DNA》公开课3月29~30日在深圳开课!

    课时:13小时(2天)    成功的产品经理DNA   讲师: 冯老师 时间:2019.03.29~30 举办单位:深圳市共创力企业管理咨询有限公司 举办地点:深圳 [课程背景] 当今时代,供过于求. ...

随机推荐

  1. JDK 8 新特性

    JDK 8, Oracle's implementation of Java SE 8. JDK 8 是 Oracle 对 Java SE 8 规范的实现. 本文分析 JDK 8 引入的新特性. 官方 ...

  2. java代码--------构造方法的调用

    总结: package com.sads; //构造方法何时被调用, //构造方法里的内容先执行 public class Sdw { static { System.out.println(&quo ...

  3. ESXI5.5开启snmp+zabbix 监控esxi 需要开启的服务

    esxcli system snmp set --communities public esxcli system snmp set --enable trueesxcli network firew ...

  4. C++ 新特性-右值引用

    作为最重要的一项语言特性,右值引用(rvalue references)被引入到 C++0x中.我们可以通过操作符“&&”来声明一个右值引用,原先在C++中使用“&”操作符声明 ...

  5. Tkinter Listbox(列表框)

    Python - Tkinter Listbox(列表框): 列表框部件用于显示一个项目列表,用户可以选择的项目数   列表框部件用于显示一个项目列表,用户可以选择的项目数. 语法: 这里是一个简单的 ...

  6. Eclipse的基本使用

    01Eclipse的下载安装 * A: Eclipse的下载安装  * a: 下载 * http://www.eclipse.org * b: 安装 * 只需要解压后就能使用 * c: 卸载 * 只 ...

  7. springboot-shiro chapter03 login

    简介:这一节主要是集成shiro进行鉴权, 用户登录/退出 环境: IDEA15+JDK1.8+Maven3+ 代码: https://git.oschina.net/xinshu/springboo ...

  8. 转载----我与CMDB不得不说的故事

    每次读到配置管理相关的书籍时,我总在想:“这些定义很精准,流程也很完整,但这不是真正的难题.”对于一个配置管理者来说,真正的难题不是绘制“庞大而精美”的数据模型,不是设计“全天候.无死角”的管控流程, ...

  9. django网页的分页功能,大家如果有疑问请留言

    url文件 from django.contrib import admin from django.conf.urls import url from app01 import views urlp ...

  10. MySQL系统时间函数NOW(),CURRENT_TIMESTAMP(),SYSDATE()的区别

    CURRENT_TIMESTAMP是NOW的同义词,也就是说两者是相同的. SYSDATE函数返回的是执行到当前函数时的时间,而NOW返回的是执行SQL语句时的时间. 测试语句: SELECT NOW ...