This project packages the PFAS water-slab adsorption workflow as a CLI.
It performs:
- slab sorting by water-layer z order
- slab optimization with xTB
- PFAS-only optimization
- dual-orientation PFAS placement above the optimized water slab (
perpendicularandparallel) - interface optimization for each orientation branch
- adsorption-energy analysis
- z-range and closest-contact analysis
- KNF analysis on the final optimized PFAS and interface geometries
The repository includes the reusable optimized slab master:
references/master_slab_xtbopt.xyzreferences/master_slab_xtbopt.molreferences/master_slab_xtbtopo.mol
Project layout highlights:
pfas_interface_cli/-> installed CLI package and workflow modules:workflow.py,geometry.py,xtb.py,placement.py,analysis.py,reporting.py,knf.pyrun_pfas_interface_knf.py-> compatibility shim that callspfas_interface_cli.workflowreferences/-> reusable slab templatestools/-> helper and analysis scriptsexamples/-> sample input files (slab.xyz,slab.mol)docs/-> manuscript and documentation assets
From this folder:
python -m pip install -e .If you want custom slab generation (--create-custom-slab), install with the optional RDKit extra:
python -m pip install -e ".[slab-builder]"Primary command:
PFAS <input file or directory>Example:
PFAS ".\molecules\PFOA.xyz"Directory mode:
PFAS ".\molecules"By default the CLI uses master_slab_xtbopt.xyz from the current working directory, or falls back to references/master_slab_xtbopt.xyz in this project.
If you want to override the slab:
PFAS ".\molecules\PFOA.xyz" --slab ".\another_slab.xyz"Example with charge:
PFAS ".\molecules\PFOS.xyz" --pfas-charge -1Interactive mode (arrow-key UI with Enter to select):
PFAS --interactiveIn interactive mode, you can:
- run the PFAS workflow
- select the current default slab
- choose a discovered preoptimized slab
- build a custom slab from dimensions and optimize it with xTB
Preoptimized slab discovery:
PFAS --list-preoptimized-slabsUse a discovered preoptimized slab by name:
PFAS ".\molecules\PFOA.xyz" --preoptimized-slab reference-masterBuild a custom slab from user dimensions (RDKit) and optimize it (xTB):
PFAS --create-custom-slab --custom-slab-only --custom-slab-x 24 --custom-slab-y 24 --custom-slab-z 12Build and immediately use the new slab in a workflow run:
PFAS ".\molecules\PFOA.xyz" --create-custom-slab --custom-slab-x 24 --custom-slab-y 24 --custom-slab-z 12By default, a custom optimized slab is copied to .\master_slab_xtbopt.xyz and becomes the default slab for later runs in that folder. Use --no-set-custom-slab-default to skip that copy.
Custom slab safety checks:
--custom-slab-spacing-xyshould be at least2.2A--custom-slab-spacing-zshould be at least2.0A- custom slab size is capped at
600waters (1800atoms) for reliable xTB runs
Advanced options are available as a second layer when needed (for reproducibility sweeps/tuning):
--run-root,--run-name--gap,--x-shift,--y-shift--orientation-mode(dual|perpendicular|parallel)--multiplicity,--gfn--contact-elements--keep-knf-intermediates--knf-scdi-var-min,--knf-scdi-var-max
Example (advanced):
PFAS ".\molecules\PFOS.xyz" --pfas-charge -1 --orientation-mode perpendicular --gfn 2 --run-name PFOS_testThe older explicit command is also still available:
pfas-interface-knf .\examples\slab.xyz ".\molecules\PFOA.xyz"xtbmust be available onPATH.- The local KNF installation must be working.
- RDKit is required only for
--create-custom-slab(or custom slab creation in--interactivemode). - KNF runs its single-point/NCI stage on the final optimized geometry; the workflow avoids KNF geometry reoptimization.