Skip to content

Error: NoneType object has no attribute "used" #1423

Closed

Description

@HoaSoup

Hello,
I ran a simulation for a short peptide with OpenMM 8.2.0 using the following code:

modeller = app.Modeller(pdb_object.topology, pdb_object.positions)
force_field = openmm.app.ForceField(*force_fields)
modeller.addHydrogens(forcefield=force_field, pH=7)
modeller.addSolvent(force_field,
                                    padding = boxPadding*unit.nanometer,
                                    boxShape = "cube",
                                    ionicStrength = 0.15*unit.molar)
system = force_field.createSystem(modeller.topology,
                                          nonbondedMethod = PME,
                                          nonbondedCutoff = 1.2*ou.nanometer,
                                          constraints = HBonds)
   
restraint = openmm.CustomExternalForce('k*periodicdistance(x, y, z, x0, y0, z0)^2')
system.addForce(restraint)
restraint.addGlobalParameter('k', restraint_const*openmm.unit.kilojoules_per_mole/openmm.unit.nanometer**2)
restraint.addPerParticleParameter('x0')
restraint.addPerParticleParameter('y0')
restraint.addPerParticleParameter('z0')
...
topology_file = parmed.openmm.load_topology(modeller.topology, system)
for ff in force_fields:
             if "amber" in ff:
                 topology_file.save(f"{output_dir}/topology.prmtop")
             if "charmm" in ff:
                 topology_file.save(f"{output_dir}/topology.psf")

I then encountered this error: NoneType object has no attribute "used". It was unclear which object returned this error.
I then took a look at the topology_file.bonds.type. Every bond return type = None.
I am relatively new to ParmED. Please help me troubleshoot this error.

I have uploaded the file related to the pdb_object here.
Thank you,
Hoa

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions