
     iX                         d Z ddlZddlmZ ddlmZmZ ddlm	Z	 ddl
mZmZmZmZmZmZmZmZmZmZmZmZmZmZ  G d	 d
e          ZdS )a|  
PDBQT topology parser
=====================

Use a PDBQT_ file to build a minimum internal structure representation (list of
atoms), including AutoDock_ atom types (stored as :attr:`Atom.type`) and
partial charges (:attr:`Atom.charge`).

* Reads a PDBQT file line by line and does not require sequential atom numbering.
* Multi-model PDBQT files are not supported.

.. note::

    By default, masses will be guessed on Universe creation.
    This may change in release 3.0.
    See :ref:`Guessers` for more information.

Notes
-----
Only reads atoms and their names; connectivity is not
deduced.


See Also
--------
:class:`MDAnalysis.coordinates.PDBQT`


Classes
-------
.. autoclass:: PDBQTParser
   :members:
   :inherited-members:


.. _PDBQT:
   https://autodock.scripps.edu/wp-content/uploads/sites/56/2021/10/AutoDock4.2.6_UserGuide.pdf 
.. _AutoDock:
   http://autodock.scripps.edu/
    N   )util   )TopologyReaderBasechange_squash)Topology)Atomids	AtomnamesAltLocs	AtomtypesChargesICodesOccupanciesRecordTypesResidsResnumsResnamesSegidsChainIDsTempfactorsc                       e Zd ZdZdZd ZdS )PDBQTParseraC  Read topology from a PDBQT file.

    Creates the following Attributes:
     - atom ids (serial)
     - atom types
     - atom names
     - altLocs
     - resnames
     - chainIDs (assigned to segid as well)
     - resids
     - record_types (ATOM/HETATM)
     - icodes
     - occupancies
     - tempfactors
     - charges


    .. versionchanged:: 0.18.0
       Added parsing of Record types
    .. versionchanged:: 2.7.0
       Columns 67 - 70 in ATOM records, corresponding to the field *footnote*,
       are now ignored. See Autodock's `reference`_.
    .. versionchanged:: 2.8.0
        Removed mass guessing (attributes guessing takes place now
        through universe.guess_TopologyAttrs() API).

       .. _reference:
          https://autodock.scripps.edu/wp-content/uploads/sites/56/2021/10/AutoDock4.2.6_UserGuide.pdf
    PDBQTc           
      @
   g }g }g }g }g }g }g }g }	g }
g }g }g }t          j        | j                  5 }|D ]H}|                                }|                    d          s-|                    |dd                                                    |                    t          |dd                              |                    |dd                                                    |                    |dd                                                    |                    |dd                                                    |                    |dd	                                                    |                    t          |d	d
                              |	                    |d
d                                                    |
                    t          |dd                              |                    t          |dd                              |                    t          |dd                              |                    |dd                                                    J	 ddd           n# 1 swxY w Y   t          |          }g }|t          t          f|t          t          j        f|t          t          f|t          t          f|
t           t          j        f|t$          t          j        f|t&          t          j        f|t(          t          ffD ]8\  }}}|                     |t          j        ||                               9t          j        |t          j                  }t          j        |	t                    }	t          j        |t                    }t          j        |t                    }|                    t-          |                     t/          ||	f||	||f          \  }\  }}	}}t          |          }|                    t1          |                     |                    t3          |                                                     |                    t7          |	                     |                    t9          |                     t/          |f|f          \  }\  }t          |          }|                    t;          |                     t=          ||||||          }|S )zParse atom information from PDBQT file *filename*.

        Returns
        -------
        MDAnalysis Topology object
        )ATOMHETATMN                           6   <   B   F   L   M   P   )dtype)attrsatom_resindexresidue_segindex)r   openanyfilenamestrip
startswithappendintfloatlenr   objectr	   npint32r
   r   r   float32r   r   r   arrayr   r   r   r   copyr   r   r   r   )selfkwargsrecord_typesserialsnamesaltlocsresnameschainidsresidsicodesoccupanciestempfactorscharges	atomtypesflinen_atomsr.   attrlistAttrr-   residx
n_residuessegidxsegids
n_segmentstops                              i/srv/www/vhosts/g4struct/public_html/venv/lib/python3.11/site-packages/MDAnalysis/topology/PDBQTParser.pyparsezPDBQTParser.parsex   s    	\$-(( 	6A 6 6zz||'9:: ##D!HNN$4$4555s4":///T"R%[..00111tBrE{0022333RU 1 1 3 3444RU 1 1 3 3444c$r"u+..///d2b5k//11222""5be#5#5666""5be#5#5666uT"R%[11222  be!2!2!4!455556	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6$ g,,;/grx(Iv&gv&+rz2+rz2grz*	6*	&
 
	@ 
	@!HdE LLbhxu===>>????&111&///8HF3338HF333Xh''(((7DVvvxB8
 8
448 [[
VF^^$$$WV[[]]++,,,VF^^$$$Xh''((()8+{CC	[[
VF^^$$$ #
 
 
 
s   IJJJN)__name__
__module____qualname____doc__formatrY        rX   r   r   W   s9         < FR R R R Rr`   r   )r]   numpyr:   libr   baser   r   core.topologyr   core.topologyattrsr	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r_   r`   rX   <module>rf      s9  0' 'P           3 3 3 3 3 3 3 3 $ $ $ $ $ $                               $s s s s s$ s s s s sr`   