Skip to content
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

Region search: Validate input. #23

Closed
yochannah opened this issue Dec 22, 2016 · 6 comments
Closed

Region search: Validate input. #23

yochannah opened this issue Dec 22, 2016 · 6 comments
Labels
beginner Bootcamp If you've been following the clojure bootcamp tutorial, try these tickets first enhancement Region Search

Comments

@yochannah
Copy link
Member

Right now whatever we input into the box is submitted to the sever. When the input is invalid we don't get verbose or meaningful error messages back, so we should validate the regions clientside before submission.

Demonstrative example:
example region search input

The 'ss' appended to the end of the input in that screenshot results in a 500 from the server, and no results for any of the regions.

@yochannah yochannah moved this from TODO to Done in General work Feb 1, 2017
@yochannah yochannah removed this from Done in General work Feb 1, 2017
@yochannah yochannah added the Bootcamp If you've been following the clojure bootcamp tutorial, try these tickets first label Jun 5, 2018
@sehgalvibhor
Copy link
Contributor

@yochannah : My thoughts on this is to implement a regex for the 'region-input' to check the string format before dispatching a function to the server otherwise raise a validation alert. Thoughts?

Also, I am not sure about the regex for the input field. Can you help me with this?

@yochannah
Copy link
Member Author

yochannah commented Dec 5, 2018

@sehgalvibhor That sounds like a good approach!

@rachellyne regarding @sehgalvibhor's question above, is a formula along the lines of (some alphanumeric chars):(numeric characters)(.. or -)(numeric characters) appropriate?

p.s. let me know if I wasn't clear enough there.

@rachellyne
Copy link
Member

That will catch any inappropriately formatted regions but will not catch regions that do not return results because, for example, they are out of range for the sequence - but maybe that's ok (These should become obvious from the results.) Also it won't catch anything with a wrong chromosome number? eg Drosophila only has chromosomes 1-4, so 8:xxxx..xxx would still go though as correct?

@yochannah
Copy link
Member Author

Thanks @rachellyne! out of range / chromosome number checks probably need to be made on the server I think. @julie-sullivan does that sound right? Or do we have the data for valid ranges available via web service somehow?

@yochannah
Copy link
Member Author

@sehgalvibhor While we're thinking about that second question, I think it's safe to proceed with the formula (some alphanumeric chars):(numeric characters)(.. or -)(numeric characters) - is that enough for you to go on?

Here's an example of a regex being used in bluegenes:

(let [matcher (re-matcher (re-pattern "[^(\\s|,;)\"']+|\"([^\"]*)\"|'([^']*)'") s)]
- or search for other re-pattern uses.

@sehgalvibhor
Copy link
Contributor

sehgalvibhor commented Dec 5, 2018

@yochannah : Yes I'll try out on the formula you mentioned. Just to confirm these can be multi-line and tab-spaced right?

Also, is it better if we disable the button dynamically like currently being done for empty search strings etc or wait for the user to press the button?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginner Bootcamp If you've been following the clojure bootcamp tutorial, try these tickets first enhancement Region Search
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants