December 22, 2024, 08:15:01 PM
Forum Rules: Read This Before Posting


Topic: Opening several molecules in PyMol  (Read 16110 times)

0 Members and 1 Guest are viewing this topic.

Offline FeLiXe

  • Theoretical Biochemist
  • Chemist
  • Full Member
  • *
  • Posts: 462
  • Mole Snacks: +34/-7
  • Gender: Male
  • Excited?
    • Chemical Quantum Images
Opening several molecules in PyMol
« on: July 30, 2007, 03:59:23 PM »
Hi!

I am looking for a quick way to open several molecules in PyMol without having to open all of them separately. Does someone know how to do that? Best would be to open them from the command line but I think this only works for one molecule ('pymol molecule.ext')

thanks

(I don't know where a chemical software question goes. but this is the closest I could think of)
Math and alcohol don't mix, so... please, don't drink and derive!

Offline sjb

  • Global Moderator
  • Sr. Member
  • ***
  • Posts: 3653
  • Mole Snacks: +222/-42
  • Gender: Male
Re: Opening several molecules in PyMol
« Reply #1 on: July 31, 2007, 12:07:00 PM »
I'm not totally sure (thought I saw a magazine article the other day, it's now disappeared into the pile by the desk - will have a look later, but I think something like xargs is possibly the way to go (http://unixhelp.ed.ac.uk/CGI/man-cgi?xargs)

S

Offline sjb

  • Global Moderator
  • Sr. Member
  • ***
  • Posts: 3653
  • Mole Snacks: +222/-42
  • Gender: Male
Re: Opening several molecules in PyMol
« Reply #2 on: July 31, 2007, 01:23:47 PM »
I'm not totally sure (thought I saw a magazine article the other day, it's now disappeared into the pile by the desk - will have a look later, but I think something like xargs is possibly the way to go (http://unixhelp.ed.ac.uk/CGI/man-cgi?xargs)

S

OK, have now found the article - try file1.ext file2.ext (etc) xargs pymol . Or even something like ls *.ext | xargs pymol which (I think will open all files with *.ext in pymol)

Offline FeLiXe

  • Theoretical Biochemist
  • Chemist
  • Full Member
  • *
  • Posts: 462
  • Mole Snacks: +34/-7
  • Gender: Male
  • Excited?
    • Chemical Quantum Images
Re: Opening several molecules in PyMol
« Reply #3 on: July 31, 2007, 02:41:17 PM »
pretty cool, thanks
I'll try that out tomorrow
Math and alcohol don't mix, so... please, don't drink and derive!

Offline Yggdrasil

  • Retired Staff
  • Sr. Member
  • *
  • Posts: 3215
  • Mole Snacks: +485/-21
  • Gender: Male
  • Physical Biochemist
Re: Opening several molecules in PyMol
« Reply #4 on: July 31, 2007, 02:46:19 PM »
From a linux terminal, if all of the files are in the same dirrectory, you can type:

pymol *.pdb

(or whatever extension you're using)

and pymol will open up all of the files in your current dirrectory with the .pdb extension.

Offline sjb

  • Global Moderator
  • Sr. Member
  • ***
  • Posts: 3653
  • Mole Snacks: +222/-42
  • Gender: Male
Re: Opening several molecules in PyMol
« Reply #5 on: August 03, 2007, 04:48:07 AM »
pretty cool, thanks
I'll try that out tomorrow

Any luck? Yggdrasil's approach may be easier - don't have pymol here to test.

S

Offline FeLiXe

  • Theoretical Biochemist
  • Chemist
  • Full Member
  • *
  • Posts: 462
  • Mole Snacks: +34/-7
  • Gender: Male
  • Excited?
    • Chemical Quantum Images
Re: Opening several molecules in PyMol
« Reply #6 on: August 03, 2007, 05:33:56 PM »
What I finally did is that I wrote a .pymolrc into the folder. The advantage is that I can do some more things that way, like showing the cartoon or showing sticks.
I tried out "pymol *.pdb" and it did not work. I will try out your commands on monday when I am at work. it would be interesting to see how it works. It's just that I thought of the pymolrc before I read your posts
Math and alcohol don't mix, so... please, don't drink and derive!

Offline FeLiXe

  • Theoretical Biochemist
  • Chemist
  • Full Member
  • *
  • Posts: 462
  • Mole Snacks: +34/-7
  • Gender: Male
  • Excited?
    • Chemical Quantum Images
Re: Opening several molecules in PyMol
« Reply #7 on: August 06, 2007, 03:38:13 AM »
I think the problem is that pymol doesn't recognize that I am trying to enter multiple molecules. it thinks that I am entering one long name with spaces in between ls *.ext writes the "correct" string but pymol doesn't recognize it as several molecules
Math and alcohol don't mix, so... please, don't drink and derive!

Sponsored Links