The current implementation of estimate_n_atoms_linear is extremely naive, assuming that all middle monomer groups defined in a MonomerGroup are expressed equally and all terminal monomers are present. This is only correct for homopolymers/alternating copolymers AND in cases where extraneous terminal groups (i.e. more than the 2 possible for a linear chain) have not been included in the MonomerGroup.
Fixing and updating this is low priority, as it is only used internally in one place polymers.building.build_linear_polymer(), where it has no effect on the correctness of the final built polymer and only serves to provide a pre-build estimate of chain size for logging purposes prior to the build process of indeterminate duration. A "proper" fix would involve incorporating monomer sequence information (which build_linear_polymer does have access to) into the chain length calculation.
The current implementation of estimate_n_atoms_linear is extremely naive, assuming that all middle monomer groups defined in a MonomerGroup are expressed equally and all terminal monomers are present. This is only correct for homopolymers/alternating copolymers AND in cases where extraneous terminal groups (i.e. more than the 2 possible for a linear chain) have not been included in the MonomerGroup.
Fixing and updating this is low priority, as it is only used internally in one place polymers.building.build_linear_polymer(), where it has no effect on the correctness of the final built polymer and only serves to provide a pre-build estimate of chain size for logging purposes prior to the build process of indeterminate duration. A "proper" fix would involve incorporating monomer sequence information (which build_linear_polymer does have access to) into the chain length calculation.