Skip to content
Snippets Groups Projects
Select Git revision
  • c8c2fdc3ffdf07a3591a4d249f6706ceaa348c5f
  • master default protected
  • macos-optional-native-tray-menu
  • windows-32bit
  • gh-pages
  • restore-geometry-option
  • get-window-class-name
  • meson
  • macos-build-time
  • qt5-scripting-3
  • wayland-clipboard
  • appveyor-upgrade
  • preload-simple-commands
  • audio
  • windows-older-qt
  • fix-windows-style
  • common-library
  • osx-show-tray-menu
  • pre-commit
  • test-executable
  • client-executable
  • v4.1.0
  • v4.0.0
  • v3.13.0
  • macos-window
  • v3.12.0
  • v3.11.1
  • v3.11.0
  • v3.10.0
  • fix-mac-sleep
  • v3.9.3
  • v3.9.2
  • v3.9.1
  • v3.9.0
  • v3.8.0-osx
  • v3.8.0
  • v3.7.3-beta-osx-fix-open-in-fullscreen
  • v3.7.3
  • v3.7.2
  • v3.7.1
  • v3.7.0
41 results

CHANGES

Blame
  • To find the state of this project's repository at the time of any of these versions, check out the tags.
    run_blastn 2.16 KiB
    #!/bin/sh -
    
    # this script will run a search program on a sequence input file or on each
    # file in a file of filenames
    
    # to customise this script see the function called run_one_prog below
    
    
    RCS_HEADER="$Header: //tmp/pathsoft/artemis/etc/run_blastn,v 1.4 2005-12-20 13:49:49 tjc Exp $"
    
    PROG=`echo $RCS_HEADER | sed 's/.*run_\(.*\),v.*/\1/'`
    
    
    if [ $# = 4 -a x$1 = x-onefile ]
    then
        shift
        ONEFILE=t
        DATABASE=$3 export DATABASE
    else
        if [ $# = 2 ]
        then
            DATABASE=$2 export DATABASE
        else
            echo usage: $0 -onefile input_file output_file database
            echo    or: $0 file_of_filenames database
            exit 1
        fi
    fi
    
    
    # expand any ~ or environment variables
    #EXPANDED_DATABASE=`echo "echo $DATABASE" | /bin/csh -f`
    eval EXPANDED_DATABASE="$DATABASE"
    
    ### change this function to suit your site:
    
    run_one_prog () {
        INPUT_FILE=$1
        OUTPUT_FILE=$2
        DATABASE=$3
    
    
        ### change these lines:
        EXEC=${EXEC-`which blastall 2>/dev/null`}
    
        if [ ! -x "$EXEC" ]; then
          EXEC=`find Artemis* -name blastall 2>/dev/null`
        fi
    
        if [ ! -d "$BLASTDB" ]; then
          DATABASE_TMP="$PWD/"`find Artemis* -name blast-data 2>/dev/null`"/$DATABASE"
          if [ -f "$DATABASE_TMP" ]; then
            DATABASE="$DATABASE_TMP"
          fi
        fi
    
        echo "about to start $EXEC with input from $INPUT_FILE and output to"
        echo "$OUTPUT_FILE using database $DATABASE"
    
    
        EXTRA_ARGS=
    
        # add/change the flags to suit your site:
        nice -19 $EXEC -d $DATABASE -i $INPUT_FILE -p blastn \
          $EXTRA_ARGS 2>&1 > $OUTPUT_FILE | 
          tee ${PROG}_errors.new 1>&2
    
        #### end of changes
    
    
        # Artemis can read compressed files
        gzip -9 $OUTPUT_FILE &
    
        if [ -s ${PROG}_errors.new ]
        then
            ( echo ERROR running $PROG: ; echo; 
              echo ===================================================
              cat ${PROG}_errors.new ) >> $OUTPUT_FILE
            cat ${PROG}_errors.new >> ${PROG}_errors
        fi
    }
    
    (echo "#!/bin/sh -"; echo "kill $$") > $PROG.kill
    
    chmod a+x $PROG.kill
    
    if [ x$ONEFILE = x ]
    then
        for i in `cat $1`
        do
            run_one_prog $i $i.out $EXPANDED_DATABASE
        done
    
    else
        run_one_prog $1 $2 $EXPANDED_DATABASE
    fi
    
    exit 0