% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/process_cif_files.R
\name{analyze_single_cif}
\alias{analyze_single_cif}
\title{Analyze the Content of a Single CIF File}
\usage{
analyze_single_cif(
  cif_content,
  file_name = NULL,
  perform_extraction = TRUE,
  perform_calcs_and_transforms = TRUE,
  bonding_algorithms = c("minimum_distance"),
  calculate_bond_angles = TRUE,
  perform_error_propagation = TRUE,
  tolerance = 1e-04,
  minimum_distance_delta = 0.1
)
}
\arguments{
\item{cif_content}{Either a \code{data.table} containing the lines of a CIF file,
OR a character string specifying the file path to a CIF file.}

\item{file_name}{The name of the original CIF file, used for labeling output.}

\item{perform_extraction}{Logical. If \code{TRUE}, extracts all metadata.}

\item{perform_calcs_and_transforms}{Logical. If \code{TRUE}, generates unit cell
and supercell.}

\item{bonding_algorithms}{Character vector. Options: \code{"minimum_distance"},
\code{"brunner"}, \code{"econ"}, \code{"crystal_nn"}, \code{"voronoi"}.}

\item{calculate_bond_angles}{Logical.}

\item{perform_error_propagation}{Logical.}

\item{tolerance}{Numeric. Cutoff for floating-point noise and atom merging (default 1e-4).}

\item{minimum_distance_delta}{Numeric. Tolerance for min-dist algorithm.}
}
\value{
A one-row \code{data.table} with results.
}
\description{
The core worker function that orchestrates the analysis pipeline
for a single crystal structure's data. It dynamically adjusts supercell
size and coordinate sets based on the requested bonding algorithms.
For geometric algorithms (Voronoi/CrystalNN), it automatically merges atoms
occupying the same site to ensure mathematical validity.
}
\examples{
cif_path <- system.file("extdata", "1590946.cif", package = "crystract")
if (file.exists(cif_path)) {
  old_threads <- data.table::setDTthreads(2)
  res <- analyze_single_cif(cif_path, perform_error_propagation = FALSE)
  data.table::setDTthreads(old_threads)
}
}
