greenwoodad / nmrfolderfix

Bash script for automatic renaming of Bruker NMR datasets with problematic names (ending-in-a-period, identical-to-another-except-for-case) once the data is finished acquiring.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nmrfolderfix

nmrfolderfix is a bash script for renaming NMR data folders that have problematic names, specifically folders that are identically named except for case differences (which are unique in Linux but indistinguishable on Windows and Mac), as well as for folders that end in a period (which is permissible on Linux and Mac but not on Windows). The purpose is to allow other scripts (such as https://github.com/greenwoodad/nmrsync) to automatically copy data from the Linux file system that the data was collected on to a windows file system. An email is optionally sent to the NMR manager.

I recommend running this as a cron job every five minutes on each workstation collecting NMR data.

Prerequisites

This script requires a linux operating system (I've run it in in CentOS 6.8, 7.5 and 5.1). I've only tested this with Bruker NMR data, but future releases may be able to handle file structures generated by other instruments.

The email feature requires that the application sendmail is working on the machine running the script.

Installing

git clone https://github.com/greenwoodad/nmrfolderfix

or

git clone https://(your github username)@github.com/greenwoodad/nmrfolderfix.git

followed by:

chmod +x ./nmrfolderfix/nmrfolderfix

Getting Started

Usage

nmrfolderfix [OPTIONS]... path/to/data

Options -h, -?, --help Show help message.

-p, --path Set path to data (flag optional).

-n, --nmr (default 'y') Set to 'y' for the default /(user)/nmr/(data set)/(expt #) data organization. Set it to 'n' for data organized as /(user)/(data set)/(expt #)

-e, --email (default '') Provide an email address to receive emails when folders are renamed.

To run this as a cron job, make an entry in your crontab like this:

*/5 * * * * /path/to/nmrfolderfix '/path/to/data'

Contributing

Pull requests and bug reports are welcome.

Authors

License

MIT

About

Bash script for automatic renaming of Bruker NMR datasets with problematic names (ending-in-a-period, identical-to-another-except-for-case) once the data is finished acquiring.

License:MIT License


Languages

Language:Shell 100.0%