sGRNA互补反序的实现方式
- 编辑时间: 2023-07-20 21:42:53
- 浏览量: 221
- 作者: 爱好者
- 文章分类: go后端
- 评论数: 暂无评论
package pkg var complementMap = map[byte]byte{ 'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C', } func Complement(sgRNA string) string { sgRNABytes := []byte(sgRNA) for i := 0; i < len(sgRNABytes); i++ { sgRNABytes[i] = complementMap[sgRNABytes[i]] } return string(sgRNABytes) } func Reverse(sgRNA string) string { sBytes := []byte(sgRNA) for i := 0; i < len(sBytes)/2; i++ { j := len(sBytes) - 1 - i sBytes[i], sBytes[j] = sBytes[j], sBytes[i] } return string(sBytes) } func ComplementReverse(sgRNA string) string { return Reverse(Complement(sgRNA)) }
上一篇: 已到最顶部
评论列表
暂无评论
热门阅读
10你有酒我有故事
提交评论