root/galaxy-central/tools/unix_tools/join_tool.sh

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

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

行番号 
1#!/bin/sh
2
3#
4# NOTE:
5#  This is a wrapper for GNU's join under galaxy
6#  not ment to be used from command line (if you're using the command line, simply run 'join' directly...)
7#
8# All parameters must be supplied.
9# the join_tool.xml file takes care of that.
10
11JOINTYPE="$1"
12OUTPUT_FORMAT="$2"
13EMPTY_STRING="$3"
14DELIMITER="$4"
15IGNORE_CASE="$5"
16
17INPUT1="$6"
18COLUMN1="$7"
19INPUT2="$8"
20COLUMN2="$9"
21OUTPUT="${10}"
22
23if [ "$OUTPUT" == "" ]; then   
24        echo "This script is part of galaxy. Don't run it manually.\n" >&2
25        exit 1;
26fi
27
28#This a TAB hack for galaxy (which can't transfer a "\t" as a parameter)
29[ "$DELIMITER" == "tab" ] && DELIMITER="        "
30
31#Remove spaces from the output format (if the user entered any)
32OUTPUT_FORMAT=${OUTPUT_FORMAT// /}
33[ "$OUTPUT_FORMAT" != "" ] && OUTPUT_FORMAT="-o $OUTPUT_FORMAT"
34
35echo join $OUTPUT_FORMAT -t "$DELIMITER" -e "$EMPTY_STRING" $IGNORE_CASE $JOINTYPE -1 "$COLUMN1" -2 "$COLUMN2"
36#echo join $OUTPUT_FORMAT -t "$DELIMITER" -e "$EMPTY_STRING" $IGNORE_CASE $JOINTYPE -1 "$COLUMN1" -2 "$COLUMN2" "$INPUT1" "$INPUT2" \> "$OUTPUT"
37join $OUTPUT_FORMAT -t "$DELIMITER" -e "$EMPTY_STRING" $JOINTYPE -1 "$COLUMN1" -2 "$COLUMN2" "$INPUT1" "$INPUT2" > "$OUTPUT" || exit 1
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。