Command-line Quick Start Guide

Contents


Why use a command-line tool?

There are any number of imaginable scenarios that might require or at least suggest the use of a command-line client. Here are several:

Because the standard output is tightly controlled (see usage for individual tools) to help automate task, capturing information is quite simple. Furthermore, the status codes are useful for automated responses to many of the problems that might occur. (See example scripts.)


How to use these tools

Step 1: Click on any of the following links to download the tool (links will be provided in each section as well):

Step 2: Unzip the downloaded archive

Step 3: In your shell, navigate to the unzipped directory

Step 4: Type the following, replacing NAME.jar with the proper name:

java -jar NAME.jar --help

This will print out the usage information, which includes a description of the tool, arguments and return codes.

Note: If java is not in your system's path, you can either add it to your path or type the full path, e.g.:

/path/to/java -jar NAME.jar --help

Download tool

Download the download tool, ZIP archive

After unziping, run the following for information on options, return codes, etc.:

java -jar Tranche-Downloader.jar --help

A minimal command would simply download a project with a certain hash. E.g.:

java -jar Tranche-Downloader.jar AWcTDlnboH/+doXe2PaN6gAnTvsT9RfJng8goVK59+Q4mPND8yWBuMNuIZ+WF74jQhRdxRbVh7mJ6wMnpf/MdV10EWUAAAAAAAABaQ==

If you run the above command, you will download the Tranche fractal.

Some projects are encrypted, so you will need to provide a passphrase:

java -jar Tranche-Downloader.jar -e supersecret sQ30yx2CIXgMCN73kZsG+uD4MINHnxkmKSyut4qil0FjPcVstlK0H8S4VE2XhdHX+iGloUkbvyXNL5lVAGoQBpC5fkkAAAAAAAACQw==

The password, "supersecret", will unencrypt the data. Without the password, the download will fail. If you run the above, you will get the same Tranche fractal—it was simply encrypted.

The standard output is the path to the directory for the downloaded directory. There are options as well for more verbose output. See the usage.


Upload tool

Download the upload tool, ZIP archive

After unziping, run the following for information on options, return codes, etc.:

java -jar Tranche-Uploader.jar --help

A minimal command would simply upload a project. E.g.:

java -jar Tranche-Uploader.jar -u bryan.zip.encrypted -p supersecret /home/besmit/data/DataForUpload

Some quick notes:

While this minimal command will upload a project, users browsing the projects using other tools (e.g., GUI, web, etc.) will not see a title nor a description. To example this example:

java -jar Tranche-Uploader.jar -t "Bryan's data submission for..." -d "Data gathered for..." -u bryan.zip.encrypted -p supersecret /home/besmit/data/DataForUpload

You may also specify paths to plain-text files containing the title and description:

java -jar Tranche-Uploader.jar -T /home/besmit/data/DataForUpload.title -D /home/besmit/data/DataForUpload.description -u bryan.zip.encrypted -p supersecret /home/besmit/data/DataForUpload

You may also encrypt the data using the -e flag:

java -jar Tranche-Uploader.jar -e passwordforproject -u bryan.zip.encrypted -p supersecret /home/besmit/data/DataForUpload

Example scripts

This section provides example scripts. For examples on using the tools individually, see the respect sections in the contents.

Sample Unix Bash shell scripts


Join group for updates

If you use either the command-line tools or API to access the Tranche network, you should join our Google Group, ProteomeCommons.org Tranche Command-Line Tools and API (link: http://groups.google.com/group/proteomecommonsorg-tranche-command-line-tools).

As a member, you will receive occasional information about new updates, bug fixes, etc. This should be a low-activity group with minimal information so that users..



Home   •   FAQ   •   Contact Us   •   Join email list   •   Collaborations   •   Credits