-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Labels
Description
SampledDensityMap has 3 constructors for its class.
(i) SampledDensityMap(KernelType kt = GAUSSIAN);
(ii) SampledDensityMap(const DensityHeader &header, KernelType kt = GAUSSIAN);
(iii) SampledDensityMap(const ParticlesTemp &ps, emreal resolution,
emreal voxel_size,
IMP::FloatKey mass_key = IMP::atom::Mass::get_mass_key(),
int sig_cutoff = 3, KernelType kt = GAUSSIAN);
When creating a map from a PDB using (iii), maps are usually aligned with the PDB as expected.
@saltzberg found a few examples where when using (ii) in combination with
void set_particles(const ParticlesTemp &ps,
IMP::FloatKey mass_key = IMP::atom::Mass::get_mass_key());
the generated density has a different bouding box, and the density is translated to the (0,0,0) corners. This behavior is unexpected. See Figure at the bottom.
The test test_sample_particles.py does not display this difference in behavior when writing both xxx.mrc and yyy.mrc.
Code Snippet to reproduce error:
### Using (ii) in red in the figure
sampled_input_density = IMP.em.SampledDensityMap(mrc.get_header())
sampled_input_density.set_particles(ps)
sampled_input_density.resample()
sampled_input_density.calcRMS()
### Using (iii) in Green in the figure
sampled_input_density2 = IMP.em.SampledDensityMap(ps,
mrc.get_header().get_resolution(),
mrc.get_header().get_spacing())
IMP.em.write_map(sampled_input_density, "./5610.sid1.mrc", IMP.em.MRCReaderWriter())
IMP.em.write_map(sampled_input_density2, "./5610.sid2.mrc", IMP.em.MRCReaderWriter())
