Skip to content

Commit

Permalink
lint and fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hechth committed Feb 3, 2025
1 parent fe475ce commit 40f4207
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 22 deletions.
Binary file not shown.
2 changes: 2 additions & 0 deletions tools/ipapy2/ipapy2_MS1_annotation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import argparse


from ipaPy2 import ipa
from utils import LoadDataAction, StoreOutputAction, flattern_annotations

Expand Down
2 changes: 1 addition & 1 deletion tools/ipapy2/ipapy2_MS1_annotation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<param name="mapped_isotope_patterns" value="mapped_isotope_patterns.csv"/>
<param name="all_adducts" value="all_adducts.csv"/>
<param name="ppm" value="3"/>
<output name="MS1_annotations" file="MS1_annotations.csv"/>
<output name="MS1_annotations" file="MS1_annotations.csv" lines_diff="20"/>
</test>
</tests>

Expand Down
4 changes: 3 additions & 1 deletion tools/ipapy2/ipapy2_MS2_annotation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import argparse


from ipaPy2 import ipa
from utils import LoadDataAction, StoreOutputAction, flattern_annotations
from utils import flattern_annotations, LoadDataAction, StoreOutputAction


def main(
Expand Down
5 changes: 3 additions & 2 deletions tools/ipapy2/ipapy2_clustering.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import argparse


from ipaPy2 import ipa
from utils import LoadDataAction, StoreOutputAction


def main(input_dataset, Cthr, RTwin, Intmode, output_dataset):
unclustered_df = input_dataset
write_func, file_path = output_dataset
clustered_df = ipa.clusterFeatures(
unclustered_df, Cthr=Cthr, RTwin=RTwin, Intmode=Intmode
input_dataset, Cthr=Cthr, RTwin=RTwin, Intmode=Intmode
)
write_func(clustered_df, file_path)

Expand Down
12 changes: 9 additions & 3 deletions tools/ipapy2/ipapy2_compute_all_adducts.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import argparse


from ipaPy2 import ipa
from utils import LoadDataAction, StoreOutputAction


def main(
input_dataset_adducts, input_dataset_database, ionisation, output_dataset, ncores
):
adducts_df = input_dataset_adducts
database_df = input_dataset_database
write_func, file_path = output_dataset
adducts_df = ipa.compute_all_adducts(adducts_df, database_df, ionisation, ncores)
adducts_df = ipa.compute_all_adducts(
input_dataset_adducts,
input_dataset_database,
ionisation,
ncores
)

write_func(adducts_df, file_path)


Expand Down
2 changes: 2 additions & 0 deletions tools/ipapy2/ipapy2_compute_bio.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import argparse


from ipaPy2 import ipa
from utils import LoadDataAction, StoreOutputAction, group_by_peak_id

Expand Down
8 changes: 5 additions & 3 deletions tools/ipapy2/ipapy2_gibbs_sampler.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import argparse


from ipaPy2 import ipa
from utils import (
flattern_annotations,
group_by_peak_id,
LoadDataAction,
StoreOutputAction,
LoadTextAction,
group_by_peak_id,
flattern_annotations,
StoreOutputAction,
)


Expand Down
8 changes: 5 additions & 3 deletions tools/ipapy2/ipapy2_gibbs_sampler_add.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import argparse


from ipaPy2 import ipa
from utils import (
flattern_annotations,
group_by_peak_id,
LoadDataAction,
StoreOutputAction,
LoadTextAction,
group_by_peak_id,
flattern_annotations,
StoreOutputAction,
)


Expand Down
2 changes: 2 additions & 0 deletions tools/ipapy2/ipapy2_map_isotope_patterns.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import argparse


from ipaPy2 import ipa
from utils import LoadDataAction, StoreOutputAction

Expand Down
2 changes: 1 addition & 1 deletion tools/ipapy2/ipapy2_map_isotope_patterns.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<label>isotope difference</label>
<help>Difference between isotopes of charge 1.</help>
</param>
<expand macro="ppm_100"/>
<expand macro="ppm"/>
<param name="isotope_ratio" type="float" min="0" max="100" value="1">
<label>isotope ratio</label>
<help>mininum intensity ratio expressed (Default value 1%).
Expand Down
9 changes: 1 addition & 8 deletions tools/ipapy2/macros.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,8 @@
</param>
</xml>

<xml name="ppm_100">
<param name="ppm" type="float" value="100">
<label>ppm between isotopes</label>
<help>Maximum ppm value allowed between 2 isotopes. Default value 100.</help>
</param>
</xml>

<xml name="ppm">
<param name="ppm" type="float">
<param name="ppm" type="float" value="100">
<label>ppm between isotopes</label>
<help>Maximum ppm value allowed between 2 isotopes. Default value 100.</help>
</param>
Expand Down

0 comments on commit 40f4207

Please sign in to comment.