Giter Site home page Giter Site logo

Comments (6)

JoaoRodrigues avatar JoaoRodrigues commented on June 1, 2024

I'm not sure that is a "bug" on our end, and I'm not even sure of how to catch it. We don't know that we are writing to a file, we're writing to stdout and that's being redirected to a file. That's outside of Python's control and therefore pdb-tools. See: https://unix.stackexchange.com/questions/257110/exclude-target-redirection-file-from-being-processed-in-for-loop

I'm afraid that short of adding an output flag (which none of the other tools has), the only option is for the user to write the ensemble to a different folder, or be more specific with the glob: pdb_mkensemble model*.pdb > ensemble.pdb. Ultimately, we could add a check to only write files that have content, but that can hide a bunch of errors.

from pdb-tools.

amjjbonvin avatar amjjbonvin commented on June 1, 2024

Ok - but then why does pdb_merge does not show the same behaviour then?
Or may-be it does but since the file is non-existing (or empty) you don't see it in the resulting pdb file.

And I was not suggesting to add an output flag.

We leave it as is then, but this can give strange behaviours and lead to errors with other software using those ensembles.

from pdb-tools.

joaomcteixeira avatar joaomcteixeira commented on June 1, 2024

When I first read this thread, I had the same opinion as João. But looking to your explanations and the code in more detail, it seems to be a bug. Give me some minutes, and I will come back with more.

edited: see next comment

from pdb-tools.

joaomcteixeira avatar joaomcteixeira commented on June 1, 2024

Hi @amjjbonvin

I can't reproduce that behaviour. It works well in my case. For example:

pdb_fecth 2fej > 2fej.pdb
pdb_splitmodel 2fej.pdb
rm 2fej.pdb
pdb_mkensemble *.pdb > test.pdb

And the test.pdb is clean.

Check if you are running on the latest version:

$ pip show pdb-tools
Name: pdb-tools
Version: 2.5.0

In similar cases, I use a tmp file to bypass the output, for example:

pdb_mkensemble *.pdb > tmp && mv tmp test.pdb

Cheers,

from pdb-tools.

amjjbonvin avatar amjjbonvin commented on June 1, 2024

Ok - must be a strange behaviour on my Mac then.

If running under tcsh (I know, it's dinosaur stuff...) I get the weird behaviour. When running under bash it works fine... In both cases the same Python3 ((3.7.2) from the system are called.

from pdb-tools.

joaomcteixeira avatar joaomcteixeira commented on June 1, 2024

Okay. So it's precisely as João said at first, it's a problem how the tcsh pass the arguments to the python sys.args. In bash the args are block to the > but likely in tcsh the whole command line is sent. If you see this can be a real issue because tcsh is used often in servers where pdb-tools may run, we can make a checkpoint in the python part. But that will bring a non-negligible burden to the code.

from pdb-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.