GithubHelp home page GithubHelp logo

fullerjamesr / fastcat Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 582 KB

High-performance, multithreaded SAXS profile calculation and fitting

License: GNU Affero General Public License v3.0

CMake 0.92% C 97.70% C++ 1.38%
saxs biophysics c11

fastcat's Introduction

FastCat

A tool for fast and accurate (all-atom) calculation of theoretical small-angle x-ray scattering (SAXS) profiles from input PDB files, and fitting that theoretical profile against experimental data.

Building and usage

fastcat is written in C11 with no external dependencies outside the C standard library, and so should be straightforward to build. A very basic CMakeLists.txt is provided, but is probably overkill. I develop and test the code against GCC 6.3 and ICC 17.0 using -std=c11, but I've occasionally used it with GCC 4.4.7 (which only supports up to -std=c99) without incident. However, I cannot promise C99 support going forward.

fastcat supports multi-threading via OpenMP, so I recommend enabling that during building if possible (GCC: -fopenmp or ICC: -qopenmp).

When bypassing CMake (which is most of the time), I build using the command:

$ gcc -o fastcat -std=c11 -march=native -O3 -fopenmp -flto -ffast-math -DNDEBUG -lm *.c

or

$ icc -o fastcat -std=c11 -xHost -O3 -qopenmp -ipo -DNDEBUG *.c

Usage follows the normal pattern of:

$ fastcat [options] structure.pdb [experimental_data.dat]

where structure.pdb is a path to a valid PDB file, and experimental.dat is the path to a file with experimental data to fit against, in a whitespace-delimited 3 column (q, intensity, error) format.

See fastcat --help for command line argument information.

Motivation

This project was concieved as a way to

  • Teach myself the C programming language.
  • See if I could improve on existing tools in the biomolecular SAXS field.

I was/am comfortable enough with the the technique and underlying math so that I thought I might be able to contribute something useful. In particular, I wanted to see if I could improve the speed of profile generation in order to make structure determination/refinement against SAXS data more feasible, and improve the accuracy of the calcuation in cases where the tradeoff between speed and accuracy was minimal.

Method citations

  • In order to avoid the the poor performance scaling of the Debeye equation as the number of atoms increases, and the accuracy problems of spherical harmonics when applied to anisotropic molecules, I use the algorithm described in Watson and Curtis, "Rapid and accurate calculation of small-angle scattering profiles using the golden ratio" J Appl Cryst (2013). https://doi.org/10.1107/S002188981301666X
  • To calculate atomic form factors for each element and maximize their accuracy even at high scattering angles, I use the equations presented in Muhammad and Lee, "New Empirical Equation for the Atomic Form Factor Function in the Momentum Transfer Range, q = 0–50 Å−1 for the Elements in the Range 1≤ Z ≤30" Plos One (2013). https://doi.org/10.1371/journal.pone.0069608
  • In order to estimate and correct for excluded volume, particularly in the case of implicit hydrogens, I use the combined atom radii determined by Tsai et al. "The packing density in proteins: standard radii and volumes" J Mol Bio (1999). https://doi.org/10.1006/jmbi.1999.2829
  • For modeling the hydration layer, I take the implicit hydration shell approach described by the FoXS program authors: Schneidman-Duhovny et al., "Accurate SAXS Profile Computation and its Assessment by Contrast Variation Experiments" Biophys J (2013). https://dx.doi.org/10.1016/j.bpj.2013.07.020

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.