Species discovery: where it stands and where to go next¶
Classification, 2026-11-02: completed evidence and handoff record, including the dated October updates. Maintain next steps only in species discovery: open work. The results below describe their recorded builds; they are not new validation of today's source.
Status note, 2026-10-12 (links updated 2026-10-20 after the note was split into
completed and unfinished parts), at master 618d709ec. It preserves the evidence and data locations for that handoff.
The open-work note is the current entry point for resuming development.
Four other documents hold the detail:
../completed/species_discovery_completed.md(the note): the design, every ruling, and the record of phases 0 to 8.../planned/species_discovery_unfinished.md: the open work (phase 9, validation, promotion, open questions), self-contained.../completed/species_discovery_report.md(the report): the reports of the unattended runs.atom_bfactor_model.md: the follow-on work on per-atom B factors and occupancy.
Moved, 2026-10-25 (the atomic density model,
atomic_density_model.mdand its reportatomic_density_model_report.md). The residual recovery of weaker atoms no longer belongs todiscover_species=yes: it runs on everydetect_atomsrun, on the present path, and its atoms are the weak atoms (chain B of_ATMS.pdb, label and recovery fields in_atoms.csv). Every atom is now fitted by the density model (its own intensity and width, seen through the reconstruction's halo,src/main/nano/simple_nano_density.f90).discover_species=yesis reduced to the class call on the fitted intensities, with the coordination term, and writes the_speciesfiles as before;min_nbrsapplies to the present path. The numbers below are those of the species work.Moved again, 2026-10-27 (the second run of the atomic density model,
atomic_density_model.mdsection 12 and the second section ofatomic_density_model_report.md). The species call is its own program now,detect_atomic_species(single_exec, category atoms; domainsrc/main/nano/simple_atomic_species.f90). It reads the products of adetect_atomsrun (pdbfile=its_ATMS.pdb, with the_atoms.csvand_model.txtbeside it) and the map (vol1,smpd), and takes the species keys:element(one name, or a list brightest first such aselement=Pt,Ni, whose length is the class count),nspecies(refused together with a list), andvol_evenwithvol_odd(the half maps then give each atom's measurement variance and the label agreement).detect_atomsis species-free: it refuseselement,nspecies,vol_evenandvol_oddwith a message namingatoms_statsanddetect_atomic_species, anddiscover_speciesis no longer a key at all (release 4: no alias). The class fit is multiplicative,ln I = ln S_k + beta (c - 12)with onebetafor every class; each atom's posterior carries its measurement variance and the coordination spreadtau_I(c), which the program measures within its classes per coordination bin (thetau_Iofdetect_atomsis fitted under one species and holds the species' separation on a mixed particle)._species.csvgainsSD_POSTERIOR(the posterior's standard error, by the delta method) andTAU_COORD.species_discoverytests the pair. On the 66 real Pt maps the program finds one class on every map, and the forcedelement=Pt,Nifit is inadmissible on every map.
What exists¶
detect_atoms (SINGLE) has an opt-in species discovery. A run without the
new keys behaves as before.
elementmay be left out. Atoms are then detected with a Gaussian template instead of an element kernel.discover_species=yesadds two steps after the present detection.- First, weaker atoms are looked for in the residual map (the map minus the model of the atoms already found). They are kept only if they pass the same contact-score pruning as the present detection. These are the recovered atoms.
- Second, every atom's aperture intensity is measured: the density summed
in a sphere of half the nearest-neighbour distance. The atoms are then
sorted into one to three intensity classes, and each class is a
candidate species.
nspeciesfixes the number of classes; 0 lets the data choose. element=Pt,Nigives the species as a list, brightest first. The number of classes is then fixed, and the names go into the products.- A two-class result is admissible when both classes are large enough and
their means are at least three pooled spreads apart (
D >= 3). - Since
618d709ecthe class fit has one more term. Intensity rises linearly with the atom's coordination number (its number of neighbours), with one slope shared by all classes. The slope is fitted with the classes and written to_species.txtascoord_slope. - Discovery writes four extra files:
_species.csv(one row per atom),_species_radial.csv,_species.txt(the summary) and_species.pdb(class in the element column). The table ends with the fully occupied hard-class/environment intensity, its species-posterior expectation for the reconstruction prior, and the fitted intensity over the former as occupancy; the PDB carries the hard label, that occupancy and the model's B.autorefine3D_nanois species-agnostic (ruling of 2026-10-26): its loop never calls the species and its atomicity prior reads_ATMS.pdbwith_atoms.csv;_species.pdbwith_species.csvcan feed a standalonereconstruct3D atm_prior=yesthe same way. The fitted Gaussian density itself is_SIM.mrcon every run since the density model. The species files remain diagnostics: the present products,_ATMS.pdb,_CC.mrcand_SIM.mrcamong them, are identical with and without discovery.
The same work also produced these changes:
- B factors in the simulator's element kernels (
pdb_bfac=yesonsimulate_nanoparticle). - Compound-crystal lattices for
CdSeW,CdSeZandCdSeR. - A fix of the automatic mask of
detect_atoms, which covered the whole box on unmasked maps. - The test seed fixed inside
simple_test_exec.
The commits:
d3480ae79: phases 0 to 3, the first pass.29808bf3e: phases 4 and 5, species lists, element kernels, compound lattices.0029ed77e: aperture intensity at one common width; the test seed.c28bfc101: the mask fix.618d709ec: the coordination term; the core case's label check back;extract_atomcopies every field.
Code:
src/main/nano/simple_nano_species.f90: the class fit,fit_species_mixture, on the clustering library's extreme-deconvolution mixturesimple_xd_gmm.src/main/nano/simple_nanoparticle.f90:discover_species, which runs the recovery, the intensities and the products.src/main/nano/simple_atoms.f90: pseudo-atoms, species lists, lattices.
Tests:
- the
speciessub-suite ofunit_single; - the high-level
species_discovery; - four
single_atoms_statsentries, one for Pt and one for each CdSe selector.
What the tests and the real maps show¶
Synthetic particles (species_discovery). Each case is a 285-atom
particle, rendered with element kernels, filtered as a reconstruction is,
with noise shaped like a real map's. The four cases are pure Pt, Pt/Ni mixed
at random, a Ni core under a Pt skin, and Pt with a light species (Al).
On 2026-10-12 every check passed:
- no false atoms;
- recall of 0.986 to 1.000 for both species;
- every atom labelled with its element in all three mixed cases;
- a two-class fit forced on pure Pt not admissible (
D0.55).
The fitted intensity ratio of the classes is biased low: by 23% for Pt/Ni mixed, 6% for the Ni core and 43% for Pt/Al. The classes still come out in the right order. This bias comes from measuring on filtered maps and is a documented limitation. Phase 6 tried to remove it by fitting with a map-filtered kernel; that made things worse and was withdrawn on 2026-10-09. Don't try that form again.
Real maps. The archive holds 66 Pt maps: 15 particles, each with 2 to 8 time points, all one species. The second validation run (2026-10-11, before the coordination term) found:
- False species are rare. One class was found on 95.5% of the maps with
element=Pt discover_species=yes, and on 97.0% with discovery but no element.element=Pt,Niwas rejected as a two-class fit on 62 of 66 maps. - The present detection matched the stored coordinates on 56 of 66 maps
with
element=Ptand on 47 without an element. A map matches when 98% of its stored atoms are found within 1 Å. The ten maps that fall short match 85% to 98%. - Sensitivity is poor. A weaker class was planted into 20% of the atoms at 0.6 of the Pt density, about Ni. It was called a second class on 4 maps; at 0.4 it was called on 21. The planted atoms were detected; they did not separate as a class.
- The reason is the spread of real intensities. Real Pt atoms differ in aperture intensity by about twice the measurement noise. Most of that follows the atom's environment:
- +3.8% per neighbour at the median map, 26% more at 12 neighbours than at 5;
- the fitted width flat.
Missing intensity without broadening is what partial occupancy of the outer sites gives. The synthetic particles show the opposite trend, a halo effect of the filtering, so they do not reproduce this.
The coordination term was chosen on 2026-10-12 to absorb that trend.
The numpy check used one real map (Pt_example, 476 atoms), with classes
planted as above and eight seeds per level:
- the 0.4 class was found on 8 of 8 seeds (recall 0.96, about 3 wrong labels);
- the 0.6 class was found on 5 of 8 (recall 0.72);
- no second class was called on the unplanted map or the noise control.
On the synthetic particles it changed no label. In SIMPLE it has so far passed only the synthetic tests. It has not run on the real maps.
What Miao's FePt data show (2026-10-14)¶
Peter sent the material of the FePt nanoparticle of Yang et al., Nature 542, 75 (2017), from Jianwei Miao's group (UCLA). The particle was imaged by atomic electron tomography (AET): a tilt series of annular dark-field STEM images, reconstructed with their GENFIRE algorithm. The folder holds:
- the raw tilt series: 68 projections of 300 × 300 pixels, from −65.6° to +64.0° about one axis;
- their MATLAB code for atom tracing, species classification and position refinement;
- the 29,325 traced peaks, each with its Gaussian fit and the 5 × 5 × 5 voxels around it;
- the initial classification (23,804 atoms) and the final model (23,196 atoms: 6,569 Fe and 16,627 Pt; 0.3725 Å per voxel);
- the reconstruction their classification used,
FePt_reconstruction_volume.mat(256³, downloaded from the group's FePt page on 2026-10-14).
The numbers below are measured on that volume, as their classification measures them. The voxels stored around each peak give the same numbers to within 0.1.
What they show:
- The same environment trend as our Pt maps. The intensity summed over the 3 × 3 × 3 voxels at each atom (a 1.1 Å cube) rises by 5.2% per neighbour, for Fe and for Pt alike. The fitted width stays almost flat; Fe is a little narrower at low coordination. This is a different microscope mode, in vacuum, with a different reconstruction method, so the trend is not specific to SINGLE or to the liquid cell.
- The contrast is like ours. Pt over Fe is 1.7 in those sums, and 2.1
in the per-species amplitudes of their refinement. For comparison, Pt over
Ni is 1.65 in our element kernels. The two classes overlap: their
separation
Dis 2.6 overall and 2.7 among fully coordinated atoms, so our gate ofD >= 3would reject the split. - The surface composition depends on how the environment is modelled. In their model, atoms with 8 or fewer neighbours are 65 to 68% Fe; those with 12 are 22% Fe. A plain two-class fit to the intensities gives 86% Fe at the surface. The same fit with our coordination term gives 20%, about the bulk value. Intensity alone does not decide between these. The environment effect itself is real in their data. Fe-labelled atoms with 4 neighbours are at 0.64 of bulk Fe, and Pt mislabelled as Fe would have raised that value, not lowered it.
- Their pipeline works as follows:
- Peaks are traced greedily. Each fitted Gaussian is subtracted before the next peak is found, which is our residual recovery applied to every atom.
- Species are assigned by iterating global 5 × 5 × 5 templates (L1 distance), starting from an intensity threshold. Labels are then edited by hand.
- A chemistry prior flags Fe atoms near the missing wedge.
- Positions are then refined against the projections, with one amplitude and one B per species and an interatomic potential as a restraint.
Their pipeline has no environment term and no occupancy term. Between the initial classification and the final model, 2.4% of the labels changed, 91% of them from Pt to Fe. The change rate was 5 to 10% among atoms with 5 to 11 neighbours, against 1% at 12. Later papers use k-means with local templates (class means within 10 Å). On this volume that leaves the surface at 87% Fe.
How their codes relate to ours, reconstruction included, is in
aet_codes_and_simple.md.
What this changes:
- A real two-species map exists. The FePt reconstruction can be the
first real two-species run of
detect_atoms, with their model as a reference. It is not ground truth, and the microscope mode differs. - Species calls at low coordination are model-dependent. They are to be reported as such. Settling them needs evidence other than map intensity: the projections, or the particle images.
- Real Pt/Ni data may be within reach. Jeong et al., Nat. Commun. 16, 8026 (2025), has AET tomograms of PtNi nanocatalysts. Peter Ercius (NCEM) is a co-author, so they are worth asking for.
Follow-up work¶
The single current work list is species discovery: open work. It owns the phase-9 acceptance criteria, promotion gates, smaller items and open questions formerly repeated here. The experiments and measurements elsewhere in this file retain their dates.
Lessons worth keeping¶
- Compare the synthetic input with a real map before blaming the code on a synthetic failure. Phase 5 stopped when the present detection found 3 of 285 atoms on a fixture, although it works on real maps. The fixture was the defect: its B factors, surface-to-core peak ratio and noise spectrum were off, and it lacked the negative wells between atoms.
- The contact-score pruning removes real densities on purpose. These are weak, poorly coordinated, high-B surface atoms. Discovery must not put them back, so recovered atoms are pruned against the present detection's atoms only.
- Don't add fitted machinery to fix a secondary output. Phase 6 did, and made the intensity ratios worse.
- Count the mixture fits before wrapping a search around them. Each
tight fit can run hundreds of iterations, and the first version of the
coordination term timed out
unit_single.
Where things are¶
- The maps:
/data/NanoX/zenodoon dell, read-only. It holds 66 pairs,mrcs/<name>.mrcandpdbs/<name>.pdb, at 0.358 Å, in boxes of 120, 160 and 200. The._*files are macOS debris. - One real map with its coordinates on the Mac:
~/agent_runs/runs/species_element_model/Pt_example/(476 atoms). Its_even/_oddmaps are not half reconstructions. - The numpy emulation and checks:
~/agent_runs/runs/species_validation/numpy_checks/: - the coordination-term checks,
real_fit.py,classfit.pyandfixture_check.py; - the mixture-fit cost model,
em_cost*.py; - the pipeline emulation,
emul_species_cases.py; - the FePt checks, in
fept/, with a reader for MATLAB.matfiles that needs only numpy. - The FePt data from Peter:
~/Downloads/TomoFromPeter, with the reconstruction volume added on 2026-10-14. The subfolderfor_simple/holds the volume as MRC and their models as PDB, in SIMPLE's coordinate frame. The denoised projections and the refined angles are still missing. They are on the Miao group's FePt page,physics.ucla.edu/research/imaging/FePt. The group's later code is on GitHub:AET-pAET/Supplementary-Data-Codes(the full pipeline, with a three-element amorphous particle) andAET-MetallicGlass/Supplementary- Data-Codes(eight elements classified into three types). - The run specs are under
~/agent_runs/runs/: single_species_proto: phases 0 to 3;species_element_model: phases 4 to 6, withrulings.md;species_validation: the first validation, which found the mask bug;species_validation_r2: phases 7 and 8;species_validation_coord: phase 9, not yet run.