Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lanthipeptide and recon multistate design update #263

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ SET_ICOOR 3H4 -60.0 70.0 1.089 C4 C3 C2
#Unpatched H gets its geometry from LOWER, which we have removed

SET_POLYMER_CONNECT LOWER NONE
ADD_PROPERTY LOWER_TERMINUS ## implies terminus

# If modified, no longer canonical.
DELETE_PROPERTY CANONICAL_AA
Expand Down
53 changes: 50 additions & 3 deletions source/src/core/scoring/constraints/ResidueTypeConstraint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,20 @@ ResidueTypeConstraint::ResidueTypeConstraint(
favor_native_bonus_( favor_native_bonus )
{}

ResidueTypeConstraint::ResidueTypeConstraint(
core::pose::Pose const &, //pose,
Size seqpos,
std::string const & AA_name,
core::Real favor_native_bonus,
bool base_name
):
Constraint( core::scoring::res_type_constraint ),
seqpos_( seqpos ),
rsd_type_name3_( AA_name ),
favor_native_bonus_( favor_native_bonus ),
base_name_( base_name )
{}

ResidueTypeConstraint::ResidueTypeConstraint(
Size seqpos,
std::string const & aa_in,
Expand Down Expand Up @@ -157,6 +171,17 @@ ResidueTypeConstraint::remapped_clone( pose::Pose const&, pose::Pose const&, id:
return utility::pointer::make_shared< ResidueTypeConstraint >(newseqpos, AAname, rsd_type_name3_, favor_native_bonus_);
}

bool
ResidueTypeConstraint::get_base_name_active( ) const
{
return base_name_;
}

void
ResidueTypeConstraint::set_base_name_active( bool base_name )
{
base_name_ = base_name;
}

// Calculates a score for this constraint using XYZ_Func, and puts the UNWEIGHTED score into
// emap. Although the current set of weights currently is provided, Constraint objects
Expand All @@ -168,16 +193,36 @@ ResidueTypeConstraint::score( func::XYZ_Func const & xyz_func, EnergyMap const &
if ( weight == 0 ) return; // what's the point?

conformation::Residue const & rsd( xyz_func.residue(seqpos_) );
if ( rsd.type().name3() == rsd_type_name3_ ) {
emap[ this->score_type() ] -= favor_native_bonus_;
if ( base_name_ ) {
if ( rsd.type().base_name() == rsd_type_name3_ ) {
emap[ this->score_type() ] -= favor_native_bonus_;
}
} else {
if ( rsd_type_name3_.length() > 3 ) {
TR.Warning <<
"Warning: base_name_ is not set (set_base_name_active(true)), but rsd_type_name3_ is greater than 3: "
<< rsd_type_name3_ << std::endl;
}
if ( rsd.type().name3() == rsd_type_name3_ ) {
emap[ this->score_type() ] -= favor_native_bonus_;
}
}
// no match, don't adjust score
}

core::Real
ResidueTypeConstraint::dist( core::scoring::func::XYZ_Func const & xyz ) const {
conformation::Residue const & rsd( xyz.residue(seqpos_) );
return rsd.type().name3() == rsd_type_name3_;
if ( base_name_ ) {
return rsd.type().base_name() == rsd_type_name3_;
} else {
if ( rsd_type_name3_.length() > 3 ) {
TR.Warning <<
"Warning: base_name_ is not set (set_base_name_active(true)), but rsd_type_name3_ is greater than 3: "
<< rsd_type_name3_ << std::endl;
}
return rsd.type().name3() == rsd_type_name3_;
}
}

void
Expand Down Expand Up @@ -222,6 +267,7 @@ core::scoring::constraints::ResidueTypeConstraint::save( Archive & arc ) const {
arc( CEREAL_NVP( AAname ) ); // std::string
arc( CEREAL_NVP( rsd_type_name3_ ) ); // std::string
arc( CEREAL_NVP( favor_native_bonus_ ) ); // core::Real
arc( CEREAL_NVP( base_name_ ) ); // bool
}

/// @brief Automatically generated deserialization method
Expand All @@ -233,6 +279,7 @@ core::scoring::constraints::ResidueTypeConstraint::load( Archive & arc ) {
arc( AAname ); // std::string
arc( rsd_type_name3_ ); // std::string
arc( favor_native_bonus_ ); // core::Real
arc( base_name_ ); // bool
}

SAVE_AND_LOAD_SERIALIZABLE( core::scoring::constraints::ResidueTypeConstraint );
Expand Down
15 changes: 15 additions & 0 deletions source/src/core/scoring/constraints/ResidueTypeConstraint.hh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ public:
Real favor_native_bonus
);

ResidueTypeConstraint(
pose::Pose const & pose,
Size seqpos,
std::string const & AAname,
Real favor_native_bonus,
bool base_name
);

ResidueTypeConstraint(
Size seqpos,
std::string const & aa_in,
Expand Down Expand Up @@ -122,11 +130,18 @@ public:
std::string
get_rsd_type_name3() const;

bool
get_base_name_active() const;

void
set_base_name_active( bool base_name );

private:
Size seqpos_;
std::string AAname;
std::string rsd_type_name3_;
core::Real favor_native_bonus_;
bool base_name_ = false;
#ifdef SERIALIZATION
public:
template< class Archive > void save( Archive & arc ) const;
Expand Down
Loading