Giter VIP home page Giter VIP logo

Comments (8)

wojdyr avatar wojdyr commented on September 24, 2024 1

Gemmi will have a function to calculate completeness at some point, but I don't know when.

from reciprocalspaceship.

JBGreisman avatar JBGreisman commented on September 24, 2024

yes -- I think this is a good idea. I think adding a stats subdirectory seems like a good place for such functions to live.

from reciprocalspaceship.

DHekstra avatar DHekstra commented on September 24, 2024

I would mark this as low-priority, FWIW.
I did do a simple implementation previously (https://github.com/Hekstra-Lab/double-wilson/blob/main/old/DoubleWIlsonExplorations.ipynb), but it's kind of slow.

from reciprocalspaceship.

kmdalton avatar kmdalton commented on September 24, 2024

@DHekstra , I think I need this for processing the GFP data.

from reciprocalspaceship.

JBGreisman avatar JBGreisman commented on September 24, 2024

Sounds good. Multiplicity and completeness would be useful stats to be able to compute, and could live in rs.stats. Computing those statistics using the groupby functionality in pandas will also make for a rather convenient way to summarize over resolution bins.

from reciprocalspaceship.

kmdalton avatar kmdalton commented on September 24, 2024

I will go ahead and implement something to get us started.

from reciprocalspaceship.

kmdalton avatar kmdalton commented on September 24, 2024

#60 introduces low level tools to rs.utils which can be used to address this issue. However, we still need to wrap the tools I added to become part of the top-level API or with a convenient function in the rs.stats module.

from reciprocalspaceship.

JBGreisman avatar JBGreisman commented on September 24, 2024

Here is a snippet that uses the stats function introduced in #60 and packages the results as a DataSet indexed by resolution bin. I'm just putting this here as a placeholder snippet for when I get around to implementing this:

h, counts = rs.utils.compute_redundancy(mtz.get_hkls(), mtz.cell, mtz.spacegroup)
ds = rs.DataSet({"n": counts, "H": h[:, 0], "K": h[:, 1], "L": h[:, 2]}, spacegroup=mtz.spacegroup, cell=mtz.cell)
ds.set_index(["H", "K", "L"], inplace=True)
ds, labels = ds.assign_resolution_bins(10)
ds["observed"] = ds["n"] > 0
result = ds.groupby("bin")["observed"].agg(["sum", "count"])
result["completeness"] = result["sum"] / result["count"]
result.index = labels
result["completeness"]

The resulting DataSet looks like this (for an example dataset that is admittedly low-completeness):

99.53 - 3.70    0.736536
3.70 - 2.93     0.779202
2.93 - 2.55     0.797380
2.55 - 2.31     0.807513
2.31 - 2.15     0.820326
2.15 - 2.02     0.825619
2.02 - 1.92     0.835808
1.92 - 1.83     0.836003
1.83 - 1.76     0.838672
1.76 - 1.70     0.839348
Name: completeness, dtype: float64

from reciprocalspaceship.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.