-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add mtz support and PDB Search #59
Conversation
This will need a test before merge |
Changed folder structure Changed mainline components to use props and spreader Extrapolated common functions
Just completed a major refactor so this testing is even more important now.
|
|
||
useEffect( () => { | ||
if (pdb.length != 4) { return } | ||
if (!pdb.match(/^[a-z0-9]+$/i)) { return } |
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.
I think we should avoid relying on regex to check if a PDB code is valid. Instead, I think it would be a better idea to query PDB API endpoint to check if the PDB code exists ( https://data.rcsb.org/#rest-api )
For example, if I use 9fjj, the PDB code is valid, but has not yet been assigned to a structure on wwPDB: https://data.rcsb.org/rest/v1/core/entry/9ffj
Currently, I am able to submit 9fjj, which causes an endless loading loop that is not reported back to the user
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.
This is just a pre-filter to stop people from submitting anything that isn't a valid PDB. After this, it checks the ebi API and if it fails to find anything there it shows an error screen.
export async function fetch_pdb(PDBCode) { | ||
if (PDBCode == null) {return} | ||
console.log("Fetching PDB ", PDBCode) | ||
let pdb_url = `https://files.rcsb.org/download/${PDBCode.toUpperCase()}.pdb` |
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.
This breaks if I submit a non-existing PDB code, like 9fjj.
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.
Other than the minor PDB code validation, LGTM. I managed to get it built and tested and it's working as expected.
Really nice job on getting mtz import implemented
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.
Can confirm this change fixed the previously observed issue
This PR address two issues #58 and #57.
This PR changes the front screen to look like this:
![image](https://private-user-images.githubusercontent.com/44945647/277669358-1aba01f1-9002-4964-8b69-7dd74629e965.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5MTQzMTEsIm5iZiI6MTczOTkxNDAxMSwicGF0aCI6Ii80NDk0NTY0Ny8yNzc2NjkzNTgtMWFiYTAxZjEtOTAwMi00OTY0LThiNjktN2RkNzQ2MjllOTY1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE4VDIxMjY1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTc5ZWMzYWQ1MzYwMDFlZmUyOTNlNjU2MDM5MDVlNmYyYzc5ZmVlZGRkMjY3NjVlYzFhMWI0YTM0NjgzOGRjNTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.WLI2Pn-yLQi-vsfb-6PoaQdpmrJU0de_nZbwrfyVeZo)
Which allows a user to get data from the PDB. While the MTZ functionality is there, the visualisation is not currently displayed due to issues interfacing with the Moorhen API.