Skip to content

Handle 4 best practice proforma sequences#33

Merged
acesnik merged 1 commit intomasterfrom
proforma-integration-tests
Apr 4, 2018
Merged

Handle 4 best practice proforma sequences#33
acesnik merged 1 commit intomasterfrom
proforma-integration-tests

Conversation

@rfellers
Copy link
Copy Markdown
Member

Adds some unit tests and relaxes the requirements for tags (from enum to string). I'm wanting feedback here: my plan is to relax the key requirements in this step and handle the higher level logic during validation and conversion. For example, a tag of [fake:123] would pass this stage and then throw an exception during a conversion to a proteoform. There was also the practical issue of PSI-MOD not working as an enum value. There is also a unit test called HandleExtraTagSpaces() that explicitly tests for extra space handling; I'm curious to see what people think. This PR addresses #22 and #27

…or database keys by relaxing tag requirements
@acesnik
Copy link
Copy Markdown
Contributor

acesnik commented Mar 23, 2018

I like how you're relaxing the parsing, waiting until later for stricter validation. The space handling looks good (ditching spaces before the key, keeping all the rest). I might recommend storing the whitespace following the value in a separate property, so that it can be reproduced, but so that the user doesn't need to stick .TrimRight() before using the value string every time.

I'll take a look at those best practice tests tomorrow afternoon.

Assert.AreEqual(ProFormaKey.Mod, tag25.Descriptors[0].Key);
Assert.AreEqual("p-adenosine", tag25.Descriptors[0].Value);
Assert.AreEqual(ProFormaKey.Mod, tag25.Descriptors[1].Key);
Assert.AreEqual(" N6-(phospho-5'-adenosine)-L-lysine(RESID)", tag25.Descriptors[1].Value);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this have the space trimmed off of the left?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be trimmed, so that using string comparisons with modifications in a database would give expected results.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open question in my opinion. Right now I'm only trimming from the ends of the descriptor. I am preserving all of the spaces directly after the colon. Seems to be the middle ground and I'm not sure if that is good. We could aggressively trim (which speaks to me), but one could argue that would hurt readability when written back out. We could not trim at all, but that complicates matching key and value strings in the backend.

I'd vote we accept this PR and discuss during the next meeting ... I've got a couple more PRs lined up after this one :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't see your response a minute later ... I don't mind switching to "aggressive trimming" for this PR. But a group discussion is warranted.

@acesnik acesnik merged commit be942da into master Apr 4, 2018
@rfellers rfellers deleted the proforma-integration-tests branch April 4, 2018 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants