serratus-bio / serratus.io

Front-end code for Serratus project website
https://serratus.io
GNU Affero General Public License v3.0
11 stars 11 forks source link

Palmid #153

Closed ababaian closed 3 years ago

ababaian commented 3 years ago

This PR will close #149, with a huge thanks to @binoyskumar92 for development help. This is a front-end interface for palmid and the palmid-lambda microservice.

The page has basic error handling (5 minute timeout), uses location.search to create static URL where previously submitted reports can be accessed (e.g. palmid.serratus.io/palmid?hash=3xample ). The front-end behaviour is as expected, any changes to palmid reports need to be made in the R-package repo.

The input fasta sequences are parsed to a 2-line fasta (header, sequence) in all caps with no indels. This promotes that when the same sequence is entered, the SHA1 hash of the sequence is more likely to collide with a previous submission of the same sequence, hopefully this decreases lambda calls overall (we'll see). What remains to be done here is the palmid-api service needs to check S3 for the existence of a hash.

Some features to consider adding are a CAPTCHA api so that the service is not spammed.

ababaian commented 3 years ago

@binoyskumar92 , I saw this warning before about a variable but the PR won't merge until it's resolved:

 src/components/Palmid/hooks/useFasta.tsx
  Line 10:17:  'rnaSequence' is defined but never used. Allowed unused args must match /^_/u  no-unused-vars

I looked at the code and I don't get why it says only this variable is undefined.

binoyskumar92 commented 3 years ago

Ah it looks like an ESLint config causing this.

image

victorlin commented 3 years ago

This is somewhat expected – it's supposed to warn for unused variables. I'll need to double check why the build is failing though.

In the meantime, you can just rename the variable to _rnaSequence to suppress the message.

binoyskumar92 commented 3 years ago

I have pushed a new change

ababaian commented 3 years ago

Added the hash error checking in palmid-lambda. It's coming together :D