Skip to content
Snippets Groups Projects
Select Git revision
  • 72c86a6f8a8dbfa98b8f7d1fda6d0ad6b281c537
  • master default protected
  • gh-pages
  • build-process-upgrade-merge
  • eb-apollo-generate_names
  • BT5_travis
  • hello_github
  • v18.1.0
  • v18.0.3
  • v18.0.2
  • v18.0.1
  • v18.0.0
  • v18.0.0-RC1
  • v17.0.1
  • v17.0.0
  • v16.0.17
  • v16.0.0
  • v15.0.0
  • v14.0.0
  • v13.2.0
20 results

feature_keys

Blame
  • act 4.08 KiB
    #!/bin/bash -
    
    #
    # This script will start ACT on a UNIX system.
    #
    
    QUIET=no
    PRG=$0
    
    usage () {
    	echo "SYNOPSIS"
    	echo "       Artemis Comparison Tool (ACT): Genome Comparison Tool"
    	echo "USAGE"
    	echo "        $0 [options] <SEQUENCE_1> <COMPARISON_1_2> <SEQUENCE_2> ..."
    	echo "OPTIONS"
    	echo "        SEQUENCE                   An EMBL, GenBank, FASTA, or GFF3 file"
    	echo "        FEATURE                    An Artemis TAB file, or GFF file"
    	echo "        COMPARISON                 A BLAST comparison file in tabular format"
    	echo
    	echo "        -options FILE              Read a text file of options from FILE"
    	echo "        -chado                     Connect to a Chado database (using PGHOST, PGPORT, PGDATABASE, PGUSER environment variables)"
    	echo
    	echo "        -Dblack_belt_mode=?         Keep warning messages to a minimum [true,false]"
    	echo "        -DuserplotX=FILE[,FILE2]    For sequence 'X' open one or more userplots"
    	echo "        -DloguserplotX=FILE[,FILE2] For sequence 'X' open one or more userplots, take log(data)"
    	echo "        -DbamX=FILE[,FILE2,...]     For sequence 'X' open one or more BAM, CRAM, VCF, or BCF files"
    	echo "        -Dchado=\"h:p/d?u\"           Get ACT to open this CHADO database"
    	echo "        -Dread_only                 Open CHADO database read-only"
    	echo "EXAMPLES"
    	echo "        % act"
    	echo "        % act af063097.embl af063097_v_b132222.crunch b132222.embl"
    	echo "        % act -Dblack_belt_mode=true -Dbam1=MAL_0h.bam -Dbam2=MAL_7h.bam,var.raw.new.bcf"
    	echo "        % act -Duserplot2=/pathToFile/userPlot"
    	echo
    	echo "HOMEPAGE"
    	echo "        http://www.sanger.ac.uk/science/tools/artemis-comparison-tool-act"
        echo   
        
        exit 1
    }
    
    add_proxy_properties() {
    
    	if [[ "$http_proxy" = "" ]]
    	then
    		http_proxy=$HTTP_PROXY
    	fi
    	
    	if [[ "$http_proxy" = "" ]]
    	then
    	 	http_proxy=$HTTP_proxy
    	fi
    	
    	if [[ "$http_proxy" != "" ]]
    	then
    		APPLICATION_PROPERTIES="$APPLICATION_PROPERTIES -DproxySet=true "`echo $http_proxy | sed 's/http:\/\/\(.*\):\(.*\)/ -Dhttp.proxyHost=\1 -Dhttp.proxyPort=\2/'`
    	fi
    }
    
    #
    # Resolve links - $0 may be a link
    #
    while [ -h "$PRG" ] ; do
    	ls=`ls -ld "$PRG"`
    	link=`expr "$ls" : '.*-> \(.*\)$'`
    	if expr "$link" : '.*/.*' > /dev/null; then
    		PRG="$link"
    	else
    		PRG="`dirname $PRG`/$link"
    	fi
    done
    
    # Special Sanger override on chado PGUSER
    if [[ "$ARTEMIS_SANGER_DBUSER" != "" ]]
    then
    	export PGUSER=$ARTEMIS_SANGER_DBUSER
    fi
    
    #
    # Parse arguments.
    #
    APPLICATION_PROPERTIES="-Djdbc.drivers=org.postgresql.Driver -Dartemis.environment=UNIX $SANGER_ARTEMIS_OPTIONS"
    while test $# != 0
    do
        case $1 in
    	    -options)   APPLICATION_PROPERTIES="$APPLICATION_PROPERTIES -Dextra_options=$2"; shift ;;
    	    -chado)     APPLICATION_PROPERTIES="$APPLICATION_PROPERTIES -Dchado=$PGHOST:$PGPORT/$PGDATABASE?$PGUSER -Dibatis" ;;
    	    -D*)        APPLICATION_PROPERTIES="$APPLICATION_PROPERTIES $1" ;;
    	    -quiet)     QUIET=yes ; APPLICATION_PROPERTIES="$APPLICATION_PROPERTIES -Drun_quietly=true" ;;
    	    -help)      usage ;;
    	    --help)     usage ;;
    	    -h)         usage ;;
    	    *)          break ;;
        esac
        shift
    done
    
    APPLICATION_HOME=`dirname "$PRG"`
    JAR_NAME=act.jar
    JAR_FILE_DEFAULT=$APPLICATION_HOME/target/unix-jars/$JAR_NAME
    JAR_FILE_INSTALLED=$APPLICATION_HOME/$JAR_NAME
    
    #
    # Use a custom Java version if necessary
    #
    if [[ "$ARTEMIS_JAVA_JRE" = "" ]]
    then
    	JAVA=`which java`
    else
    	JAVA_HOME=$ARTEMIS_JAVA_JRE
    	JAVA=$ARTEMIS_JAVA_JRE/bin/java
    fi
    
    #
    # Allow URLs to work from behind firewalls.
    #
    add_proxy_properties
    
    #
    # "-mx1g" sets the maximum amount of memory to use. 
    # This may need to be increased when dealing with large files
    #
    if [[ "$ARTEMIS_JVM_FLAGS" = "" ]]
    then
        FLAGS="-mx2g -ms100m -noverify"
    else
        FLAGS="$ARTEMIS_JVM_FLAGS -noverify"
    fi
    
    PLATTMP=`uname`
    if [[ "$PLATTMP" = "Darwin" ]]
    then
      	APPLICATION_PROPERTIES="$APPLICATION_PROPERTIES -Dapple.laf.useScreenMenuBar=true -Xdock:name=ACT"
    fi
    
    if [[ "$QUIET" = no ]]
    then
        echo "Starting ACT with arguments: $FLAGS $APPLICATION_PROPERTIES $*"
    fi
    
    $JAVA $FLAGS $APPLICATION_PROPERTIES -cp ".:$JAR_FILE_DEFAULT:$JAR_FILE_INSTALLED" uk.ac.sanger.artemis.components.ActMain $*
    result=$?
    
    exit $result