Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Omnicrobe web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Omnicrobe
Omnicrobe web
Merge requests
!11
Update April 2024
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Update April 2024
dev
into
master
Overview
0
Commits
4
Pipelines
0
Changes
2
Merged
Sandra Derozier
requested to merge
dev
into
master
10 months ago
Overview
0
Commits
4
Pipelines
0
Changes
2
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
4babd7e1
4 commits,
10 months ago
2 files
+
121
−
33
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
static/files/omnicrobe.py
+
26
−
22
Options
#!/usr/bin/env python3.6
# Copyright 2022 Robert Bossy (INRAE)
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,7 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#!/usr/bin/env python3.6
'''
Wrapper objects and functions for the Omnicrobe REST API. See: http://omnicrobe.migale.inrae.fr/api.
@@ -27,7 +29,9 @@ Variables:
import
requests
BASE_URL
=
'
http://omnicrobe.migale.inrae.fr/api
'
BASE_URL
=
'
https://omnicrobe.migale.inrae.fr/api
'
class
OmnicrobeError
(
Exception
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
@@ -200,6 +204,7 @@ class OBTType(object):
return
obt_type
.
name
return
str
(
obt_type
)
HABITAT
=
OBTType
(
'
habitat
'
)
PHENOTYPE
=
OBTType
(
'
phenotype
'
)
USE
=
OBTType
(
'
use
'
)
@@ -330,42 +335,41 @@ class Relation:
)
if
__name__
==
'
__main__
'
:
print
(
'
Version
'
)
print
(
version
())
print
(
'
\n
'
)
print
(
'
Version
'
)
print
(
version
())
print
(
'
\n
'
)
print
(
'
taxon info by id
'
)
print
(
'
taxon info by id
'
)
bs
=
Taxon
(
'
ncbi:1423
'
)
print
(
bs
)
print
(
bs
)
print
(
'
\n
'
)
print
(
'
obt info by id
'
)
print
(
'
obt info by id
'
)
soil
=
OBT
(
'
OBT:000427
'
)
print
(
soil
)
print
(
soil
)
print
(
'
\n
'
)
print
(
'
search taxon descendants
'
)
print
(
'
search taxon descendants
'
)
for
t
in
Taxon
.
search
(
root
=
bs
):
print
(
t
.
identifier
)
print
(
t
.
identifier
)
print
(
'
\n
'
)
print
(
'
search taxon name
'
)
print
(
'
search taxon name
'
)
for
t
in
Taxon
.
search
(
'
propionibacterium
'
):
print
(
t
.
identifier
)
print
(
t
.
identifier
)
print
(
'
\n
'
)
print
(
'
search obt descendants
'
)
print
(
'
search obt descendants
'
)
for
o
in
OBT
.
search
(
root
=
soil
):
print
(
o
.
identifier
)
print
(
'
\n
'
)
print
(
o
.
identifier
)
print
(
'
\n
'
)
print
(
'
search obt name
'
)
print
(
'
search obt name
'
)
for
o
in
OBT
.
search
(
'
food
'
):
print
(
o
.
identifier
)
print
(
'
\n
'
)
print
(
o
.
identifier
)
print
(
'
\n
'
)
print
(
'
search relations
'
)
print
(
'
search relations
'
)
for
r
in
Relation
.
search
(
taxon
=
bs
,
obt
=
soil
,
qps
=
True
,
sources
=
'
GenBank
'
):
print
(
r
)
print
(
r
)
Loading