Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    jmintser
    @jmintser
    Great, thank you! Didn't realize I could get it from a frame.
    Moyassar Meshhal
    @mmeshhal
    Hey there, I'm a new user of chemfiles/cfiles and I have some questions:
    in the hbonds analysis using cfiles:
    1. if the trajectory is in xyz format but the system is periodic, so if I used the cell argument, will it make any difference?
    2. if yes, does it wrap the atoms within the cell?
    Guillaume Fraux
    @Luthaf
    Hey! If you are using the cell option to cfiles, that makes it so the system is considered periodic, and compute distances accordingly. If you don't use it, atoms on opposite sides of the cell will not see each other.
    However, using the option do not modify the structure and change the positions of the atoms (i.e. wrap them). It just changes the way distances are computed
    jmintser
    @jmintser
    Hi I'm analyzing a trajectory that includes ~ 35000 water atoms. I'd like to select and remove them from a frame before doing further analysis, using code essentially like in the examples (C++ Tutorials). This works perfectly for any other residue I select, but for waters, most of them get removed, but not all. About 32750 get removed, so my hunch is there's some limit somewhere? Feels close to max(short int). Does this kind of behavior ring any bells? Any additional selections on the remaining atoms results in "/usr/include/chemfiles/external/optional.hpp:685: std::experimental::optional<T&>::operator->() const [with T = const chemfiles::Residue]::<lambda()>: Assertion `false && "ref"' failed." Thanks much for any helpful hints
    Guillaume Fraux
    @Luthaf

    If the failed assertion comes from chemfiles, that's a bug on our side! What is the selection you are using? It sounds like you are checking a residue property/residue name.

    so my hunch is there's some limit somewhere?

    The limit should be max size_t, i.e. 4294967295 for 32-bit systems & 18446744073709551615 on 64-bits

    Yassine Naimi
    @ynaimi
    Hi all, I am working on optimizing the guess_bonds function and I had a question on multithreading. Does chemfiles offer or use an API for running and managing multithreaded tasks?
    Thank you in advance for any information/help.
    Guillaume Fraux
    @Luthaf
    No, everything is single threaded currently. I can see two main contenders for multi-threading: OpenMP and std::thread. You may want to open an issue to discuss this since there are a lot of design implication to adding multithreading =)
    For example: how can we guarantee that threading is supported with all compilers (including MSVC), and if we can not how to ensure the code can still run single-threaded; which parallelisation strategy (tasks, split the input data in chunks, work stealing, ...) is the best one in this case; how can we ensure the abscence of data races (maybe add thread sanitizer in CI?); and a few others
    Yassine Naimi
    @ynaimi
    For sure, it is a big change and this should be discussed carefully in order to choose the best option and the best design for the library as it will impact everything else. Maybe a good start would be the use of the mulithreading API in VMD (under BSD-3 license) as it is cross-platform and seems to offer the possibility to run single-threaded codes as well.
    Guillaume Fraux
    @Luthaf
    I would be a bit worried of importing code from VMD, since it is not the cleanest and easiest code to use. I don't know what the threading API they have looks like, but I've had bad experiences with the plugins. Also, VMD codebase is not under the BSD license, the plugins are under the UIUC license which looks a lot like the BSD one. The core of the code is under a non standard open source license: https://www.ks.uiuc.edu/Research/vmd/current/LICENSE.html
    To get back at the problem at hand here, I think using a cell list for neighbors search in bond search would yield more gains for less pains that trying to use multithreading here. The current algorithm is O(N^2), a cell list would be O(N) (cf https://hoomd-blue.readthedocs.io/en/stable/nlist.html)
    Yassine Naimi
    @ynaimi
    The header is mentionning BSD-3 license but I understand your concerns about using VMD code.
    Yassine Naimi
    @ynaimi
    Actually, as they are doing both using a cell list algorithm and running it on multithreads I thought about having multithreading as well on chemfiles. But I understand that this is a complex implementation which will impact several aspects of the library's code. It should be discussed extensively before choosing an option. I will keep you updated about my version of the code with a cell list algorithm.
    Julian Mintseris
    @jmintser_gitlab
    Hi, I had chemfiles 0.9.3 installed with dnf on centos 8 working fine. Then I had to remove and re-install for various reasons and now I just realized that the newly installed chemfiles is version 0.10 and that appears to be the only version available via packages. Also, the website http://chemfiles.org/chemfiles/latest now appears to refer to version "0.11-dev". I'm not sure what this means. Code that was working before with 0.9 now fails with a segfault using 0.10 version. I can install 0.9.3 from source but just wanted to check what's happening. Thanks
    Guillaume Fraux
    @Luthaf
    Sorry about that, we are in the process of releasing 0.10, and we did not intend for it to reach users yet. I guess you are getting chemfiles as a pre-compiled binary here: http://chemfiles.org/chemfiles/latest/installation.html#pre-compiled-binaries ? I though that using a pre-release tag (0.10.0-rc1) meant that users would not get the update yet.
    You should be able to use dnf to get back to 0.9.3 with dnf downgrade chemfiles-0.9.3 and potentially the same for chemfiles-devel.
    Out of interest, and to prevent this from happening again, which language are you using chemfiles from? If it is C or C++, could you share the compiled binary with me, potentially in private? I would like for users to get a proper error when trying to use a different version of chemfiles instead of a segfault.
    Guillaume Fraux
    @Luthaf
    I tried to reset the linux builders to 0.9.3, let me know if you can get 0.9.3 back on your system!
    Julian Mintseris
    @jmintser_gitlab
    I'm trying to install with dnf. Here's what I get running dnf info chemfiles on CentOS 8:

    dnf info chemfiles
    Last metadata expiration check: 1 day, 1:07:05 ago on Mon 23 Nov 2020 11:31:44 AM EST.
    Available Packages
    Name : chemfiles
    Version : 0.10.0
    Release : 3.1
    Architecture : aarch64
    Size : 1.1 M
    Source : chemfiles-0.10.0-3.1.src.rpm
    Repository : home_Luthaf
    Summary : Modern library for chemistry file reading and writing
    URL : http://chemfiles.com/
    License : BSD
    Description :

    Name : chemfiles
    Version : 0.10.0
    Release : 3.1
    Architecture : src
    Size : 4.5 M
    Source : None
    Repository : home_Luthaf
    Summary : Modern library for chemistry file reading and writing
    URL : http://chemfiles.com/
    License : BSD
    Description :

    Name : chemfiles
    Version : 0.10.0
    Release : 3.1
    Architecture : x86_64
    Size : 1.3 M
    Source : chemfiles-0.10.0-3.1.src.rpm
    Repository : home_Luthaf
    Summary : Modern library for chemistry file reading and writing
    URL : http://chemfiles.com/
    License : BSD
    Description :

    Name : chemfiles
    Version : 0.9.3
    Release : 7.11
    Architecture : ppc64le
    Size : 1.2 M
    Source : chemfiles-0.9.3-7.11.src.rpm
    Repository : home_Luthaf
    Summary : Modern library for chemistry file reading and writing
    URL : http://chemfiles.com/
    License : BSD
    Description :

    Julian Mintseris
    @jmintser_gitlab
    0.9.3 appears only available for ppc64
    Guillaume Fraux
    @Luthaf
    Can you update repository metadata in any way? Here it tells me that the most recent version should be 0.9.3: https://build.opensuse.org/package/binaries/home:Luthaf/chemfiles/CentOS_8
    Or maybe uninstall 0.10 first?
    Julian Mintseris
    @jmintser_gitlab
    yes, removed the repo, then added it back again and now it looks good. Thanks!
    Guillaume Fraux
    @Luthaf
    Ok, that's good! I'm still interested in trying to improve from a segfault to a well defined error message the next time someone does this kind of update! Is sharing your binarry with me a possibility?
    Julian Mintseris
    @jmintser_gitlab
    Yeah, sorry, I accidentally overwrote that executable after fixing the installation. But, it was segfaulting while just reading in a topology, not doing anything fancy
    jmintser
    @jmintser
    Hi, just wondering if there's a way to remove atoms from residue membership? Or just remove whole residues (leaving the atoms) I'm thinking of re-assigning some residues, for example defining main-chain and side-chain atoms as separate custom residues. Thanks much
    Guillaume Fraux
    @Luthaf
    There is no way currently to remove atoms from a residue, or to remove residues from a topology. The best way to do this right now is to create a new topology with the same atoms, and then add back residues as you want them.
    That's one point I'd like to improve on chemfiles core before the 1.0 release. The structure proposed at the end of this post (https://khinsen.wordpress.com/2013/04/10/lessons-from-sixteen-years-of-molecular-simulation-in-python/) with AtomGroups looks interesting.
    Guillaume Fraux
    @Luthaf
    Hi everyone @/all :wave: ! The version 0.10 of chemfiles have just been finalized, and is now available in all package managers. See https://github.com/chemfiles/chemfiles/releases/tag/0.10.0 or the changelog for more details on what changed!
    @jmintser_gitlab just a heads up, I could not find a way to provide both 0.9.3 and 0.10 on build.opensuse.org, so the repo will only contain the 0.10 version. If you want to stay on 0.9.3 for a while, you'll have to build it from sources. Sorry about the inconvenience!
    Leandro Martínez
    @lmiq
    Hello. Simple question here: I am about to submit an article in which I describe a software that uses Chemfiles, in particular with the Julia interface. How would you like it to be cited? (I could not find the recommended citation in the site)
    Guillaume Fraux
    @Luthaf
    There is no published article for chemfiles yet, so the best next thing to cite would be the zenodo DOI: https://zenodo.org/record/4540492
    Zenodo also allows you to cite a specific version if that makes sense in your case!
    ShoubhikRaj
    @ShoubhikRaj
    I have come across a peculiar issue in chemfiles, and I just want to make sure that I am not missing something before submitting an issue. The coordinates returned by Frame.positions() are in Angstroms, is that correct?
    When I calculate the distance between two atoms with Frame.distance(), it does not match the one calculated manually by vector subtraction of the coordinates of the two atoms.
    I am running this code:
    chemfiles::Trajectory trj("testfile.dcd");
    auto testframe=trj.read();
    cout << "Distance between oxygen " << 1 << " and " << 5 << "is" << testframe.distance(1,5) << "\n";
    
    auto position = testframe.positions();
    auto diff = position[5] - position[1];
    cout << "Distance from positions" << diff.norm() << "\n";
    I am getting vastly different values from both methods. If I use the distance() method then I get 0.18 Angstroms, but from vector subtraction, I get 9.56 Angstroms (which matches the one I get from VMD).
    ShoubhikRaj
    @ShoubhikRaj
    Is it possible that there is a bug in the distance() method of Frame ? My dcd file contains the data of a simulation which does not have periodic boundary conditions, so that there is no unit cell data inside the dcd file (or maybe there is some dummy unit cell data, I am not sure). Is there any way to turn off the PBC in chemfiles?
    Guillaume Fraux
    @Luthaf

    The coordinates returned by Frame.positions() are in Angstroms, is that correct?

    yes, that's the idea. We need to improve the doc on this front.

    I am getting vastly different values from both methods. If I use the distance() method then I get 0.18 Angstroms, but from vector subtraction, I get 9.56 Angstroms (which matches the one I get from VMD).

    Frame::distance uses periodic boundary condition, and you can check the distances being used by looking at frame.cell().lengths() and frame.cell().angles(). If you want to remove all periodic boundary conditions, you need to use an infinite cell, which you can set with frame.set_cell(UnitCell())

    ShoubhikRaj
    @ShoubhikRaj
    @Luthaf Thank you. I found that the unit cell lengths were set to 1 Angstroms and the angles were set to 90 degrees each. I am not sure why those values would be set, because the DCD file I was using should not have any unit cell values. Besides, the chemfiles documentation mentions that the unit cell information is not read from DCD file anyways. So, this setting of default value seems like a possible bug in the code?
    Guillaume Fraux
    @Luthaf
    Very possible. There is a convention of setting a unit cell with 1A and 90° angles in biological formats when the unit cell information is missing, and we might not be handling this the right way. It is worth opening an issue, if possible sharing the DCD file you use as well!
    ShoubhikRaj
    @ShoubhikRaj
    @Luthaf Sorry, I found out that the unit cell length is set to 1 Angstrom and Angles to 90 degrees in the DCD file itself, by reading it with VMD. However, I am still not sure if chemfiles is reading those from DCD or setting those by default.
    I will still open an issue.
    Nico Dacquay
    @ndacquay_gitlab
    Hello,
    I'm working on a software that use Chemfiles to read and write molecule files.
    I have an issue with the .mmcif parser, and more especially with the pdbx_struct_oper_list attribute that doesn't seems to be read.
    For example with 6NCL (PDB id) in mmtf format, Chemfiles is able to read the assembly data and duplicate the structure with the right transformations.
    But in .mmcif, the assembly parameters are not read (or not applied).
    Do I forgot a special action to apply these parameters ?
    Thank you for your reply.
    Guillaume Fraux
    @Luthaf
    Hi @ndacquay_gitlab! Yay, I've been talking with S.G. on the VTX team (I guess you are working on that software?) about this, and chemfiles is currently not reading this attribute. I'll open an issue about it and try to give it a look when I find time!
    To fully understand what's going on, the code should read all entries in pdbx_struct_oper_list, and then apply them one by one, creating new atoms for each transformation, right?
    Please add any info/question on this here: chemfiles/chemfiles#427 !