Skip to content
Snippets Groups Projects
Commit bf0d2867 authored by UMEC Mathieu's avatar UMEC Mathieu
Browse files

fix bug and of pathwyas name of CPDB

parent 272f53d9
No related branches found
No related tags found
No related merge requests found
......@@ -195,7 +195,7 @@ def mapping_ramp_api_enrichment(metabolites_list, outfile, inf="all"):
return (len(list_result[0]), list_result)
def mapping_ramp_offline(meta_l_r_off, outfile, conect_id, inf="flow", all_name=False):
def mapping_ramp_offline(meta_l_r_off, outfile, conect_id, inf="flow", all_name=False): # Version non modifier
"""
This function gives the result of mapping of a metabolites list from RAMP.
for the moment this function is not correct but it's work...
......@@ -210,8 +210,8 @@ def mapping_ramp_offline(meta_l_r_off, outfile, conect_id, inf="flow", all_name=
Returns:
1 excel file whith 5 columns
"""
"""
if len(meta_l_r_off) == 0:
badend = " Your metabolite list is empty. Here's an example"
badend += "['KEGG:C01157','hmdb:HMDB0032566','chebi:16015']"
......@@ -324,6 +324,7 @@ def mapping_ramp_offline(meta_l_r_off, outfile, conect_id, inf="flow", all_name=
return (len(full_results), df_result.transpose().values.tolist())
def multimapping_ramp(file, num_col, outfiles, infpath="Yes"):
"""
Processe multimapping from multi list
......@@ -623,6 +624,7 @@ def m_ora_cpdb(accnumbers, acctype, cpdbidsbg=None,
print("Mapping empty")
return []
print("CPDB mapping ok")
# Shapping API data for upcoming treatment
details = str(xml_dict_orar["ns1:details"])
pval = str(xml_dict_orar["ns1:pValue"])[2:-2]
qval = str(xml_dict_orar["ns1:qValue"])[2:-2]
......@@ -680,6 +682,7 @@ def m_ora_cpdb(accnumbers, acctype, cpdbidsbg=None,
output_1[4][pos] = output_1[4][pos][9:]
name_splited = name.split("', '")
source = ["source"]
"""
for nam_i, nam in enumerate(name_splited):
p_ind = nam.index("(")
sub_nam = nam[p_ind+1:-1]
......@@ -688,7 +691,14 @@ def m_ora_cpdb(accnumbers, acctype, cpdbidsbg=None,
sub_nam = nam[p_ind+2:-1]
sub_nam = sub_nam.strip("(")
source.append(sub_nam)
name_splited[nam_i] = nam[:p_ind-1]
name_splited[nam_i] = nam[:p_ind].strip()
"""
for nam_i, nam in enumerate(name_splited):
p_ind = 0
for npar in range(nam.count("(")):
p_ind += nam[p_ind:].index("(") + 1
source.append(nam[p_ind:-1])
name_splited[nam_i] = nam[:p_ind-1].strip()
name_splited.insert(0, "Pathways")
psplited = pval.split("', '")
psplited.insert(0, "p-value")
......@@ -1188,4 +1198,42 @@ if __name__ == "__main__":
ID = ["127.0.0.1", "root", "A6y39m26&1608", "ramp_version_2024_04_11"]
mapping_ramp_offline(metabo_l, FI_OUT, ID, inf="flow", all_name=True)
"""
print(try_parameters_cpdb(["16015", "15903"], "chebi", pthreshold=0.05))
#print(try_parameters_cpdb(["16015", "15903"], "chebi", pthreshold=0.05))
Fold = "C:\\Users\\mumec\\Desktop\\Mini_codes\\ajout_informations_workflow\\"
m_ora_cpdb(["16015", "15903", "18019", "16523"], 'chebi', infos="flow",
ofile=Fold + "test_out_cpdb.xlsx")
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment