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

rfu_residues_sd error #348

Closed
tuttlelm opened this issue Jun 10, 2024 · 3 comments
Closed

rfu_residues_sd error #348

tuttlelm opened this issue Jun 10, 2024 · 3 comments

Comments

@tuttlelm
Copy link

I have generated an HDX Measurement object from my data. (Naively) Looking at the code it seems like there should be both a .rfu_residues field and .rfu_residues_sd field for this object, but trying to access hdxm.rfu_residues_sd generates an error (summarized below). The rfu_residues values are generated and are sensible. Is there a way to generate the error bars on the rfu_residues values?

Thanks for your work on this repository!

:
:
File ~/.local/lib/python3.10/site-packages/pyhdx/models.py:625, in HDXTimepoint.rfu_residues_sd(self)
    [621](pyhdx/models.py:621) @property
    [622](pyhdx/models.py:622) def rfu_residues_sd(self) -> pd.Series:
    [623](pyhdx/models.py:623)     """Error propagated standard deviations of RFU per residue."""
--> [625](pyhdx/models.py:625)     return self.propagate_errors("rfu_sd")
:
:
KeyError: 'rfu_sd'
@Jhsmit
Copy link
Owner

Jhsmit commented Jun 12, 2024

Hi, thanks for opening the issue

Normally you do have sd values, they are calculated from the sd values associated with the d-uptake values ('uptake_sd'), That typically happens in the apply_control function here

Depending on how you've created the HDXMeasurement object, you might not have this field.
This template shows the typical steps: https://github.com/Jhsmit/PyHDX/blob/master/templates/01_load_secb_data.py

Hope that helps! Please reach out if you have additional issues

@tuttlelm
Copy link
Author

Thanks so much for your response. I've got a patchwork conversion script for starting from HDExaminer outputs and I had used "rfu sd" instead of "rfu_sd". It is working now.

Related to coming from HDExaminer data (and I can open a separate issue for that topic if that would be more appropriate), pyHDX currently does not allow duplicate measurements when creating the HDXMeasurement object. As far as I can tell, having replicates isn't an issue for any of the downstream calculations, but I wondered if you had thoughts on that. I was able to make some simple modifications to models.py so that I can leave replicates in my data and not have to replicate average it first (basically just data.reset_index() in the init() function and add "index" as a column where you are sorting or pivoting on the columns)

Thanks again

@Jhsmit
Copy link
Owner

Jhsmit commented Jun 13, 2024

Yes, let discuss on #349

@Jhsmit Jhsmit closed this as completed Jun 13, 2024
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

No branches or pull requests

2 participants