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 举办单位:深圳市共创力企业管理咨询有限公司 举办地点:深圳 [课程背景] 当今时代,供过于求. ...
随机推荐
- java代码----------实现创建DataInputStream和DataOutputStream进行读写
总结: 主要是 捕获异常 package com.a.b; import java.io.*; public class testData { public static void main(Stri ...
- 3D角色渲染到2D界面上
using UnityEngine; using System.Collections; using System.Collections.Generic; using Carrie.Net; usi ...
- GSON使用笔记
GSON简介 GSON是Google开发的Java API,用于转换Java对象和Json对象,我在这里将记录一下GSON的简单使用 下载GSON 我们可以在其github仓库中下载,也可以使用Mav ...
- Oracle 热备份
Oracle 热备份是指数据库处于open状态下,对数据库的数据文件.控制文件.参数文件.密码文件等进行一系列备份操作. 热备是基于用户管理备份恢复的一种方式,也是除了RMAN备份之外较为常用的一种备 ...
- OCR (Optical Character Recognition,光学字符识别)
OCR (Optical Character Recognition,光学字符识别)是指电子设备(例如扫描仪或数码相机)检查纸上打印的字符,通过检测暗.亮的模式确定其形状,然后用字符识别方法将形状翻译 ...
- 设置请求头解决浏览器同源问题,ajx跨域获取cookie问题
思想: 添加过滤器 设置请求头 代码如下 import java.io.IOException; import javax.servlet.Filter; import javax.servlet.F ...
- GO 功能注释
文章转载于 Original 2017-06-12 liuhui 生信百科 相似的基因在不同物种中,其功能往往保守的.显然,需要一个统一的术语用于描述这些跨物种的同源基因及其基因产物的功能,否则,不同 ...
- halcon采集一幅图像
**顺序也很重要,必须现有窗口,才能设置属性 dev_close_window()dev_open_window (0, 0, 1400, 1200, 'black', WindowHandle)de ...
- leetcode747
public class Solution { public int DominantIndex(int[] nums) { var list = new List<KeyValuePair&l ...
- WPF DataGrid 控件的运用
WPF DataGrid 控件的运用 运行环境:Window7 64bit,.NetFramework4.61,C# 6.0: 编者:乌龙哈里 2017-02-23 参考: King Cobra 博客 ...