Python Forum
Problem Passing Arguement to do loop
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem Passing Arguement to do loop
#1
I am running Debian Stretch on my main platform. I have a Computational Chemistry problem in which I have to run a number of python scripts. How do I pass the argument to a do loop?

I have a total of 32 ligands of the form name.mol2 that I want to dock to a number of protein molecules. The ligand is in a space separated ASCII file.

The computations will involve 17 different python scripts.

Here is my code:
!/bin/sh

for nvar in ligands do
/pythonsh ./prepare_ligand4.py -l $nvar.mol2 -o $nvar.pbdqt
done

When I run the code I get:

~/Apps/Modeling/VSTutorial/VirtualScreening/Ligands$ ./Run.pbdqt.sh setting PYTHONHOME environment the file ligands.mol2 doesn't contain any mol2 records The file ligands.mol2 doesn't have Atom records, molecules can't be built Traceback (most recent call last): File "./prepare_ligand4.py", line 152, in mol = mols[0] File "/sdc1/Apps/MGLTools-1.5.6rc3/lib/python2.5/UserList.py", line 28, in getitem def getitem(self, i): return self.data[i] IndexError: list index out of range

I know that the argument is not being passed, but have googled, but can't find any solution.

Assistance will be much appreciated.

Thanks in advance.

Stephen P. Molnar, Ph.D. Life is a fuzzy set
www.molecular-modeling.net Stochastic and multivariate
(614)312-7528©
Skype: smolnar1
Reply


Messages In This Thread
Problem Passing Arguement to do loop - by stephenmolnar - May-08-2019, 02:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  While Loop Problem Benno2805 1 596 Sep-06-2023, 04:51 PM
Last Post: deanhystad
  Loop reading csv file problem faustineaiden 1 1,589 Dec-11-2021, 08:40 AM
Last Post: ibreeden
  Infinite loop problem Zirconyl 5 3,030 Nov-16-2020, 09:06 AM
Last Post: DeaD_EyE
  Dataframe mean calculation problem: do we have to loop? sparkt 1 2,194 Aug-28-2020, 02:41 PM
Last Post: sparkt
  Python loop problem Kristenl2784 11 5,140 Jun-18-2020, 07:22 PM
Last Post: buran
  Problem with append list in loop michaelko03 0 1,704 Feb-16-2020, 07:04 PM
Last Post: michaelko03
  problem with for loop using integers python_germ 5 3,044 Aug-31-2019, 11:42 AM
Last Post: jefsummers
  problem in loop roseojha 3 2,322 Aug-26-2019, 09:03 AM
Last Post: perfringo
  Nested while loop problem + turtle DreamingInsanity 3 3,010 Jul-06-2019, 02:01 PM
Last Post: DreamingInsanity
  Nested for loop strange problem mcva 2 2,648 Mar-16-2019, 12:53 PM
Last Post: mcva

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020