-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1df43f0
commit ca70f3d
Showing
9 changed files
with
725 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,6 @@ | |
*.png | ||
*.o | ||
*.d | ||
ANA | ||
bin | ||
obj | ||
dep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#ifndef ANAPO | ||
#define ANAPO | ||
#include <iostream> | ||
#include <fstream> | ||
#include <boost/program_options.hpp> | ||
namespace ANA { | ||
namespace PO = boost::program_options; | ||
using namespace std; | ||
const std::string help_header = "\t\t\t----- ANA -----"; | ||
|
||
int get_parameters(int ac, char* av[], std::string& input_struct_filename, | ||
std::string& input_md_filename, std::string& include_CH_filename, | ||
std::string& include_CH_aa_proto, std::string& include_CH_atom_proto, | ||
std::string& AA_indices_proto, bool& triangulate_only_included_aas, | ||
bool& atom_only, unsigned int& precision, unsigned int& clusters_min_size, | ||
unsigned int& nbr_of_vertices_to_include, unsigned int& md_start, | ||
unsigned int& md_step, unsigned int& md_end, double& minVR, double& maxSR, | ||
double& max_probe, double& max_probe_length, double& sphere_size, | ||
unsigned int& sphere_count, std::string& list_wall, | ||
std::string& list_wall_separator, std::string& clusters_method, | ||
std::string& only_side_ASA, std::string& ASA_method, | ||
std::string& exclude_ca_for_ASA, std::string& pdbs_list_ndd_filename, | ||
std::string& out_CH_filename, std::string& out_ndd_filename, | ||
std::string& out_filename, std::string& out_vol, std::string& output_type, | ||
std::string& tool_check_CH, std::string& tool_pdb_to_ch, | ||
std::string& sphere_proto, std::string& cylinder_proto, | ||
std::string& prism_proto, std::string& tool_pdb_norm, | ||
std::string& tool_aa_to_ca); | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
//////////////////////////////////////////////////////////////////////////////// | ||
// ANA // | ||
// // | ||
//////////////////////////////////////////////////////////////////////////////// | ||
#ifndef ANAINCLUDES | ||
#define ANAINCLUDES | ||
#include <iostream> | ||
#include <fstream> | ||
#include <assert.h> | ||
#include <vector> | ||
#include <numeric> | ||
#include <cmath> | ||
#include <algorithm> | ||
#include <string> | ||
#include <sstream> | ||
#include <iterator> | ||
#include <typeinfo> | ||
#include <boost/program_options.hpp> | ||
#include "chemfiles.hpp" | ||
|
||
#include <CGAL/Origin.h> | ||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> | ||
#include <CGAL/Triangulation_3.h> | ||
#include <CGAL/Delaunay_triangulation_3.h> | ||
#include <CGAL/Triangulation_vertex_base_with_info_3.h> | ||
#include <CGAL/Tetrahedron_3.h> | ||
#include <CGAL/Polyhedron_3.h> | ||
#include <CGAL/Triangle_3.h> | ||
#include <CGAL/convex_hull_3.h> | ||
#include <CGAL/box_intersection_d.h> | ||
|
||
// clang-format off | ||
class Vtx_info { | ||
public: | ||
// Return the atom index | ||
const unsigned int& GetIndex() const { return index_; } | ||
// Return the atom radii | ||
const double& GetRadii() const { return radii_; } | ||
// Return the atom's amino acid name | ||
const std::string& GetAa() const { return residue_; } | ||
// Return the atom's residue number | ||
const unsigned int& GetResn() const { return resn_; } | ||
|
||
// Assign the atom index | ||
void AssignIndex(unsigned int input_index) { index_ = input_index; } | ||
// Assign the atom radii | ||
void AssignRadii(double input_radii) { radii_ = input_radii; } | ||
// Assign the atom's amino acid name | ||
void AssignAa(std::string input_residue) { residue_ = input_residue; } | ||
// Assign the atom's residue number | ||
void AssignResn(unsigned int input_resn) { resn_ = input_resn; } | ||
|
||
private: | ||
unsigned int index_; | ||
double radii_; | ||
// atom's residue name in 3 letter format | ||
std::string residue_; | ||
// atom's residue number | ||
unsigned int resn_; | ||
}; | ||
|
||
// Colours for pymol CGO objects | ||
const unsigned int col_nbr = 16; | ||
const std::array<float, col_nbr> red = {1.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.4, 0.4, | ||
0.0, 0.75, 0.75, 0.0, 0.875, 0.875, 0.0}; | ||
const std::array<float, col_nbr> green = {1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.4, 0.0, | ||
0.4, 0.75, 0.0, 0.75, 0.875, 0.0, 0.875}; | ||
const std::array<float, col_nbr> blue = {1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0, 0.4, | ||
0.4, 0.0, 0.75, 0.75, 0.0, 0.875, 0.875}; | ||
|
||
// Basic definitions | ||
using EPIC = CGAL::Exact_predicates_inexact_constructions_kernel; | ||
using Vb = CGAL::Triangulation_vertex_base_with_info_3<Vtx_info, EPIC>; | ||
using Tds = CGAL::Triangulation_data_structure_3<Vb>; | ||
using Delaunay = CGAL::Delaunay_triangulation_3<EPIC, Tds>; | ||
|
||
// Definitions for Delaunay triangulation | ||
using Vector = CGAL::Vector_3<EPIC>; | ||
using Segment = CGAL::Segment_3<EPIC>; | ||
using Point = Delaunay::Point; | ||
using Vertex_handle = Delaunay::Vertex_handle; | ||
using Cell_handle = Delaunay::Cell_handle; | ||
using Vertex_iterator = Delaunay::Vertex_iterator; | ||
using Finite_vertices_iterator = Delaunay::Finite_vertices_iterator; | ||
using All_vertices_iterator = Delaunay::All_vertices_iterator; | ||
using Edge_iterator = Delaunay::Edge_iterator; | ||
using Facet_iterator = Delaunay::Facet_iterator; | ||
using Finite_facets_iterator = Delaunay::Finite_facets_iterator; | ||
using Cell_iterator = Delaunay::Cell_iterator; | ||
using Finite_cells_iterator = Delaunay::Finite_cells_iterator; | ||
using All_cells_iterator = Delaunay::All_cells_iterator; | ||
using Cell_circulator = Delaunay::Cell_circulator; | ||
|
||
// Definitions for convex hull | ||
using Polyhedron = CGAL::Polyhedron_3<EPIC>; | ||
using P_Facet_iterator = Polyhedron::Facet_iterator; | ||
using P_Facet_const_iterator = Polyhedron::Facet_const_iterator; | ||
using P_Edge_iterator = Polyhedron::Edge_iterator; | ||
using P_Edge_const_iterator = Polyhedron::Edge_const_iterator; | ||
using P_Halfedge_around_facet_circulator = Polyhedron::Halfedge_around_facet_circulator; | ||
using P_Halfedge_around_facet_const_circulator = Polyhedron::Halfedge_around_facet_const_circulator; | ||
using P_Vertex_iterator = Polyhedron::Vertex_iterator; | ||
using P_Vertex_const_iterator = Polyhedron::Vertex_const_iterator; | ||
|
||
// ANA definitions | ||
using MD_Element = std::array<Point, 4>; // Cell | ||
using MD_Vector = std::vector<MD_Element>; // Pocket | ||
using MD_Matrix = std::vector<MD_Vector>; // All voids | ||
using NDD_Element = std::array<std::pair<Point, double>, 4>; // Cell | ||
using NDD_Vector = std::vector<NDD_Element>; // Pocket | ||
using NDD_Matrix = std::vector<NDD_Vector>; // All voids | ||
using NDD_IElement = std::array<unsigned int, 4>; // Cell indices | ||
using NDD_IVector = std::vector<NDD_IElement>; // Pocket indices | ||
using NDD_IMatrix = std::vector<NDD_IVector>; // All voids indices | ||
using NA_Vector = std::vector<Finite_cells_iterator>; // Pocket | ||
using NA_Matrix = std::vector<NA_Vector>; // All voids | ||
using Poly_Vector = std::vector<Polyhedron>; // Pocket border cells | ||
using Poly_Matrix = std::vector<Poly_Vector>; // All null areas border cells | ||
using ANA_molecule = std::vector<std::pair<Point, Vtx_info>>; | ||
|
||
// Miscellaneous definitions | ||
using Object = CGAL::Object; | ||
using Triangle = CGAL::Triangle_3<EPIC>; | ||
using Triang_Vector = std::vector<Triangle>; | ||
using Segment = EPIC::Segment_3; | ||
using Tetrahedron = CGAL::Tetrahedron_3<EPIC>; | ||
using Tetra_Vector = std::vector<Tetrahedron>; | ||
using Box = CGAL::Box_intersection_d::Box_with_handle_d<double, 3, Finite_cells_iterator>; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef ANAMD | ||
#define ANAMD | ||
#include <ANA/ANAincludes.hpp> | ||
#include <ANA/ANAread.hpp> | ||
#include <ANA/ANAwrite.hpp> | ||
#include <ANA/ANAutils.hpp> | ||
namespace ANA { | ||
// Main function for dynamic version of ANA. | ||
int MD_ANA(const std::string& in_filename, const std::string& in_md_filename, | ||
std::string& AA_indices_proto, const std::string& only_side_ASA, | ||
const std::string& ASA_method, | ||
std::string& exclude_ca_for_ASA_indices_proto, const std::string& list_wall, | ||
const std::string& list_wall_separator, std::string& include_CH_aa_proto, | ||
std::string& include_CH_atom_proto, std::string& sphere_proto, | ||
std::string& cylinder_proto, std::string& prism_proto, | ||
const std::string& include_CH_filename, std::string& out_filename, | ||
const std::string& out_vol, const std::string& out_type, | ||
const bool triangulate_only_included_aas, const bool atom_only, | ||
const double minVR, const double maxSR, const double max_probe, | ||
const double max_probe_length, const double sphere_size, | ||
const unsigned int& sphere_count, | ||
const unsigned int nbr_of_vertices_to_include, const unsigned int precision, | ||
const unsigned int& md_start, const unsigned int& md_step, | ||
unsigned int& md_end); | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#ifndef ANANDD | ||
#define ANANDD | ||
#include <ANA/ANAincludes.hpp> | ||
#include <ANA/ANAread.hpp> | ||
#include <ANA/ANAwrite.hpp> | ||
#include <ANA/ANAutils.hpp> | ||
// prototype functions | ||
namespace ANA { | ||
// Main function for NDD version of ANA. | ||
int NDD_ANA(const std::string& in_filename, std::string& AA_indices_proto, | ||
const std::string& ASA_method, const std::string& only_side_ASA, | ||
std::string& exclude_ca_for_ASA_indices_proto, const std::string& list_wall, | ||
const std::string& list_wall_separator, std::string& include_CH_aa_proto, | ||
std::string& include_CH_atom_proto, std::string& sphere_proto, | ||
std::string& cylinder_proto, std::string& prism_proto, | ||
const std::string& include_CH_filename, | ||
const std::string& pdbs_list_ndd_filename, | ||
const std::string& out_ndd_filename, std::string& out_filename, | ||
const std::string& out_vol, const std::string& out_type, | ||
const bool triangulate_only_included_aas, const bool atom_only, | ||
const double minVR, const double maxSR, const double max_probe, | ||
const double max_probe_length, const double sphere_size, | ||
const unsigned int sphere_count, | ||
const unsigned int nbr_of_vertices_to_include, | ||
const unsigned int precision); | ||
} // namespace ANA | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#ifndef ANAREAD | ||
#define ANAREAD | ||
#include <ANA/ANAincludes.hpp> | ||
|
||
// prototype functions | ||
namespace ANA { | ||
namespace NDD { | ||
// NDD Specific function for PDB input | ||
void ndd_read_PDB_get_cells(const std::string &filename, | ||
const NDD_IVector &in_cells_indices, | ||
NDD_Vector &output_cells); | ||
|
||
// NDD Specific function for PDB input. Hi precision method | ||
void ndd_read_PDB_get_cells(const std::string &filename, | ||
const NDD_IVector &in_void_cells_indices, | ||
const std::vector<unsigned int> &include_CH_atoms, | ||
NDD_Vector &output_cells, | ||
Triang_Vector &CH_triangs); | ||
} | ||
// Refine the provided list of amino acids. If its not present, then return an | ||
// array of one 0 element. | ||
template <class tipo> | ||
bool adapt_aa_list(std::string &aa_list_proto, std::vector<tipo> &aa_list); | ||
// Read coordinates in pdb format using chemfiles. | ||
bool read_static( | ||
const std::string &filename, const bool triangulate_only_included_aas, | ||
const bool atom_only, std::string &aa_list_proto, | ||
std::string &exclude_ca_for_ASA_proto, std::string &include_CH_aa_proto, | ||
std::string &include_CH_atom_proto, std::string &sphere_proto, | ||
std::string &cylinder_proto, std::string &prism_proto, | ||
const std::string &include_CH_filename, ANA_molecule &molecule_points, | ||
Point &cm, std::vector<unsigned int> &aa_list, | ||
std::vector<unsigned int> &CA_indices, std::vector<Point> &CAs_Points, | ||
std::vector<unsigned int> &include_CH_aa, Triang_Vector &CH_triangs, | ||
std::vector<unsigned int> &hetatm_atoms); | ||
// Read coordinates in netcdf format. | ||
void read_MD(const chemfiles::Frame &in_frame, const bool requested_CH, | ||
const std::string &sphere_proto, const std::string &cylinder_proto, | ||
const std::string &prism_proto, | ||
const std::vector<unsigned int> &hetatm_atoms, | ||
std::vector<unsigned int> &include_CH_atoms, | ||
const std::string &include_CH_filename, Triang_Vector &CH_triangs, | ||
const std::string &ASA_method, | ||
const std::vector<unsigned int> &CA_indices, | ||
std::vector<Point> &CAs_points, ANA_molecule &molecule_points); | ||
// Get the center of mass from a chemfiles molecule. | ||
Point getCM(const chemfiles::span<chemfiles::Vector3D> &in_xyz, const unsigned int natoms); | ||
// Read PDB to draw included area for MD | ||
void read_included_area(const std::string &filename, | ||
std::vector<Point> &area_points); | ||
// Tool for parsing a double from input file stringstream | ||
double parse_double(std::stringstream &in_stream); | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef ANASTATIC | ||
#define ANASTATIC | ||
#include <ANA/ANAincludes.hpp> | ||
#include <ANA/ANAread.hpp> | ||
#include <ANA/ANAwrite.hpp> | ||
#include <ANA/ANAutils.hpp> | ||
// prototype functions | ||
namespace ANA { | ||
// Main function for static version of ANA. | ||
int static_ANA(const std::string& in_filename, std::string& AA_indices_proto, | ||
const std::string& ASA_method, const std::string& only_side_ASA, | ||
std::string& exclude_ca_for_ASA_indices_proto, const std::string& list_wall, | ||
const std::string& list_wall_separator, const std::string& clusters_method, | ||
std::string& include_CH_aa_proto, std::string& include_CH_atom_proto, | ||
std::string& sphere_proto, std::string& cylinder_proto, | ||
std::string& prism_proto, const std::string& include_CH_filename, | ||
std::string& out_filename, const std::string& out_vol, | ||
const std::string& out_type, const bool triangulate_only_included_aas, | ||
const bool atom_only, const double minVR, const double maxSR, | ||
const double max_probe, const double max_probe_length, | ||
const double sphere_size, const unsigned int sphere_count, | ||
const unsigned int nbr_of_vertices_to_include, | ||
const unsigned int clusters_min_size, const unsigned int precision); | ||
} // namespace ANA | ||
#endif |
Oops, something went wrong.