Skip to content

Commit

Permalink
Merge pull request #1928 from RosettaCommons/Cyrus/mergetarget
Browse files Browse the repository at this point in the history
From Steven Lewis:

This is mostly small features I did in in the summer/fall of 2016 and never got around to testing and PRing until just now.

Features: 

* smlewis/fix_README - improving the front README, based on a better understanding of our forking policy, thanks to @aleaverfay @kwikwag 

* smlewis/FT_clangstatic_fix - fix a clangstatic bug @roccomoretti  pointed out (it was a copy paste error)

* smlewis/cyrus/ss_printer_for_commons - fixes to the HELIX/SHEET printer so that the records are ordered properly in large/multichain structures where the numbering restarts per chain.  This integration test (secondary_structure_output) will change, as it now has a long enough input to have triggered this bug.

smlewis/cyrus/LoopLengthChange_restype: LoopLengthChange takes a residue type char for what to insert/  Resolves RC issue RosettaCommons/main#1700.  Adds integration test.

smlewis/cyrus/actccm_atompair_bounded - AddConstraintsToCurrentConformationMover constraint choice improvements.  Adds integration test.  This code already had an integration test testing different aspects of the Mover; I made a second test so that it multithreads more efficiently.

Old repository SHA1: d610dbcac7de639bb5b5bd832f24a111e2e5cc83

Co-authored-by: Steven Lewis <[email protected]>
  • Loading branch information
aleaverfay and smlewis authored Jan 3, 2017
1 parent 20351e3 commit c3d6219
Show file tree
Hide file tree
Showing 34 changed files with 784 additions and 129 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
Don't Fork Rosetta main
=======================

In our current development workflow, all work should be done in branches. Do not fork this repository. Read [Our workflow Documentation](https://wiki.rosettacommons.org/index.php/GithubWorkflow) to learn how to work with the Rosetta repositories. Rosetta avoids PUBLIC forks because then we'll lose control of the Rosetta IP and/or Rosetta becomes de facto free and we can no longer afford RosettaCON. Rosetta avoids PRIVATE forks inside RosettaCommons because that costs money to no purpose. PRIVATE forks to approved outside groups are an exception.
In our current development workflow, all work should be done in branches. Do not fork this repository. Read [our workflow Documentation](https://wiki.rosettacommons.org/index.php/GithubWorkflow) to learn how to work with the Rosetta repositories.

We avoid forking, using a branching-only method, to ensure that all the Rosetta code stays accessible. We would lose access to unmerged forked branches as developers leave the community. It also ensures we have a single backup of all pushed branches in the event that GitHub were to disappear.

Rosetta main
============

Rosetta/main contains the Rosetta source code, database, unit tests and integration tests. The source code is located in source/src can be compiled with SCons using the following commands:
Rosetta/main (the repository you are looking at) contains the Rosetta source code, database, unit tests and integration tests. The source code is located in source/src can be compiled with SCons using the following commands:

``` sh
$ cd Rosetta/main/source
Expand Down
20 changes: 10 additions & 10 deletions source/src/core/io/StructFileRep.hh
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ struct HELIXInformation {
// http://www.wwpdb.org/documentation/file-format-content/format23/sect5.html
/// @author Steven Lewis [email protected]
struct SHEETInformation {
core::Size sheetID; //numeric ID (which # helix is this?). if > 999 bad things happen here (output field is only 3 chars)
std::string sheet_name; //arbitrary unique ID; copy of sheetID as a string
core::Size strand_num = 1; //nominally the strand number within the sheet, but we are recording each STRAND as its own sheet
std::string sheetID; //arbitrary unique ID; copy of sheetID as a string
core::Size num_strands = 1; //nominally these are SHEET records but we are only doing STRANDs
std::string name3_1; //name3 of start residue
char chainID1; //chain of start residue
Expand Down Expand Up @@ -247,15 +247,15 @@ public: // Accessors /////////////////////////////////////////////////////////

// PDB Secondary Structure Section ////////////////////////////////////////
/// @brief Access map for storing HELIX records.
/// @details key is 6-character resID of 1st residue in helix, from ResidueInformation::resid(). These records should be essentially correct, unlike the SHEET records. NOTE that they are NOT read from the PDB by PoseFromStructFileRepConverter, only generated FROM the pose in PoseToStructFileRepConverter.
std::map< std::string, HELIXInformation > const & HELIXInformations() const { return HELIXInformations_; }
std::map< std::string, HELIXInformation > & HELIXInformations() { return HELIXInformations_; }
/// @details These records should be essentially correct, unlike the SHEET records. NOTE that they are NOT read from the PDB by PoseFromStructFileRepConverter, only generated FROM the pose in PoseToStructFileRepConverter.
utility::vector1< HELIXInformation > const & HELIXInformations() const { return HELIXInformations_; }
utility::vector1< HELIXInformation > & HELIXInformations() { return HELIXInformations_; }

// PDB Secondary Structure Section ////////////////////////////////////////
/// @brief Access map for storing SHEET records.
/// @details key is 6-character resID of 1st residue in strand, from ResidueInformation::resid(). These records are cheating on the PDB rules and just storing individual strands as 1-strand sheets. NOTE that they are NOT read from the PDB by PoseFromStructFileRepConverter, only generated FROM the pose in PoseToStructFileRepConverter.
std::map< std::string, SHEETInformation > const & SHEETInformations() const { return SHEETInformations_; }
std::map< std::string, SHEETInformation > & SHEETInformations() { return SHEETInformations_; }
/// @details These records are cheating on the PDB rules and just storing individual strands as 1-strand sheets. NOTE that they are NOT read from the PDB by PoseFromStructFileRepConverter, only generated FROM the pose in PoseToStructFileRepConverter.
utility::vector1< SHEETInformation > const & SHEETInformations() const { return SHEETInformations_; }
utility::vector1< SHEETInformation > & SHEETInformations() { return SHEETInformations_; }

// PDB Connectivity Annotation Section ////////////////////////////////////
/// @brief Access map for storing SSBOND records.
Expand Down Expand Up @@ -365,8 +365,8 @@ private:
std::map< std::string, utility::vector1< std::string > > heterogen_synonyms_; // key is hetID
std::map< std::string, std::string > heterogen_formulae_; // key is hetID
std::map< std::string, std::pair< std::string, std::string > > residue_type_base_names_; // key is 6-char. resID
std::map< std::string, HELIXInformation > HELIXInformations_; // key is 6-char resID from ResidueInformation::resid
std::map< std::string, SHEETInformation > SHEETInformations_; // key is 6-char resID from ResidueInformation::resid
utility::vector1< HELIXInformation > HELIXInformations_;
utility::vector1< SHEETInformation > SHEETInformations_;
std::map< std::string, utility::vector1< SSBondInformation > > ssbond_map_; // key is 6-character resID
std::map< std::string, utility::vector1< LinkInformation > > link_map_; // key is 6-character resID
std::map< std::string, CisPeptideInformation > cispep_map_; // key is 6-character resID
Expand Down
62 changes: 31 additions & 31 deletions source/src/core/io/pdb/pdb_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -261,43 +261,43 @@ create_records_from_sfr(
if ( options->output_secondary_structure() ) {

R = RecordCollection::record_from_record_type( HELIX );
//type is std::map< std::string, HELIXInformation >
auto const helixmap(sfr.HELIXInformations());
for ( auto it(helixmap.begin()); it != helixmap.end(); ++it ) {
//type is utility::vector1< HELIXInformation >
auto const helixvec(sfr.HELIXInformations());
for ( auto it(helixvec.begin()); it != helixvec.end(); ++it ) {
R["type"].value = "HELIX ";
R["serNum"].value = pad_left(it->second.helixID, 3);
R["helixID"].value = it->second.helix_name;
R["initResName"].value = it->second.name3_1;
R["initChainID"].value = std::string( 1, it->second.chainID1 );
R["initSeqNum"].value = pad_left( it->second.seqNum1, 4 );
R["initICode"].value = std::string( 1, it->second.icode1 );
R["endResName"].value = it->second.name3_2;
R["endChainID"].value = std::string( 1, it->second.chainID2 );
R["endSeqNum"].value = pad_left( it->second.seqNum2, 4 );
R["endICode"].value = std::string( 1, it->second.icode2 );
R["helixClass"].value = pad_left(it->second.helixClass, 2 );
R["comment"].value = it->second.comment;
R["length"].value = pad_left( it->second.length, 5 );
R["serNum"].value = pad_left(it->helixID, 3);
R["helixID"].value = it->helix_name;
R["initResName"].value = it->name3_1;
R["initChainID"].value = std::string( 1, it->chainID1 );
R["initSeqNum"].value = pad_left( it->seqNum1, 4 );
R["initICode"].value = std::string( 1, it->icode1 );
R["endResName"].value = it->name3_2;
R["endChainID"].value = std::string( 1, it->chainID2 );
R["endSeqNum"].value = pad_left( it->seqNum2, 4 );
R["endICode"].value = std::string( 1, it->icode2 );
R["helixClass"].value = pad_left(it->helixClass, 2 );
R["comment"].value = it->comment;
R["length"].value = pad_left( it->length, 5 );
VR.push_back(R);
}

R = RecordCollection::record_from_record_type( SHEET );
//type is std::map< std::string, SHEETInformation >
auto const sheetmap(sfr.SHEETInformations());
for ( auto it(sheetmap.begin()); it != sheetmap.end(); ++it ) {
//type is utility::vector1< SHEETInformation >
auto const sheetvec(sfr.SHEETInformations());
for ( auto it(sheetvec.begin()); it != sheetvec.end(); ++it ) {
R["type"].value = "SHEET ";
R["strand"].value = pad_left(it->second.sheetID, 3);
R["sheetID"].value = it->second.sheet_name;
R["numStrands"].value = pad_left( it->second.num_strands, 2);
R["initResName"].value = it->second.name3_1;
R["initChainID"].value = std::string( 1, it->second.chainID1 );
R["initSeqNum"].value = pad_left( it->second.seqNum1, 4 );
R["initICode"].value = std::string( 1, it->second.icode1 );
R["endResName"].value = it->second.name3_2;
R["endChainID"].value = std::string( 1, it->second.chainID2 );
R["endSeqNum"].value = pad_left( it->second.seqNum2, 4 );
R["endICode"].value = std::string( 1, it->second.icode2 );
R["sense"].value = pad_left(it->second.strandClass, 2);
R["strand"].value = pad_left(it->strand_num, 3);
R["sheetID"].value = it->sheetID;
R["numStrands"].value = pad_left( it->num_strands, 2);
R["initResName"].value = it->name3_1;
R["initChainID"].value = std::string( 1, it->chainID1 );
R["initSeqNum"].value = pad_left( it->seqNum1, 4 );
R["initICode"].value = std::string( 1, it->icode1 );
R["endResName"].value = it->name3_2;
R["endChainID"].value = std::string( 1, it->chainID2 );
R["endSeqNum"].value = pad_left( it->seqNum2, 4 );
R["endICode"].value = std::string( 1, it->icode2 );
R["sense"].value = pad_left(it->strandClass, 2);
//There are other fields, but we have no values for them, let's try skipping them wholesale and see what happens
VR.push_back(R);
}
Expand Down
21 changes: 5 additions & 16 deletions source/src/core/io/pose_to_sfr/PoseToStructFileRepConverter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1324,13 +1324,7 @@ void PoseToStructFileRepConverter::generate_HELIXInformation(
//IGNORING comment
helix.length = length;

std::string const key(start_info.resid());
//check if this is already in map
if ( sfr_->HELIXInformations().count( key ) ) {
utility_exit_with_message("when generating HELIXInformation in PoseToStructFileRepConverter, one HELIX has been generated repeatedly (starting at " + key + ")");
} else { //good, add to map
sfr_->HELIXInformations()[key] = helix;
}
sfr_->HELIXInformations().push_back(helix);

return;
}
Expand All @@ -1344,8 +1338,8 @@ void PoseToStructFileRepConverter::generate_SHEETInformation(
){

SHEETInformation sheet;
sheet.sheetID = index; // NOTE this means we are defining all strands as isolated sheets
sheet.sheet_name = std::string(ObjexxFCL::format::I(3, index)); //3-width string
//IGNORING strand_num
sheet.sheetID = std::string(ObjexxFCL::format::I(3, index)); //3-width string
//IGNORING num_strands
sheet.name3_1 = start_info.resName();
sheet.chainID1 = start_info.chainID();
Expand All @@ -1358,13 +1352,8 @@ void PoseToStructFileRepConverter::generate_SHEETInformation(
//IGNORING strandClass
//IGNORING the remainder of the record, this is enough to get it to show nicely in pymol and PV

std::string const key(start_info.resid());
//check if this is already in map
if ( sfr_->SHEETInformations().count( key ) ) {
utility_exit_with_message("when generating SHEETInformation in PoseToStructFileRepConverter, one SHEET has been generated repeatedly (starting at " + key + ")");
} else { //good, add to map
sfr_->SHEETInformations()[key] = sheet;
}
sfr_->SHEETInformations().push_back(sheet);


return;
}
Expand Down
4 changes: 2 additions & 2 deletions source/src/core/scoring/constraints/ConstraintSet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ ConstraintSet::show(
}
} // for ( Size ii = 1; ii <= other.residue_pair_constraints_.size(); ++ii )

out << "IntraResidueCosntraints: total: " << intra_residue_constraints_.size() << " showing active..." << std::endl;
out << "IntraResidueConstraints: total: " << intra_residue_constraints_.size() << " showing active..." << std::endl;
for ( ResidueConstraints::const_iterator it = intra_residue_constraints_.begin(),
eit = intra_residue_constraints_.end(); it != eit; ++it ) {
out << "IntraResidueConstraints (" << it->first << ")" << std::endl;
Expand All @@ -959,7 +959,7 @@ ConstraintSet::show(
}


out << "NonResiduePairCosntraints: total: " << non_residue_pair_constraints_.size() << " showing active..." << std::endl;
out << "NonResiduePairConstraints: total: " << non_residue_pair_constraints_.size() << " showing active..." << std::endl;
for ( Constraints::const_iterator it = non_residue_pair_constraints_.begin(),
eit = non_residue_pair_constraints_.end(); it != eit; ++it ) {
(*it)->show( out );
Expand Down
5 changes: 5 additions & 0 deletions source/src/core/scoring/constraints/CoordinateConstraint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@ CoordinateConstraint::same_type_as_me( Constraint const & other ) const {
return dynamic_cast< CoordinateConstraint const * > (&other);
}

core::scoring::func::Func const &
CoordinateConstraint::get_func() const {
return *func_;
}

// functions
Real
CoordinateConstraint::func( Real const theta ) const
Expand Down
8 changes: 6 additions & 2 deletions source/src/core/scoring/constraints/CoordinateConstraint.hh
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,10 @@ public:
ConstraintOP
remap_resid( core::id::SequenceMapping const &seqmap ) const;


AtomID const &
atom( Size const n ) const;

// UNDEFIUNED, commenting out to fix PyRosetta build void set_atom( Size const index, AtomID const atom_id );
// UNDEFINED, commenting out to fix PyRosetta build void set_atom( Size const index, AtomID const atom_id );

virtual Size show_violations(
std::ostream& out,
Expand All @@ -157,6 +156,11 @@ public:
Real threshold = 1
) const;


/// @brief Returns the func::Func object associated with this Constraint object.
virtual
core::scoring::func::Func const & get_func() const;

private:

// functions
Expand Down
1 change: 0 additions & 1 deletion source/src/protocols/floppy_tail/FloppyTailMover.cc
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,6 @@ void FloppyTailMover::low_res( core::pose::Pose & pose ) {
clock_t stoptime = clock();
TR << "One perturb took " << ((double) stoptime - starttime )/CLOCKS_PER_SEC << " seconds" << std::endl;
TR << "perturb steps complete" << std::endl;
starttime = clock();

// convert back to full atom
protocols::simple_moves::ReturnSidechainMover return_sidechains( saved_input_pose );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static THREAD_LOCAL basic::Tracer TR( "protocols.protein_interface_design.movers

LoopLengthChange::LoopLengthChange() :
Mover( LoopLengthChange::mover_name() ),
loop_start_( 0 ), loop_end_( 0 ), delta_( 0 ), tail_segment_(false)
loop_start_( 0 ), loop_end_( 0 ), delta_( 0 ), tail_segment_(false)/*, restype_char_('A') (in .hh)*/
{
}

Expand Down Expand Up @@ -127,8 +127,9 @@ LoopLengthChange::apply( core::pose::Pose & pose )
using namespace core::chemical;
using namespace core::conformation;

ResidueTypeCOP residue_type( core::pose::get_restype_for_pose(pose, name_from_aa( aa_from_oneletter_code( 'A' ) ) ) );
ResidueCOP new_res = ResidueFactory::create_residue( *residue_type );
ResidueTypeSetCOP residue_set( pose.residue_type_set_for_pose() );
runtime_assert(oneletter_code_specifies_aa(restype_char())); //ensure that we aren't about to try this with aa_unk
ResidueCOP new_res = ResidueFactory::create_residue( residue_set->name_map( name_from_aa( aa_from_oneletter_code( restype_char() ) ) ) );
if ( tail_segment_ ) {
/* This will be ugly: For some reason you cannot use .append_polymer_residue_after_seqpos to add residues
* to the very last position. Instead we are here adding n+1 residues to the second last position. */
Expand All @@ -153,7 +154,7 @@ LoopLengthChange::apply( core::pose::Pose & pose )

}
pose.update_residue_neighbors();
pose.pdb_info()->obsolete( true );
if( pose.pdb_info() ) pose.pdb_info()->obsolete( true );
}

// XRW TEMP std::string
Expand All @@ -171,6 +172,18 @@ LoopLengthChange::parse_my_tag( TagCOP const tag, basic::datacache::DataMap &, p
runtime_assert( loop_end() > loop_start() );
// runtime_assert( loop_end() + delta() >= loop_start() );

if ( tag->hasOption("restype") ) {
restype_char( tag->getOption< char >( "restype" ) );
if ( !(core::chemical::oneletter_code_specifies_aa(restype_char())) ) {
utility_exit_with_message(std::string("LoopLengthChange restype argument apparently does not specify a canonical residue type (ACDEFGHIKLMNPQRSTVWY), argument was ") + std::string( 1, restype_char()));
//manual casting because string literal plus char doesn't work as expected; http://stackoverflow.com/questions/25812411/something-in-c
}
if ( delta() <= 0 ) {
utility_exit_with_message("LoopLengthChange restype argument invalid when delta is less than zero (you are removing residues; do not specify that residue type to add!)");

}
}

TR<<"LoopLengthChange with loop "<<loop_start()<<"-"<<loop_end()<<" and delta "<<delta()<<std::endl;
}

Expand Down Expand Up @@ -208,6 +221,17 @@ core::Size
LoopLengthChange::loop_cut() const{
return( loop_cut_ );
}

void
LoopLengthChange::restype_char( char const restype_char ){
restype_char_ = restype_char;
}

char
LoopLengthChange::restype_char() const{
return( restype_char_ );
}

void
LoopLengthChange::delta( int const d ){
delta_ = d;
Expand Down Expand Up @@ -237,9 +261,10 @@ void LoopLengthChange::provide_xml_schema( utility::tag::XMLSchemaDefinition & x

attlist + XMLSchemaAttribute::required_attribute( "loop_start", xsct_refpose_enabled_residue_number, "Starting residue number for loop, formatted in seqpos or PDB or refpose numbering" )
+ XMLSchemaAttribute::required_attribute( "loop_end", xsct_refpose_enabled_residue_number, "Ending residue number for loop, formatted in seqpos or PDB or refpose numbering" )
+ XMLSchemaAttribute::required_attribute( "delta", xs_integer, "Number of residues to extend or contract the loop" );
+ XMLSchemaAttribute::required_attribute( "delta", xs_integer, "Number of residues to extend or contract the loop" )
+ XMLSchemaAttribute("restype", xsct_canonical_res_char, "Only valid if delta is positive. Char of residue type to insert, on [ACDEFGHIKLMNPQRSTVWY] (the canonicals)." );

protocols::moves::xsd_type_definition_w_attributes( xsd, mover_name(), "XRW TO DO", attlist );
protocols::moves::xsd_type_definition_w_attributes( xsd, mover_name(), "A Mover for changing the length of a loop; does not close the loop afterwards.", attlist );
}

std::string LoopLengthChangeCreator::keyname() const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ public:
void loop_start( core::Size const loop_start );
void loop_end( core::Size const loop_end );
void loop_cut( core::Size const loop_cut );
void restype_char( char const restype_char );
core::Size loop_start() const;
core::Size loop_end() const;
core::Size loop_cut() const;
char restype_char() const;
void delta( int const d );
void tail( bool b );
int delta() const;
Expand All @@ -65,6 +67,7 @@ private:
core::Size loop_start_, loop_end_, loop_cut_;
int delta_; // delta_: by how much to change
bool tail_segment_; //if the tail
char restype_char_ = 'A'; //What residue type should be inserted if delta is positive? Assuming canonical 20.
};


Expand Down
Loading

0 comments on commit c3d6219

Please sign in to comment.