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. EasyUI treegrid 删除一条或多条记录

    function del_dg() { $.messager.defaults = { ok: "是", cancel: "否" }; var node = $ ...

  2. JavaScript实现排序算法总结

    <script type="text/javascript" src="js/laydate.js" > //插入排序 function inser ...

  3. Ceph的工作原理及流程

    本文将对Ceph的工作原理和若干关键工作流程进行扼要介绍.如前所述,由于Ceph的功能实现本质上依托于RADOS,因而,此处的介绍事实上也是针对RADOS进行.对于上层的部分,特别是RADOS GW和 ...

  4. Java的native关键字以及JNI

    http://blog.csdn.net/yangjiali014/article/details/1633017 这篇博文相当清楚了 包括native关键字的介绍,JNI的书写步骤,以及JNI的实现 ...

  5. 全景之HDR

    全景之HDR拍摄 全景HDR流程: 1.相机拍摄 1.1  HDR拍摄 HDR拍摄需要拍摄不同曝光度的多张图片. 1.2 摄像师消去 需要摄像师在不同位置(一般为相机的两面),拍摄两次HDR. 注意: ...

  6. python学习——练习题(13)

    """ 题目:打印出所有的"水仙花数",所谓"水仙花数"是指一个三位数,其各位数字立方和等于该数本身.例如:153是一个" ...

  7. CBV 验证装饰器的使用

    下面是3种方式: from django.shortcuts import render, redirect from django.views import View # Create your v ...

  8. Sass 入门 (一) 安装Sass

    Sass安装 ruby安装 因为sass依赖于ruby环境,所以装sass之前先确认装了ruby.先导官网下载个ruby 在安装的时候,请勾选Add Ruby executables to your ...

  9. 【LUA table 移除操作非常慢】

    LUA的表有插入和删除两种操作.插入操作非常快,100000次操作都在0.01S左右,而删除操作在表元素大于10000时却急速变慢,测试如下: t = {} local t1= os.clock() ...

  10. CodeFirst(反射+特性)

    using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using Sy ...