Skip to content
Snippets Groups Projects
Select Git revision
  • 7e23e2cc05c8df7071e2ad1a3179e0be01543bb3
  • 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

run_clustalx

Blame
  • run_clustalx 934 B
    #!/bin/sh -
    
    # this script will run clustalx on a temporary file containing the concatenated
    # contents of files listed in a file of filenames
    
    
    RCS_HEADER="$Header: //tmp/pathsoft/artemis/etc/run_clustalx,v 1.3 2005-02-21 11:50:01 tjc Exp $"
    
    PROG=`echo $RCS_HEADER | sed 's/.*run_\(.*\),v.*/\1/'`
    
    
    if [ $# != 1 ]
    then
        echo usage: $0 file_of_filenames
    fi
    
    (echo "#!/bin/sh -"; echo "kill $$") > $PROG.kill
    
    chmod a+x $PROG.kill
    
    file_of_filenames=$1
    date=`date +"%y_%m_%d"`
    hostname=`hostname`
    temp_file_name=/tmp/artemis_temp.$$.$hostname.$date.clustalx_input.fasta
    
    cat $file_of_filenames | xargs cat > $temp_file_name
    
    # make sure that the identifiers are unique for clustalx
    perl -pne 'if (/^>(\S+)/) {
      $name = $1;
      if (exists $h{$name}) {
        $i = $h{$name}++;
        s/^>(\S+)/>$name.$i/;
      } else {
        $h{$name} = 0;
      }
    }' $temp_file_name > $temp_file_name.processed
    
    clustalx -INFILE=$temp_file_name.processed
    
    exit 0