Answers.Body: <p>I got for <code>CC(C)C</code></p>
  <p>this <code>.prmtop</code> :</p>
  <pre><code>%VERSION  VERSION_STAMP = V0001.000  DATE = 09/07/24  17:39:38                  
  %FLAG TITLE                                                                     
  %FORMAT(20a4)                                                                   
  output.pdb                                                                      
  %FLAG POINTERS                                                                  
  %FORMAT(10I8)                                                                   
        14       2      10       3      21       3      27       0       0       0
        66       1       3       3       0       2       3       2       2       0
         0       0       0       0       0       0       0       0      14       0
         0
  %FLAG ATOM_NAME                                                                 
  %FORMAT(20a4)                                                                   
  C1  C2  C3  C4  H1  H2  H3  H4  H5  H6  H7  H8  H9  H10 
  %FLAG CHARGE                                                                    
  %FORMAT(5E16.8)                                                                 
   -1.62360693E+00 -1.27009431E+00 -1.62360693E+00 -1.62360693E+00  6.01937236E-01
    6.01937236E-01  6.01937236E-01  8.14536810E-01  6.01937236E-01  6.01937236E-01
    6.01937236E-01  6.01937236E-01  6.01937236E-01  6.01937236E-01
  %FLAG ATOMIC_NUMBER                                                             
  %FORMAT(10I8)                                                                   
         6       6       6       6       1       1       1       1       1       1
         1       1       1       1
  %FLAG MASS                                                                      
  %FORMAT(5E16.8)                                                                 
    1.20100000E+01  1.20100000E+01  1.20100000E+01  1.20100000E+01  1.00800000E+00
    1.00800000E+00  1.00800000E+00  1.00800000E+00  1.00800000E+00  1.00800000E+00
    1.00800000E+00  1.00800000E+00  1.00800000E+00  1.00800000E+00
  %FLAG ATOM_TYPE_INDEX                                                           
  %FORMAT(10I8)                                                                   
         1       1       1       1       2       2       2       2       2       2
         2       2       2       2
  %FLAG NUMBER_EXCLUDED_ATOMS                                                     
  %FORMAT(10I8)                                                                   
        13      12      11      10       3       2       1       6       2       1
         1       2       1       1
  %FLAG NONBONDED_PARM_INDEX                                                      
  %FORMAT(10I8)                                                                   
         1       2       2       3
  %FLAG RESIDUE_LABEL                                                             
  %FORMAT(20a4)                                                                   
  UNL 
  %FLAG RESIDUE_POINTER                                                           
  %FORMAT(10I8)                                                                   
         1
  %FLAG BOND_FORCE_CONSTANT                                                       
  %FORMAT(5E16.8)                                                                 
    3.00900000E+02  3.30600000E+02
  %FLAG BOND_EQUIL_VALUE                                                          
  %FORMAT(5E16.8)                                                                 
    1.53750000E+00  1.09690000E+00
  %FLAG ANGLE_FORCE_CONSTANT                                                      
  %FORMAT(5E16.8)                                                                 
    6.29000000E+01  4.63000000E+01  3.94000000E+01
  %FLAG ANGLE_EQUIL_VALUE                                                         
  %FORMAT(5E16.8)                                                                 
    1.94621748E+00  1.91637234E+00  1.87762601E+00
  %FLAG DIHEDRAL_FORCE_CONSTANT                                                   
  %FORMAT(5E16.8)                                                                 
    1.60000000E-01  1.50000000E-01
  %FLAG DIHEDRAL_PERIODICITY                                                      
  %FORMAT(5E16.8)                                                                 
    3.00000000E+00  3.00000000E+00
  %FLAG DIHEDRAL_PHASE                                                            
  %FORMAT(5E16.8)                                                                 
    0.00000000E+00  0.00000000E+00
  %FLAG SCEE_SCALE_FACTOR                                                         
  %FORMAT(5E16.8)                                                                 
    1.20000000E+00  1.20000000E+00
  %FLAG SCNB_SCALE_FACTOR                                                         
  %FORMAT(5E16.8)                                                                 
    2.00000000E+00  2.00000000E+00
  %FLAG SOLTY                                                                     
  %FORMAT(5E16.8)                                                                 
    0.00000000E+00  0.00000000E+00
  %FLAG LENNARD_JONES_ACOEF                                                       
  %FORMAT(5E16.8)                                                                 
    1.04308023E+06  9.71708117E+04  7.51607703E+03
  %FLAG LENNARD_JONES_BCOEF                                                       
  %FORMAT(5E16.8)                                                                 
    6.75612247E+02  1.26919150E+02  2.17257828E+01
  %FLAG BONDS_INC_HYDROGEN                                                        
  %FORMAT(10I8)                                                                   
         0      12       2       0      15       2       0      18       2       3
        21       2       6      24       2       6      27       2       6      30
         2       9      33       2       9      36       2       9      39       2
  %FLAG BONDS_WITHOUT_HYDROGEN                                                    
  %FORMAT(10I8)                                                                   
         0       3       1       3       6       1       3       9       1
  %FLAG ANGLES_INC_HYDROGEN                                                       
  %FORMAT(10I8)                                                                   
         0       3      21       2       3       0      12       2       3       0
        15       2       3       0      18       2       3       6      24       2
         3       6      27       2       3       6      30       2       3       9
        33       2       3       9      36       2       3       9      39       2
         6       3      21       2       9       3      21       2      12       0
        15       3      12       0      18       3      15       0      18       3
        24       6      27       3      24       6      30       3      27       6
        30       3      33       9      36       3      33       9      39       3
        36       9      39       3
  %FLAG ANGLES_WITHOUT_HYDROGEN                                                   
  %FORMAT(10I8)                                                                   
         0       3       6       1       0       3       9       1       6       3
         9       1
  %FLAG DIHEDRALS_INC_HYDROGEN                                                    
  %FORMAT(10I8)                                                                   
         0       3       6      24       1       0       3       6      27       1
         0       3       6      30       1       0       3       9      33       1
         0       3       9      36       1       0       3       9      39       1
        12       0       3       6       1      15       0       3       6       1
        18       0       3       6       1       6       3       9      33       1
         6       3       9      36       1       6       3       9      39       1
        12       0       3       9       1      15       0       3       9       1
        18       0       3       9       1       9       3       6      24       1
         9       3       6      27       1       9       3       6      30       1
        12       0       3      21       2      15       0       3      21       2
        18       0       3      21       2      21       3       6      24       2
        21       3       6      27       2      21       3       6      30       2
        21       3       9      33       2      21       3       9      36       2
        21       3       9      39       2
  %FLAG DIHEDRALS_WITHOUT_HYDROGEN                                                
  %FORMAT(10I8)                                                                   
  
  %FLAG EXCLUDED_ATOMS_LIST                                                       
  %FORMAT(10I8)                                                                   
         2       3       4       5       6       7       8       9      10      11
        12      13      14       3       4       5       6       7       8       9
        10      11      12      13      14       4       5       6       7       8
         9      10      11      12      13      14       5       6       7       8
         9      10      11      12      13      14       6       7       8       7
         8       8       9      10      11      12      13      14      10      11
        11       0      13      14      14       0
  %FLAG HBOND_ACOEF                                                               
  %FORMAT(5E16.8)                                                                 
  
  %FLAG HBOND_BCOEF                                                               
  %FORMAT(5E16.8)                                                                 
  
  %FLAG HBCUT                                                                     
  %FORMAT(5E16.8)                                                                 
  
  %FLAG AMBER_ATOM_TYPE                                                           
  %FORMAT(20a4)                                                                   
  c3  c3  c3  c3  hc  hc  hc  hc  hc  hc  hc  hc  hc  hc  
  %FLAG TREE_CHAIN_CLASSIFICATION                                                 
  %FORMAT(20a4)                                                                   
  BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA 
  %FLAG JOIN_ARRAY                                                                
  %FORMAT(10I8)                                                                   
         0       0       0       0       0       0       0       0       0       0
         0       0       0       0
  %FLAG IROTAT                                                                    
  %FORMAT(10I8)                                                                   
         0       0       0       0       0       0       0       0       0       0
         0       0       0       0
  %FLAG RADIUS_SET                                                                
  %FORMAT(1a80)                                                                   
  modified Bondi radii (mbondi)                                                   
  %FLAG RADII                                                                     
  %FORMAT(5E16.8)                                                                 
    1.70000000E+00  1.70000000E+00  1.70000000E+00  1.70000000E+00  1.30000000E+00
    1.30000000E+00  1.30000000E+00  1.30000000E+00  1.30000000E+00  1.30000000E+00
    1.30000000E+00  1.30000000E+00  1.30000000E+00  1.30000000E+00
  %FLAG SCREEN                                                                    
  %FORMAT(5E16.8)                                                                 
    7.20000000E-01  7.20000000E-01  7.20000000E-01  7.20000000E-01  8.50000000E-01
    8.50000000E-01  8.50000000E-01  8.50000000E-01  8.50000000E-01  8.50000000E-01
    8.50000000E-01  8.50000000E-01  8.50000000E-01  8.50000000E-01
  %FLAG IPOL                                                                      
  %FORMAT(1I8)                                                                    
         0
  </code></pre>
  <p>from the <a href="https://www.bio2byte.be/acpype/" rel="nofollow noreferrer">acpype server</a> it has a nice API interface (could do by Python)</p>
  <p>here <a href="https://www.bio2byte.be/acpype/api_reference" rel="nofollow noreferrer">acpype api_reference</a></p>
  <p>I guess for your molecule atom type would be someting related to C3 and I dont think thats in the PDB file format</p>
  <p>You can install <strong>acpype</strong> locally:</p>
  <blockquote>
  <p>ACPYPE can also be installed locally from GitHub (<a href="https://github.com/alanwilter/acpype" rel="nofollow noreferrer">https://github.com/alanwilter/acpype</a>) as well as via Anaconda (<a href="https://anaconda.org/conda-forge/acpype" rel="nofollow noreferrer">https://anaconda.org/conda-forge/acpype</a>), Pypi (<a href="https://pypi.org/project/acpype/" rel="nofollow noreferrer">https://pypi.org/project/acpype/</a>), and Docker Hub (<a href="https://hub.docker.com/r/acpype/acpype" rel="nofollow noreferrer">https://hub.docker.com/r/acpype/acpype</a>). All ACPYPE functionality can be obtained using the local installation, including direct SMILES conversion. The source version also does not limit runtime or number of atoms.</p>
  </blockquote>
  <p>(see <a href="https://academic.oup.com/bioinformatics/article/39/6/btad350/7186498" rel="nofollow noreferrer">The ACPYPE web server for small-molecule MD topology generation</a> :</p>
  <p>and <a href="https://bmcresnotes.biomedcentral.com/articles/10.1186/1756-0500-5-367" rel="nofollow noreferrer">ACPYPE - AnteChamber PYthon Parser interfacE</a>)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-09-07T17:54:13.953Z
Answers.LastActivityDate: 2024-09-09T09:30:28.120Z
Answers.LastEditDate: 2024-09-09T09:30:28.120Z
Answers.UserDisplayName: pippo1980
Answers.Body: <p>OK, my attempt , using Python</p>
  <p>with <strong>acpype</strong>  (<a href="https://github.com/alanwilter/acpype" rel="nofollow noreferrer">https://github.com/alanwilter/acpype</a> that needs</p>
  <p><code>antechamber</code> from <strong>AmberTools</strong> (<a href="https://ambermd.org/" rel="nofollow noreferrer">https://ambermd.org/</a> )</p>
  <p>and <strong>OpenBabel</strong> (<a href="https://openbabel.org/" rel="nofollow noreferrer">https://openbabel.org/</a>) .</p>
  <p>I had to change one of <strong>acpype</strong> files to have <code>acpype.cli</code> (<a href="https://acpype.readthedocs.io/en/latest/_autosummary/acpype.cli.html" rel="nofollow noreferrer">https://acpype.readthedocs.io/en/latest/_autosummary/acpype.cli.html</a>) to work
  with my script [I had problem passing args parameters and values to the <code>argparse.parser</code> used by acpype]:</p>
  <p><code>parser_args.py</code> :</p>
  <pre><code>import argparse
  
  from acpype.params import MAXTIME, epilog, outTopols, usage
  
  &quot;&quot;&quot;
  see https://stackoverflow.com/questions/18157376/handle-spaces-in-argparse-input
  
      https://stackoverflow.com/a/71156023/9877065
      
  &quot;&quot;&quot;
  
  print('\n\nIMPORTING MY get_option_parser\n\n\n')
  
  class StripArgument(argparse.Action):
      def __call__(self, parser, namespace, values, option_string=None):
          setattr(namespace, self.dest, values.strip())
  
  
  def get_option_parser():
      # not used yet: -e -l -r
      parser = argparse.ArgumentParser(usage=usage + epilog)
      group = parser.add_mutually_exclusive_group()
      parser.add_argument(
          &quot;-i&quot;,
          &quot;--input&quot;,
          action = StripArgument,
          #action=&quot;store&quot;,
          #dest=&quot;input&quot;,
          help=&quot;input file type like '.pdb', '.mdl', '.mol2' or SMILES string (mandatory if -p and -x not set)&quot;,
      )
      parser.add_argument(
          &quot;-b&quot;,
          &quot;--basename&quot;,
          action = StripArgument,
          #action=&quot;store&quot;,
          #dest=&quot;basename&quot;,
          help=&quot;a basename for the project (folder and output files)&quot;,
      )
      parser.add_argument(
          &quot;-x&quot;,
          &quot;--inpcrd&quot;,
          action = StripArgument,
          #action=&quot;store&quot;,
          #dest=&quot;inpcrd&quot;,
          help=&quot;amber inpcrd file name (always used with -p)&quot;,
      )
      parser.add_argument(
          &quot;-p&quot;,
          &quot;--prmtop&quot;,
          action = StripArgument,
          #action=&quot;store&quot;,
          #dest=&quot;prmtop&quot;,
          help=&quot;amber prmtop file name (always used with -x)&quot;,
      )
      parser.add_argument(
          &quot;-c&quot;,
          &quot;--charge_method&quot;,
          choices=[&quot;gas&quot;, &quot;bcc&quot;, &quot;user&quot;],
          action = StripArgument,
          #action=&quot;store&quot;,
          default=&quot;bcc&quot;,
          #dest=&quot;charge_method&quot;,
          help=&quot;charge method: gas, bcc (default), user (user's charges in mol2 file)&quot;,
      )
      parser.add_argument(
          &quot;-n&quot;,
          &quot;--net_charge&quot;,
          action = StripArgument,
          #action=&quot;store&quot;,
          type=int,
          default=None,
          #dest=&quot;net_charge&quot;,
          help=&quot;net molecular charge (int), it tries to guess it if not not declared&quot;,
      )
      parser.add_argument(
          &quot;-m&quot;,
          &quot;--multiplicity&quot;,
          action = StripArgument,
          #action=&quot;store&quot;,
          type=int,
          default=1,
          #dest=&quot;multiplicity&quot;,
          help=&quot;multiplicity (2S+1), default is 1&quot;,
      )
      parser.add_argument(
          &quot;-a&quot;,
          &quot;--atom_type&quot;,
          choices=[&quot;gaff&quot;, &quot;amber&quot;, &quot;gaff2&quot;, &quot;amber2&quot;],
          action = StripArgument,
          #action=&quot;store&quot;,
          default=&quot;gaff2&quot;,
          #dest=&quot;atom_type&quot;,
          help=&quot;atom type, can be gaff, gaff2 (default), amber (AMBER14SB) or amber2 (AMBER14SB + GAFF2)&quot;,
      )
      parser.add_argument(
          &quot;-q&quot;,
          &quot;--qprog&quot;,
          choices=[&quot;mopac&quot;, &quot;sqm&quot;, &quot;divcon&quot;],
          action = StripArgument,
          #action=&quot;store&quot;,
          default=&quot;sqm&quot;,
          #dest=&quot;qprog&quot;,
          help=&quot;am1-bcc flag, sqm (default), divcon, mopac&quot;,
      )
      parser.add_argument(
          &quot;-k&quot;,
          &quot;--keyword&quot;,
          action = StripArgument,
          #action=&quot;store&quot;,
          #dest=&quot;keyword&quot;,
          help=&quot;mopac or sqm keyword, inside quotes&quot;,
      )
      parser.add_argument(
          &quot;-f&quot;,
          &quot;--force&quot;,
          action=&quot;store_true&quot;,
          dest=&quot;force&quot;,
          help=&quot;force topologies recalculation anew&quot;,
      )
      group.add_argument(
          &quot;-d&quot;,
          &quot;--debug&quot;,
          action=&quot;store_true&quot;,
          dest=&quot;debug&quot;,
          help=&quot;for debugging purposes, keep any temporary file created (not allowed with arg -w)&quot;,
      )
      group.add_argument(
          &quot;-w&quot;,
          &quot;--verboseless&quot;,
          action=&quot;store_false&quot;,
          default=True,
          dest=&quot;verboseless&quot;,
          help=&quot;print nothing (not allowed with arg -d)&quot;,
      )
      parser.add_argument(
          &quot;-o&quot;,
          &quot;--outtop&quot;,
          choices=[&quot;all&quot;, *outTopols],
          action = StripArgument,
          #action=&quot;store&quot;,
          default=&quot;all&quot;,
          #dest=&quot;outtop&quot;,
          help=&quot;output topologies: all (default), gmx, cns or charmm&quot;,
      )
      parser.add_argument(
          &quot;-z&quot;,
          &quot;--gmx4&quot;,
          action=&quot;store_true&quot;,
          dest=&quot;gmx4&quot;,
          help=&quot;write RB dihedrals old GMX 4.0&quot;,
      )
      parser.add_argument(
          &quot;-t&quot;,
          &quot;--cnstop&quot;,
          action=&quot;store_true&quot;,
          dest=&quot;cnstop&quot;,
          help=&quot;write CNS topology with allhdg-like parameters (experimental)&quot;,
      )
      parser.add_argument(
          &quot;-s&quot;,
          &quot;--max_time&quot;,
          type=int,
          action = StripArgument,
          #action=&quot;store&quot;,
          default=MAXTIME,
          #dest=&quot;max_time&quot;,
          help=&quot;max time (in sec) tolerance for sqm/mopac, default is %i hours&quot; % (MAXTIME // 3600),
      )
      parser.add_argument(
          &quot;-y&quot;,
          &quot;--ipython&quot;,
          action=&quot;store_true&quot;,
          dest=&quot;ipython&quot;,
          help=&quot;start iPython interpreter&quot;,
      )
      parser.add_argument(
          &quot;-g&quot;,
          &quot;--merge&quot;,
          action=&quot;store_true&quot;,
          dest=&quot;merge&quot;,
          help=&quot;Merge lower and uppercase atomtypes in GMX top file if identical parameters&quot;,
      )
      parser.add_argument(
          &quot;-u&quot;,
          &quot;--direct&quot;,
          action=&quot;store_true&quot;,
          dest=&quot;direct&quot;,
          help=&quot;for 'amb2gmx' mode, does a direct conversion, for any solvent (EXPERIMENTAL)&quot;,
          # NOTE: when solvent is present, gmx mdrun is not working, lack solvent topology
      )
      parser.add_argument(
          &quot;-l&quot;,
          &quot;--sorted&quot;,
          action=&quot;store_true&quot;,
          dest=&quot;sorted&quot;,
          help=&quot;sort atoms for GMX ordering&quot;,
      )
      parser.add_argument(
          &quot;-j&quot;,
          &quot;--chiral&quot;,
          action=&quot;store_true&quot;,
          dest=&quot;chiral&quot;,
          help=&quot;create improper dihedral parameters for chiral atoms in CNS&quot;,
      )
      parser.add_argument(
          &quot;-v&quot;,
          &quot;--version&quot;,
          action=&quot;store_true&quot;,
          dest=&quot;version&quot;,
          help=&quot;Show the Acpype version and exit&quot;,
      )
      
      print('\n\nUSING MY get_option_parser\n\n\n')
  
      return parser
  
  </code></pre>
  <p>My code :</p>
  <pre><code>from rdkit import Chem
  from rdkit.Chem import AllChem 
  
  import os 
  
  import shutil
  
  os.mkdir('TEMP')
  
  mydir = os.getcwd() # would be the MAIN folder
  mydir_tmp = mydir + &quot;/TEMP&quot; # add the testA folder name
  mydir_new = os.chdir(mydir_tmp) # change the current working directory
  
  
  
  smile = 'CC(C)C'
  
  molecule = Chem.MolFromSmiles(smile)
  molecule = Chem.AddHs(molecule)
  AllChem.EmbedMolecule(molecule)
  Chem.MolToPDBFile(molecule, 'molecule.pdb')
  
  
  import acpype
  
  print('\n-------------------------------')
  print('\n acpype Version : ', acpype.__version__)
  print('\n-------------------------------')
  
  
  from acpype import cli
  
  
  inpt = &quot;-i     molecule.pdb&quot; 
  
  
  print('\n',inpt,'\n')
  
  
  res = cli.init_main(binaries = {&quot;ac_bin&quot;  : &quot;antechamber&quot; , &quot;obabel_bin&quot;: &quot;obabel&quot;} , argv =  [inpt])
            
  print('\n\n dir now : ', os.getcwd())
  
  
  shutil.copyfile(os.getcwd()+'/molecule.acpype/molecule_AC.prmtop', mydir+'/molecule_AC.prmtop')
  
  os.chdir(mydir)
  
  shutil.rmtree(mydir_tmp)
  </code></pre>
  <p>Printed output :</p>
  <pre><code>-------------------------------
  
   acpype Version :  2023.10.27
  
  -------------------------------
  
  
  IMPORTING MY get_option_parser
  
  
  
  
   -i     molecule.pdb 
  
  
  
  USING MY get_option_parser
  
  
  
  ============================================================================
  | ACPYPE: AnteChamber PYthon Parser interfacE v. 2023.10.27 (c) 2024 AWSdS |
  ============================================================================
  WARNING: no charge value given, trying to guess one...
  ==&gt; ... charge set to 0
  ==&gt; ... converting pdb input file to mol2 input file
  ==&gt; * Babel OK *
  ==&gt; Executing Antechamber...
  ==&gt; * Antechamber OK *
  ==&gt; * Parmchk OK *
  ==&gt; Executing Tleap...
  ==&gt; * Tleap OK *
  ==&gt; Removing temporary files...
  ==&gt; Using OpenBabel v.3.1.0
  
  ==&gt; Writing NEW PDB file
  
  ==&gt; Writing CNS/XPLOR files
  
  ==&gt; Writing GROMACS files
  
  ==&gt; Disambiguating lower and uppercase atomtypes in GMX top file, even if identical.
  
  ==&gt; Writing GMX dihedrals for GMX 4.5 and higher.
  
  ==&gt; Writing CHARMM files
  
  ==&gt; Writing pickle file molecule.pkl
  ==&gt; Removing temporary files...
  Total time of execution: 1s
  
  
   dir now : xxx/xxx/xxx/xxxx/xxxx/xxx
  </code></pre>
  <p>file <code>molecule_AC.prmtop</code> as result :</p>
  <pre><code>%VERSION  VERSION_STAMP = V0001.000  DATE = 09/13/24  19:41:45                  
  %FLAG TITLE                                                                     
  %FORMAT(20a4)                                                                   
  molecule.pdb                                                                    
  %FLAG POINTERS                                                                  
  %FORMAT(10I8)                                                                   
        14       2      10       3      21       3      27       0       0       0
        66       1       3       3       0       2       3       2       2       0
         0       0       0       0       0       0       0       0      14       0
         0
  %FLAG ATOM_NAME                                                                 
  %FORMAT(20a4)                                                                   
  C1  C2  C3  C4  H1  H2  H3  H4  H5  H6  H7  H8  H9  H10 
  %FLAG CHARGE                                                                    
  %FORMAT(5E16.8)                                                                 
   -1.62360693E+00 -1.27009431E+00 -1.62360693E+00 -1.62360693E+00  6.01937236E-01
    6.01937236E-01  6.01937236E-01  8.14536810E-01  6.01937236E-01  6.01937236E-01
    6.01937236E-01  6.01937236E-01  6.01937236E-01  6.01937236E-01
  %FLAG ATOMIC_NUMBER                                                             
  %FORMAT(10I8)                                                                   
         6       6       6       6       1       1       1       1       1       1
         1       1       1       1
  %FLAG MASS                                                                      
  %FORMAT(5E16.8)                                                                 
    1.20100000E+01  1.20100000E+01  1.20100000E+01  1.20100000E+01  1.00800000E+00
    1.00800000E+00  1.00800000E+00  1.00800000E+00  1.00800000E+00  1.00800000E+00
    1.00800000E+00  1.00800000E+00  1.00800000E+00  1.00800000E+00
  %FLAG ATOM_TYPE_INDEX                                                           
  %FORMAT(10I8)                                                                   
         1       1       1       1       2       2       2       2       2       2
         2       2       2       2
  %FLAG NUMBER_EXCLUDED_ATOMS                                                     
  %FORMAT(10I8)                                                                   
        13      12      11      10       3       2       1       6       2       1
         1       2       1       1
  %FLAG NONBONDED_PARM_INDEX                                                      
  %FORMAT(10I8)                                                                   
         1       2       2       3
  %FLAG RESIDUE_LABEL                                                             
  %FORMAT(20a4)                                                                   
  UNL 
  %FLAG RESIDUE_POINTER                                                           
  %FORMAT(10I8)                                                                   
         1
  %FLAG BOND_FORCE_CONSTANT                                                       
  %FORMAT(5E16.8)                                                                 
    2.28890000E+02  3.45250000E+02
  %FLAG BOND_EQUIL_VALUE                                                          
  %FORMAT(5E16.8)                                                                 
    1.53540000E+00  1.09620000E+00
  %FLAG ANGLE_FORCE_CONSTANT                                                      
  %FORMAT(5E16.8)                                                                 
    5.98700000E+01  4.32700000E+01  3.58000000E+01
  %FLAG ANGLE_EQUIL_VALUE                                                         
  %FORMAT(5E16.8)                                                                 
    1.96576518E+00  1.91427794E+00  1.88024401E+00
  %FLAG DIHEDRAL_FORCE_CONSTANT                                                   
  %FORMAT(5E16.8)                                                                 
    1.30000000E-01  1.20000000E-01
  %FLAG DIHEDRAL_PERIODICITY                                                      
  %FORMAT(5E16.8)                                                                 
    3.00000000E+00  3.00000000E+00
  %FLAG DIHEDRAL_PHASE                                                            
  %FORMAT(5E16.8)                                                                 
    0.00000000E+00  0.00000000E+00
  %FLAG SCEE_SCALE_FACTOR                                                         
  %FORMAT(5E16.8)                                                                 
    1.20000000E+00  1.20000000E+00
  %FLAG SCNB_SCALE_FACTOR                                                         
  %FORMAT(5E16.8)                                                                 
    2.00000000E+00  2.00000000E+00
  %FLAG SOLTY                                                                     
  %FORMAT(5E16.8)                                                                 
    0.00000000E+00  0.00000000E+00
  %FLAG LENNARD_JONES_ACOEF                                                       
  %FORMAT(5E16.8)                                                                 
    1.02073671E+06  1.00235148E+05  7.94617769E+03
  %FLAG LENNARD_JONES_BCOEF                                                       
  %FORMAT(5E16.8)                                                                 
    6.63431737E+02  1.37787728E+02  2.57122925E+01
  %FLAG BONDS_INC_HYDROGEN                                                        
  %FORMAT(10I8)                                                                   
         0      12       2       0      15       2       0      18       2       3
        21       2       6      24       2       6      27       2       6      30
         2       9      33       2       9      36       2       9      39       2
  %FLAG BONDS_WITHOUT_HYDROGEN                                                    
  %FORMAT(10I8)                                                                   
         0       3       1       3       6       1       3       9       1
  %FLAG ANGLES_INC_HYDROGEN                                                       
  %FORMAT(10I8)                                                                   
         0       3      21       2       3       0      12       2       3       0
        15       2       3       0      18       2       3       6      24       2
         3       6      27       2       3       6      30       2       3       9
        33       2       3       9      36       2       3       9      39       2
         6       3      21       2       9       3      21       2      12       0
        15       3      12       0      18       3      15       0      18       3
        24       6      27       3      24       6      30       3      27       6
        30       3      33       9      36       3      33       9      39       3
        36       9      39       3
  %FLAG ANGLES_WITHOUT_HYDROGEN                                                   
  %FORMAT(10I8)                                                                   
         0       3       6       1       0       3       9       1       6       3
         9       1
  %FLAG DIHEDRALS_INC_HYDROGEN                                                    
  %FORMAT(10I8)                                                                   
         0       3       6      24       1       0       3       6      27       1
         0       3       6      30       1       0       3       9      33       1
         0       3       9      36       1       0       3       9      39       1
        12       0       3       6       1      15       0       3       6       1
        18       0       3       6       1       6       3       9      33       1
         6       3       9      36       1       6       3       9      39       1
        12       0       3       9       1      15       0       3       9       1
        18       0       3       9       1       9       3       6      24       1
         9       3       6      27       1       9       3       6      30       1
        12       0       3      21       2      15       0       3      21       2
        18       0       3      21       2      21       3       6      24       2
        21       3       6      27       2      21       3       6      30       2
        21       3       9      33       2      21       3       9      36       2
        21       3       9      39       2
  %FLAG DIHEDRALS_WITHOUT_HYDROGEN                                                
  %FORMAT(10I8)                                                                   
  
  %FLAG EXCLUDED_ATOMS_LIST                                                       
  %FORMAT(10I8)                                                                   
         2       3       4       5       6       7       8       9      10      11
        12      13      14       3       4       5       6       7       8       9
        10      11      12      13      14       4       5       6       7       8
         9      10      11      12      13      14       5       6       7       8
         9      10      11      12      13      14       6       7       8       7
         8       8       9      10      11      12      13      14      10      11
        11       0      13      14      14       0
  %FLAG HBOND_ACOEF                                                               
  %FORMAT(5E16.8)                                                                 
  
  %FLAG HBOND_BCOEF                                                               
  %FORMAT(5E16.8)                                                                 
  
  %FLAG HBCUT                                                                     
  %FORMAT(5E16.8)                                                                 
  
  %FLAG AMBER_ATOM_TYPE                                                           
  %FORMAT(20a4)                                                                   
  c3  c3  c3  c3  hc  hc  hc  hc  hc  hc  hc  hc  hc  hc  
  %FLAG TREE_CHAIN_CLASSIFICATION                                                 
  %FORMAT(20a4)                                                                   
  BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA 
  %FLAG JOIN_ARRAY                                                                
  %FORMAT(10I8)                                                                   
         0       0       0       0       0       0       0       0       0       0
         0       0       0       0
  %FLAG IROTAT                                                                    
  %FORMAT(10I8)                                                                   
         0       0       0       0       0       0       0       0       0       0
         0       0       0       0
  %FLAG RADIUS_SET                                                                
  %FORMAT(1a80)                                                                   
  modified Bondi radii (mbondi)                                                   
  %FLAG RADII                                                                     
  %FORMAT(5E16.8)                                                                 
    1.70000000E+00  1.70000000E+00  1.70000000E+00  1.70000000E+00  1.30000000E+00
    1.30000000E+00  1.30000000E+00  1.30000000E+00  1.30000000E+00  1.30000000E+00
    1.30000000E+00  1.30000000E+00  1.30000000E+00  1.30000000E+00
  %FLAG SCREEN                                                                    
  %FORMAT(5E16.8)                                                                 
    7.20000000E-01  7.20000000E-01  7.20000000E-01  7.20000000E-01  8.50000000E-01
    8.50000000E-01  8.50000000E-01  8.50000000E-01  8.50000000E-01  8.50000000E-01
    8.50000000E-01  8.50000000E-01  8.50000000E-01  8.50000000E-01
  %FLAG IPOL                                                                      
  %FORMAT(1I8)                                                                    
         0
  </code></pre>
  <p>it gives different values for some of the <code>.prmtop</code> constant/values compared to the web server service, but I am not a Amber/MD expert (actually I am not even a novice)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-09-13T17:52:21.587Z
Answers.LastActivityDate: 2024-09-13T19:09:13.630Z
Answers.LastEditDate: 2024-09-13T19:09:13.630Z
Answers.UserDisplayName: pippo1980
Body: <p>I have a list of SMILES of small molecules and I want to be able to simulate these molecules with an Amber force field in Python. Currently, I use RDkit to convert the smile into a PDB file:</p>
  <pre><code>from rdkit import Chem
  from rdkit.Chem import AllChem 
  
  molecule = Chem.MolFromSMiles('smile')
  molecule = Chem.AddHs(molecule)
  AllChem.EmbedMolecule(molecule)
  Chem.MolToPDBFile(molecule, 'molecule.pdb')
  </code></pre>
  <p>Then I use the ParmEd package:</p>
  <pre><code>import parmed as pmd
  
  pdb = pmd.load_file('molecule.pdb')
  </code></pre>
  <p>This pdb object for 'CC(C)C' for example, looks like:</p>
  <pre><code>&lt;Structure 14 atoms; 1 residues; 13 bonds; NOT parameterized&gt;
  </code></pre>
  <p>Then I want to create a prmtop file, which is needed to initialise an Amber force:</p>
  <pre><code>pdb.save('molecule.prmtop', overwrite=True)
  </code></pre>
  <p>This throws the error:</p>
  <pre><code>RuntimeError: atom types are not assigned
  </code></pre>
  <p>I'm not sure why this error gets thrown, since the atom types do seem to be inside the PDB file. I'm new to trying to do these kinds of things, so I'm not completely sure if more information is needed.</p>
  <p>If this method in general is not preferable, what is the best way to achieve this (preferably on python)?</p>
  <p>Any help would be greatly appreciated.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-09-06T13:33:15.020Z
Comments.Text: https://ambermd.org/prmtop.pdf
Comments.UserDisplayName: pippo1980
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-09-07T17:28:59.297Z
Comments.Text: are all yours small molecules covered by Amber GAFF force field ?
Comments.UserDisplayName: pippo1980
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-09-07T17:43:40.557Z
Comments.Text: What is the force field atom type?
  The forcefield atom types are related to the chemical environment of the atoms in a way defined by the particular forcefield. For example, a methane molecule has only two atom types, one for the carbon and one for the hydrogens, even though each of the atoms may have a distinct atom name for labeling purposes.
Comments.UserDisplayName: pippo1980
Tags: <python><rdkit><small-molecules><amber>
Title: From SMILE get Amber force in Python
ThreadText: # From SMILE get Amber force in Python
  
  (Asked by: username_0 on 2023-03-14)
  
  I have a list of SMILES of small molecules and I want to be able to simulate these molecules with an Amber force field in Python. Currently, I use RDkit to convert the smile into a PDB file:
  
  ```
  from rdkit import Chem
  from rdkit.Chem import AllChem 
  
  molecule = Chem.MolFromSMiles('smile')
  molecule = Chem.AddHs(molecule)
  AllChem.EmbedMolecule(molecule)
  Chem.MolToPDBFile(molecule, 'molecule.pdb')
  
  ```
  
  Then I use the ParmEd package:
  
  ```
  import parmed as pmd
  
  pdb = pmd.load_file('molecule.pdb')
  
  ```
  
  This pdb object for 'CC(C)C' for example, looks like:
  
  ```
  <Structure 14 atoms; 1 residues; 13 bonds; NOT parameterized>
  
  ```
  
  Then I want to create a prmtop file, which is needed to initialise an Amber force:
  
  ```
  pdb.save('molecule.prmtop', overwrite=True)
  
  ```
  
  This throws the error:
  
  ```
  RuntimeError: atom types are not assigned
  
  ```
  
  I'm not sure why this error gets thrown, since the atom types do seem to be inside the PDB file. I'm new to trying to do these kinds of things, so I'm not completely sure if more information is needed.
  
  If this method in general is not preferable, what is the best way to achieve this (preferably on python)?
  
  Any help would be greatly appreciated.
  
  **Tags:** python, rdkit, small-molecules, amber
  
  > **Comments:**
  > **username_1**: https://ambermd.org/prmtop.pdf  
  > **username_1**: are all yours small molecules covered by Amber GAFF force field ?  
  > **username_1**: What is the force field atom type? The forcefield atom types are related to the chemical environment of the atoms in a way defined by the particular forcefield. For example, a methane molecule has only two atom types, one for the carbon and one for the hydrogens, even though each of the atoms may have a distinct atom name for labeling purposes.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2024-09-07. Score: 1
  
  I got for `CC(C)C`
  
  this `.prmtop` :
  
  ```
  %VERSION  VERSION_STAMP = V0001.000  DATE = 09/07/24  17:39:38                  
  %FLAG TITLE                                                                     
  %FORMAT(20a4)                                                                   
  output.pdb                                                                      
  %FLAG POINTERS                                                                  
  %FORMAT(10I8)                                                                   
        14       2      10       3      21       3      27       0       0       0
        66       1       3       3       0       2       3       2       2       0
         0       0       0       0       0       0       0       0      14       0
         0
  %FLAG ATOM_NAME                                                                 
  %FORMAT(20a4)                                                                   
  C1  C2  C3  C4  H1  H2  H3  H4  H5  H6  H7  H8  H9  H10 
  %FLAG CHARGE                                                                    
  %FORMAT(5E16.8)                                                                 
   -1.62360693E+00 -1.27009431E+00 -1.62360693E+00 -1.62360693E+00  6.01937236E-01
    6.01937236E-01  6.01937236E-01  8.14536810E-01  6.01937236E-01  6.01937236E-01
    6.01937236E-01  6.01937236E-01  6.01937236E-01  6.01937236E-01
  %FLAG ATOMIC_NUMBER                                                             
  %FORMAT(10I8)                                                                   
         6       6       6       6       1       1       1       1       1       1
         1       1       1       1
  %FLAG MASS                                                                      
  %FORMAT(5E16.8)                                                                 
    1.20100000E+01  1.20100000E+01  1.20100000E+01  1.20100000E+01  1.00800000E+00
    1.00800000E+00  1.00800000E+00  1.00800000E+00  1.00800000E+00  1.00800000E+00
    1.00800000E+00  1.00800000E+00  1.00800000E+00  1.00800000E+00
  %FLAG ATOM_TYPE_INDEX                                                           
  %FORMAT(10I8)                                                                   
         1       1       1       1       2       2       2       2       2       2
         2       2       2       2
  %FLAG NUMBER_EXCLUDED_ATOMS                                                     
  %FORMAT(10I8)                                                                   
        13      12      11      10       3       2       1       6       2       1
         1       2       1       1
  %FLAG NONBONDED_PARM_INDEX                                                      
  %FORMAT(10I8)                                                                   
         1       2       2       3
  %FLAG RESIDUE_LABEL                                                             
  %FORMAT(20a4)                                                                   
  UNL 
  %FLAG RESIDUE_POINTER                                                           
  %FORMAT(10I8)                                                                   
         1
  %FLAG BOND_FORCE_CONSTANT                                                       
  %FORMAT(5E16.8)                                                                 
    3.00900000E+02  3.30600000E+02
  %FLAG BOND_EQUIL_VALUE                                                          
  %FORMAT(5E16.8)                                                                 
    1.53750000E+00  1.09690000E+00
  %FLAG ANGLE_FORCE_CONSTANT                                                      
  %FORMAT(5E16.8)                                                                 
    6.29000000E+01  4.63000000E+01  3.94000000E+01
  %FLAG ANGLE_EQUIL_VALUE                                                         
  %FORMAT(5E16.8)                                                                 
    1.94621748E+00  1.91637234E+00  1.87762601E+00
  %FLAG DIHEDRAL_FORCE_CONSTANT                                                   
  %FORMAT(5E16.8)                                                                 
    1.60000000E-01  1.50000000E-01
  %FLAG DIHEDRAL_PERIODICITY                                                      
  %FORMAT(5E16.8)                                                                 
    3.00000000E+00  3.00000000E+00
  %FLAG DIHEDRAL_PHASE                                                            
  %FORMAT(5E16.8)                                                                 
    0.00000000E+00  0.00000000E+00
  %FLAG SCEE_SCALE_FACTOR                                                         
  %FORMAT(5E16.8)                                                                 
    1.20000000E+00  1.20000000E+00
  %FLAG SCNB_SCALE_FACTOR                                                         
  %FORMAT(5E16.8)                                                                 
    2.00000000E+00  2.00000000E+00
  %FLAG SOLTY                                                                     
  %FORMAT(5E16.8)                                                                 
    0.00000000E+00  0.00000000E+00
  %FLAG LENNARD_JONES_ACOEF                                                       
  %FORMAT(5E16.8)                                                                 
    1.04308023E+06  9.71708117E+04  7.51607703E+03
  %FLAG LENNARD_JONES_BCOEF                                                       
  %FORMAT(5E16.8)                                                                 
    6.75612247E+02  1.26919150E+02  2.17257828E+01
  %FLAG BONDS_INC_HYDROGEN                                                        
  %FORMAT(10I8)                                                                   
         0      12       2       0      15       2       0      18       2       3
        21       2       6      24       2       6      27       2       6      30
         2       9      33       2       9      36       2       9      39       2
  %FLAG BONDS_WITHOUT_HYDROGEN                                                    
  %FORMAT(10I8)                                                                   
         0       3       1       3       6       1       3       9       1
  %FLAG ANGLES_INC_HYDROGEN                                                       
  %FORMAT(10I8)                                                                   
         0       3      21       2       3       0      12       2       3       0
        15       2       3       0      18       2       3       6      24       2
         3       6      27       2       3       6      30       2       3       9
        33       2       3       9      36       2       3       9      39       2
         6       3      21       2       9       3      21       2      12       0
        15       3      12       0      18       3      15       0      18       3
        24       6      27       3      24       6      30       3      27       6
        30       3      33       9      36       3      33       9      39       3
        36       9      39       3
  %FLAG ANGLES_WITHOUT_HYDROGEN                                                   
  %FORMAT(10I8)                                                                   
         0       3       6       1       0       3       9       1       6       3
         9       1
  %FLAG DIHEDRALS_INC_HYDROGEN                                                    
  %FORMAT(10I8)                                                                   
         0       3       6      24       1       0       3       6      27       1
         0       3       6      30       1       0       3       9      33       1
         0       3       9      36       1       0       3       9      39       1
        12       0       3       6       1      15       0       3       6       1
        18       0       3       6       1       6       3       9      33       1
         6       3       9      36       1       6       3       9      39       1
        12       0       3       9       1      15       0       3       9       1
        18       0       3       9       1       9       3       6      24       1
         9       3       6      27       1       9       3       6      30       1
        12       0       3      21       2      15       0       3      21       2
        18       0       3      21       2      21       3       6      24       2
        21       3       6      27       2      21       3       6      30       2
        21       3       9      33       2      21       3       9      36       2
        21       3       9      39       2
  %FLAG DIHEDRALS_WITHOUT_HYDROGEN                                                
  %FORMAT(10I8)                                                                   
  
  %FLAG EXCLUDED_ATOMS_LIST                                                       
  %FORMAT(10I8)                                                                   
         2       3       4       5       6       7       8       9      10      11
        12      13      14       3       4       5       6       7       8       9
        10      11      12      13      14       4       5       6       7       8
         9      10      11      12      13      14       5       6       7       8
         9      10      11      12      13      14       6       7       8       7
         8       8       9      10      11      12      13      14      10      11
        11       0      13      14      14       0
  %FLAG HBOND_ACOEF                                                               
  %FORMAT(5E16.8)                                                                 
  
  %FLAG HBOND_BCOEF                                                               
  %FORMAT(5E16.8)                                                                 
  
  %FLAG HBCUT                                                                     
  %FORMAT(5E16.8)                                                                 
  
  %FLAG AMBER_ATOM_TYPE                                                           
  %FORMAT(20a4)                                                                   
  c3  c3  c3  c3  hc  hc  hc  hc  hc  hc  hc  hc  hc  hc  
  %FLAG TREE_CHAIN_CLASSIFICATION                                                 
  %FORMAT(20a4)                                                                   
  BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA 
  %FLAG JOIN_ARRAY                                                                
  %FORMAT(10I8)                                                                   
         0       0       0       0       0       0       0       0       0       0
         0       0       0       0
  %FLAG IROTAT                                                                    
  %FORMAT(10I8)                                                                   
         0       0       0       0       0       0       0       0       0       0
         0       0       0       0
  %FLAG RADIUS_SET                                                                
  %FORMAT(1a80)                                                                   
  modified Bondi radii (mbondi)                                                   
  %FLAG RADII                                                                     
  %FORMAT(5E16.8)                                                                 
    1.70000000E+00  1.70000000E+00  1.70000000E+00  1.70000000E+00  1.30000000E+00
    1.30000000E+00  1.30000000E+00  1.30000000E+00  1.30000000E+00  1.30000000E+00
    1.30000000E+00  1.30000000E+00  1.30000000E+00  1.30000000E+00
  %FLAG SCREEN                                                                    
  %FORMAT(5E16.8)                                                                 
    7.20000000E-01  7.20000000E-01  7.20000000E-01  7.20000000E-01  8.50000000E-01
    8.50000000E-01  8.50000000E-01  8.50000000E-01  8.50000000E-01  8.50000000E-01
    8.50000000E-01  8.50000000E-01  8.50000000E-01  8.50000000E-01
  %FLAG IPOL                                                                      
  %FORMAT(1I8)                                                                    
         0
  
  ```
  
  from the [acpype server](https://www.bio2byte.be/acpype/) it has a nice API interface (could do by Python)
  
  here [acpype api\_reference](https://www.bio2byte.be/acpype/api_reference)
  
  I guess for your molecule atom type would be someting related to C3 and I dont think thats in the PDB file format
  
  You can install **acpype** locally:
  
  > ACPYPE can also be installed locally from GitHub (<https://github.com/alanwilter/acpype>) as well as via Anaconda (<https://anaconda.org/conda-forge/acpype>), Pypi (<https://pypi.org/project/acpype/>), and Docker Hub (<https://hub.docker.com/r/acpype/acpype>). All ACPYPE functionality can be obtained using the local installation, including direct SMILES conversion. The source version also does not limit runtime or number of atoms.
  
  (see [The ACPYPE web server for small-molecule MD topology generation](https://academic.oup.com/bioinformatics/article/39/6/btad350/7186498) :
  
  and [ACPYPE - AnteChamber PYthon Parser interfacE](https://bmcresnotes.biomedcentral.com/articles/10.1186/1756-0500-5-367))
  
  
  ---
  
  ### Answer by username_1 on 2024-09-13. Score: 0
  
  OK, my attempt , using Python
  
  with **acpype** (<https://github.com/alanwilter/acpype> that needs
  
  `antechamber` from **AmberTools** (<https://ambermd.org/> )
  
  and **OpenBabel** (<https://openbabel.org/>) .
  
  I had to change one of **acpype** files to have `acpype.cli` (<https://acpype.readthedocs.io/en/latest/_autosummary/acpype.cli.html>) to work
  with my script [I had problem passing args parameters and values to the `argparse.parser` used by acpype]:
  
  `parser_args.py` :
  
  ```
  import argparse
  
  from acpype.params import MAXTIME, epilog, outTopols, usage
  
  """
  see https://stackoverflow.com/questions/18157376/handle-spaces-in-argparse-input
  
      https://stackoverflow.com/a/71156023/9877065
      
  """
  
  print('\n\nIMPORTING MY get_option_parser\n\n\n')
  
  class StripArgument(argparse.Action):
      def __call__(self, parser, namespace, values, option_string=None):
          setattr(namespace, self.dest, values.strip())
  
  def get_option_parser():
      # not used yet: -e -l -r
      parser = argparse.ArgumentParser(usage=usage + epilog)
      group = parser.add_mutually_exclusive_group()
      parser.add_argument(
          "-i",
          "--input",
          action = StripArgument,
          #action="store",
          #dest="input",
          help="input file type like '.pdb', '.mdl', '.mol2' or SMILES string (mandatory if -p and -x not set)",
      )
      parser.add_argument(
          "-b",
          "--basename",
          action = StripArgument,
          #action="store",
          #dest="basename",
          help="a basename for the project (folder and output files)",
      )
      parser.add_argument(
          "-x",
          "--inpcrd",
          action = StripArgument,
          #action="store",
          #dest="inpcrd",
          help="amber inpcrd file name (always used with -p)",
      )
      parser.add_argument(
          "-p",
          "--prmtop",
          action = StripArgument,
          #action="store",
          #dest="prmtop",
          help="amber prmtop file name (always used with -x)",
      )
      parser.add_argument(
          "-c",
          "--charge_method",
          choices=["gas", "bcc", "user"],
          action = StripArgument,
          #action="store",
          default="bcc",
          #dest="charge_method",
          help="charge method: gas, bcc (default), user (user's charges in mol2 file)",
      )
      parser.add_argument(
          "-n",
          "--net_charge",
          action = StripArgument,
          #action="store",
          type=int,
          default=None,
          #dest="net_charge",
          help="net molecular charge (int), it tries to guess it if not not declared",
      )
      parser.add_argument(
          "-m",
          "--multiplicity",
          action = StripArgument,
          #action="store",
          type=int,
          default=1,
          #dest="multiplicity",
          help="multiplicity (2S+1), default is 1",
      )
      parser.add_argument(
          "-a",
          "--atom_type",
          choices=["gaff", "amber", "gaff2", "amber2"],
          action = StripArgument,
          #action="store",
          default="gaff2",
          #dest="atom_type",
          help="atom type, can be gaff, gaff2 (default), amber (AMBER14SB) or amber2 (AMBER14SB + GAFF2)",
      )
      parser.add_argument(
          "-q",
          "--qprog",
          choices=["mopac", "sqm", "divcon"],
          action = StripArgument,
          #action="store",
          default="sqm",
          #dest="qprog",
          help="am1-bcc flag, sqm (default), divcon, mopac",
      )
      parser.add_argument(
          "-k",
          "--keyword",
          action = StripArgument,
          #action="store",
          #dest="keyword",
          help="mopac or sqm keyword, inside quotes",
      )
      parser.add_argument(
          "-f",
          "--force",
          action="store_true",
          dest="force",
          help="force topologies recalculation anew",
      )
      group.add_argument(
          "-d",
          "--debug",
          action="store_true",
          dest="debug",
          help="for debugging purposes, keep any temporary file created (not allowed with arg -w)",
      )
      group.add_argument(
          "-w",
          "--verboseless",
          action="store_false",
          default=True,
          dest="verboseless",
          help="print nothing (not allowed with arg -d)",
      )
      parser.add_argument(
          "-o",
          "--outtop",
          choices=["all", *outTopols],
          action = StripArgument,
          #action="store",
          default="all",
          #dest="outtop",
          help="output topologies: all (default), gmx, cns or charmm",
      )
      parser.add_argument(
          "-z",
          "--gmx4",
          action="store_true",
          dest="gmx4",
          help="write RB dihedrals old GMX 4.0",
      )
      parser.add_argument(
          "-t",
          "--cnstop",
          action="store_true",
          dest="cnstop",
          help="write CNS topology with allhdg-like parameters (experimental)",
      )
      parser.add_argument(
          "-s",
          "--max_time",
          type=int,
          action = StripArgument,
          #action="store",
          default=MAXTIME,
          #dest="max_time",
          help="max time (in sec) tolerance for sqm/mopac, default is %i hours" % (MAXTIME // 3600),
      )
      parser.add_argument(
          "-y",
          "--ipython",
          action="store_true",
          dest="ipython",
          help="start iPython interpreter",
      )
      parser.add_argument(
          "-g",
          "--merge",
          action="store_true",
          dest="merge",
          help="Merge lower and uppercase atomtypes in GMX top file if identical parameters",
      )
      parser.add_argument(
          "-u",
          "--direct",
          action="store_true",
          dest="direct",
          help="for 'amb2gmx' mode, does a direct conversion, for any solvent (EXPERIMENTAL)",
          # NOTE: when solvent is present, gmx mdrun is not working, lack solvent topology
      )
      parser.add_argument(
          "-l",
          "--sorted",
          action="store_true",
          dest="sorted",
          help="sort atoms for GMX ordering",
      )
      parser.add_argument(
          "-j",
          "--chiral",
          action="store_true",
          dest="chiral",
          help="create improper dihedral parameters for chiral atoms in CNS",
      )
      parser.add_argument(
          "-v",
          "--version",
          action="store_true",
          dest="version",
          help="Show the Acpype version and exit",
      )
      
      print('\n\nUSING MY get_option_parser\n\n\n')
  
      return parser
  
  ```
  
  My code :
  
  ```
  from rdkit import Chem
  from rdkit.Chem import AllChem 
  
  import os 
  
  import shutil
  
  os.mkdir('TEMP')
  
  mydir = os.getcwd() # would be the MAIN folder
  mydir_tmp = mydir + "/TEMP" # add the testA folder name
  mydir_new = os.chdir(mydir_tmp) # change the current working directory
  
  smile = 'CC(C)C'
  
  molecule = Chem.MolFromSmiles(smile)
  molecule = Chem.AddHs(molecule)
  AllChem.EmbedMolecule(molecule)
  Chem.MolToPDBFile(molecule, 'molecule.pdb')
  
  import acpype
  
  print('\n-------------------------------')
  print('\n acpype Version : ', acpype.__version__)
  print('\n-------------------------------')
  
  from acpype import cli
  
  inpt = "-i     molecule.pdb" 
  
  print('\n',inpt,'\n')
  
  res = cli.init_main(binaries = {"ac_bin"  : "antechamber" , "obabel_bin": "obabel"} , argv =  [inpt])
            
  print('\n\n dir now : ', os.getcwd())
  
  shutil.copyfile(os.getcwd()+'/molecule.acpype/molecule_AC.prmtop', mydir+'/molecule_AC.prmtop')
  
  os.chdir(mydir)
  
  shutil.rmtree(mydir_tmp)
  
  ```
  
  Printed output :
  
  ```
  -------------------------------
  
   acpype Version :  2023.10.27
  
  -------------------------------
  
  IMPORTING MY get_option_parser
  
   -i     molecule.pdb 
  
  USING MY get_option_parser
  
  ============================================================================
  | ACPYPE: AnteChamber PYthon Parser interfacE v. 2023.10.27 (c) 2024 AWSdS |
  ============================================================================
  WARNING: no charge value given, trying to guess one...
  ==> ... charge set to 0
  ==> ... converting pdb input file to mol2 input file
  ==> * Babel OK *
  ==> Executing Antechamber...
  ==> * Antechamber OK *
  ==> * Parmchk OK *
  ==> Executing Tleap...
  ==> * Tleap OK *
  ==> Removing temporary files...
  ==> Using OpenBabel v.3.1.0
  
  ==> Writing NEW PDB file
  
  ==> Writing CNS/XPLOR files
  
  ==> Writing GROMACS files
  
  ==> Disambiguating lower and uppercase atomtypes in GMX top file, even if identical.
  
  ==> Writing GMX dihedrals for GMX 4.5 and higher.
  
  ==> Writing CHARMM files
  
  ==> Writing pickle file molecule.pkl
  ==> Removing temporary files...
  Total time of execution: 1s
  
   dir now : xxx/xxx/xxx/xxxx/xxxx/xxx
  
  ```
  
  file `molecule_AC.prmtop` as result :
  
  ```
  %VERSION  VERSION_STAMP = V0001.000  DATE = 09/13/24  19:41:45                  
  %FLAG TITLE                                                                     
  %FORMAT(20a4)                                                                   
  molecule.pdb                                                                    
  %FLAG POINTERS                                                                  
  %FORMAT(10I8)                                                                   
        14       2      10       3      21       3      27       0       0       0
        66       1       3       3       0       2       3       2       2       0
         0       0       0       0       0       0       0       0      14       0
         0
  %FLAG ATOM_NAME                                                                 
  %FORMAT(20a4)                                                                   
  C1  C2  C3  C4  H1  H2  H3  H4  H5  H6  H7  H8  H9  H10 
  %FLAG CHARGE                                                                    
  %FORMAT(5E16.8)                                                                 
   -1.62360693E+00 -1.27009431E+00 -1.62360693E+00 -1.62360693E+00  6.01937236E-01
    6.01937236E-01  6.01937236E-01  8.14536810E-01  6.01937236E-01  6.01937236E-01
    6.01937236E-01  6.01937236E-01  6.01937236E-01  6.01937236E-01
  %FLAG ATOMIC_NUMBER                                                             
  %FORMAT(10I8)                                                                   
         6       6       6       6       1       1       1       1       1       1
         1       1       1       1
  %FLAG MASS                                                                      
  %FORMAT(5E16.8)                                                                 
    1.20100000E+01  1.20100000E+01  1.20100000E+01  1.20100000E+01  1.00800000E+00
    1.00800000E+00  1.00800000E+00  1.00800000E+00  1.00800000E+00  1.00800000E+00
    1.00800000E+00  1.00800000E+00  1.00800000E+00  1.00800000E+00
  %FLAG ATOM_TYPE_INDEX                                                           
  %FORMAT(10I8)                                                                   
         1       1       1       1       2       2       2       2       2       2
         2       2       2       2
  %FLAG NUMBER_EXCLUDED_ATOMS                                                     
  %FORMAT(10I8)                                                                   
        13      12      11      10       3       2       1       6       2       1
         1       2       1       1
  %FLAG NONBONDED_PARM_INDEX                                                      
  %FORMAT(10I8)                                                                   
         1       2       2       3
  %FLAG RESIDUE_LABEL                                                             
  %FORMAT(20a4)                                                                   
  UNL 
  %FLAG RESIDUE_POINTER                                                           
  %FORMAT(10I8)                                                                   
         1
  %FLAG BOND_FORCE_CONSTANT                                                       
  %FORMAT(5E16.8)                                                                 
    2.28890000E+02  3.45250000E+02
  %FLAG BOND_EQUIL_VALUE                                                          
  %FORMAT(5E16.8)                                                                 
    1.53540000E+00  1.09620000E+00
  %FLAG ANGLE_FORCE_CONSTANT                                                      
  %FORMAT(5E16.8)                                                                 
    5.98700000E+01  4.32700000E+01  3.58000000E+01
  %FLAG ANGLE_EQUIL_VALUE                                                         
  %FORMAT(5E16.8)                                                                 
    1.96576518E+00  1.91427794E+00  1.88024401E+00
  %FLAG DIHEDRAL_FORCE_CONSTANT                                                   
  %FORMAT(5E16.8)                                                                 
    1.30000000E-01  1.20000000E-01
  %FLAG DIHEDRAL_PERIODICITY                                                      
  %FORMAT(5E16.8)                                                                 
    3.00000000E+00  3.00000000E+00
  %FLAG DIHEDRAL_PHASE                                                            
  %FORMAT(5E16.8)                                                                 
    0.00000000E+00  0.00000000E+00
  %FLAG SCEE_SCALE_FACTOR                                                         
  %FORMAT(5E16.8)                                                                 
    1.20000000E+00  1.20000000E+00
  %FLAG SCNB_SCALE_FACTOR                                                         
  %FORMAT(5E16.8)                                                                 
    2.00000000E+00  2.00000000E+00
  %FLAG SOLTY                                                                     
  %FORMAT(5E16.8)                                                                 
    0.00000000E+00  0.00000000E+00
  %FLAG LENNARD_JONES_ACOEF                                                       
  %FORMAT(5E16.8)                                                                 
    1.02073671E+06  1.00235148E+05  7.94617769E+03
  %FLAG LENNARD_JONES_BCOEF                                                       
  %FORMAT(5E16.8)                                                                 
    6.63431737E+02  1.37787728E+02  2.57122925E+01
  %FLAG BONDS_INC_HYDROGEN                                                        
  %FORMAT(10I8)                                                                   
         0      12       2       0      15       2       0      18       2       3
        21       2       6      24       2       6      27       2       6      30
         2       9      33       2       9      36       2       9      39       2
  %FLAG BONDS_WITHOUT_HYDROGEN                                                    
  %FORMAT(10I8)                                                                   
         0       3       1       3       6       1       3       9       1
  %FLAG ANGLES_INC_HYDROGEN                                                       
  %FORMAT(10I8)                                                                   
         0       3      21       2       3       0      12       2       3       0
        15       2       3       0      18       2       3       6      24       2
         3       6      27       2       3       6      30       2       3       9
        33       2       3       9      36       2       3       9      39       2
         6       3      21       2       9       3      21       2      12       0
        15       3      12       0      18       3      15       0      18       3
        24       6      27       3      24       6      30       3      27       6
        30       3      33       9      36       3      33       9      39       3
        36       9      39       3
  %FLAG ANGLES_WITHOUT_HYDROGEN                                                   
  %FORMAT(10I8)                                                                   
         0       3       6       1       0       3       9       1       6       3
         9       1
  %FLAG DIHEDRALS_INC_HYDROGEN                                                    
  %FORMAT(10I8)                                                                   
         0       3       6      24       1       0       3       6      27       1
         0       3       6      30       1       0       3       9      33       1
         0       3       9      36       1       0       3       9      39       1
        12       0       3       6       1      15       0       3       6       1
        18       0       3       6       1       6       3       9      33       1
         6       3       9      36       1       6       3       9      39       1
        12       0       3       9       1      15       0       3       9       1
        18       0       3       9       1       9       3       6      24       1
         9       3       6      27       1       9       3       6      30       1
        12       0       3      21       2      15       0       3      21       2
        18       0       3      21       2      21       3       6      24       2
        21       3       6      27       2      21       3       6      30       2
        21       3       9      33       2      21       3       9      36       2
        21       3       9      39       2
  %FLAG DIHEDRALS_WITHOUT_HYDROGEN                                                
  %FORMAT(10I8)                                                                   
  
  %FLAG EXCLUDED_ATOMS_LIST                                                       
  %FORMAT(10I8)                                                                   
         2       3       4       5       6       7       8       9      10      11
        12      13      14       3       4       5       6       7       8       9
        10      11      12      13      14       4       5       6       7       8
         9      10      11      12      13      14       5       6       7       8
         9      10      11      12      13      14       6       7       8       7
         8       8       9      10      11      12      13      14      10      11
        11       0      13      14      14       0
  %FLAG HBOND_ACOEF                                                               
  %FORMAT(5E16.8)                                                                 
  
  %FLAG HBOND_BCOEF                                                               
  %FORMAT(5E16.8)                                                                 
  
  %FLAG HBCUT                                                                     
  %FORMAT(5E16.8)                                                                 
  
  %FLAG AMBER_ATOM_TYPE                                                           
  %FORMAT(20a4)                                                                   
  c3  c3  c3  c3  hc  hc  hc  hc  hc  hc  hc  hc  hc  hc  
  %FLAG TREE_CHAIN_CLASSIFICATION                                                 
  %FORMAT(20a4)                                                                   
  BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA 
  %FLAG JOIN_ARRAY                                                                
  %FORMAT(10I8)                                                                   
         0       0       0       0       0       0       0       0       0       0
         0       0       0       0
  %FLAG IROTAT                                                                    
  %FORMAT(10I8)                                                                   
         0       0       0       0       0       0       0       0       0       0
         0       0       0       0
  %FLAG RADIUS_SET                                                                
  %FORMAT(1a80)                                                                   
  modified Bondi radii (mbondi)                                                   
  %FLAG RADII                                                                     
  %FORMAT(5E16.8)                                                                 
    1.70000000E+00  1.70000000E+00  1.70000000E+00  1.70000000E+00  1.30000000E+00
    1.30000000E+00  1.30000000E+00  1.30000000E+00  1.30000000E+00  1.30000000E+00
    1.30000000E+00  1.30000000E+00  1.30000000E+00  1.30000000E+00
  %FLAG SCREEN                                                                    
  %FORMAT(5E16.8)                                                                 
    7.20000000E-01  7.20000000E-01  7.20000000E-01  7.20000000E-01  8.50000000E-01
    8.50000000E-01  8.50000000E-01  8.50000000E-01  8.50000000E-01  8.50000000E-01
    8.50000000E-01  8.50000000E-01  8.50000000E-01  8.50000000E-01
  %FLAG IPOL                                                                      
  %FORMAT(1I8)                                                                    
         0
  
  ```
  
  it gives different values for some of the `.prmtop` constant/values compared to the web server service, but I am not a Amber/MD expert (actually I am not even a novice)
  
  
  ---
  
  