Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

add tests to GH #12

Merged
merged 8 commits into from
Jul 20, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Docs
on:
push:
branches: [main, 20240719-view]
branches: [main]
permissions:
contents: read
pages: write
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Tests
on:
push:
branches:
- "**"
pull_request:
branches:
- "**"
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Configure cache
uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test --verbose
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
//!
//! ## Usage
//!
//! ```rust
//! use pymolparsing::psedata::PSEData;
//! let pse_data = PSEData::load("path/to/file.pse");
//! ```no_run
//! use pseutils::pymolparsing::psedata::PSEData;
//! let psedata = PSEData::load("path/to/file.pse").expect("local pse path");
//! // Work with the loaded PSE data
//! psedata.to_disk_full("my_output_directory");
//! ```
Expand Down
Binary file added tests/mol-spec-data/.DS_Store
Binary file not shown.
39 changes: 39 additions & 0 deletions tests/mol-spec-data/1cbs/annotations.cif
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Test annotations #

# Chain Annotation (label)
loop_
_mvs_test_chain_label_annotation.label_asym_id
_mvs_test_chain_label_annotation.label_entity_id
_mvs_test_chain_label_annotation.tooltip
_mvs_test_chain_label_annotation.color
# polymer
A . polymer '#AAAAAA'
# REA ligand
B . ligand '#FF0000'

# Residue Annotation (auth)
loop_
_mvs_test_auth_residue_annotation.auth_asym_id
_mvs_test_auth_residue_annotation.auth_seq_id
_mvs_test_auth_residue_annotation.pdbx_PDB_ins_code
_mvs_test_auth_residue_annotation.tooltip
_mvs_test_auth_residue_annotation.color
# not possible to annotate the whole polymer using this
# REA ligand
A 200 . ligand '#FF0000'

# Residue Range Annotation (auth)
loop_
_mvs_test_auth_residue_range_annotation.auth_asym_id
_mvs_test_auth_residue_range_annotation.beg_auth_seq_id
_mvs_test_auth_residue_range_annotation.beg_pdbx_PDB_ins_code
_mvs_test_auth_residue_range_annotation.end_auth_seq_id
_mvs_test_auth_residue_range_annotation.end_pdbx_PDB_ins_code
_mvs_test_auth_residue_range_annotation.tooltip
_mvs_test_auth_residue_range_annotation.color
# polymer
A 1 . 137 . polymer '#AAAAAA'
# REA ligand
A 200 . 200 . ligand '#FF0000'

#
3 changes: 3 additions & 0 deletions tests/mol-spec-data/1cbs/auth_residue.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
{ "auth_asym_id": "A", "auth_seq_id": 200, "pdbx_PDB_ins_code": null, "tooltip": "ligand", "color": "#FF0000" }
]
7 changes: 7 additions & 0 deletions tests/mol-spec-data/1cbs/auth_residue_range.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"auth_asym_id": ["A", "A"],
"beg_auth_seq_id": [1, 200],
"end_auth_seq_id": [137, 200],
"tooltip": ["polymer", "ligand"],
"color": ["#121212", "#FF0000"]
}
4 changes: 4 additions & 0 deletions tests/mol-spec-data/1cbs/chain_label.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
{ "label_asym_id": "A", "label_entity_id": null, "tooltip": "polymer", "color": "#121212" },
{ "label_asym_id": "B", "label_entity_id": null, "tooltip": "ligand", "color": "#FF0000" }
]
14 changes: 14 additions & 0 deletions tests/mol-spec-data/1cbs/components.cif
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Test annotations #

# Component Selection
loop_
_mvs_test_component1.label_asym_id
_mvs_test_component1.label_entity_id
# polymer
A .

loop_
_mvs_test_component1.label_asym_id
_mvs_test_component1.label_entity_id
# REA ligand
B .
50 changes: 50 additions & 0 deletions tests/mol-spec-data/1cbs/custom-multicategory.cif
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
data_block1

# Test annotations #

# Chain Annotation (label)
loop_
_color.label_asym_id
_color.label_entity_id
_color.type_symbol
_color.label_atom_id
_color.tooltip
_color.color
# polymer
A . . . polymer '#AAAAAA'
# REA ligand
B . . . ligand '#FF0000'
B . C . ligand '#0044FF'
B . . C2 ligand '#00FFFF'


data_block2

# Chain Annotation (label)
loop_
_weather_forecast.day
_weather_forecast.temperature
monday 20
tuesday 20
wednesday 0

loop_
_color.label_asym_id
_color.label_entity_id
_color.type_symbol
_color.label_atom_id
_color.tooltip
_color.color
_color.secondary_color
A . . . polymer green orange
B . . . ligand blue yellow

loop_
_black_is_good.label_asym_id
_black_is_good.label_entity_id
_black_is_good.type_symbol
_black_is_good.label_atom_id
_black_is_good.tooltip
_black_is_good.color
A . . . polymer black
B . . . ligand black
Binary file added tests/mol-spec-data/1cbs/custom.bcif
Binary file not shown.
16 changes: 16 additions & 0 deletions tests/mol-spec-data/1cbs/custom.cif
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Test annotations #

# Chain Annotation (label)
loop_
_color.label_asym_id
_color.label_entity_id
_color.type_symbol
_color.label_atom_id
_color.tooltip
_color.color
# polymer
A . . . polymer '#AAAAAA'
# REA ligand
B . . . ligand '#FF0000'
B . C . ligand '#0044FF'
B . . C2 ligand '#00FFFF'
Loading