This function takes neuron morphology files and converts them into standardised SWC files. It can take 23 different, common file types as input. The user gets a .zip file downloaded and a data frame of any errors or corrections made to the files.

xyz2swc_convert(
  source_dir = NULL,
  source_file = NULL,
  target_zip = file.path(getwd(), "xyz2swc.zip"),
  get_logs = TRUE,
  neuromorpho_url = "https://neuromorpho.org",
  folder = paste0(sample(letters, 10, replace = TRUE), collapse = ""),
  ...
)

Arguments

source_dir

A character string indicating the directory containing the source files.

source_file

A character string indicating the full path to the source file.

target_zip

A character string indicating the full path and filename for the resulting .zip file.

get_logs

A logical indicating whether to create a log file of any errors or corrections made to the files.

neuromorpho_url

A character string indicating the URL of the Neuromorpho website.

folder

A character string indicating the name of the folder to store the converted files on the server.

...

Additional arguments to pass to `neuromorpho_fetch`.

Value

A data frame of any errors or corrections made to the files.

See also

xyz2swc_check for a function to validate SWC files.

Examples

if (FALSE) {
# Convert a single file
xyz2swc_convert(source_file = "path/to/source/file")

# Convert all files in a directory
xyz2swc_convert(source_dir = "path/to/source/directory")

# Specify a custom URL
xyz2swc_convert(source_file = "path/to/source/file", neuromorpho_url = "https://mycustomurl.com")
}