### Using Test Fixtures with setUp() and tearDown() Source: https://github.com/rosettacommons/rosetta/blob/main/source/external/cxxtest/docs/guide.html Implement setUp() and tearDown() methods to manage resources before and after each test case. This is crucial for non-trivial tests involving setup and cleanup. ```cpp class TestFileOps : public CxxTest::TestSuite { public: void setUp() { mkdir( "playground" ); } void tearDown() { system( "rm -Rf playground"); } void testCreateFile() { FileCreator fc( "playground" ); fc.createFile( "test.bin" ); TS_ASSERT_EQUALS( access( "playground/test.bin", 0 ), 0 ); } }; ``` -------------------------------- ### Build Example Executable Source: https://github.com/rosettacommons/rosetta/blob/main/source/external/zlib-1.2.8/CMakeLists.txt Creates an executable named 'example' from test/example.c and links it against the 'zlib' library. It also adds a test for this executable. ```cmake add_executable(example test/example.c) target_link_libraries(example zlib) add_test(example example) ``` -------------------------------- ### Build and Install PyRosetta Package Source: https://github.com/rosettacommons/rosetta/blob/main/README.md Use this script to build and install a PyRosetta package locally. Ensure you have a C++ compiler, Ninja, and CMake installed. ```sh cd source/src/python/PyRosetta python3 build.py -j24 --create-package $HOME/my_pyrosetta_package cd $HOME/my_pyrosetta_package/setup python3 setup.py install ``` -------------------------------- ### Build 64-bit Example Executable Source: https://github.com/rosettacommons/rosetta/blob/main/source/external/zlib-1.2.8/CMakeLists.txt Creates a 64-bit executable 'example64' by compiling test/example.c with the -D_FILE_OFFSET_BITS=64 flag. This is conditional on HAVE_OFF64_T being defined. ```cmake if(HAVE_OFF64_T) add_executable(example64 test/example.c) target_link_libraries(example64 zlib) set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") add_test(example64 example64) add_executable(minigzip64 test/minigzip.c) target_link_libraries(minigzip64 zlib) set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") endif() ``` -------------------------------- ### Build and Install Executables Source: https://github.com/rosettacommons/rosetta/blob/main/source/readme.txt This command builds and installs executables into the 'bin/' directory. The '-D' option searches for SConstruct iteratively, and '#' is an alias for the top build directory. ```bash scons bin ``` ```bash scons -D #bin ``` -------------------------------- ### Install ZLIB Libraries and Headers Source: https://github.com/rosettacommons/rosetta/blob/main/source/external/zlib-1.2.8/CMakeLists.txt Installs the zlib and zlibstatic targets, headers, man pages, and pkgconfig files. This is conditional on NOT SKIP_INSTALL_LIBRARIES, NOT SKIP_INSTALL_HEADERS, and NOT SKIP_INSTALL_FILES. ```cmake if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) install(TARGETS zlib zlibstatic RUNTIME DESTINATION "${INSTALL_BIN_DIR}" ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ) endif() if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL ) install(FILES ${ZLIB_PUBLIC_HDRS} DESTINATION "${INSTALL_INC_DIR}") endif() if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL ) install(FILES zlib.3 DESTINATION "${INSTALL_MAN_DIR}/man3") endif() if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL ) install(FILES ${ZLIB_PC} DESTINATION "${INSTALL_PKGCONFIG_DIR}") endif() ``` -------------------------------- ### Example template_directories.txt Format Source: https://github.com/rosettacommons/rosetta/blob/main/source/scripts/python/public/plot_VL_VH_orientational_coordinates/README.md Illustrates the required format for `template_directories.txt`, listing directories containing grafting output from the `antibody.py` application. ```plaintext /Users/guest/antibody_a/grafting /Users/guest/antibody_b/grafting /Users/guest/antibody_c/grafting /Users/guest/antibody_d/grafting /Users/guest/antibody_e/grafting ``` -------------------------------- ### Build Specific Executable Source: https://github.com/rosettacommons/rosetta/blob/main/source/readme.txt Build and install a particular executable into the 'bin' directory. Specify the executable name and optionally the build mode. ```bash scons bin/exec ``` ```bash scons bin/benchmark.linuxgccdebug ``` ```bash scons mode=release bin/benchmark.linuxgccrelease ``` -------------------------------- ### Run Step-by-Step Test Execution Source: https://github.com/rosettacommons/rosetta/blob/main/tests/benchmark/readme.md After initial setup with benchmark.py, navigate to the test results directory and use this command to execute individual steps of a test script. ```bash cd main/tests/benchmark/results/./ && python-3.6 .py ``` -------------------------------- ### Setup Resfiles Script Source: https://github.com/rosettacommons/rosetta/blob/main/tests/features/sample_sources/top8000/input/REAME.txt Run this Python script to generate the rosetta_inputs.db3 file. Ensure the --data_dir argument points to your prepared PDB data. ```bash python setup_resfiles.py --data_dir top8000_chains_eds_70 ``` -------------------------------- ### Example remodel_h3_files.txt Format Source: https://github.com/rosettacommons/rosetta/blob/main/source/scripts/python/public/plot_VL_VH_orientational_coordinates/README.md Shows the expected format for `remodel_h3_files.txt`, which is a list of score files generated by the `antibody_H3` application. ```plaintext /Users/guest/antibody_a/remodel_h3.fasc /Users/guest/antibody_b/remodel_h3.fasc /Users/guest/antibody_c/remodel_h3.fasc /Users/guest/antibody_d/remodel_h3.fasc /Users/guest/antibody_e/remodel_h3.fasc ``` -------------------------------- ### Input File Format Example Source: https://github.com/rosettacommons/rosetta/blob/main/tests/scientific/tests/make_fragments/readme.md The input file for the benchmark is a JSON structure containing protein data, including PDB text and target sequence. ```json { "casp_12": { "target_id": { "pdb_text": "pdb_text...", "target_sequence": "MYSEQVENCE..." } } ... ``` -------------------------------- ### Configure Conda Channels for Rosetta Source: https://context7.com/rosettacommons/rosetta/llms.txt Add the official Rosetta Commons Conda channel to your `.condarc` file to install Rosetta and its dependencies. This example uses a US West coast mirror. ```yaml # ~/.condarc (US West coast mirror) channels: - https://conda.rosettacommons.org - conda-forge ``` -------------------------------- ### Build Pilot Applications and Devel Sources Source: https://github.com/rosettacommons/rosetta/blob/main/source/readme.txt These commands build all pilot applications listed in 'src/pilot_apps.src.settings.all' and sources in 'src/devel.src.settings', along with core libraries. Restricted builds can be achieved using '.my' settings files. ```bash scons bin pilot_apps_all ``` ```bash scons bin my ``` ```bash scons bin my_pilot_apps ``` -------------------------------- ### Install Rosetta using Conda Source: https://context7.com/rosettacommons/rosetta/llms.txt Install the Rosetta package using the Conda package manager after configuring the appropriate channels. ```sh conda install rosetta ``` -------------------------------- ### Build and Run Unit Tests Source: https://github.com/rosettacommons/rosetta/blob/main/source/readme.txt First, build the necessary sources using 'scons cat=test'. Then, run the unit tests using the provided Python script. Ensure sources are built prior to running tests. ```bash scons cat=test python test/run.py ``` -------------------------------- ### Example Citation Entry Format Source: https://github.com/rosettacommons/rosetta/blob/main/source/code_templates/README.md This is an example of how a citation entry is formatted in the rosetta_citations.txt file, including author, year, title, journal, volume/issue/pages, and DOI. ```text [BEGIN_CITATION] [BEGIN_PRIMARY_AUTHORS] "" "Hart" "MW" [END_PRIMARY_AUTHORS] [BEGIN_SENIOR_AUTHORS] "" "Grosberg" "RK" [END_SENIOR_AUTHORS] [BEGIN_YEAR] 2009 [END_YEAR] [BEGIN_TITLE] Caterpillars did not evolve from onychophorans by hybridogenesis. [END_TITLE] [BEGIN_JOURNAL] Proc Natl Acad Sci U S A [END_JOURNAL] [BEGIN_VOLUME_ISSUE_PAGES] 106(47):19906-9 [END_VOLUME_ISSUE_PAGES] [BEGIN_DOI] 10.1073/pnas.0910229106 [END_DOI] [END_CITATION] ``` -------------------------------- ### Benchmark Help Command Source: https://github.com/rosettacommons/rosetta/blob/main/tests/benchmark/readme.md Run this command to view the full list of available command-line options for the benchmark.py script. ```bash benchmark.py --help ``` -------------------------------- ### Initial Acetylated N-Terminus Setup Source: https://github.com/rosettacommons/rosetta/blob/main/database/chemical/residue_type_sets/fa_standard/patches/AcetylatedProteinNtermConnection.txt Initial setup for a specific case of acetylated N-terminus, defining atoms, bonds, and internal coordinates. This configuration is for a specific residue type (3HP2) and connection (CP2). ```python ADD_BOND 3HP2 CP2 SET_BACKBONE_HEAVYATOM CO SET_BACKBONE_HEAVYATOM OP1 SET_BACKBONE_HEAVYATOM CP2 SET_ICOOR CO -150.000169 57.684068 1.348791 N CA C SET_ICOOR OP1 -2.200808 57.317771 1.203828 CO N CA SET_ICOOR CP2 -178.916686 64.195695 1.513616 CO N OP1 #SET_ICOOR 1HP2 -136.216863 71.360284 1.082267 CP2 CO N SET_ICOOR 1HP2 122.078056 66.682399 1.083159 CP2 CO CONN%LASTCONN SET_ICOOR 2HP2 120.977283 71.438584 1.084823 CP2 CO 1HP2 SET_ANCESTOR CN GREATGRANDPARENT CO SET_POLYMER_CONNECT LOWER NONE ADD_PROPERTY ACETYLATED_NTERMINUS ADD_PROPERTY LOWER_TERMINUS END_CASE ``` -------------------------------- ### Example Distance Restraint Format Source: https://github.com/rosettacommons/rosetta/blob/main/source/GUIs/rosetta_flag_file_builder/AppDescriptions/Rosetta3-3/ddg_monomer.txt This is an example of how a distance restraint between two C-alpha atoms is formatted in a Rosetta constraint file. It specifies the atom pair, restraint type (HARMONIC), ideal distance, and standard deviation. ```text AtomPair CA 2 CA 1 HARMONIC 3.79007 0.5 ``` -------------------------------- ### Initialize and Run Job Distributor (JD2) Source: https://context7.com/rosettacommons/rosetta/llms.txt Sets up the Job Distributor to manage batch jobs, reading input structures, creating output files, and writing scores. Requires Rosetta database initialization. ```cpp #include #include #include #include #include int main( int argc, char * argv[] ) { try { devel::init( argc, argv ); core::scoring::ScoreFunctionOP sfxn = core::scoring::get_score_function(); protocols::minimization_packing::PackRotamersMoverOP mover( new protocols::minimization_packing::PackRotamersMover( sfxn ) ); // JD2 reads -in:file:s, creates nstruct output files, // and writes scores to a score file automatically protocols::jd2::JobDistributor::get_instance()->go( mover ); } catch ( utility::excn::Exception const & e ) { e.display(); return -1; } return 0; } ``` -------------------------------- ### Define 6-Lactyl Sugar Patch Source: https://github.com/rosettacommons/rosetta/blob/main/database/chemical/residue_type_sets/centroid/patches/carbohydrates/O6-lactylation.txt Defines the name and types for the 6-lactyl sugar residue patch. This is the initial setup for the patch. ```python NAME 6-Lac TYPES O6_LACTYL_SUGAR ``` -------------------------------- ### Build PyRosetta with Python Source: https://github.com/rosettacommons/rosetta/blob/main/docker/README.md Execute this command in the PyRosetta source directory to build PyRosetta. ```bash cd rosetta/source/src/python/PyRosetta && python3 build.py -j8 ``` -------------------------------- ### Define 1-Lactyl Sugar Patch Source: https://github.com/rosettacommons/rosetta/blob/main/database/chemical/residue_type_sets/fa_standard/patches/carbohydrates/O1-lactylation.txt Defines the name and atom types for the 1-lactyl sugar residue patch. This is the initial setup for the patch. ```python NAME 1-Lac TYPES O1_LACTYL_SUGAR ``` -------------------------------- ### Define 4-Propargyl Sugar Residue Type Source: https://github.com/rosettacommons/rosetta/blob/main/database/chemical/residue_type_sets/centroid/patches/carbohydrates/4-propargylation.txt Defines the name and types for the 4-propargyl sugar residue. This is the initial setup for the custom residue. ```text NAME 4-propargyl TYPES O4_PROPARGYL_SUGAR ```