Skip to content
Merged
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
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[submodule "Catch2"]
path = Catch2
path = submodules/Catch2
url = https://github.com/catchorg/Catch2
[submodule "msgpack-c"]
path = msgpack-c
path = submodules/msgpack-c
url = https://github.com/msgpack/msgpack-c
[submodule "mmtf_spec"]
path = mmtf_spec
path = submodules/mmtf_spec
url = https://github.com/rcsb/mmtf
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
[MMTF specification](https://github.com/rcsb/mmtf/pull/35).
- New methods to find polymer chains and HETATM following discussions in
[rcsb/mmtf#28](https://github.com/rcsb/mmtf/issues/28).
- Altered submodule locations [rcsb/mmtf-cpp#36](https://github.com/rcsb/mmtf-cpp/pull/36)
from the base directory to the new submodules directory.

## v1.0.0 - 2019-02-05
### Added
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ target_include_directories(MMTFcpp INTERFACE

if (mmtf_build_local)
# use header only
set(MSGPACKC_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/msgpack-c/include)
set(MSGPACKC_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/submodules/msgpack-c/include)
add_library(msgpackc INTERFACE)
target_include_directories(msgpackc INTERFACE ${MSGPACKC_INCLUDE_DIR})
if (BUILD_TESTS)
set(CATCH_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Catch2/single_include)
set(CATCH_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/submodules/Catch2/single_include)
add_library(Catch INTERFACE)
target_include_directories(Catch INTERFACE ${CATCH_INCLUDE_DIR})
endif()
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,18 @@ Example codes:
- mmtf_demo.cpp: Loads an MMTF file and checks internal consistency using
mmtf::StructureData::hasConsistentData.
```bash
./examples/mmtf_demo ../mmtf_spec/test-suite/mmtf/173D.mmtf
./examples/mmtf_demo ../submodules/mmtf_spec/test-suite/mmtf/173D.mmtf
```
- traverse.cpp: Loads an MMTF file and dumps it in human-readable forms.
```bash
./examples/traverse ../mmtf_spec/test-suite/mmtf/173D.mmtf
./examples/traverse ../mmtf_spec/test-suite/mmtf/173D.mmtf json
./examples/traverse ../mmtf_spec/test-suite/mmtf/173D.mmtf print
./examples/traverse ../submodules/mmtf_spec/test-suite/mmtf/173D.mmtf
./examples/traverse ../submodules/mmtf_spec/test-suite/mmtf/173D.mmtf json
./examples/traverse ../submodules/mmtf_spec/test-suite/mmtf/173D.mmtf print
```

- print_as_pdb.cpp: Loads an MMTF file and prints it in pdb format.
```bash
./examples/print_as_pdb ../mmtf_spec/test-suite/mmtf/173D.mmtf
./examples/print_as_pdb ../submodules/mmtf_spec/test-suite/mmtf/173D.mmtf
```

## Benchmark
Expand Down
8 changes: 4 additions & 4 deletions ci/travis-test-example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ set -e
cd $TRAVIS_BUILD_DIR/examples
if [ -z "$EMSCRIPTEN" ]; then
# Compile with C++03 forced
$CXX -I"../msgpack-c/include" -I"../include" -std=c++03 -O2 \
$CXX -I"../submodules/msgpack-c/include" -I"../include" -std=c++03 -O2 \
-o read_and_write read_and_write.cpp
./read_and_write ../mmtf_spec/test-suite/mmtf/3NJW.mmtf test.mmtf
./read_and_write ../submodules/mmtf_spec/test-suite/mmtf/3NJW.mmtf test.mmtf
else
# Cannot do C++03 here and need to embed input file for running it with node
cp ../mmtf_spec/test-suite/mmtf/3NJW.mmtf .
$CXX -I"../msgpack-c/include" -I"../include" -O2 \
cp ../submodules/mmtf_spec/test-suite/mmtf/3NJW.mmtf .
$CXX -I"../submodules/msgpack-c/include" -I"../include" -O2 \
-o read_and_write.js read_and_write.cpp --embed-file 3NJW.mmtf
node read_and_write.js 3NJW.mmtf test.mmtf
fi
74 changes: 37 additions & 37 deletions tests/mmtf_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ msgpack_obj_to_map(const msgpack::object& obj) {
}

TEST_CASE("assignment operator") {
std::string working_mmtf = "../mmtf_spec/test-suite/mmtf/173D.mmtf";
std::string working_mmtf = "../submodules/mmtf_spec/test-suite/mmtf/173D.mmtf";
mmtf::StructureData sd;
mmtf::decodeFromFile(sd, working_mmtf);
SECTION("basic assignment operator") {
Expand Down Expand Up @@ -78,7 +78,7 @@ TEST_CASE("assignment operator") {


TEST_CASE("copy constructor") {
std::string working_mmtf = "../mmtf_spec/test-suite/mmtf/173D.mmtf";
std::string working_mmtf = "../submodules/mmtf_spec/test-suite/mmtf/173D.mmtf";
mmtf::StructureData sd;
mmtf::decodeFromFile(sd, working_mmtf);
SECTION("Basic copy constructor") {
Expand All @@ -99,32 +99,32 @@ TEST_CASE("copy constructor") {
// Tests for structure_data.hpp
TEST_CASE("Test round trip StructureData working") {
std::vector<std::string> works;
works.push_back("../mmtf_spec/test-suite/mmtf/173D.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/1AA6.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/1AUY.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/1BNA.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/1CAG.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/1HTQ.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/1IGT.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/1L2Q.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/1LPV.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/1MSH.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/1O2F.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/1R9V.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/1SKM.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/3NJW.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/3ZYB.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/4CK4.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/4CUP.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/4OPJ.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/4P3R.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/4V5A.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/4Y60.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/5EMG.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/5ESW.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/empty-all0.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/empty-numChains1.mmtf");
works.push_back("../mmtf_spec/test-suite/mmtf/empty-numModels1.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/173D.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/1AA6.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/1AUY.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/1BNA.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/1CAG.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/1HTQ.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/1IGT.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/1L2Q.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/1LPV.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/1MSH.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/1O2F.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/1R9V.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/1SKM.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/3NJW.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/3ZYB.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/4CK4.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/4CUP.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/4OPJ.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/4P3R.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/4V5A.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/4Y60.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/5EMG.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/5ESW.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/empty-all0.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/empty-numChains1.mmtf");
works.push_back("../submodules/mmtf_spec/test-suite/mmtf/empty-numModels1.mmtf");
works.push_back("../temporary_test_data/all_canoncial.mmtf");
works.push_back("../temporary_test_data/1PEF_with_resonance.mmtf");
for (size_t i=0; i<works.size(); ++i) {
Expand All @@ -138,7 +138,7 @@ TEST_CASE("Test round trip StructureData working") {


TEST_CASE("Test round trip StructureData not working - EncodeError") {
std::string basic = "../mmtf_spec/test-suite/mmtf/173D.mmtf";
std::string basic = "../submodules/mmtf_spec/test-suite/mmtf/173D.mmtf";
mmtf::StructureData sd;
mmtf::decodeFromFile(sd, basic);
SECTION("Alter xCoordList") {
Expand Down Expand Up @@ -187,7 +187,7 @@ TEST_CASE("Test round trip StructureData not working - EncodeError") {

TEST_CASE("Test StructureData DecodeError") {
std::vector<std::string> doesnt_work;
doesnt_work.push_back("../mmtf_spec/test-suite/mmtf/empty-mmtfVersion99999999.mmtf");
doesnt_work.push_back("../submodules/mmtf_spec/test-suite/mmtf/empty-mmtfVersion99999999.mmtf");
for (size_t i=0; i<doesnt_work.size(); ++i) {
mmtf::StructureData sd;
REQUIRE_THROWS_AS(mmtf::decodeFromFile(sd, doesnt_work[i]), mmtf::DecodeError);
Expand Down Expand Up @@ -597,7 +597,7 @@ TEST_CASE("Test FourByteInt enc/dec") {
}

TEST_CASE("Test bondOrderList vs bondAtomList") {
std::string working_mmtf = "../mmtf_spec/test-suite/mmtf/173D.mmtf";
std::string working_mmtf = "../submodules/mmtf_spec/test-suite/mmtf/173D.mmtf";
mmtf::StructureData sd;
mmtf::decodeFromFile(sd, working_mmtf);
SECTION("Deleting all bondOrderLists") {
Expand Down Expand Up @@ -744,7 +744,7 @@ map_const_sd_helper(mmtf::StructureData const & sd) {
}

TEST_CASE("mapDecoder types") {
std::string working_mmtf = "../mmtf_spec/test-suite/mmtf/173D.mmtf";
std::string working_mmtf = "../submodules/mmtf_spec/test-suite/mmtf/173D.mmtf";
mmtf::StructureData sd;
mmtf::decodeFromFile(sd, working_mmtf);

Expand All @@ -761,7 +761,7 @@ TEST_CASE("mapDecoder types") {

// test/example of how to use extra data
TEST_CASE("atomProperties field") {
std::string working_mmtf = "../mmtf_spec/test-suite/mmtf/173D.mmtf";
std::string working_mmtf = "../submodules/mmtf_spec/test-suite/mmtf/173D.mmtf";
mmtf::StructureData sd, sd2;
mmtf::decodeFromFile(sd, working_mmtf);

Expand Down Expand Up @@ -831,7 +831,7 @@ void check_extra_data(const std::map<std::string, msgpack::object>& sd_map,
// test round trips with all extra data set
TEST_CASE("extra data fields") {
// Randomly chosen, small example MMTF
std::string working_mmtf = "../mmtf_spec/test-suite/mmtf/173D.mmtf";
std::string working_mmtf = "../submodules/mmtf_spec/test-suite/mmtf/173D.mmtf";
mmtf::StructureData sd, sd2, sd3;
mmtf::decodeFromFile(sd, working_mmtf);

Expand Down Expand Up @@ -863,7 +863,7 @@ TEST_CASE("extra data fields") {
}

TEST_CASE("Test export_helpers") {
std::string working_mmtf = "../mmtf_spec/test-suite/mmtf/3NJW.mmtf";
std::string working_mmtf = "../submodules/mmtf_spec/test-suite/mmtf/3NJW.mmtf";
mmtf::StructureData sd;
mmtf::decodeFromFile(sd, working_mmtf);
size_t numbonds_ref = sd.numBonds;
Expand Down Expand Up @@ -942,7 +942,7 @@ TEST_CASE("Test export_helpers") {
}

TEST_CASE("Test mapdecoder from raw mmtf") {
std::string working_mmtf = "../mmtf_spec/test-suite/mmtf/173D.mmtf";
std::string working_mmtf = "../submodules/mmtf_spec/test-suite/mmtf/173D.mmtf";
mmtf::MapDecoder md;
mmtf::mapDecoderFromFile(md, working_mmtf);
std::vector<int> bonds;
Expand All @@ -955,7 +955,7 @@ TEST_CASE("Test mapdecoder from raw mmtf") {

TEST_CASE("Test various encode and decode options") {
// fetch reference data
std::string working_mmtf = "../mmtf_spec/test-suite/mmtf/173D.mmtf";
std::string working_mmtf = "../submodules/mmtf_spec/test-suite/mmtf/173D.mmtf";
mmtf::StructureData sd_ref;
mmtf::decodeFromFile(sd_ref, working_mmtf);
// write into buffer
Expand Down
2 changes: 1 addition & 1 deletion tests/multi_cpp_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

int main(int argc, char** argv) {
// decode MMTF file
std::string filename = "../mmtf_spec/test-suite/mmtf/173D.mmtf";
std::string filename = "../submodules/mmtf_spec/test-suite/mmtf/173D.mmtf";
mmtf::StructureData data;
read_check_file(data, filename);

Expand Down