Skip to content

Commit

Permalink
temp: check conversion impact
Browse files Browse the repository at this point in the history
  • Loading branch information
padix-key committed Aug 24, 2024
1 parent 089a8c2 commit cda280b
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,30 +551,12 @@ impl PDBFile {
Some(model_number) => {
let atom_line_i = self.get_atom_indices(model_number)?;
let mut coord = Array::zeros((atom_line_i.len(), 3));
for (atom_i, line_i) in atom_line_i.iter().enumerate() {
let line = &self.lines[*line_i];
if line.len() < 80 {
return Err(biotite::InvalidFileError::new_err("Line is too short"))
}
coord[[atom_i, 0]] = parse_float_from_string(line, 30, 38)?;
coord[[atom_i, 1]] = parse_float_from_string(line, 38, 46)?;
coord[[atom_i, 2]] = parse_float_from_string(line, 46, 54)?;
}
Ok(CoordArray::Single(coord))
},

None => {
let length = self.get_model_length()?;
let mut coord = Array::zeros((self.atom_line_i.len(), 3));
for (atom_i, line_i) in self.atom_line_i.iter().enumerate() {
let line = &self.lines[*line_i];
if line.len() < 80 {
return Err(biotite::InvalidFileError::new_err("Line is too short"))
}
coord[[atom_i, 0]] = parse_float_from_string(line, 30, 38)?;
coord[[atom_i, 1]] = parse_float_from_string(line, 38, 46)?;
coord[[atom_i, 2]] = parse_float_from_string(line, 46, 54)?;
}
Ok(
CoordArray::Multi(coord.into_shape((self.model_start_i.len(), length, 3))
.expect("Model length is invalid"))
Expand Down

0 comments on commit cda280b

Please sign in to comment.