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

Add mtz support and PDB Search #59

Merged
merged 18 commits into from
Oct 29, 2023
Merged

Add mtz support and PDB Search #59

merged 18 commits into from
Oct 29, 2023

Conversation

Dialpuri
Copy link
Collaborator

This PR address two issues #58 and #57.

This PR changes the front screen to look like this:
image

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.

@Dialpuri Dialpuri added the enhancement New feature or request label Oct 24, 2023
This was linked to issues Oct 24, 2023
@Dialpuri Dialpuri marked this pull request as ready for review October 26, 2023 10:37
@Dialpuri Dialpuri requested a review from GABRAH October 26, 2023 10:37
@Dialpuri
Copy link
Collaborator Author

This will need a test before merge

Changed folder structure
Changed mainline components to use props and spreader
Extrapolated common functions
@Dialpuri
Copy link
Collaborator Author

Just completed a major refactor so this testing is even more important now.
Things to test

  • Uploading a PDB
  • Uploading a CIF / mmCIF
  • Uploading a PDB and MTZ
  • Uploading a CIF and MTZ
  • Uploading just an MTZ -> shouldn't let you submit past that
  • Sugar Clicking Working
  • MTZ visible
  • Contour slider working


useEffect( () => {
if (pdb.length != 4) { return }
if (!pdb.match(/^[a-z0-9]+$/i)) { return }
Copy link
Collaborator

@GABRAH GABRAH Oct 29, 2023

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

Copy link
Collaborator Author

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`
Copy link
Collaborator

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.

Copy link
Collaborator

@GABRAH GABRAH left a 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

Copy link
Collaborator

@GABRAH GABRAH left a 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

@Dialpuri Dialpuri merged commit bede7cd into webserver Oct 29, 2023
This was referenced Oct 29, 2023
@Dialpuri Dialpuri deleted the add_mtz_support branch November 10, 2023 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Allow MTZ Input Get PDB fetch working on main screen
2 participants