molframe 0.6.2

A batteries-included structural bioinformatics engine
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::{ReadOptions, read_bytes};

#[cfg(all(feature = "pdb", feature = "gzip"))]
#[test]
fn owned_compressed_bytes_are_decoded_before_format_detection() {
    let bytes = vec![
        31, 139, 8, 0, 0, 0, 0, 0, 2, 255, 115, 12, 241, 247, 85, 0, 3, 67, 5, 5, 103, 71, 5, 5,
        71, 31, 71, 5, 71, 8, 23, 12, 12, 244, 12, 12, 12, 48, 105, 67, 32, 165, 96, 9, 226, 40,
        32, 128, 179, 130, 2, 151, 171, 159, 11, 23, 0, 141, 81, 192, 56, 85, 0, 0, 0,
    ];
    let options = ReadOptions::new().only_atomic_coords(true);
    let (structure, _) = read_bytes(bytes.clone(), Some("model.pdb.gz"), &options).unwrap();
    assert_eq!(structure.atom_count(), 1);
    let context = molframe_core::ExecutionContext::default();
    let (budgeted, _) =
        super::read_bytes_in(bytes, Some("model.pdb.gz"), &options, &context).unwrap();
    assert_eq!(budgeted.atom_count(), structure.atom_count());
}