Commit bd1a3928 authored by NOEL Philippe's avatar NOEL Philippe

Add function to refine atom dialing

parent 8f1754a8
......@@ -308,4 +308,19 @@ impl<'a> Protein {
}
Some(n_prot)
}
/// Used to clean the dialing of atoms in the proteins
/// Does not change the dialing of residues
///
pub fn refine_dialing(&mut self){
let mut n_atom = 0;
for chain in &mut self.lst_chain {
for residue in &mut chain.lst_res {
for atom in &mut residue.lst_atom {
atom.number = n_atom;
n_atom += 1;
}
}
}
}
}
......@@ -7,7 +7,7 @@ use std::io;
/// Write a PDB file for the `Protein`.
/// Be careful, the protein is write with the atom numbers in its structure. Remind to use the method
/// my_protein.refine_numerotation() before !
/// my_protein.refine_dialing() before !
pub fn write_pdb(my_prot: &Protein, file: &str) -> io::Result<()>{
let mut output_pdb = File::create(file)?;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment