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

Adding a background subtraction script #19

Open
alisiafadini opened this issue Aug 17, 2022 · 8 comments
Open

Adding a background subtraction script #19

alisiafadini opened this issue Aug 17, 2022 · 8 comments

Comments

@alisiafadini
Copy link
Collaborator

The script I have essentially takes 2 mtzs (light and dark), a reference PDB, and XYZ coordinates for a region of interest. It returns a background subtracted map (similar to the PanDDA one) where the subtraction in done in reciprocal space ( |F1| - N*|F2| ) rather than with 2mFo-DFc maps. Option to weight the differences as usual for now. Was thinking it makes sense to keep this as its own script for now but open to suggestions.

@kmdalton
Copy link
Member

What would the alternative be? Building this into the difference map script?

@alisiafadini
Copy link
Collaborator Author

Best alternative could be making it a function that can be called from any script. May work better as its own script

@JBGreisman
Copy link
Member

I'm a bit confused here by the XYZ coordinates -- is that just used to generate a mask for the output map? Where does that factor in if the subtraction is handled in reciprocal space?

This seems very close to rs.diffmap with the addition of an N term for weighting the dark dataset. I could see it being added as a flag to that script, or as its own. Right now my inclination is to start as its own script. It's somewhere conceptually between rs.diffmap and rs.extrapolate (which handles generating extrapolated structure factor for refinement of excited states).

@alisiafadini
Copy link
Collaborator Author

alisiafadini commented Aug 18, 2022

@JBGreisman the background subtraction is done in reciprocal space, but the screening for the right value is done in real space (you try to maximize the difference in CC between a local region e.g. chromophore and the rest of the protein). Whichever background subtraction value is found to maximize this is used for the reciprocal space difference. I can share a figure if easier?

Because of this extra part of the analysis it's a little more complex than just adding an N option to diffmap I guess. It's probably closer conceptually to rs.extrapolate

@JBGreisman
Copy link
Member

got it -- that makes sense to me. I agree this should be its own script, and we can add a figure as part of an example/documentation.

@alisiafadini
Copy link
Collaborator Author

I like the rocket emoji – and sounds good. On that note actually, what's your policy on plotting/graphics (not sure if this should be another issue). I have some plotting sections in my script that saves things like the screening of the regularization parameter for inspection after running the script. I was seeing that matplotlib and seaborn are not required dependencies for the rs install – so maybe plotting should be optional or removed?

@JBGreisman
Copy link
Member

I'm fine with plotting/graphics -- matplotlib and seaborn are requirements already for rsbooster (but you're correct that they are not requirements in rs itself).

https://github.com/Hekstra-Lab/rs-booster/blob/ecd60451db3e459fbe84f3c27469cbcd7fe5f835/setup.py#L38

Some of the methods in the stats submodule open plots. I think you can either open an interactive plot using something like plt.show(), or you can take an output filename for writing a plot. Whatever seems best for your use case.

@alisiafadini
Copy link
Collaborator Author

Ah great – yeah sorry I was looking at rs instead of rs-booster. I think I would keep the plotting sections in my scripts but maybe make them optional

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

3 participants