Comments (8)
This error occurs in both the 2022 and 2023 versions.
from biosimspace.
I've not had a chance to test, but assume the error is occurring since the objects have the same MolNum
. To get a unique number, you could create a copy of one, e.g.
print(morph + pro.copy())
I guess the issue here is that MolNum
identifiers are unique to a Sire session, so there can be a clash if you pickle/unpickle and object. I think we will need to implement a copy of unpickling, or similar, although this could lead to other issues.
from biosimspace.
Hi @lohedges , many thanks for your quick reply!
I've tried using the .copy()
function, but the MolNum
remains unchanged.
from biosimspace.
Ah, I think it only works with the .copy
done at the Molecule
level, not at the System
. Try extracting the molecules and doing a copy of one before recombining to make a new system.
from biosimspace.
Thanks, pro[0].copy()
works! 🎉 🎉
from biosimspace.
Great. I'll update the System
copy method to copy each of the molecules in it, then recombine them.
from biosimspace.
Just a quick update on this, since we might need to have a rethink on how we constrain and compare molecules in BioSimSpace. In Sire, there is the concept of a molecule number and version. This means you can have different versions of the same molecule number, i.e. if you edit it. The combined version and number is guaranteed to be unique.
For BioSimSpace, I have needed to place some additional restrictions on molecule (and residue and atom) numbering within a System due to the requirements of SOMD, i.e. it assumes unique and ascending numbering, even though this isn't a requirement of SIre itself. For example, SOMD completely re-orders the atoms in a system on load, so we need to use some unique identifiers, e.g. atom number, to re-map updated coordinates from a trajectory file.
For the above, doing a .copy()
doesn't really make sense in terms of the behaviour of Sire, so we are thinking of changing this to .renumber()
. We had discussed implicitly doing this on unpickling, but this could cause other issues, e.g. if you wanted to unpickle a System and Molecule, then check that the Molecule was in the System.
When we eventually re-write SOMD I will make sure that it is designed in a way that doesn't require invalid assumptions about a Sire system. This will hopefully avoid issues like this.
Just to note that we realised that your issue could also be resolved by changing the order of the read and pickle in your second script, i.e. if you unpickle first, then load the perturbable system, i.e.:
import pickle
import BioSimSpace as BSS
with open('pro.pkl', 'rb') as f:
pro = pickle.load(f)
morph = BSS.IO.readPerturbableSystem('morph0.prm7', 'morph0.rst7', 'morph1.prm7', 'morph1.rst7')
print(morph + pro)
This is because the molecule in morph is correctly assigned a unique number on read.
from biosimspace.
Thank @lohedges for the detailed information 🤗
Just to note that we realised that your issue could also be resolved by changing the order of the read and pickle in your second script, i.e. if you unpickle first, then load the perturbable system, i.e.:
Thanks! that's good to know.
from biosimspace.
Related Issues (20)
- Storage quota exceeded on the Anaconda cloud HOT 1
- HILLS file not updating during restarting simulation HOT 4
- Is it possible to add ions to an already solvated system, without adding any more water molecules? HOT 4
- Problem when converting Gro/Top to Rst7 HOT 12
- Making HMR work with dummies HOT 11
- Make _removeDummies() recognise dummy bonds HOT 10
- Would it be possible to include HiMap as an alternative to LoMap in the generateNetwork method? HOT 2
- Unable to import BioSimSpace after mamba installation HOT 12
- BioSimSpace.Align.viewMapping: py3Dmol.view not rendering in Jupyter Notebook HOT 11
- `_toRegularMolecule` failing with `convert_amber_dummies=True` HOT 15
- Absolute Binding Free Energy Calculations with GROMACS HOT 7
- Pickling a parametrised molecule from an SDF file with GAFF2 HOT 4
- Are atomtypes meant to be updated when using repartitionHydrogenMass? HOT 16
- [BUG] OSError "It looks like you failed to include a topology file." when reading SDF which doesn't contain redundant bond order information HOT 10
- [BUG] Cannot import BioSimSpace after installation of biosimspace 2023.1.2 using mamba HOT 3
- AnalysisError: SOMD free-energy analysis failed! HOT 5
- [BUG] HOT 10
- Reporting a vulnerability
- [BUG] Water molecule coordinates are setting to (0,0,0) HOT 4
- Issue in reproducing the funnel methadynamics tutorial HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from biosimspace.