basename.pdb: Manipulate PDB File Names

View source: R/basename.pdb.R

basename.pdbR Documentation

Manipulate PDB File Names

Description

Removes all of the path up to and including the last path separator (if any) and the final ‘.pdb’ extension.

Usage

basename.pdb(x, mk4 = FALSE, ext=".pdb")

Arguments

x

character vector of PDB file names, containing path and extensions.

mk4

logical, if TRUE the output will be truncated to the first 4 characters of the basename. This is frequently convenient for matching RCSB PDB identifier conventions (see examples below).

ext

character, specifying the file extension, e.g. ‘.pdb’ or ‘.mol2’.

Details

This is a simple utility function for the common task of PDB file name manipulation. It is used internally in several bio3d functions and van be thought of as basename for PDB files.

Value

A character vector of the same length as the input ‘x’.

Paths not containing any separators are taken to be in the current directory.

If an element of input is ‘x’ is ‘NA’, so is the result.

Author(s)

Barry Grant

References

Grant, B.J. et al. (2006) Bioinformatics 22, 2695–2696.

See Also

basename, dirname

Examples

	basename.pdb("/somedir/somewhere/1bg2_myfile.pdb")
	basename.pdb("/somedir/somewhere/1bg2_myfile.pdb", TRUE)

bio3d documentation built on Oct. 27, 2022, 1:06 a.m.