18 #include <core/types.hh>
19 #include <core/chemical/AtomType.hh>
20 #include <core/chemical/util.hh>
21 #include <core/conformation/Residue.hh>
22 #include <core/import_pose/pose_stream/MetaPoseInputStream.hh>
23 #include <core/import_pose/pose_stream/util.hh>
24 #include <core/pose/util.hh>
25 #include <core/pose/Pose.hh>
26 #include <core/pose/PDBInfo.hh>
55 burial.resize( mypose.total_residue() );
58 for (
Size i = 1; i <= mypose.total_residue(); ++i ) {
59 for (
Size j = i + 1;
j <= mypose.total_residue(); ++
j ) {
60 core::conformation::Residue
resi = mypose.residue(i);
61 core::conformation::Residue
resj = mypose.residue(
j);
64 resi.xyz( resi.nbr_atom() ).
distance( resj.xyz( resj.nbr_atom() ) )
66 if (
dist < dist_cutoff ) {
77 int main(
int argc,
char* argv [] ) {
81 using namespace basic::options::OptionKeys;
104 core::import_pose::pose_stream::MetaPoseInputStream
input
105 = core::import_pose::pose_stream::streams_from_cmd_line();
106 ResidueTypeSetCOP rsd_set( rsd_set_from_cmd_line() );
108 output <<
A( 10,
"resi_idx" )
109 <<
A( 10,
"resj_idx" )
114 <<
A( 10,
"burial_i" )
115 <<
A( 10,
"burial_j" )
118 <<
A( 14,
"pose_tag" )
121 while (
input.has_another_pose() ) {
123 input.fill_pose( pose, *rsd_set );
124 string const pose_tag(
file_basename( core::pose::tag_from_pose( pose ) ) );
126 for (
Size i = 1; i <= pose.total_residue(); ++i ) {
127 for (
Size j = i+1;
j <= pose.total_residue(); ++
j ) {
128 const core::conformation::Residue&
resi = pose.residue(i);
129 const core::conformation::Residue&
resj = pose.residue(
j);
131 for (
Size m = 1; m <= resi.natoms(); ++m ) {
132 for (
Size n = 1; n <= resj.natoms(); ++n ) {
133 if ( atoms_wanted.size() > 0 ) {
134 std::string
const & atom_m( resi.atom_type(m).name() );
135 std::string
const & atom_n( resj.atom_type(n).name() );
137 std::find(atoms_wanted.begin(),atoms_wanted.end(),atom_m)
140 std::find(atoms_wanted.begin(),atoms_wanted.end(),atom_n)
142 if ( find_m == atoms_wanted.end() || find_n == atoms_wanted.end() ) {
148 if ( resi.atom_type(m).is_hydrogen() ||
149 resj.atom_type(n).is_hydrogen() ) {
154 if ( resi.atom_type(m).name() != resj.atom_type(n).name() &&
161 pose.residue(i).xyz(m).distance( resj.xyz(n) ));
165 Size pos_i = pose.pdb_info()->number(i);
166 Size pos_j = pose.pdb_info()->number(
j);
173 output <<
I( 10, pos_i)
175 <<
A( 6, resi.name1() )
176 <<
A( 6, resj.name1() )
177 <<
A( 8, resi.atom_name(m) )
178 <<
A( 8, resj.atom_name(n) )
179 <<
I( 10, burial[i] )
180 <<
I( 10, burial[
j] )
181 <<
F( 10, 4, distance )
183 <<
A( pose_tag_width, pose_tag )
192 std::cout <<
"caught exception " << e.
msg() << std::endl;
IntegerOptionKey const seqsep
IntegerOptionKey const resj
virtual std::string const msg() const
void init(int argc, char *argv[])
Command line init() version.
RealOptionKey const dist_cutoff
std::string file_basename(std::string const &filename)
Basename of a File Name.
StringVectorOptionKey const atom_names("james:atom_names")
common derived classes for thrown exceptions
std::string file_basename(const std::string &full_path)
IntegerOptionKey const min_seqsep
FileVectorOptionKey const burial
T abs(T const &x)
std::abs( x ) == | x |
File name class supporting Windows and UN*X/Linux format names.
BooleanOptionKey const debug("james:debug")
rule< Scanner, options_closure::context_t > options
T distance(MathVector< T > const &VECTOR_A, MathVector< T > const &VECTOR_B)
super::const_iterator const_iterator
RealVectorOptionKey const dist_thresholds("james:dist_thresholds")
IntegerOptionKey const min_seqsep("james:min_seqsep")
T distance(CArray< T > const &a, CArray< T > const &b)
Distance.
utility::vector1< int > calculate_burial(core::pose::Pose &mypose, core::Real const dist_cutoff)
basic::options::OptionKeys collection
ocstream cout(std::cout)
Wrapper around std::cout.
vector1: std::vector with 1-based indexing
Some std::string helper functions.
Program options global and initialization function.
IntegerOptionKey const resi
BooleanOptionKey const chemical
StringOptionKey const output
StringOptionKey const user
rule< Scanner, option_closure::context_t > option