Skip to content

Commit 110a3e6

Browse files
committed
Merge branch 'main' of https://github.com/ModelSEED/ModelSEEDpy into main
# Conflicts: # modelseedpy/__init__.py # modelseedpy/core/__init__.py
2 parents 4737197 + 65332dd commit 110a3e6

25 files changed

+274373
-19
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ target/
7676

7777
# Jupyter Notebook
7878
.ipynb_checkpoints
79+
.idea
7980

8081
# IPython
8182
profile_default/

examples/GCF_000005845.2_ASM584v2_protein.faa

Lines changed: 22981 additions & 0 deletions
Large diffs are not rendered by default.

examples/Genomes.ipynb

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 1,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"import modelseedpy\n",
10+
"from modelseedpy.core.msgenome import MSGenome\n",
11+
"from modelseedpy.core.rast_client import RastClient"
12+
]
13+
},
14+
{
15+
"cell_type": "code",
16+
"execution_count": 2,
17+
"metadata": {},
18+
"outputs": [],
19+
"source": [
20+
"rast = RastClient()"
21+
]
22+
},
23+
{
24+
"cell_type": "code",
25+
"execution_count": 7,
26+
"metadata": {},
27+
"outputs": [],
28+
"source": [
29+
"genome = MSGenome.from_fasta('GCF_000005845.2_ASM584v2_protein.faa', split=' ')"
30+
]
31+
},
32+
{
33+
"cell_type": "code",
34+
"execution_count": 4,
35+
"metadata": {},
36+
"outputs": [
37+
{
38+
"name": "stdout",
39+
"output_type": "stream",
40+
"text": [
41+
"Number of features: 4284\n"
42+
]
43+
}
44+
],
45+
"source": [
46+
"print('Number of features:', len(genome.features))"
47+
]
48+
},
49+
{
50+
"cell_type": "code",
51+
"execution_count": 14,
52+
"metadata": {},
53+
"outputs": [
54+
{
55+
"data": {
56+
"text/plain": [
57+
"[{'execution_time': 1622756127.36331,\n",
58+
" 'tool_name': 'kmer_search',\n",
59+
" 'hostname': 'pear',\n",
60+
" 'parameters': ['-a',\n",
61+
" '-g',\n",
62+
" 200,\n",
63+
" '-m',\n",
64+
" 5,\n",
65+
" '-d',\n",
66+
" '/opt/patric-common/data/kmer_metadata_v2',\n",
67+
" '-u',\n",
68+
" 'http://pear.mcs.anl.gov:6100/query'],\n",
69+
" 'id': '9CCA6D20-C4B3-11EB-A893-36A8BEF382BD'},\n",
70+
" {'parameters': ['annotate_hypothetical_only=1',\n",
71+
" 'dataset_name=Release70',\n",
72+
" 'kmer_size=8'],\n",
73+
" 'hostname': 'pear',\n",
74+
" 'tool_name': 'KmerAnnotationByFigfam',\n",
75+
" 'id': '9CE3769E-C4B3-11EB-A893-36A8BEF382BD',\n",
76+
" 'execution_time': 1622756127.52738},\n",
77+
" {'execute_time': 1622756127.88296,\n",
78+
" 'hostname': 'pear',\n",
79+
" 'parameters': [],\n",
80+
" 'tool_name': 'annotate_proteins_similarity',\n",
81+
" 'id': '9D19B7EA-C4B3-11EB-9714-71B3BDF382BD'}]"
82+
]
83+
},
84+
"execution_count": 14,
85+
"metadata": {},
86+
"output_type": "execute_result"
87+
}
88+
],
89+
"source": [
90+
"rast.annotate_genome(genome)"
91+
]
92+
},
93+
{
94+
"cell_type": "markdown",
95+
"metadata": {},
96+
"source": [
97+
"### Equivalent call from the client it self"
98+
]
99+
},
100+
{
101+
"cell_type": "code",
102+
"execution_count": 15,
103+
"metadata": {},
104+
"outputs": [],
105+
"source": [
106+
"#genome, res = rast.annotate_genome_from_fasta('GCF_000005845.2_ASM584v2_protein.faa', split=' ')\n",
107+
"#res"
108+
]
109+
},
110+
{
111+
"cell_type": "code",
112+
"execution_count": null,
113+
"metadata": {},
114+
"outputs": [],
115+
"source": []
116+
},
117+
{
118+
"cell_type": "code",
119+
"execution_count": null,
120+
"metadata": {},
121+
"outputs": [],
122+
"source": []
123+
},
124+
{
125+
"cell_type": "code",
126+
"execution_count": 22,
127+
"metadata": {},
128+
"outputs": [],
129+
"source": []
130+
},
131+
{
132+
"cell_type": "code",
133+
"execution_count": null,
134+
"metadata": {},
135+
"outputs": [],
136+
"source": []
137+
},
138+
{
139+
"cell_type": "code",
140+
"execution_count": 8,
141+
"metadata": {},
142+
"outputs": [],
143+
"source": []
144+
},
145+
{
146+
"cell_type": "code",
147+
"execution_count": null,
148+
"metadata": {},
149+
"outputs": [],
150+
"source": []
151+
},
152+
{
153+
"cell_type": "code",
154+
"execution_count": 34,
155+
"metadata": {},
156+
"outputs": [],
157+
"source": [
158+
"feature = genome.features.get_by_id('YP_588478.1')"
159+
]
160+
},
161+
{
162+
"cell_type": "code",
163+
"execution_count": 36,
164+
"metadata": {},
165+
"outputs": [
166+
{
167+
"data": {
168+
"text/plain": [
169+
"{'RAST': 'DUF1435 domain-containing protein YjjZ [Escherichia coli str. K-12 substr. MG1655]'}"
170+
]
171+
},
172+
"execution_count": 36,
173+
"metadata": {},
174+
"output_type": "execute_result"
175+
}
176+
],
177+
"source": [
178+
"feature.ontology_terms"
179+
]
180+
},
181+
{
182+
"cell_type": "code",
183+
"execution_count": null,
184+
"metadata": {},
185+
"outputs": [],
186+
"source": [
187+
"feature.add_ontology_term('')"
188+
]
189+
}
190+
],
191+
"metadata": {
192+
"kernelspec": {
193+
"display_name": "Python 3",
194+
"language": "python",
195+
"name": "python3"
196+
},
197+
"language_info": {
198+
"codemirror_mode": {
199+
"name": "ipython",
200+
"version": 3
201+
},
202+
"file_extension": ".py",
203+
"mimetype": "text/x-python",
204+
"name": "python",
205+
"nbconvert_exporter": "python",
206+
"pygments_lexer": "ipython3",
207+
"version": "3.7.4"
208+
}
209+
},
210+
"nbformat": 4,
211+
"nbformat_minor": 4
212+
}

0 commit comments

Comments
 (0)