afm_read_bruker: Reads a Bruker afm image file

Description Usage Arguments Details Value Examples

Description

This function will read an AFM image file in .txt format from a Bruker Icon AFM. Bruker scans will be produced in .spm format and can be easily exported from the Nanoscope software as a .txt file. A header should always be included with the scan data when exporting.

Usage

1
2
3
afm_read_bruker(file = NULL, maps = "all", opt_params = list(),
  scan_size = "Scan Size", samps_per_line = "Samps/line",
  afm_lines = "Lines")

Arguments

file

The full path to the AFM .txt file

maps

Which channels from the scan you want formatted as matrices for imaging, default will return all channels

opt_params

A list of any extra parameters you want. See details

scan_size

The scan size. Drawn from the header automatically, don't change unless you know what you're doing

samps_per_line

The samples per line. Drawn from the header automatically, don't change unless you know what you're doing

afm_lines

The number of lines. Drawn from the header automatically, don't change unless you know what you're doing

Details

By default, afm_read_bruker will detect which channels are present in your data and return them as a matrix with dimensions [afm_lines, samps_per_line]. If you only want to include some maps, you must specify a character vector that contains the names of the maps you want. These names must match exactly the column names in the .txt AFM file you provided. To specify optional parameters you should make a named list. If the parameters you want are included in the header, they will be extracted if you provide a character vector that matches a header hook. ie. If you want the scan rate specify opt_params = list(scan_rate = "Scan Rate") and the number will be fetched from the header. If you want to include parameters that are not in the header, just specify them within the list as character or numerics ie. opt_params = list(sample = "mouse_cells", rep = 1). If the parameters you specify do not appear in the header, it will trigger a warning.

Value

An object of class S3 containing raw scan data, scan size, lines, samples per line, maps as rasters, and optional parameters

Examples

1
2
3
4
5
6
7
#read in with all maps and no optional params

scan_1 <- afm_read_bruker("scan_1.txt")

#read in with only height map and with optional params

scan2 <- afm_read_bruker("scan_2.txt", maps = "Height_Sensor(nm)", opt_params = list(scan_rate = "Scan Rate", rep = 1)

will-r-chase/afmr documentation built on May 9, 2019, 4:11 p.m.