root/galaxy-central/tools/unix_tools/cut_wrapper.sh @ 3

リビジョン 3, 0.9 KB (コミッタ: kohda, 14 年 前)

Install Unix tools  http://hannonlab.cshl.edu/galaxy_unix_tools/galaxy.html

行番号 
1#!/bin/sh
2
3##
4## Galaxy wrapper for cut command.
5##
6
7##
8## command line arguments:
9##   complement flag (might be empty string)
10##   what to cut (fields or characters)
11##   cut list (e.g. 1,2,3,4)
12##   input_file
13##   output_file
14
15COMPLEMENT="$1"
16CUTWHAT="$2"
17CUTLIST="$3"
18INPUT="$4"
19OUTPUT="$5"
20
21if [ -z "$OUTPUT" ]; then
22        echo "This script should be run from inside galaxy!" >&2
23        exit 1
24fi
25
26if [ ! -r "$INPUT" ]; then
27        echo "error: input file ($INPUT) not found!" >&2
28        exit 1
29fi
30
31# Messages printed to STDOUT will be displayed in the "INFO" field in the galaxy dataset.
32# This way the user can tell what was the command
33if [ -z "$COMPLEMENT" ]; then
34        echo -n "Extracting "
35else
36        echo "Deleting "
37fi
38
39case $CUTWHAT in
40        -f)     echo -n "field(s) "
41                ;;
42               
43        -c)     echo -n "character(s) "
44                ;;
45esac
46
47echo "$CUTLIST"
48
49
50cut $COMPLEMENT $CUTWHAT $CUTLIST < $INPUT > $OUTPUT
51
52exit
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。