Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MULTIMAP
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
Admin message
A compter du 1er avril, attention à vos pipelines :
Nouvelles limitations de Docker Hub
Show more breadcrumbs
UMEC Mathieu
MULTIMAP
Commits
044bbf6a
Commit
044bbf6a
authored
1 year ago
by
UMEC Mathieu
Browse files
Options
Downloads
Patches
Plain Diff
cleaning code and starting the unittest
parent
08b9d804
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Mapping_using_the_API.py
+211
-210
211 additions, 210 deletions
Mapping_using_the_API.py
Tests_unitaires/test_Mapping_using_the_API.py
+60
-5
60 additions, 5 deletions
Tests_unitaires/test_Mapping_using_the_API.py
with
271 additions
and
215 deletions
Mapping_using_the_API.py
+
211
−
210
View file @
044bbf6a
This diff is collapsed.
Click to expand it.
Tests_unitaires/test_Mapping_using_the_API.py
+
60
−
5
View file @
044bbf6a
...
@@ -3,7 +3,17 @@ import sys
...
@@ -3,7 +3,17 @@ import sys
sys
.
path
.
append
(
'
C:
\\
Users
\\
mumec
\\
Desktop
\\
Dossier_gitlab_local
\\
traitement_des_données
'
)
sys
.
path
.
append
(
'
C:
\\
Users
\\
mumec
\\
Desktop
\\
Dossier_gitlab_local
\\
traitement_des_données
'
)
import
Mapping_using_the_API
import
Mapping_using_the_API
class
TestMappingAPI
(
unittest
.
TestCase
):
class
Testutils
(
unittest
.
TestCase
):
"""
recup_all_inf_excel(file)
send_request_to_mapping_api(url, data_json, head, met=
'
POST
'
)
excel_file_writer(dataframe, name_out_file, sheetname=
"
Resultats
"
)
pre_cut(listed)
"""
def
test_recup_all_inf_excel
(
self
):
def
test_send_request_to_Mapping_API
(
self
):
def
test_send_request_to_Mapping_API
(
self
):
result
=
Mapping_using_the_API
.
send_request_to_Mapping_API
(
'
https://rampdb.nih.gov/api/pathways-from-analytes
'
,[
"
hmdb:HMDB0000064
"
],{
'
Accept
'
:
'
*/*
'
,
'
Content-Type
'
:
'
application/json
'
})
result
=
Mapping_using_the_API
.
send_request_to_Mapping_API
(
'
https://rampdb.nih.gov/api/pathways-from-analytes
'
,[
"
hmdb:HMDB0000064
"
],{
'
Accept
'
:
'
*/*
'
,
'
Content-Type
'
:
'
application/json
'
})
...
@@ -13,13 +23,58 @@ class TestMappingAPI(unittest.TestCase):
...
@@ -13,13 +23,58 @@ class TestMappingAPI(unittest.TestCase):
with
self
.
assertRaises
(
ValueError
):
with
self
.
assertRaises
(
ValueError
):
Mapping_using_the_API
.
send_request_to_Mapping_API
(
'
https://rampdb.nih.gov/api/pathways-from-analytes
'
,[],{
'
Accept
'
:
'
*/*
'
,
'
Content-Type
'
:
'
application/json
'
})
Mapping_using_the_API
.
send_request_to_Mapping_API
(
'
https://rampdb.nih.gov/api/pathways-from-analytes
'
,[],{
'
Accept
'
:
'
*/*
'
,
'
Content-Type
'
:
'
application/json
'
})
"""
def
test_excel_file_writer
(
self
):
def test_mapping_from_RAMP_API(self):
def test_excel_file_writer(self):
def
test_pre_cut
(
self
):
"""
class
TestMappingAPI
(
unittest
.
TestCase
):
"""
mapping_ramp_api(metabolites_list, outfile, inf=
"
opti
"
)
m_ora_cpdb(accnumbers, acctype, cpdbidsbg=None,
pthreshold=0.05, infos=
"
all
"
,
ofile=
"
C:
\\
Users
\\
mumec
\\
Desktop
\\
test_out_cpdb.xlsx
"
)
equiv_from_ma_api(metabolites_list)
"""
def
test_mapping_ramp_api
(
self
):
def
test_m_ora_cpdb
(
self
):
def
test_equiv_from_ma_api
(
self
):
class
TestCPDBannexe
(
unittest
.
TestCase
):
"""
get_cpdb_available_fset_types(entity_type)
get_cpdb_available_accesion_types(entity_type)
get_cpdb_available_accesion_id(acctype, accnumbers)
get_cpdb_version()
"""
def
test_get_cpdb_available_fset_types
(
self
):
def
test_get_cpdb_available_accesion_types
(
self
):
def
test_get_cpdb_available_accesion_id
(
self
):
def
test_get_cpdb_version
(
self
):
class
TestMultiMapping
(
unittest
.
TestCase
):
"""
multimapping_ramp(file, num_col, outfiles, infpath=
"
Yes
"
)
opti_multimapping(file, outfolder, mapping=
"
YES
"
)
"""
def
test_multimapping_ramp
(
self
):
def
test_opti_multimapping
(
self
):
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
unittest
.
main
()
unittest
.
main
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment