forked from gehrigrl/ProteinFunctionalAnnotationScripts
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRetrieve2014.py
More file actions
39 lines (31 loc) · 1.26 KB
/
Retrieve2014.py
File metadata and controls
39 lines (31 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#This code fetches the 2014 DSV genome (chromosome only) and the 2016 DSV plasmid genome, and
#counts the hypotheticals and genes across the 2 files
from Bio import SeqIO
from Bio import Entrez
Entrez.email = "gehrig.rl@gmail.com"
handle = Entrez.efetch(db="nucleotide", id="AE017285.1", rettype="gb", retmode="text")
iterator = SeqIO.parse(handle, 'genbank')
DSVgenome = next(iterator)
handle.close()
handle = Entrez.efetch(db="nucleotide", id="AE017286.1", rettype="gb", retmode="text")
iterator = SeqIO.parse(handle, 'genbank')
DSVplasmid = next(iterator)
handle.close()
GenomeHypotheticalsCount = 0
for each_feature in DSVgenome.features:
if 'product' in each_feature.qualifiers:
if each_feature.qualifiers['product'] == ['hypothetical protein']:
GenomeHypotheticalsCount += 1
PlasmidHypotheticalsCount = 0
for each_feature in DSVplasmid.features:
if 'product' in each_feature.qualifiers:
if each_feature.qualifiers['product'] == ['hypothetical protein']:
PlasmidHypotheticalsCount += 1
GenomeGeneCount = 0
for each_feature in DSVgenome.features:
if each_feature.type == 'gene':
GenomeGeneCount += 1
PlasmidGeneCount = 0
for each_feature in DSVplasmid.features:
if each_feature.type == 'gene':
PlasmidGeneCount += 1