[Tutor] Why Doesn't the for loop Increment?

Stephen P. Molnar s.molnar at sbcglobal.net
Tue Jan 12 15:30:52 EST 2021



On 01/12/2021 02:57 PM, Mats Wichmann wrote:
> On 1/12/21 12:32 PM, Stephen P. Molnar wrote:
>> Python3.7.3 on Debian Buster.
>>
>> I have a large number of computational docking files from which I 
>> wish to extract results.
>>
>> I have cobbled together a script that works, up to a point:
>>
>> #!/usr/bin/env python3
>> # -*- coding: utf-8 -*-
>> import pandas as pd
>> import numpy as np
>>
>> df = pd.read_csv('ligands_3')
>> num = [1,2,3,4,5,6,7,8,9,10]
>>
>> for ligand in df:
> ..
>> For each ligand I run ten repetitions of the docking. The ligands_3 
>> file contains three ligand names:
>>
>> 7-Phloroeckol
>> Aloeemodin
>> beta-Sitosterol
> ..
>> The problem, though, is that the script does not go on to the next 
>> ligand in the list. Everything that I have found in Google results 
>> says that the script will iterate through the list.
>>
>> What have I done or not done?
>
> you're reading as a csv and trying to create a dataframe. are you 
> getting what you expect?

Yes. I get exactly what I was expecting.

See below.
>
> print out what df is before you start using it.
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>

=======================================================================
GWOVina version 1.0
Michael K. M. Wong & Shirley W. I. Siu

Computational Biology and Bioinformatics Lab
University of Macau

Visit http://cbbio.cis.umac.mo for more information.

GWOVina was developed based on the framework of AutoDock Vina.

For more information about Vina, please visit http://vina.scripps.edu.

=======================================================================

WARNING: The search space volume > 27000 Angstrom^3 (See FAQ)
Detected 8 CPUs
Reading input ... done.
Setting up the scoring function ... done.
Analyzing the binding site ... done.
Using random seed: -1915785459
Performing search ... done.

Refining results ... done.

mode |   affinity | dist from best mode
      | (kcal/mol) | rmsd l.b.| rmsd u.b.
-----+------------+----------+----------
    1    -9.248153586      0.000      0.000
    2    -8.770186166      4.382     11.138
    3    -8.711215213      2.155      9.423
    4    -8.693086289      5.334     11.567
    5    -8.669326608      4.935     11.596
    6    -8.438957983      4.145     10.894
    7    -8.224671047      2.364      8.799
    8    -8.202856331      4.968      9.419
    9    -8.198276007      2.291      8.099
Writing output ... done.

-- 
Stephen P. Molnar, Ph.D.
www.molecular-modeling.net
614.312.7528 (c)
Skype:  smolnar1



More information about the Tutor mailing list