从基因NCBI检索内含子剪接

时间:2018-10-11 12:54:29

标签: python-3.6 biopython

我想检索某些基因(例如https://www.ncbi.nlm.nih.gov/nuccore/X62462.1)的内含子序列。

我可以通过核苷酸数据库获得某些基因,但是其中一些仅出现在NCBI的基因数据库中。为此,我正在使用Biopython。

这里有一段代码可以从核苷酸数据库中检索内含子。

from Bio.Seq import Seq
from Bio import SeqIO, Entrez
count = 4 # Number of entries to see
genes = ["estrogen receptor"]

shortname = genes[0] 

Entrez.email = "email@gmail.com"
handle = Entrez.esearch(db="nucleotide", term="Human[Orgn] AND "+shortname+"[GENE] AND biomol_genomic[PROP] AND nucleotide_protein[Filter]", idtype="acc", retmax=count)
record = Entrez.read(handle)
handle.close()

在这一部分中,我检查我想要哪个条目:

print("Entries:", record["Count"])
seq_records=[]
for i in range(len(record["IdList"])):
    idname = record["IdList"][i]
    with Entrez.efetch(db="nucleotide", rettype="gb", retmode="text", id=idname) as handle:
        seq_record = SeqIO.read(handle, "gb")
        seq_records.append(seq_record)
        print(i, "--", seq_record.description, seq_record.id)

条目:1 0-雌激素受体(乳房)基因X62462.1的智人H'5'侧翼区域

现在我检索该基因的内含子序列:

id_chosen = 0
intron = [f for f in seq_records[id_chosen].features if f.type == "intron"]
x=1
for start, end in [(e.location.start.position, e.location.end.position ) for e in intron]:
        print(">>>",seq_record.id, "Intron:",x, start+1, end, ",len:",len(seq_record.seq[start:end]))
        x += 1
        print(seq_record.seq[start:end], "\n")

输出:> X62462.1内含子:1 911 2933,镜头:2023 GTAGGCTTGTTTTGATTTCTCTCTCTGTAGCTTTAGCATTTTGAGAAAGCAACTTACCTTTCTGGCTAGTGTCTGTATCCTAGCAGGGAGATGAGGATTGCTGTTCTCCATCAT ......

在这种情况下,只有一个内含子。

所以我的问题是...如何处理具有多个内含子剪接并出现在基因数据库中的基因?如何使用这些功能?

示例:https://www.ncbi.nlm.nih.gov/gene/374

Screenshot of the Introns to retrieve

谢谢!

0 个答案:

没有答案