-
Notifications
You must be signed in to change notification settings - Fork 23
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
Conversion bruker data #148
Conversation
Can you add a "--version" command so we dont have to hardcode the version in workflows everytime and everywhere? |
|
…o conversion_bruker_data
How can you specify that both raw and d are converted to mzml? |
You mean having a conversion where you have more than one file type? Right now you will only have one file type to another, this is allowed: |
what if you have multiple file types in the initial design? |
We don't allow that in quantms or even OpenMS. I guess is a really future use case. |
It is allowed in quantms. |
If you only allow one type of raw file, why a mapping at all? |
Ok, what will be the expected behaviour, something like: raw:mzml Which mean convert the raw to mzml and keep the d as d? |
Yes exactly. |
What should happen if the user gives contradictory changes, like d:d and d:raw ? Error? |
I will put the following behavior: |
@jpfeuffer the following commit allows multiple file conversions: 9c304a7 |
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.
Good work. Most comments can be safely ignored, but the tests should all use asserts.
(and please excuse my post merge review...)
@@ -12,17 +12,28 @@ def test_validate_srdf(): | |||
runner = CliRunner() | |||
result = runner.invoke(cli, ["validate-sdrf", "--sdrf_file", "testdata/PXD000288.sdrf.tsv", "--check_ms"]) | |||
|
|||
print(result.output) | |||
assert "ERROR" not in result.output | |||
print("validate sdrf " + result.output) |
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.
Any particular reason to not use an assert statement here instead of the print? Just reading this test, I don't know what would count as a test failure. Or success. There might be an
assert "ERROR" not in result.output
missing?
def test_search_mods_by_accession(): | ||
unimod = UnimodDatabase() | ||
ptm = unimod.get_by_accession("UNIMOD:21") | ||
print(ptm.get_name()) | ||
|
||
|
||
def test_search_mods_by_keyword(): | ||
unimod = UnimodDatabase() | ||
ptms = unimod.search_mods_by_keyword("Phospho") | ||
for ptm in ptms: | ||
print(ptm.to_str()) |
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.
Again, tests should have an assert. Without they still require human interpretation and the idea is to have the test automated and as little as possible human interpretation/interaction.
@@ -37,7 +37,7 @@ def verify_content(pname, pvalue, ptype): | |||
# exit("ERROR: " + pname + " needs to be a numeric value!!") | |||
elif ptype == "class": | |||
not_matching = [x for x in pvalue.split(",") if x not in p["value"]] | |||
if not_matching != []: | |||
if len(not_matching) != 0: |
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.
Sidenote: This could be just if not_matching:
@@ -98,7 +98,7 @@ def add_ptms(mods, pname, mod_columns): | |||
modname = tmod[0] | |||
modpos = tmod[1] | |||
found = [x for x in unimod.modifications if modname == x.get_name()] | |||
if found == []: | |||
if len(found) == 0: |
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.
Sidenote: I would probably have gone with if not found
.
@@ -35,6 +41,15 @@ def get_name(self): | |||
def get_accession(self): | |||
return self._ontology_term.get_accession() | |||
|
|||
def get_delta_mono_mass(self): |
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.
Another option would be to make them properties with the "@Property" decorator. That way the "get_" prefix could be left out and the attributes would still have some protection against overwriting.
extension_convert
reflecting discussion in [Pitch] Partial keep raw in OpenMS #145 and PR in quantms Feature/bruker data quantms#275.