-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding the ipaPy2 tool suite #468
Draft
hechth
wants to merge
24
commits into
master
Choose a base branch
from
ipa_stub
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 6 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
a338bbc
started ipapy2 clustering tool
hechth f95e14a
added empty lines
hechth 4982aba
added help text
hechth 8990fcf
added citation
hechth 2e6e58f
added tests
hechth 3c28584
lint
hechth 357a3e5
Update macros.xml
ChangLiuuczlcl8 8286e5a
Add files via upload
ChangLiuuczlcl8 c5a98a0
Update ipapy2_clustering.py
ChangLiuuczlcl8 d9b87e9
Update ipapy2_clustering.xml
ChangLiuuczlcl8 9705593
Add files via upload
ChangLiuuczlcl8 8c5bafd
Add files via upload
ChangLiuuczlcl8 a7f5ff8
Add files via upload
ChangLiuuczlcl8 c217fe1
first
ChangLiuuczlcl8 94af151
Update tools/ipapy2/ipapy2_clustering.xml
hechth 76dc71a
Merge branch 'ipa_stub' of github.com:RECETOX/galaxytools into ipa_stub
hechth 04166cd
changed ionization to select
hechth 651874d
Update tools/ipapy2/ipapy2_MS1_annotation.xml
ChangLiuuczlcl8 5e4d5e9
delete outdated files
ChangLiuuczlcl8 895aee6
add compute bio and gibbs sampler
ChangLiuuczlcl8 a37e307
fix error in macros
ChangLiuuczlcl8 f28a256
Merge pull request #474 from ChangLiuuczlcl8/ipa_stub
hechth f539a24
Merge branch 'master' into ipa_stub
hechth fc7b6e0
Merge branch 'master' into ipa_stub
hechth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: ipaPy2 | ||
owner: | ||
remote_repository_url: "https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2" | ||
homepage_url: "https://github.com/francescodc87/ipaPy2" | ||
categories: | ||
- Metabolomics | ||
description: "Mass spectrometry data annotation tool." | ||
long_description: "New Python implementation of the Integrated Probabilistic Annotation (IPA) - A Bayesian annotation method for LC/MS data integrating biochemical relations, isotope patterns and adduct formation." | ||
auto_tool_repositories: | ||
name_template: "{{ tool_id }}" | ||
description_template: "{{ tool_name }} tool from the ipaPy2 package" | ||
suite: | ||
name: suite_ipapy2 | ||
description: tools from the ipaPy2 suite are used for annotation of mass spectrometry data | ||
type: repository_suite_definition |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import click | ||
import pandas as pd | ||
from ipaPy2 import ipa | ||
|
||
|
||
@click.group(invoke_without_command=True) | ||
@click.option('--i', 'input_filename', type=click.Path(exists=True), required=True) | ||
@click.option('--o', 'output_filename', type=click.Path(writable=True), required=True) | ||
def cli(input_filename, output_filename): | ||
intensity_table = pd.read_csv(input_filename) | ||
result = ipa.clusterFeatures(intensity_table) | ||
result.to_csv(output_filename, index=False) | ||
|
||
|
||
if __name__ == '__main__': | ||
cli() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,60 @@ | ||||||
<tool id="ipapy2_clustering" name="ipaPy2 clustering" version="@TOOL_VERSION@+galaxy0" python_template_version="3.5" profile="21.05"> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Description is missing atm |
||||||
<macros> | ||||||
<import>macros.xml</import> | ||||||
</macros> | ||||||
|
||||||
<requirements> | ||||||
<requirement type="package" version="@TOOL_VERSION@">ipapy2</requirement> | ||||||
<requirement type="package" version="8.0.1">click</requirement> | ||||||
</requirements> | ||||||
|
||||||
<command detect_errors="exit_code"><![CDATA[ | ||||||
python3 ${__tool_directory__}/ipapy2_clustering.py --i '${intensity_table}' --o '${output}' | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
]]></command> | ||||||
|
||||||
<inputs> | ||||||
<param label="Intensity table" name="intensity_table" type="data" format="csv" help="Mass spectral library file." /> | ||||||
</inputs> | ||||||
|
||||||
<outputs> | ||||||
<data label="${tool.name} on ${on_string}" name="output" format="csv"/> | ||||||
</outputs> | ||||||
|
||||||
<tests> | ||||||
<test> | ||||||
<param name="intensity_table" value="minimal_input.csv"/> | ||||||
<output name="output" file="clustering.csv"/> | ||||||
</test> | ||||||
</tests> | ||||||
|
||||||
<help><![CDATA[ | ||||||
Before using the ipaPy2 package, the processed data coming from an untargeted metabolomics experiment must be properly prepared. | ||||||
The data must be organized in a pandas dataframe containing the following columns: | ||||||
|
||||||
- **ids**: an unique numeric id for each mass spectrometry feature feature | ||||||
hechth marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
- **rel.ids**: relation ids. Features must be clustered based on correlation/peak shape/retention time. Features in the same cluster are likely to come from the same metabolite. | ||||||
- **mzs**: mass-to-charge ratios, usually the average across different samples. | ||||||
- **RTs**: retention times in seconds, usually the average across different samples. | ||||||
- **Int**: representative (e.g., maximum or average) intensity detected for each feature across samples (either peak area or peak intensity) | ||||||
|
||||||
The clustering of the features is a necessary and must be performed before running the IPA method. | ||||||
For this step, the use of widely used data processing software such as mzMatch and CAMERA is recommended. | ||||||
Nevertheless, the ipaPy2 library provides a function (clusterFeatures()) able to perform such step, | ||||||
starting from a dataframe containing the measured intensities across several samples (at least 3 samples, the more samples the better). | ||||||
Such dataframe should be organized as follows: | ||||||
|
||||||
+----+------+-----+-------------+-------------+-------------+ | ||||||
| id | mz | rt | intensity_1 | intensity_2 | intensity_3 | | ||||||
+====+======+=====+=============+=============+=============+ | ||||||
| 1 | 100 | 10 | 500 | 600 | 700 | | ||||||
+----+------+-----+-------------+-------------+-------------+ | ||||||
| 2 | 200 | 20 | 800 | 900 | 1000 | | ||||||
+----+------+-----+-------------+-------------+-------------+ | ||||||
| 3 | 300 | 30 | 1100 | 1200 | 1300 | | ||||||
+----+------+-----+-------------+-------------+-------------+ | ||||||
]]></help> | ||||||
<citations> | ||||||
<citation type="doi">10.1021/acs.analchem.9b02354</citation> | ||||||
<citation type="doi">10.1093/bioinformatics/btad455</citation> | ||||||
</citations> | ||||||
</tool> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<macros> | ||
<token name="@TOOL_VERSION@">1.3.0</token> | ||
</macros> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
ids,rel.ids,mzs,RTs,Int | ||
0,0,110.0346328990618,189.90331509802155,3786719.935982465 | ||
1,1,112.0506647763902,163.27735969175174,142356656.91329387 | ||
2,2,112.07565637582633,185.44492145379184,4232563.395784442 | ||
3,3,113.0233876257136,172.1718694530046,814718.2931617 | ||
4,4,113.05983818307936,170.6316635193729,25946536.94788723 | ||
5,5,113.05983777733188,180.8824750038957,14719570.784554532 | ||
6,6,114.03726205384052,184.9377656087088,2277920.5184312323 | ||
7,7,114.06619405738884,166.3394005272794,12877950.34415196 | ||
8,8,114.06619243777511,179.11913090787945,4012725.880463593 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
id,mz,rt,data06_intensity,data07_intensity,data08_intensity | ||
0,110.03463289906179,189.90331509802155,3786719.935982465,3337130.2371725794 | ||
1,112.05066477639019,163.27735969175174,142356656.91329387,84292123.72052653,116220468.2058125 | ||
2,112.07565637582633,185.44492145379184,3027831.662547251,4232563.395784442 | ||
3,113.02338762571361,172.1718694530046,814718.2931617,667412.6145220067 | ||
4,113.05983818307935,170.6316635193729,9769737.443290893,25946536.94788723,15256613.822737923 | ||
5,113.05983777733188,180.8824750038957,5083952.726032479,14719570.784554532,11882839.70348706 | ||
6,114.03726205384051,184.9377656087088,2277920.5184312323,1942789.2956770866 | ||
7,114.06619405738884,166.3394005272794,4854729.25883474,12877950.34415196,0.0 | ||
8,114.06619243777511,179.11913090787945,1029415.0130157267,0.0,4012725.880463593 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we put this small function into a
<configfile>
or use argparse we could save the click dependency and the additional container.