一、CDS序列的基本概念
在分子遗传学中,CDS序列是代表编码蛋白质的部分,是完整的编码序列。CDS是Coding Sequence的缩写,即编码序列。CDS通常是从起始密码子(AUG)到终止密码子(UAA,UAG,UGA)之间的所有核苷酸序列。因此,CDS可以唯一地描述一个蛋白质的氨基酸序列,是进行遗传变异和系统发育分析的关键基础。
二、CDS序列在基因注释中的重要性
在基因组学中,基因注释是指将基因组序列转化为有意义的功能元件。其中,CDS序列是基因注释中的一个重要部分。通过对CDS进行分析,可以确定基因的起始位点和终止位点,从而确定氨基酸序列。此外,CDS序列还可以用于预测蛋白质结构和功能,以及比较不同物种之间的CDS序列差异。
三、CDS序列的提取方法
1. NCBI在线工具提取
NCBI提供了一种在线工具,可以将给定基因的CDS序列提取出来。用户只需要提供该基因在NCBI数据库中的ID或AC(Accession Number)即可。下面是一个Python程序,利用Biopython库实现了同样的功能:
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.Alphabet import generic_dna
# 读取基因组序列
genome_seq = SeqIO.read("genome_seq.fasta", "fasta")
# 读取基因注释信息
gene_annotation = open("gene_annotation.gff")
# 遍历每一个基因,提取CDS序列
for record in SeqIO.parse(gene_annotation, "gff"):
if record.type == "gene":
gene_seq = genome_seq[record.start:record.end]
cds_seq = Seq("", generic_dna)
for feature in record.features:
if feature.type == "CDS":
cds_seq += feature.extract(gene_seq)
# output CDS seq here
2. 已知基因组和基因注释信息的情况下,直接提取
在已知基因组和基因注释信息的情况下,可以利用基因注释文件中的CDS起始位点和终止位点,直接从基因组序列中提取CDS序列。下面是一个Python程序:
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.Alphabet import generic_dna
# 读取基因组序列
genome_seq = SeqIO.read("genome_seq.fasta", "fasta")
# 读取基因注释文件
gene_annotation = open("gene_annotation.gff")
# 遍历每一个基因,提取CDS序列
for line in gene_annotation:
if line.startswith("#"):
continue
fields = line.strip().split("\t")
if fields[2] == "CDS":
gene_seq = genome_seq[ int(fields[3])-1 : int(fields[4]) ]
if fields[6] == "-":
gene_seq = gene_seq.reverse_complement()
cds_seq = Seq("", generic_dna)
for i in range(7, len(fields)):
if fields[i].startswith("Parent="):
parent = fields[i][7:]
for line2 in gene_annotation:
if line2.startswith("#"):
continue
fields2 = line2.strip().split("\t")
if (fields2[2] == "mRNA" or fields2[2] == "transcript") and fields2[8].find(parent) != -1:
transcript_seq = genome_seq[ int(fields2[3])-1 : int(fields2[4]) ]
if fields2[6] == "-":
transcript_seq = transcript_seq.reverse_complement()
cds_seq += gene_seq[len(gene_seq) - ( int(fields[4]) - int(fields2[4]) ) : len(gene_seq) - ( int(fields[3]) - int(fields2[4]) )]
break
# output CDS seq here
四、CDS序列的应用举例
1. 基于CDS序列预测蛋白质结构与功能
CDS序列是预测蛋白质结构和功能的重要基础。通过CDS序列,可以预测蛋白质的氨基酸序列,从而获取蛋白质的结构和功能信息。下面是一个Python程序,利用Phyre2等工具预测蛋白质结构:
import requests
# 获取CDS序列
cds_seq = "ATGATGAACAGGACTG..."
# 使用Phyre2预测蛋白质结构
response = requests.post('https://www.sbg.bio.ic.ac.uk/phyre2/webscripts/phyre2_server.cgi', data={
'seq': cds_seq,
'output': 'json',
'email': 'example@example.com'
})
# 获取结果
result = response.json()
2. 比较不同物种的CDS序列差异
比较不同物种的CDS序列差异可以帮助研究人员了解不同物种之间的遗传差异。下面是一个Python程序,比较两个物种的CDS序列:
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.Alphabet import generic_dna
from Bio.Blast import NCBIWWW
from Bio.Blast import NCBIXML
# 读取基因组序列和基因注释文件
genome_seq1 = SeqIO.read("genome1.fasta", "fasta")
genome_seq2 = SeqIO.read("genome2.fasta", "fasta")
gene_annotation1 = open("gene_annotation1.gff")
gene_annotation2 = open("gene_annotation2.gff")
# 遍历每一个基因,提取CDS序列,并用BLAST比对
for line in gene_annotation1:
if line.startswith("#"):
continue
fields = line.strip().split("\t")
if fields[2] == "CDS":
gene_seq1 = genome_seq1[ int(fields[3])-1 : int(fields[4]) ]
if fields[6] == "-":
gene_seq1 = gene_seq1.reverse_complement()
cds_seq1 = Seq("", generic_dna)
for i in range(7, len(fields)):
if fields[i].startswith("Parent="):
parent = fields[i][7:]
for line2 in gene_annotation1:
if line2.startswith("#"):
continue
fields2 = line2.strip().split("\t")
if (fields2[2] == "mRNA" or fields2[2] == "transcript") and fields2[8].find(parent) != -1:
transcript_seq1 = genome_seq1[ int(fields2[3])-1 : int(fields2[4]) ]
if fields2[6] == "-":
transcript_seq1 = transcript_seq1.reverse_complement()
cds_seq1 += gene_seq1[len(gene_seq1) - ( int(fields[4]) - int(fields2[4]) ) : len(gene_seq1) - ( int(fields[3]) - int(fields2[4]) )]
break
result_handle = NCBIWWW.qblast("blastn", "nt", str(cds_seq1))
blast_record = NCBIXML.read(result_handle)
for alignment in blast_record.alignments:
for hsp in alignment.hsps:
if hsp.expect < 0.001:
print("****Alignment****")
print("sequence:", alignment.title)
print("length:", alignment.length)
print("e-value:", hsp.expect)
print(hsp.query[0:75] + "...")
print(hsp.match[0:75] + "...")
print(hsp.sbjct[0:75] + "...")
print("\n\n\n")
for line in gene_annotation2:
...
五、总结
本文从CDS序列的基本概念开始介绍了CDS序列在基因注释中的重要性,并详细讲解了CDS序列的提取方法。此外,本文还结合实际案例,展示了CDS序列在预测蛋白质结构与功能,比较不同物种之间的遗传差异方面的应用,具有很好的指导意义。
原创文章,作者:YPWQ,如若转载,请注明出处:https://www.506064.com/n/146019.html
微信扫一扫
支付宝扫一扫