Coder Social home page Coder Social logo

gixstapose's Introduction

build pytest codecov pre-commit.ci status

GIXStapose

GIXStapose is an interactive analysis tool for for studying semi-crystalline and soft materials structures. It enables grazing incidence X-ray scattering (GIXS) patterns to be visualized while interactively rotating chemical structures, especially periodic simulation volumes generated from molecular simulations.

This functionality is useful for interactively identifying real-space chemical features that correspond to bright diffraction peaks and the rotation matrices that generate them. As such, this tool has potential to aid in the reproducible generation of figures that include both GIXS and structural data, and it has pedagogical potential for students learning about crystal structures and diffraction.

GIXStapose is made possible by open-source packages, including the high-quality rendering of the Fresnel ray-tracer, the ability to read in multiple chemical file formats of MBuild, and numpy's fast Fourier implementations used in interactive diffraction analysis, and by funding from the National Science Foundation (#1835593)

A screen capture of GIXStapose in action

Examples

Click the binder link to see an example using the gixstapose library for generating reproducible figures and scattering patterns:

Binder

Updates

  • Jul 31, 2020: GIXStapose's diffraction code has been added as a module in Freud!

Installation

To install GIXStapose you will need the conda package manager (we recommend Miniconda)

  1. Clone this repo
git clone [email protected]:cmelab/GIXStapose.git;
cd GIXStapose
  1. Using conda, create and activate your environment
conda env create -f environment.yml;
conda activate gixstapose
  1. With the environment active, install this package
pip install .

Usage

To run a simple cubic example:

gixstapose

To load an input file format supported by MDTraj (e.g., pdb, xml, dcd, xyz, hoomdxml) or a gsd file:

gixstapose -i INPUTFILE

gixstapose's People

Contributors

chrisjonesbsu avatar erjank avatar jennyfothergill avatar pre-commit-ci[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gixstapose's Issues

Fix z-axis rotations

from #4 (comment)

Check if rotations about the z-axis also rotate the diffraction pattern about the z-axis. Something about the diffraction pattern rotation seems a bit off looking at the lamellar example. It's not a huge deal, but having as close to 1-to-1 rotation correspondence would be nice.

Gixtapsoe cubic example not working

I just created the environment and installed Gixtapose on Linux and tried running the cubic example and get the following error:

No input provided, showing simple cubic example
Traceback (most recent call last):
  File "/home/chris/miniconda3/envs/gixstapose/bin/gixstapose", line 33, in <module>
    sys.exit(load_entry_point('gixstapose', 'console_scripts', 'gixstapose')())
  File "/home/chris/cme/repos/GIXStapose/gixstapose/main.py", line 271, in main
    app = ApplicationWindow(args.input, args.frame)
  File "/home/chris/cme/repos/GIXStapose/gixstapose/main.py", line 50, in __init__
    self.initUI()
  File "/home/chris/cme/repos/GIXStapose/gixstapose/main.py", line 80, in initUI
    self.createGridLayout()
  File "/home/chris/cme/repos/GIXStapose/gixstapose/main.py", line 104, in createGridLayout
    toplayout.addWidget(dynamic_canvas, 0, 1)
TypeError: 'PySide2.QtWidgets.QGridLayout.addWidget' called with wrong argument types:
  PySide2.QtWidgets.QGridLayout.addWidget(FigureCanvasQTAgg, int, int)
Supported signatures:
  PySide2.QtWidgets.QGridLayout.addWidget(PySide2.QtWidgets.QWidget, int, int, PySide2.QtCore.Qt.Alignment = Default(Qt.Alignment))
  PySide2.QtWidgets.QGridLayout.addWidget(PySide2.QtWidgets.QWidget, int, int, int, int, PySide2.QtCore.Qt.Alignment = Default(Qt.Alignment))
  PySide2.QtWidgets.QGridLayout.addWidget(PySide2.QtWidgets.QWidget)

Feature request: support for triclinic boxes.

I would like to use the "Diffractometer" code in GIXStapose with triclinic boxes, not just orthorhombic boxes. This probably requires careful handling of periodic boundaries, gridding in non-square systems, and linear algebra for various projections and transformations. The freud library may be useful for this. I would ultimately like to consider including this diffraction code as a module in freud.

Cubic example not working

Looks like an issue with breaking changes in Pyside2? I tried it with both versions 5.13.21 and 5.15.8` which is the latest version.

(gixstapose) ~ ❯ gixstapose
/home/chris/miniconda3/envs/gixstapose/lib/python3.8/site-packages/pkg_resources/__init__.py:121: DeprecationWarning: pkg_resources is deprecated as an API
  warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
/home/chris/miniconda3/envs/gixstapose/lib/python3.8/site-packages/pkg_resources/__init__.py:2870: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('mpl_toolkits')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
  declare_namespace(pkg)
/home/chris/miniconda3/envs/gixstapose/lib/python3.8/site-packages/pkg_resources/__init__.py:2870: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('google')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
  declare_namespace(pkg)
No input provided, showing simple cubic example
Traceback (most recent call last):
  File "/home/chris/miniconda3/envs/gixstapose/bin/gixstapose", line 33, in <module>
    sys.exit(load_entry_point('gixstapose', 'console_scripts', 'gixstapose')())
  File "/home/chris/cme/forks/GIXStapose/gixstapose/main.py", line 271, in main
    app = ApplicationWindow(args.input, args.frame)
  File "/home/chris/cme/forks/GIXStapose/gixstapose/main.py", line 50, in __init__
    self.initUI()
  File "/home/chris/cme/forks/GIXStapose/gixstapose/main.py", line 80, in initUI
    self.createGridLayout()
  File "/home/chris/cme/forks/GIXStapose/gixstapose/main.py", line 104, in createGridLayout
    toplayout.addWidget(dynamic_canvas, 0, 1)
TypeError: 'PySide2.QtWidgets.QGridLayout.addWidget' called with wrong argument types:
  PySide2.QtWidgets.QGridLayout.addWidget(FigureCanvasQTAgg, int, int)
Supported signatures:
  PySide2.QtWidgets.QGridLayout.addWidget(PySide2.QtWidgets.QWidget, int, int, PySide2.QtCore.Qt.Alignment = Default(Qt.Alignment))
  PySide2.QtWidgets.QGridLayout.addWidget(PySide2.QtWidgets.QWidget, int, int, int, int, PySide2.QtCore.Qt.Alignment = Default(Qt.Alignment))
  PySide2.QtWidgets.QGridLayout.addWidget(PySide2.QtWidgets.QWidget)

Specifically this part:

TypeError: 'PySide2.QtWidgets.QGridLayout.addWidget' called with wrong argument types:
  PySide2.QtWidgets.QGridLayout.addWidget(FigureCanvasQTAgg, int, int)

We are trying to use from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas passed into addWiget but I guess it doesn't like that?

Add classic diffraction features

  1. This may overlap with issue #2 , but being able to click on a peak and know the length scale it corresponds to (a calculation involving simulation unit conversions, zoom, and the box length) will be super handy.
  2. Also, the ability to write out a finished publication quality diffraction image with axes.
  3. AAAAND! Check if rotations about the z-axis also rotate the diffraction pattern about the z-axis. Something about the diffraction pattern rotation seems a bit off looking at the lamellar example. It's not a huge deal, but having as close to 1-to-1 rotation correspondence would be nice.

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.