Package: topas-tools
Topas toolsThese are set of small scripts and tools that were developed to help with structure refinement (of zeolites in particular) using the programTOPAS.topasdiffTopasdiff is a tool to generate nice looking difference maps. First, output the observed structure factors, and structure in cif format from Topas:Out_fobs(fobs.hkl)
Out_CIF_STR(structure.cif)Observed structure factors can be generated using this macro (add this toC:/topas5/local.inc):macro Out_fobs(file)
{
   phase_out file load out_record out_fmt out_eqn
   {
       "%4.0f" = H;
       "%4.0f" = K;
       "%4.0f" = L;
       '"%4.0f" = M;
       "%12.4f\n" = (Iobs_no_scale_pks / M)^(0.5);
   }
}Then to calculate the difference map, run the command:topasdiff structure.cif --diff fobs.hklor use the GUI, accessible available viatopasdiff.bat(Windows). The program will ask for the scale factor provided by TOPAS, and generates an input file for the program superflip (http://superflip.fzu.cz/). Superflip is then used to perform the fourier transform, and generates an.XPLORfile that can be visualized using Chimera or VESTA.Note: There is a bug in Topas where the cif files it outputs cannot be read using CCTBX, because they lack the data header. A work-around is to openC:/topas5/topas.incand modify all instances of:Out_String("\ndata_")by:Out_String("\ndata_topas_cif_out")cif2topascif2topas transforms a crystal structure into cif format into the corresponding TOPAS code.Usage:cif2topas structure.ciffh2topasfh2topas is a script that converts from Fenske-Hall z-matrix to TOPAS codeUsage:fh2topas zmatrix.fh [n]Here,nis an optional parameter to give the number of molecules to generate. fh2topas will automatically number them to avoid naming conflicts.topasrestraintstopasrestraints is a tool that can help with the generation of bond and angle restraints for structure refinement of zeolites with TOPAS. First, generate all bonds by using the TOPAS instruction:append_bond_lengthsto generate all bonds and angles, including their symmetry codes for the current structure. Copy everything between the curly brackets to a new file calledbonds.txt, and run:topasrestraints bonds.txtThis generates a file called restraints.out that contains the restraints that can be added to TOPAS. The script checks for all distances of1.61 +- 0.4Angstrom to identify T-O bonds. The program checks the connectivity for every atom, and reports if there is a problem (too many / not enough distances per T-atom). There is no check for symmetrically equivalent connections, so some restraints may be redundant.stripcifstripcif is a tool to clean a cif file from all extra metadata. Essentially it reads a cif file and writes it back tostructure_simple.cifwith just the cell parameters and atomic coordinates.Usage:stripcif structure.cifexpandcellexpandcell is a tool to take a cif file and expand the axes along different directions to form a supercell.For example:expandcell structure.cif -z2will write a cif inP1thezaxis doubled. You can then use a tool likePLATONto find the right symmetry for this structure (if needed). You can use:expandcell structure.cif -z2 -s SPGR --shift X Y Zto force the new a new symmetry on the output. HereSPGRis the space group suggested by platon, and--shift X Y Zis the suggested origin shift.The option-ecan be used to exclude elements from the result.make_superflipThis is a very simple tool that asks a couple of questions and writes an input file for superflip.Usage:make_superflipRequirementsPython>=3.9numpymatplotlibpandasCCTBXsuperflip (superflip.fzu.cz/)InstallationInstallminiconda(pick the one suitable for your platform, Python version does not matter here).Install using:condacreate-ntopas_tools-cconda-forgecctbx-base
condaactivatetopas_tools
pipinstalltopas_toolsOr use the environment file:condaenvcreate-fenvironment.yml
condaactivatetopas_tools
pipinstall-e.(note that every time you want to usetopas_tools, you must always activate the environment usingconda activate topas_tools)