[med-svn] [Git][med-team/sift][master] Technically works as 6.2.1.

Steffen Möller gitlab at salsa.debian.org
Fri Jul 13 12:40:55 BST 2018


Steffen Möller pushed to branch master at Debian Med / sift


Commits:
4a2c1577 by Steffen Moeller at 2018-07-13T13:39:25+02:00
Technically works as 6.2.1.

- - - - -


10 changed files:

- debian/changelog
- debian/copyright
- debian/docs
- debian/patches/fix_gcc_warnings
- debian/patches/fix_perl_interpreter_and_lib_path
- − debian/patches/jarfile
- debian/patches/ld-as-needed
- debian/patches/series
- debian/rules
- + debian/source/lintian-overrides


Changes:

=====================================
debian/changelog
=====================================
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+sift (6.2.1-1) unstable; urgency=medium
+
+  * Team upload.
+
+  * New upstream version.
+
+ -- Steffen Moeller <moeller at debian.org>  Thu, 12 Jul 2018 12:54:01 +0200
+
 sift (4.0.3b-7) UNRELEASED; urgency=medium
 
   * d/u/metadata:


=====================================
debian/copyright
=====================================
--- a/debian/copyright
+++ b/debian/copyright
@@ -7,6 +7,16 @@ Disclaimer: This package is not part of Debian because of the non-free
  FHCRC NONCOMMERCIAL LICENSE license.  The license does not restrict
  auto-building of the package.   Distribution on a royalty-free basis
  is allowed, therefore Debian is allowed to distribute the program.
+Files-Excluded: bin/choose_seqs_via_psiblastseedmedian
+                bin/clump_output_alignedseq
+                bin/consensus_to_seq
+                bin/fastaseqs
+                bin/info_on_seqs
+                bin/process_alignment
+                bin/psiblast_res_to_fasta_dbpairwise
+                bin/seqs_from_psiblast_res
+		blimps/obj/*.o
+
 
 Files: *
 Copyright: 1993-2008, Fred Hutchinson Cancer Research Center


=====================================
debian/docs
=====================================
--- a/debian/docs
+++ b/debian/docs
@@ -1,3 +1,4 @@
-README
-README_4.0.3
+#README
+#README_4.0.3
+INSTALL
 VERSION_UPDATE


=====================================
debian/patches/fix_gcc_warnings
=====================================
--- a/debian/patches/fix_gcc_warnings
+++ b/debian/patches/fix_gcc_warnings
@@ -1,8 +1,10 @@
 Description: Fix gcc warnings.
 Author: Michael Bienia <geser at ubuntu.com>
---- a/src/Alignment.c
-+++ b/src/Alignment.c
-@@ -766,7 +766,7 @@
+Index: sift/src/Alignment.c
+===================================================================
+--- sift.orig/src/Alignment.c
++++ sift/src/Alignment.c
+@@ -766,7 +766,7 @@ read_psiblast_header_until_first (FILE*
  void
  read_psiblast_header_until_first_alignment (FILE* fp)
  {
@@ -11,7 +13,7 @@ Author: Michael Bienia <geser at ubuntu.com>
  
  	read_psiblast_header_until_first (fp);
  	
-@@ -783,7 +783,7 @@
+@@ -783,7 +783,7 @@ read_psiblast_header_until_first_alignme
  int 
  read_psiblast_header_until_first_no_error (FILE* fp,int return_error )
  {
@@ -20,18 +22,11 @@ Author: Michael Bienia <geser at ubuntu.com>
  
          while (!feof (fp) && fgets (line, LINE_LEN, fp) != NULL &&
                  strstr (line, "Sequences producing significant alignments") == NULL)
-@@ -1694,7 +1694,7 @@
- 	assert (fp != NULL);
- 	fgets (line, LARGE_BUFF_LENGTH, fp);
- 	if (strstr (line, "Query") == NULL) {
--		fprintf (stderr,"%s line should have Query:\n");
-+		fprintf (stderr,"'%s' line should have 'Query'\n", line);
- 		exit (-1);
- 	}
- 	strptr = strtok (line, " \t\r\n"); /* this should be Query */
---- a/src/PN_convert.c
-+++ b/src/PN_convert.c
-@@ -2184,7 +2184,7 @@
+Index: sift/src/PN_convert.c
+===================================================================
+--- sift.orig/src/PN_convert.c
++++ sift/src/PN_convert.c
+@@ -2032,7 +2032,7 @@ void init_frq_qij()
     else
     {
        fprintf (stderr, "Can't open file '%s': %s.\n", qijname, strerror(errno) );
@@ -40,35 +35,11 @@ Author: Michael Bienia <geser at ubuntu.com>
        system( "pwd" );
        exit (-1);
     }
---- a/src/Psiblast.c
-+++ b/src/Psiblast.c
-@@ -77,14 +77,14 @@
- 
- 	buff = strstr(Buffer, "Score=");
-         if (buff != NULL) {
--                sscanf (buff, "Score = %d", alignment->score);
-+                sscanf (buff, "Score = %d", &alignment->score);
-         } else {
-                 fprintf (errorfp, "Unable to read Score, parsing incorrect");
-                 exit (-1);
-         }
-         buff = strstr (Buffer, "Expect = ");
-         if (buff != NULL) {
--                sscanf (buff, "Expect = %lf", alignment->evalue);
-+                sscanf (buff, "Expect = %lf", &alignment->evalue);
-         } else {
-                 fprintf (errorfp, "Unable to read e-value, parsing incorrect");
-                 exit (-1);
-@@ -95,7 +95,7 @@
-         fgets (Buffer, LARGE_BUFF_LENGTH, fp); /* get blank line */
-         fgets (Buffer, LARGE_BUFF_LENGTH, fp); /* get first line */;
-         get_start_pos = TRUE;
--        while (Buffer != "\n") {
-+        while ( strcmp( Buffer, "\n" ) != 0 ) {
-                 read_4_alignment_lines (Buffer, alignment, fp, get_start_pos);
-                 get_start_pos = FALSE; /* read 1rst 4 alignment lines*/
-                                         /* already got the starting pos*/
-@@ -274,7 +274,7 @@
+Index: sift/src/Psiblast.c
+===================================================================
+--- sift.orig/src/Psiblast.c
++++ sift/src/Psiblast.c
+@@ -302,7 +302,7 @@ get_top_seq (char next_seq_to_add[], Has
  	FILE* psiblastfp;
  	char name[KEY_WIDTH];
  	char *strptr;
@@ -77,25 +48,3 @@ Author: Michael Bienia <geser at ubuntu.com>
  
  
  	if ((psiblastfp = fopen (psiblastres_file, "r")) == NULL)
---- a/src/clump_output_alignedseq.c
-+++ b/src/clump_output_alignedseq.c
-@@ -137,7 +137,7 @@
- 	char queryfilename[LARGE_BUFF_LENGTH];
- 
- 	if (argc < 4) {
--		printf ("clump.c : Clusters sequences into % clus");
-+		printf ("clump.c : Clusters sequences into %% clus");
- 	}
- 
- 	if (argc > 1 ) strcpy (seqfilename, argv[1]);
---- a/src/Matrix_Info.c
-+++ b/src/Matrix_Info.c
-@@ -467,7 +467,7 @@
- 				case 2: /* +- phenotype is - */
- 					if ( matrix->weights[aa_atob[c]][l] >= 0) {
- 						pos_error_fp++;	error_fp++; 
--		printf ("incorrect less severe %d %d %c\n", l, matrix->weights[aa_atob[c]][l], c);
-+		printf ("incorrect less severe %d %g %c\n", l, matrix->weights[aa_atob[c]][l], c);
- 						print_type = print_incorrect;
- 					} else if (matrix->weights[aa_atob[c]][l] < 0){
- 					pos_notobserved_intolerant++;


=====================================
debian/patches/fix_perl_interpreter_and_lib_path
=====================================
--- a/debian/patches/fix_perl_interpreter_and_lib_path
+++ b/debian/patches/fix_perl_interpreter_and_lib_path
@@ -3,74 +3,20 @@
 * Enhance verbosity in csh scripts for bug hunting.
 * Add blast processors argument SIFT_for_submitting_fasta_seq.csh .
 * Trailing whitespace removed from lines.
---- a/bin/SIFT_exome_nssnvs.pl
-+++ b/bin/SIFT_exome_nssnvs.pl
-@@ -1,4 +1,8 @@
--#!/usr/local/bin/perl
-+#!/usr/bin/perl
-+
-+#Location of all the SIFT grot on Debian.
-+use lib '/usr/lib/sift/bin';
-+
- use List::Util qw[min max];
- use File::Copy;
- use Getopt::Std;
-@@ -12,7 +16,7 @@
- 
- $| = 1;
- system("umask 006");
--$ENV{'SIFT_HOME'} = '/usr/local/projects/SIFT/sift4.0.2/';
-+$ENV{'SIFT_HOME'} = '/usr/lib/sift/';
- my $SIFT_HOME = $ENV{'SIFT_HOME'};
- use vars qw($opt_i $opt_d $opt_o $opt_A $opt_B $opt_C $opt_D $opt_E $opt_F $opt_G $opt_H $opt_I $opt_J $opt_K $opt_L);
- getopts("i:d:o:A:B:C:D:E:F:G:H:I:J:K:L:");
-@@ -62,7 +66,7 @@
- my $oo12 = defined($opt_L) ? 1:0;
- my $pid             = $$;
- my $bin             = "$SIFT_HOME/bin";
--my $tmp = defined($opt_o) ? "$opt_o/$pid" : "$SIFT_HOME/tmp/$pid";
-+my $tmp = defined($opt_o) ? "$opt_o/$pid" : "/tmp/sift_$pid";
- my $Variation_db_dir = $opt_d;
- mkdir $tmp;
- my $num_coords_per_split = 1000;
---- a/bin/SIFT_exome_indels.pl
-+++ b/bin/SIFT_exome_indels.pl
-@@ -1,4 +1,6 @@
--#!/usr/local/bin/perl
-+#!/usr/bin/perl
-+
-+use lib '/usr/lib/sift/bin';
- 
- # This program is licensed to you under the Fred
- # Hutchinos Cancer Research Center (FHCRC)
-@@ -12,7 +14,7 @@
- use Tie::IxHash;
- use File::Copy;
- use Getopt::Std;
--$ENV{'SIFT_HOME'} = '/usr/local/projects/SIFT/sift4.0.1';
-+$ENV{'SIFT_HOME'} = '/usr/lib/sift';
- $SIFT_HOME = $ENV{'SIFT_HOME'};
- use vars qw($opt_i $opt_c $opt_d $opt_o);
- getopts("i:c:d:o:");
-@@ -38,7 +40,7 @@
- system("umask 006");
- my $bin             = "$SIFT_HOME/bin";
- my $pid             = $$;
--my $tmp = defined($opt_o) ? "$opt_o/$pid" : "$SIFT_HOME/tmp/$pid";
-+my $tmp = defined($opt_o) ? "$opt_o/$pid" : "/tmp/sift_$pid";
- require "$bin/SIFT_subroutines.pm";
- mkdir $tmp;
- chmod 0777, $tmp;
---- a/bin/perlscripts/get_BLINK_seq.pl
-+++ b/bin/perlscripts/get_BLINK_seq.pl
+Index: sift/bin/perlscripts/get_BLINK_seq.pl
+===================================================================
+--- sift.orig/bin/perlscripts/get_BLINK_seq.pl
++++ sift/bin/perlscripts/get_BLINK_seq.pl
 @@ -1,4 +1,4 @@
 -#!/usr/local/bin/perl 
 +#!/usr/bin/perl
  #use strict;
  use LWP::Simple;
  use LWP::UserAgent;
---- a/bin/seqs_chosen_via_median_info.csh
-+++ b/bin/seqs_chosen_via_median_info.csh
+Index: sift/bin/seqs_chosen_via_median_info.csh
+===================================================================
+--- sift.orig/bin/seqs_chosen_via_median_info.csh
++++ sift/bin/seqs_chosen_via_median_info.csh
 @@ -1,7 +1,8 @@
 -#!/bin/csh
 +#!/bin/csh -e
@@ -81,298 +27,21 @@
  
  # This program is licensed to you under the Fred
  # Hutchinos Cancer Research Center (FHCRC)
-@@ -9,14 +10,16 @@
- # http://blocks.fhcrc.org/sift/license.html and should be attached
- # to this software
- 
--set tmpdir = $SIFT_DIR/tmp
--set bindir = $SIFT_DIR/bin
--
--unalias cp
--unalias rm
-+unalias cp || true
-+unalias rm || true
- 
- set seq_database = $2
- set median_threshold = 2.75;
-+if ( $3 == "" ) then
-+	set blastprocessors = 1
-+else
-+	set blastprocessors = $3
-+endif
- 
- # 	Cleanup query sequence.  NCBI stuff is intolerant of format
- #	deviations.
-@@ -24,22 +27,24 @@
- set tail = $1:t
- set pid = $tail:r
- echo tail is $tail
--set query = $tmpdir/$tail.query
-+set query = $TMPDIR/$tail.query
- echo query is $query
- 
--$bindir/fastaseqs $1 $query	>& /dev/null
-+echo "fastaseqs $1 $query     >& /dev/null"
-+fastaseqs $1 $query	>& /dev/null
- 
- 
- 
- # (1) PSIBLAST
- 
-- set iterations = 1 
-+set iterations = 2
- # the query is called $$.fasta, get pid from that
- 
- #######   FILTER ############################
- #$BLASTFILTER/seg $query -x > $query.imp
-+echo "cp $query $query.unfiltered"
- cp $query $query.unfiltered
--#mv -f $query.imp $query # this has the filtered query 
-+#mv -f $query.imp $query # this has the filtered query
- 
- # b option, # of alignments to show (else it is 250)
- # m option, type of alignment 0-pairwise, 6-flat master slave w/out identites
-@@ -47,10 +52,18 @@
- # make error file & remove only if PSI-BLAST is finished within time allotted
- # not filtering query because Jorja says new statistics take care of that
- 
--echo "PSI-BLAST time limit exceeded." > $tmpdir/$pid.time.error
-+echo "PSI-BLAST time limit exceeded." > $TMPDIR/$pid.time.error
- limit cputime 30m
- 
--$NCBI/blastpgp -d $seq_database -i $query -o $query.out -m 0 -j $iterations -e .0001 -h 0.002 -b 399
-+if ( $?SIFT_DEBUG ) then
-+	echo "if ! ( -e "/tmp/savethis.out" ) blastpgp -a $blastprocessors -d $seq_database -i $query -o /tmp/savethis.out -m 0 -j $iterations -e .0001 -h 0.002 -b 399"
-+	      if ! ( -e "/tmp/savethis.out" ) blastpgp -a $blastprocessors -d $seq_database -i $query -o /tmp/savethis.out -m 0 -j $iterations -e .0001 -h 0.002 -b 399;
-+	echo "cp -a /tmp/savethis.out $query.out"
-+	cp -a /tmp/savethis.out $query.out
-+else
-+					echo "blastpgp -a $blastprocessors -d $seq_database -i $query -o $query.out        -m 0 -j $iterations -e .0001 -h 0.002 -b 399"
-+					      blastpgp -a $blastprocessors -d $seq_database -i $query -o $query.out        -m 0 -j $iterations -e .0001 -h 0.002 -b 399
-+endif
- 
- if ($status != 0) then
-         echo "exiting because stauts not equal to 0"
-@@ -59,45 +72,50 @@
- unlimit cputime
- 
- # finished within 10 minutes, remove error file
--rm -f $tmpdir/$pid.time.error
-+echo "rm -f $TMPDIR/$pid.time.error"
-+rm -f $TMPDIR/$pid.time.error
- 
- ##echo done psiblast
- 
- # get the psiblast alignment of all the sequences found.
- 
--$bindir/psiblast_res_to_fasta_dbpairwise $query.out $query.globalX $iterations $query.unfiltered
-+echo "__SIFT_BINDIR__/psiblast_res_to_fasta_dbpairwise $query.out $query.globalX $iterations $query.unfiltered"
-+      __SIFT_BINDIR__/psiblast_res_to_fasta_dbpairwise $query.out $query.globalX $iterations $query.unfiltered
- if ($status != 0) then
- 	exit (-1)
- endif
- 
--$bindir/clump_output_alignedseq $query.globalX $tmpdir/$pid.clumped .9 0 >& /dev/null
-+echo "__SIFT_BINDIR__/clump_output_alignedseq $query.globalX $TMPDIR/$pid.clumped .9 0 >& /dev/null"
-+      __SIFT_BINDIR__/clump_output_alignedseq $query.globalX $TMPDIR/$pid.clumped .9 0 >& /dev/null
- 
--echo "choose seqs time limit exceeded." > $tmpdir/$pid.time.error
-+echo "choose seqs time limit exceeded." > $TMPDIR/$pid.time.error
- limit cputime 30m
- 
--$bindir/choose_seqs_via_psiblastseedmedian $query.unfiltered $tmpdir/$pid.clumped $query.selectedclumped 1.0 $pid $median_threshold >& /dev/null
-+echo "__SIFT_BINDIR__/choose_seqs_via_psiblastseedmedian $query.unfiltered $TMPDIR/$pid.clumped $query.selectedclumped 1.0 $pid $median_threshold"
-+      __SIFT_BINDIR__/choose_seqs_via_psiblastseedmedian $query.unfiltered $TMPDIR/$pid.clumped $query.selectedclumped 1.0 $pid $median_threshold
- 
- if ($status != 0) then
-        echo "exiting because stauts not equal to 0"
-        exit (-1)
- endif
- unlimit cputime
--rm -f $tmpdir/$pid.time.error
-+rm -f $TMPDIR/$pid.time.error
- 
--$bindir/consensus_to_seq $query.selectedclumped $tmpdir/$pid.clumped.consensuskey $tmpdir/$pid.selected >& /dev/null
-+echo "__SIFT_BINDIR__/consensus_to_seq $query.selectedclumped $TMPDIR/$pid.clumped.consensuskey $TMPDIR/$pid.selected >& /dev/null"
-+      __SIFT_BINDIR__/consensus_to_seq $query.selectedclumped $TMPDIR/$pid.clumped.consensuskey $TMPDIR/$pid.selected >& /dev/null
- 
- 
--$bindir/seqs_from_psiblast_res $query.out $tmpdir/$pid.selected $iterations $query.unfiltered $tmpdir/$pid.alignedfasta $pid
-+echo "__SIFT_BINDIR__/seqs_from_psiblast_res $query.out $TMPDIR/$pid.selected $iterations $query.unfiltered $TMPDIR/$pid.alignedfasta $pid"
-+      __SIFT_BINDIR__/seqs_from_psiblast_res $query.out $TMPDIR/$pid.selected $iterations $query.unfiltered $TMPDIR/$pid.alignedfasta $pid
- 
--	rm $tmpdir/$pid.clumped*
--	rm $query.selectedclumped* 
--	rm $tmpdir/$pid.selected
--	rm $tmpdir/$pid.unaligned
--	rm $query.globalX
--	rm $tmpdir/$pid.psiblastout	
--	rm $pid.TEMP*
--	rm $query
--	rm $query.unfiltered
-+echo "rm -f"
-+	rm -f $TMPDIR/$pid.clumped*
-+	rm -f $query.selectedclumped*
-+	rm -f $TMPDIR/$pid.selected
-+	rm -f $TMPDIR/$pid.unaligned
-+	rm -f $query.globalX
-+	rm -f $TMPDIR/$pid.psiblastout
-+	rm -f $pid.TEMP*
-+	rm -f $query
-+	rm -f $query.unfiltered
- exit (0)
--
--
---- a/bin/SIFT_for_submitting_fasta_seq.csh
-+++ b/bin/SIFT_for_submitting_fasta_seq.csh
+Index: sift/bin/SIFT_for_submitting_NCBI_gi_id.csh
+===================================================================
+--- sift.orig/bin/SIFT_for_submitting_NCBI_gi_id.csh
++++ sift/bin/SIFT_for_submitting_NCBI_gi_id.csh
 @@ -1,4 +1,4 @@
 -#!/bin/csh
 +#!/bin/csh -e
  #		SIFT.csh
  # This program is licensed to you under the Fred
  # Hutchinos Cancer Research Center (FHCRC)
-@@ -10,30 +10,37 @@
- # Argument 1: the protein sequence file in fasta format
- # Argument 2: the pathname to the protein sequence database
- # Argument 3: the substitution file (file containing amino acid substitutions to be predicted on. 
-+# Argument 4: blast processors
- 
- ### Set these for your installation
- #	Location of blastpgp
--setenv NCBI /usr/local/packages/blast-2.2.18/bin/
-+#setenv NCBI /usr/local/packages/blast-2.2.18/bin/
- 
- 
- #	Location of BLIMPS
--setenv BLIMPS_DIR /opt/www/sift/sift3.0/blimps/
--
--#	Location of SIFT 
--setenv SIFT_DIR /opt/www/sift/sift3.0
-+setenv BLIMPS_DIR __MAKE_PREFIX__/share/sift/blimps
- 
- #	SIFT's output files are written here
--set tmpdir = /opt/www/sift/sift3.0/tmp
-+setenv TMPDIR `mktemp -d` || exit 1
-+
-+setenv SIFT_BINDIR __SIFT_BINDIR__
-+setenv SIFT_SCRIPTDIR __SIFT_SCRIPTDIR__
-+setenv BLASTMAT __MAKE_PREFIX__/share/ncbi/data
-+
-+if ( -e "$HOME/.siftrc" ) source "$HOME/.siftrc";
- 
- ### Shouldn't need to make any more changes, look for output in $tmpsift
--set bindir = $SIFT_DIR/bin
- set root_file = $1:r
- set tail_of_root = $root_file:t
--set tmpfasta = $tmpdir/$tail_of_root.alignedfasta
--set tmpsift = $tmpdir/$tail_of_root.SIFTprediction
--
--$bindir/seqs_chosen_via_median_info.csh $1 $2 $4
--$bindir/info_on_seqs $tmpfasta $3 $tmpsift
--echo "Output in $tmpsift"
-+set tmpfasta = $TMPDIR/$tail_of_root.alignedfasta
-+#set tmpsift = $TMPDIR/$tail_of_root.SIFTprediction
-+set tmpsift = $tail_of_root.SIFTprediction
-+
-+echo "$SIFT_SCRIPTDIR/seqs_chosen_via_median_info.csh $1 $2 $4"
-+      $SIFT_SCRIPTDIR/seqs_chosen_via_median_info.csh $1 $2 $4
-+echo "$SIFT_SCRIPTDIR/info_on_seqs $tmpfasta $3 $tmpsift"
-+      $SIFT_SCRIPTDIR/info_on_seqs $tmpfasta $3 $tmpsift
-+rm -rf $TMPDIR
-+echo "Output in ($PWD/)$tmpsift"
- 
- exit
---- a/bin/SIFT_for_submitting_NCBI_gi_id.csh
-+++ b/bin/SIFT_for_submitting_NCBI_gi_id.csh
-@@ -1,4 +1,4 @@
--#!/bin/csh
-+#!/bin/csh -e
- #		SIFT.csh
- # This program is licensed to you under the Fred
- # Hutchinos Cancer Research Center (FHCRC)
-@@ -6,53 +6,56 @@
- # http://blocks.fhcrc.org/sift/license.html and should be attached
- # to this software
- 
--# Argument 1: NCBI protein gi #. Just the number, nothing else.  
--# Argument 2: The substitution file (file containing amino acid substitutions to be predicted on. 
--# Argument 3: Type of sequences to get from NCBI BLink. "BEST" or "ALL"  
--# BEST is recommended if high-confidence scores can be obtained 
-+# Argument 1: NCBI protein gi #. Just the number, nothing else.
-+# Argument 2: The substitution file (file containing amino acid substitutions to be predicted on.
-+# Argument 3: Type of sequences to get from NCBI BLink. "BEST" or "ALL"
-+# BEST is recommended if high-confidence scores can be obtained
- 
- ### Set these for your installation
- #	Location of blastpgp
--setenv NCBI ../../blast
--setenv NCBI /usr/local/blast/
-+#setenv NCBI ../../blast
- 
- #	Location of BLIMPS
--setenv BLIMPS_DIR ../blimps
--
--#	Location of SIFT 
--setenv SIFT_DIR ../
-+setenv BLIMPS_DIR __MAKE_PREFIX__/share/sift/blimps
- 
- #	SIFT's output files are written here
--set tmpdir = ../tmp
-+setenv TMPDIR `mktemp -d` || exit 1
-+
-+setenv SIFT_SCRIPTDIR __SIFT_SCRIPTDIR__
-+setenv BLASTMAT __MAKE_PREFIX__/share/ncbi/data
-+
-+if ( -e "$HOME/.siftrc" ) source "$HOME/.siftrc";
- 
--### Shouldn't need to make any more changes, look for output in $tmpdir 
--set bindir = $SIFT_DIR/bin
-+### Shouldn't need to make any more changes, look for output in $tmpdir
- set gi = $1
- set polymorphism_file = $2
--set outfile = $tmpdir/$1.SIFTprediction
--set bestORall = $3 # if set to BEST, takes best reciprocal hits from BLink, 
-+#set outfile = $TMPDIR/$1.SIFTprediction
-+set outfile = $1.SIFTprediction
-+set bestORall = $3 # if set to BEST, takes best reciprocal hits from BLink,
- 			# otherwise it will take all hits from BLINK
- 
- # get unaligned sequences from NCBI
--set unalignedseqs = $tmpdir/$gi.unaligned
--perl $bindir/perlscripts/get_BLINK_seq.pl $gi $tmpdir/$gi.unaligned $bestORall 
-+set unalignedseqs = $TMPDIR/$gi.unaligned
-+$SIFT_SCRIPTDIR/get_BLINK_seq.pl $gi $TMPDIR/$gi.unaligned $bestORall
- 
- # getting the alignment from PSI-BLAST, quick and dirty
-  cat $unalignedseqs | perl -pe 's/\|//' | perl -pe 's/\|/\t/' | perl -pe 's/^\n//' | awk '{if ($1 ~ /^>/) { print $1} else { print;}}' > $unalignedseqs.2
-         set alignedseqs = $unalignedseqs.aligned
--        perl $bindir/perlscripts/separate_query_from_rest_of_seqs.pl $unalignedseqs.2  $unalignedseqs.queryseq  $unalignedseqs.database
--        $NCBI/formatdb -i $unalignedseqs.database -o T -p T
-+        $SIFT_SCRIPTDIR/separate_query_from_rest_of_seqs.pl $unalignedseqs.2  $unalignedseqs.queryseq  $unalignedseqs.database
-+        formatdb -i $unalignedseqs.database -o T -p T
- # extremely large evalues and multipass threshold because want to make sure get
- #all the
- # sequences the user submits
--        $NCBI/blastpgp -d $unalignedseqs.database -i $unalignedseqs.queryseq -o $unalignedseqs.psiblastout -m 0 -j 4 -e 10 -h 1 -b 399
-+        blastpgp -d $unalignedseqs.database -i $unalignedseqs.queryseq -o $unalignedseqs.psiblastout -m 0 -j 4 -e 10 -h 1 -b 399
-         echo QUERY > $unalignedseqs.listseq
-         grep ">" $unalignedseqs.database | cut -d" " -f1 | cut -c2- >> $unalignedseqs.listseq
--        $bindir/seqs_from_psiblast_res $unalignedseqs.psiblastout $unalignedseqs.listseq 4 $unalignedseqs.queryseq $alignedseqs $$
-+        seqs_from_psiblast_res $unalignedseqs.psiblastout $unalignedseqs.listseq 4 $unalignedseqs.queryseq $alignedseqs $$
- 
- 
--# final scoring 
--$bindir/info_on_seqs $alignedseqs $polymorphism_file $outfile 
-+# final scoring
-+info_on_seqs $alignedseqs $polymorphism_file $outfile
-+rm -rf $TMPDIR
-+echo "Output in ($PWD/)$outfile"
- 
- exit
- 
---- a/src/Alignment.c
-+++ b/src/Alignment.c
-@@ -17,7 +17,7 @@
+Index: sift/src/Alignment.c
+===================================================================
+--- sift.orig/src/Alignment.c
++++ sift/src/Alignment.c
+@@ -17,7 +17,7 @@ query sequence is moved to be the first
  #define _ALIGNMENT_C_
  #include "PN_convert.c"
  
@@ -381,7 +50,7 @@
  
  #include "Alignment.h"
  
-@@ -478,6 +478,7 @@
+@@ -478,6 +478,7 @@ int flat_master_slave (FILE* fp, Sequenc
  		fprintf(errorfp, "ERROR! Why haven't %s and %s been freed?\n", prev_name,
  		prev_residues);
  		fprintf (errorfp, "Current %s %s\n", name, residues);
@@ -389,7 +58,7 @@
  		exit (-1);
  	 }
  	} /* end of if (line[0] != ' ') */ 
-@@ -752,7 +753,8 @@
+@@ -752,7 +753,8 @@ read_psiblast_header_until_first (FILE*
          }
  	if (feof (fp)) {
  		fclose (fp);
@@ -399,7 +68,7 @@
                  exit (-1);
  	}
  
-@@ -792,7 +794,8 @@
+@@ -792,7 +794,8 @@ read_psiblast_header_until_first_no_erro
                  fclose (fp);
                  if (return_error) {
                          fprintf (errorfp, "ERROR! PSI-BLAST found no hits. Program terminating.\n");
@@ -409,7 +78,7 @@
                  } else {
                          return (-1);
                  }
-@@ -827,6 +830,7 @@
+@@ -827,6 +830,7 @@ printf ("finished reading psiblast file\
  	if (feof (fp)) {
  		fclose (fp);
  		fprintf (errorfp, "ERROR! PSI-BLAST found no hits. Program terminating.\n");
@@ -417,7 +86,7 @@
  		exit (-1);
  	}
  	sscanf (line, "Results from round %d", &iteration);
-@@ -1273,6 +1277,7 @@
+@@ -1213,6 +1217,7 @@ get_index_from_seqs (char name[], Sequen
  		}
  	}
  	fprintf (errorfp, "EXITING -- couldn't find %s in get_index_from_seqs\n", name);
@@ -425,7 +94,7 @@
  	exit (-1);
  }
  
-@@ -1405,8 +1410,9 @@
+@@ -1352,8 +1357,9 @@ psiblast_pairwise (FILE* fp, Sequence *
  		sscanf (strptr, "Expect = %lf", &evalue);
  		} else { 
  			fprintf (errorfp, "Unable to read e-value, parsing incorrect");
@@ -437,7 +106,7 @@
  /* printf ("evalue is %lf\n", evalue); */ 
  /* end get evalue */
  			
-@@ -1491,6 +1497,7 @@
+@@ -1439,6 +1445,7 @@ nonoverlapping (Sequence* seq1, Sequence
  	assert (seq1->length == seq2->length);
  	if (strcmp (seq1->name, seq2->name ) != 0) {
  		fprintf (errorfp, "seeing whether %s and %s overlap, should be same name\n", seq1->name, seq2->name);
@@ -445,7 +114,7 @@
  		exit (-1);
  	}
  	for (i = 0; i < seq1->length; i++) {
-@@ -1595,7 +1602,7 @@
+@@ -1543,7 +1550,7 @@ read_4lines_of_pairwise (FILE* fp, Seque
  	}
  
  	if (strstr (line, "Query") == NULL) {
@@ -454,16 +123,7 @@
  		exit (-1);
  	}
          strptr = strtok (line, " \t\r\n"); /* this should be Query */
-@@ -1687,7 +1694,7 @@
- 	assert (fp != NULL);
- 	fgets (line, LARGE_BUFF_LENGTH, fp);
- 	if (strstr (line, "Query") == NULL) {
--		printf ("%s line should have Query:\n");
-+		fprintf (stderr,"%s line should have Query:\n");
- 		exit (-1);
- 	}
- 	strptr = strtok (line, " \t\r\n"); /* this should be Query */
-@@ -2107,10 +2114,10 @@
+@@ -2052,10 +2059,10 @@ printf ("entered if statment\n");
     }
  
  
@@ -476,8 +136,10 @@
   return no_of_clumps;
  }  /* end of cluster */
  
---- a/src/blocklist.c
-+++ b/src/blocklist.c
+Index: sift/src/blocklist.c
+===================================================================
+--- sift.orig/src/blocklist.c
++++ sift/src/blocklist.c
 @@ -9,7 +9,7 @@
  #include <string.h>
  #include "blocklist.h"
@@ -487,8 +149,10 @@
  
  /*======================================================================
  routines for a list of blocks
---- a/src/choose_seqs_via_psiblastseedmedian.c
-+++ b/src/choose_seqs_via_psiblastseedmedian.c
+Index: sift/src/choose_seqs_via_psiblastseedmedian.c
+===================================================================
+--- sift.orig/src/choose_seqs_via_psiblastseedmedian.c
++++ sift/src/choose_seqs_via_psiblastseedmedian.c
 @@ -1,6 +1,6 @@
  /* (C) Copyright 2000, Fred Hutchinson Cancer Research Center */
  /* Use, modification or distribution of these programs is subject to */
@@ -527,7 +191,7 @@
  		char pid[SMALL_BUFF_LENGTH],
  		double* median_threshold);
  
-@@ -53,10 +53,10 @@
+@@ -53,10 +53,10 @@ main (int argc, char* argv[])
  	FILE* outfp; FILE* temp_chk_fp;
  	FILE* seqfp;
  	int nseqs, db_type, seq_type;
@@ -540,156 +204,7 @@
  	HashTable seqnamehash;
  	char seqname[KEY_WIDTH];
  	char pid[SMALL_BUFF_LENGTH];
-@@ -77,22 +77,22 @@
- 
- 	init_frq_qij(); /* matrix conversion in order to calculate R */
- 
--	getargs (argc, argv, query_seq_file, &seqfp,  &outfp, 
-+	getargs (argc, argv, query_seq_file, &seqfp,  &outfp,
- 		 &clumping_threshold, pid, &median_threshold);
- 	seqnamehash = InitializeTable (10);
--	
-+
- 	i = 0;
- /**************** READ IN SEQUENCES (to get info comments) ***************/
- 	nseqs = 0;
- 	db_type = type_dbs (seqfp, DbInfo); seq_type = AA_SEQ;
- 	rewind (seqfp);
--	while ( nseqs < MAXSEQ && 
-+	while ( nseqs < MAXSEQ &&
- 		(seqs[nseqs] = read_a_sequence(seqfp, db_type, seq_type)) != NULL) {
- 		nseqs++;
- 	}
- 	fclose (seqfp);
- 
--printf ("clumping teshodl is %.2f\n",clumping_threshold);	
-+fprintf( stderr, "clumping teshodl is %.2f\n",clumping_threshold);
- /**************** GET SEED BLOCK BY PERCENTAGE IDENTITY ******************/
- /*       cluster_of_seqs = cluster_seqs (clumping_threshold, seqs, nseqs,
-                                    &num_clusters);
-@@ -101,13 +101,13 @@
- */
- 
- /*only copy query sequence  (argumen 3 is 1 =>copy 1rst seq. only )*/
--	workingblock = make_block (seqs[0]->length, 0, 1, seqs, FALSE); 
-+	workingblock = make_block (seqs[0]->length, 0, 1, seqs, FALSE);
- assert (workingblock != NULL);
- 	for (i = 0; i < workingblock->num_sequences; i++) {
--		printf ("inserting %s in hash\n", workingblock->sequences[i].name);
-+		fprintf( stderr, "inserting %s in hash\n", workingblock->sequences[i].name);
- 		Insert (workingblock->sequences[i].name, seqnamehash);
- 	}
--	median = calculate_median_information_of_block (workingblock, FALSE, TRUE); 
-+	median = calculate_median_information_of_block (workingblock, FALSE, TRUE);
- 
- /* write the first sequence into a file that will be used as the query
- for the psiblast search */
-@@ -116,20 +116,20 @@
- 	write_seq_to_file (query_filename, seqs[0]);
- 
- assert (workingblock != NULL);
--printf ("median is %.2f\n", median);
-+fprintf( stderr, "median is %.2f\n", median);
- /* printf ("finished extracting\n"); */
--/*	fprintf (outfp, "*********SEED BLOCK********\n"); 
-+/*	fprintf (outfp, "*********SEED BLOCK********\n");
- 	fprintf (outfp, "median %.3f \n", median);
--	output_block_s (workingblock, outfp, FLOAT_OUTPUT);  
-+	output_block_s (workingblock, outfp, FLOAT_OUTPUT);
- 	fflush (outfp); */
--	done = FALSE; 
-+	done = FALSE;
- /**********ITERATIVE LOOP *************************************/
--while ( median > median_threshold && !done) { 
-+while ( median > median_threshold && !done) {
- 	/* before add next sequence, copy this block, which
- 	we know that passes criterion, to finalblock */
- 
- 
--        /****PSIBLAST CALL  do it only every PSIBLAST_TURN round  */ 
-+        /****PSIBLAST CALL  do it only every PSIBLAST_TURN round  */
- 		strcpy (temp_chk_filename, pid);
- 		strcat (temp_chk_filename, ".TEMP");
- 		strcpy (psiblastres_file, pid);
-@@ -138,31 +138,31 @@
- 		strcat (query_database_file, ".TEMP_DB");
- 
- /*strcpy (temp_chk_filename,"tmpout3pid.TEMP"); */
--		nseqs_written = write_seqs_not_in_hash (query_database_file, 
-+		nseqs_written = write_seqs_not_in_hash (query_database_file,
- 					seqs, nseqs,
- 					 seqnamehash);
- 		if (nseqs_written == 0) {
- 		 	fprintf (stderr, "wrote 0 seqs to database\n");
- 			done = TRUE;
- 		} else {
--		formatdb_system_call (query_database_file) ; 
-+		formatdb_system_call (query_database_file) ;
- 		if ((temp_chk_fp = fopen (temp_chk_filename, "w")) == NULL) {
- 			fprintf (errorfp, "couldn't open checkpoint file %s when choosing sequences\n", temp_chk_filename);
- 			exit (-1);
- 		}
--		block_to_checkpoint_file (workingblock, temp_chk_fp, logfp); 
--		fclose (temp_chk_fp); 
--     		printf ("prior to psiblast system call");
-+		block_to_checkpoint_file (workingblock, temp_chk_fp, logfp);
-+		fclose (temp_chk_fp);
-+     		fprintf( stderr, "prior to psiblast system call");
- 		psiblast_system_call (temp_chk_filename, query_database_file,
--				      psiblastres_file, query_filename, logfp); 
--		printf ("finished psiblast system call");
-+				      psiblastres_file, query_filename, logfp);
-+		fprintf( stderr, "finished psiblast system call");
- 		} /* end of if seqs written to database file */
- 	/****END OF PSIBLAST CALL ****/
- 
- 	/* GET TOP PSIBLAST_TURN HITS ******/
--	for (k = 0; k < PSIBLAST_TURN && !done; k++) { 
--		get_top_seq (seqname, seqnamehash, psiblastres_file); 
--		printf ( "top sequence is %s\n", seqname); 
-+	for (k = 0; k < PSIBLAST_TURN && !done; k++) {
-+		get_top_seq (seqname, seqnamehash, psiblastres_file);
-+		fprintf( stderr, "top sequence is %s\n", seqname);
- 		if (seqname[0] != '\0' && seqname[0] != ' ') {
- 		/**** ADD TOP SEQ to BLOCK *******************/
- 			index = get_index_from_seqs (seqname, seqs, nseqs);
-@@ -170,28 +170,28 @@
- 			/* block not weighted */
- 			add_sequence_to_block (workingblock,seqs[index], FALSE);
- 		        if (workingblock->num_sequences == nseqs) {
--				/* added all the possible sequences to the block 
-+				/* added all the possible sequences to the block
- 				have chosen all of the sequences, done*/
- 				done = TRUE;
- 			}
--			Insert (seqname, seqnamehash);   /* update hash */        
-+			Insert (seqname, seqnamehash);   /* update hash */
- 		} else {
-                         fprintf (stderr, "done\n");
-                         done = TRUE;
-                 }
- 	} /* done adding PSIBLAST_TURN sequences ***/
- 
--	median = calculate_median_information_of_block (workingblock, 
--								FALSE, FALSE);	
-+	median = calculate_median_information_of_block (workingblock,
-+								FALSE, FALSE);
-  	fprintf (logfp, "added %s %s median:%.3f median %d seq total\n",
-                  	workingblock->sequences[workingblock->num_sequences-1].name,
--			seqs[index]->info, median, workingblock->num_sequences); 
-+			seqs[index]->info, median, workingblock->num_sequences);
-                  	fflush (logfp); fflush (stderr);
--			fflush (errorfp); fflush (outfp); 
-+			fflush (errorfp); fflush (outfp);
- 
- 	/* prepare to run psiblast on next iteration */
-        	fprintf (stderr, "rm search files\n");
--	rm_file (temp_chk_filename); 
-+	rm_file (temp_chk_filename);
-       	rm_file (psiblastres_file);
- 	strcat (query_database_file, ".*");
- 	rm_file (query_database_file);
-@@ -208,15 +208,15 @@
+@@ -226,15 +226,15 @@ error file */
  /*		print_block_ids (workingblock, outfp, TRUE); */
  		/* should free memeory, clean up later */
  /*		fclose (outfp); fclose (errorfp); fclose (logfp);
@@ -708,7 +223,7 @@
  							FALSE, FALSE);
  		num_seqs_removed++;
  	}
-@@ -225,30 +225,30 @@
+@@ -243,30 +243,30 @@ error file */
  
  	fprintf (logfp, "********FINAL BLOCK ****** ");
  	fprintf (logfp, "last block : median %.3f with %d sequences\n", median,
@@ -748,7 +263,7 @@
  			 Sequence* seqs[MAXSEQ], int nseqs,
                                           HashTable hash)
  {
-@@ -259,7 +259,7 @@
+@@ -277,7 +277,7 @@ write_seqs_not_in_hash (char query_datab
  
  	nseqs_written = 0;
  	if ( (outfp = fopen (query_database_file, "w")) == NULL) {
@@ -757,7 +272,7 @@
  			query_database_file);
  		exit (-1);
  	}
-@@ -273,15 +273,15 @@
+@@ -291,15 +291,15 @@ write_seqs_not_in_hash (char query_datab
  
  	fclose (outfp);
  	return nseqs_written;
@@ -779,38 +294,7 @@
  	char pid[SMALL_BUFF_LENGTH],
  	double* median_threshold)
  {
-@@ -297,7 +297,7 @@
-         if (argc > 1) strcpy (query_seq_file, argv[1]);
-         else {
-                 printf ("Enter query sequence file\n");
--                gets (query_seq_file);
-+                fgets(query_seq_file, LARGE_BUFF_LENGTH, stdin );
-         }
- 
- 
-@@ -306,7 +306,7 @@
-         else
-         {
-                 printf ("Enter sequence file \n");
--                gets (seqfile);
-+                fgets(seqfile, LARGE_BUFF_LENGTH, stdin);
-         }
-         if ( (*seqfp = fopen (seqfile, "r")) == NULL )
-         {
-@@ -315,10 +315,10 @@
-         }
- 
- 	if ( argc > 3) strcpy (outfile, argv[3]);
--	else 
-+	else
- 	{
- 		printf ("Enter outfile \n");
--		gets (outfile);
-+		fgets( outfile, LARGE_BUFF_LENGTH, stdin );
- 	}
- 
-         strcpy (errorfilename, outfile);
-@@ -341,7 +341,7 @@
+@@ -359,7 +359,7 @@ getargs (int argc, char* argv[],
  	}
  
  	if (argc > 4) *clumping_threshold = atof (argv[4]);
@@ -819,21 +303,7 @@
  	{
  		printf ("Enter clumping threshold\n");
  		scanf ("%lf\n", clumping_threshold);
-@@ -351,10 +351,10 @@
- 	if (argc > 5) strcpy (pid, argv[5]);
- 	else {
- 		printf ("Enter process identification number\n");
--		gets (pid);
--		printf ("gets %s\n", pid);
-+		fgets( pid, SMALL_BUFF_LENGTH, stdin );
-+		printf ("fgets %s\n", pid);
- 	}
--	
-+
- 	if (argc > 6) *median_threshold = atof (argv[6]);
- 	else {
- 		printf ("Enter median threshold\n");
-@@ -363,10 +363,10 @@
+@@ -381,10 +381,10 @@ getargs (int argc, char* argv[],
  	}
  
  
@@ -846,9 +316,11 @@
  {
  	FILE* fp;
  
---- a/src/clump_output_alignedseq.c
-+++ b/src/clump_output_alignedseq.c
-@@ -25,7 +25,7 @@
+Index: sift/src/clump_output_alignedseq.c
+===================================================================
+--- sift.orig/src/clump_output_alignedseq.c
++++ sift/src/clump_output_alignedseq.c
+@@ -25,7 +25,7 @@ option 1 -- print out sequences that hav
  #include "Clumping.c"
  
  #define MINSEQ 2 
@@ -857,55 +329,10 @@
  #define INDEX(n, col, row) (col*n - (col*(col+3))/2 - 1 + row)
  #define MIN_CLUSTERS 3
  
-@@ -144,7 +144,7 @@
-         else
-         {
-                 printf ("Enter filename with sequences:\n");
--                gets (seqfilename);
-+                fgets( seqfilename, LARGE_BUFF_LENGTH, stdin );
-         }
-         if ((*seqfp = fopen (seqfilename, "r")) == NULL)
-         {
-@@ -156,7 +156,7 @@
-         else
-         {
-                 printf ("Enter name of outfile\n");
--                gets (outfilename);
-+                fgets( outfilename, LARGE_BUFF_LENGTH, stdin );
-         }
- 
- 
---- a/src/consensus_to_seq.c
-+++ b/src/consensus_to_seq.c
-@@ -120,7 +120,7 @@
- 	else 
-         {
-                 printf ("Enter filename with sequences:\n");
--                gets (seqfilename);
-+                fgets( seqfilename, LINE_LEN, stdin );
-         }
- 
-         if ((*seqfp = fopen (seqfilename, "r")) == NULL)
-@@ -133,7 +133,7 @@
- 	else
- 	{
- 		printf ("Enter file with keys and elements\n");
--		gets (keyfilename);
-+		fgets( keyfilename, LINE_LEN, stdin );
- 	}
- 	if ((*keyfp = fopen (keyfilename, "r")) == NULL) 
- 	{
-@@ -144,7 +144,7 @@
- 	else
- 	{
- 		printf ("Enter name of outfile\n");
--		gets (outfilename);
-+		fgets( outfilename, LINE_LEN, stdin );
- 	}
- 	if ( (*outfp = fopen (outfilename, "w")) == NULL)
- 	{
---- a/src/info_on_seqs.c
-+++ b/src/info_on_seqs.c
+Index: sift/src/info_on_seqs.c
+===================================================================
+--- sift.orig/src/info_on_seqs.c
++++ sift/src/info_on_seqs.c
 @@ -11,7 +11,7 @@
  #include "Psiblast.c"
  /* #include "Information.c */
@@ -915,7 +342,7 @@
  #define LINE_LEN 800
  #define FALSE 0
  #define TRUE 1
-@@ -198,10 +198,10 @@
+@@ -200,10 +200,10 @@ output_predictions (AAnode* polymorph_da
  	int substitution, original_aa;
  	int substitution_exists;
  	int pos;
@@ -929,7 +356,7 @@
  	int block_constructed;
  	
  	substitution_exists = FALSE;
-@@ -337,7 +337,7 @@
+@@ -339,7 +339,7 @@ comments_on_info(Block* oldblock, int po
         fprintf (outfp, "%d\n", residues_stored[pos]);
  */
  	/* the array will be sorted in call for median_of_array*/
@@ -938,7 +365,7 @@
  	median = median_of_array (info_array, prot_length);
         printf ("found mediant %.2f\n", median);
  	 fprintf (outfp, "%.3f\t%d\t%d\n",
-@@ -352,7 +352,7 @@
+@@ -354,7 +354,7 @@ printf ("looking for median\n");
  	assert (oldblock->sequences[0].sequence != NULL);
  	assert (oldblock->sequences != NULL);
  	assert (oldblock != NULL);
@@ -947,52 +374,10 @@
  }
  
  double
-@@ -524,23 +524,23 @@
- 	else
- 	{
- 		printf ("Enter filename with sequences:\n");
--		gets (seqfilename);
-+		fgets( seqfilename, LINE_LEN, stdin );
- 	}
--printf ("fawegwa\n");
-+fprintf( stderr, "%s:%d\n", __FILE__, __LINE__ );
- 	if ((*seqfp = fopen (seqfilename, "r")) == NULL)
- 	{
- 		printf ("cannot open file %s \n", seqfilename);
- 		exit (-1);
- 	}
--printf ("eaegrtjkl\n");
-+fprintf( stderr, "%s:%d\n", __FILE__, __LINE__ );
- 	if (argc > 2) strcpy (substfilename, argv[2]);
- 	else {
--		printf ("Enter file with substitutions.\n");
--		printf ("format:\n");
--		printf ("M1Y\n");
--		printf ("S2K\n");
--		printf ("...\n\n");
--		gets (substfilename);
-+		fprintf( stderr, "Enter file with substitutions.\n");
-+		fprintf( stderr, "format:\n");
-+		fprintf( stderr, "M1Y\n");
-+		fprintf( stderr, "S2K\n");
-+		fprintf( stderr, "...\n\n");
-+		fgets( substfilename, LARGE_BUFF_LENGTH, stdin );
- 	}
-         if (substfilename[0] == '-') { *polymorphfp = NULL; }
- 	else if ((*polymorphfp = fopen (substfilename, "r")) == NULL)
-@@ -553,8 +553,8 @@
- 	if (argc > 3) strcpy (outfilename, argv[3]);
- 	else 
- 	{
--		printf ("Enter name of outfile\n");
--		gets (outfilename);
-+		fprintf( stderr, "Enter name of outfile\n");
-+		fgets( outfilename, LARGE_BUFF_LENGTH, stdin );
- 	}
- 
-         strcpy (errorfilename, outfilename);
+Index: sift/src/Makefile
+===================================================================
 --- /dev/null
-+++ b/src/Makefile
++++ sift/src/Makefile
 @@ -0,0 +1,45 @@
 +include-prefix := $(prefix)
 +lib-prefix := $(prefix)
@@ -1039,9 +424,11 @@
 +include deps.mk
 +
 +# vim:ai:
---- a/src/Matrix_Info.c
-+++ b/src/Matrix_Info.c
-@@ -384,7 +384,7 @@
+Index: sift/src/Matrix_Info.c
+===================================================================
+--- sift.orig/src/Matrix_Info.c
++++ sift/src/Matrix_Info.c
+@@ -384,7 +384,7 @@ void output_Matrix_Info (Matrix_Info* in
    int pos_observed_tolerant, pos_error_tn, pos_notobserved_intolerant,
  	pos_error_fp, pos_total;
    char c; int l;
@@ -1049,26 +436,8 @@
 +  int print_correct, print_incorrect, print_X, print_type = 0;
  
  	print_correct = 1; print_incorrect = 2; print_X =3; 
-   correct = 0; error_fp=0; error_tn = 0, total=0;
-@@ -438,7 +438,7 @@
- 				 observed_tolerant++; pos_observed_tolerant++;
- 				print_type = print_correct;
- 			}
--	        	else { printf ("missing somethingdsaff\n"); }
-+	        	else { fprintf( stderr, "%s:%d missing something\n", __FILE__, __LINE__ ); }
- 		} else if (info_matrix->info[aa_atob[c]][l] == not_allowed) {
- 			if ( matrix->weights[aa_atob[c]][l] >= 0 ) 
- 			{ /* ERROR of OBSERVED, but INTOLERANT false positive */
-@@ -449,7 +449,7 @@
- 				notobserved_intolerant++; 
- 				pos_notobserved_intolerant++;
- 				print_type = print_correct;
--			} else {printf ("dfafaw\n"); }
-+			} else {fprintf( stderr, "%s:%d\n", __FILE__, __LINE__ ); }
- 		} else if (info_matrix->info[aa_atob[c]][l] == less_severe) {
- 			switch (severity_option) {
- 				case 1: /* include +- phenotype with + */
-@@ -520,7 +520,7 @@
+   error_fp=0; error_tn = 0, total=0;
+@@ -520,7 +520,7 @@ void output_Matrix_Info (Matrix_Info* in
                                                  pos_error_tn++;
  						error_tn++;
  						 print_type = print_incorrect;
@@ -1076,8 +445,8 @@
 +                                        } else {fprintf( stderr, "%s:%d something is wrong\n", __FILE__, __LINE__ );}
                                  	break;
  				case 2: /* +- phenotype is - */
-                                         if ( matrix->weights[aa_atob[c]][l] > 0.0) {
-@@ -531,7 +531,7 @@
+                                         if ( matrix->weights[aa_atob[(int)c]][l] > 0.0) {
+@@ -531,7 +531,7 @@ void output_Matrix_Info (Matrix_Info* in
                                                  pos_notobserved_intolerant++;
  						notobserved_intolerant++; 
  						print_type = print_correct;
@@ -1086,7 +455,7 @@
                                          break;
                          	default:
  					fprintf(errorfp, "severity option error %d\n", severity_option);
-@@ -612,7 +612,7 @@
+@@ -612,7 +612,7 @@ void output_Matrix_Info_float (Matrix_In
    int pos_observed_tolerant, pos_error_tn, pos_notobserved_intolerant,
          pos_error_fp, pos_total;
    char c; int l;
@@ -1094,17 +463,8 @@
 +  int print_correct, print_incorrect, print_X, print_type = 0;
  
    print_correct = 1; print_incorrect = 2; print_X =3;
-   correct = 0; error_fp=0; error_tn = 0, total=0;
-@@ -657,7 +657,7 @@
-                                  observed_tolerant++; pos_observed_tolerant++;
-                                 print_type = print_correct;
-                         }
--                        else { printf ("missing somethingdsaff\n"); }
-+                        else { fprintf( stderr, "%s:%d missing something\n", __FILE__, __LINE__ ); }
-                 } else if (info_matrix->info[aa_atob[c]][l] == not_allowed) {
-                         if ( matrix->weights[aa_atob[c]][l] >= 0.01 )
-                         { /* ERROR of OBSERVED, but INTOLERANT false positive */
-@@ -735,7 +735,7 @@
+   error_fp=0; error_tn = 0, total=0;
+@@ -735,7 +735,7 @@ void output_Matrix_Info_float (Matrix_In
                                                  pos_error_tn++;
                                                  error_tn++;
                                                   print_type = print_incorrect;
@@ -1112,8 +472,8 @@
 +                                        } else {fprintf( stderr, "%s:%d something is wrong\n", __FILE__, __LINE__ );}
                                          break;
                                  case 2: /* +- phenotype is - */
-                                         if ( matrix->weights[aa_atob[c]][l] > 0.01) {
-@@ -847,10 +847,10 @@
+                                         if ( matrix->weights[aa_atob[(int) c]][l] > 0.01) {
+@@ -847,10 +847,10 @@ void read_matrix_20_aa_body(mfp, matrix)
     */
  
    len = 0;
@@ -1126,7 +486,7 @@
    /* read in the numbers */
    while (fgets(Buffer, LARGE_BUFF_LENGTH, mfp) &&
           !blank_line(Buffer) &&
-@@ -924,7 +924,7 @@
+@@ -923,7 +923,7 @@ int
  min_aa_in_column (Matrix * matrix, int pos)
  {
  	double min;
@@ -1135,16 +495,7 @@
  
  	min = 1000;
  	for (aa = 0; aa < AAS; aa++) {
-@@ -1043,7 +1043,7 @@
- 		case 'W': return 18;
- 		case 'Y' : return 19;
- 
--		default: printf ("unknown character %c\n", c );
-+		default: fprintf( stderr, "unknown character %c\n", c );
- 	} /* end switch */
- }
- 
-@@ -1060,7 +1060,7 @@
+@@ -1038,7 +1038,7 @@ void output_Matrix_Info_float_uncertaint
    int pos_observed_tolerant, pos_error_tn, pos_notobserved_intolerant,
          pos_error_fp, pos_total;
    char c; int l;
@@ -1153,30 +504,11 @@
    int uncertain_aa, uncertain_tolerant, uncertain_intolerant;
    int pos_uncertain_aa, pos_uncertain_tolerant, pos_uncertain_intolerant;
    int total_correct, total_counted;
-@@ -1124,7 +1124,7 @@
- ;
-                                 print_type = print_correct;
-                         }
--                        else { printf ("missing somethingdsaff\n"); }
-+                        else { fprintf( stderr, "%s:%d missing something\n", __FILE__, __LINE__ ); }
-                 } else if (info_matrix->info[aa_atob[c]][l] == not_allowed) {
-                         if ( matrix->weights[aa_atob[c]][l] >= THRESHOLD )
-                         { /* ERROR of OBSERVED, but INTOLERANT false positive */
-@@ -1506,9 +1506,9 @@
- 		polymorph_data[i]->aa = aa_atob['-'];
-         	polymorph_data[i]->next = NULL;
- 	}
-- 	if (infofp == NULL) { printf ("no substitutions read\n");
-+ 	if (infofp == NULL) { fprintf( stderr, "no substitutions read\n");
- 			      return polymorph_data;} /* no file to read*/
--printf ("before seg fault?\n");
-+fprintf( stderr, "%s:%d before seg fault?\n", __FILE__, __LINE__ );
- 	while (fgets (line, LARGE_BUFF_LENGTH, infofp) != NULL) {
-                 word1[0] = '\0'; word2[0] = '\0';
-                 stringp = strtok (line, " \r\n\t");
---- a/src/PN_blocks.c
-+++ b/src/PN_blocks.c
-@@ -671,7 +671,7 @@
+Index: sift/src/PN_blocks.c
+===================================================================
+--- sift.orig/src/PN_blocks.c
++++ sift/src/PN_blocks.c
+@@ -668,7 +668,7 @@ remove_seq0_Xes_from_block (Block* block
          Block* newblock;
          Residue* residue_pointer;
          int i, pos;
@@ -1185,8 +517,10 @@
  
          non_X_length = 0;
  	for (i=0; i < block->width; i++) {
---- a/src/PN_convert.c
-+++ b/src/PN_convert.c
+Index: sift/src/PN_convert.c
+===================================================================
+--- sift.orig/src/PN_convert.c
++++ sift/src/PN_convert.c
 @@ -1,6 +1,6 @@
  /* (C) Copyright 2000, Fred Hutchinson Cancer Research Center */
  /* Use, modification or distribution of these programs is subject to */
@@ -1206,7 +540,7 @@
  throughout.
  */
  /*	system headers not in global.h */
-@@ -18,6 +18,9 @@
+@@ -18,6 +18,9 @@ throughout.
  
  #include <assert.h>
  #include <math.h>
@@ -1216,7 +550,7 @@
  #include "PN_convert.h"
  #include "queue.c"
  #include "SortList.c"
-@@ -47,7 +50,7 @@
+@@ -45,7 +48,7 @@ struct float_qij *Qij;
  void pb_weights(/*block*/);
  
  /*
@@ -1225,7 +559,7 @@
   * sequence weights.
   */
  
-@@ -133,7 +136,7 @@
+@@ -131,7 +134,7 @@ Matrix *PN_block_to_matrix(block, conver
      break;
    case 22:  /* instead of adding RTot * diffaas*/
  	    /* as in option 20, add RTot * (diffass - 1), thus not adding*/
@@ -1234,7 +568,7 @@
  	    /* qij's as pseudocounts */
      PN_altschul_data_dependent_conversion_method (block, matrix, 22);
      break;
-@@ -141,13 +144,13 @@
+@@ -139,13 +142,13 @@ Matrix *PN_block_to_matrix(block, conver
  	   /* exp. pseudocounts*/
      PN_altschul_data_dependent_conversion_method (block, matrix, 23);
      break;
@@ -1250,7 +584,7 @@
      PN_altschul_data_dependent_conversion_method (block, matrix, 26);
      break;
    case 27:
-@@ -172,7 +175,7 @@
+@@ -170,7 +173,7 @@ Matrix *PN_block_to_matrix(block, conver
  	qij_matrix_profile (block, matrix, Qij);
  	break;
     default: /* the default case */
@@ -1259,7 +593,7 @@
  	    "Invalid block to matrix conversion method specified, %d.",
  	    conversion_method);
      ErrorReport(WARNING_ERR_LVL);
-@@ -213,10 +216,10 @@
+@@ -211,10 +214,10 @@ Matrix *PN_block_to_matrix_RTot_par(bloc
  	    ErrorReport(WARNING_ERR_LVL);
  
  	 sprintf(ErrorBuffer,     /* ^^^^----------------vvvvvvvvvvvvvvvvvvv */                    "Using the default conversion method of Altschul's data-dependent method.\n");
@@ -1272,7 +606,7 @@
  
    /* return the matrix */
    return matrix;
-@@ -241,11 +244,11 @@
+@@ -239,11 +242,11 @@ static struct working *make_col()
  {
    struct working *col;
    int aa;
@@ -1286,7 +620,7 @@
    col->totcnt = col->totreg = 0.0;
    for (aa=0; aa < AASALL; aa++) {
      col->cnt[aa] = col->reg[aa] = 0.0;
-@@ -262,7 +265,7 @@
+@@ -260,7 +263,7 @@ struct work_pssm *PN_make_pssm(int lengt
    struct work_pssm *pssm;
    int pos, aa;
    double* double_pointer;
@@ -1295,7 +629,7 @@
    CheckMem(
  	   pssm = (struct work_pssm *) malloc(sizeof(struct work_pssm))
  	   );
-@@ -270,7 +273,7 @@
+@@ -268,7 +271,7 @@ struct work_pssm *PN_make_pssm(int lengt
  	double_pointer = (double*) calloc (length * AASALL, sizeof (double));
  	pssm->value = (double **) calloc (length, sizeof (double*));
  	pssm->sum = (double *) calloc (length, sizeof (double));
@@ -1304,7 +638,7 @@
    for (pos = 0; pos < length; pos++) {
  	pssm->value[pos] = &(double_pointer[pos * AASALL]);
    }
-@@ -306,7 +309,7 @@
+@@ -304,7 +307,7 @@ void counts_no_gaps (Block* block, struc
      }
    } /* end of for */
  } /* end of subroutine */
@@ -1313,7 +647,7 @@
  /*======================================================================*/
  static void counts(block, col, pos)
       Block *block;
-@@ -316,7 +319,7 @@
+@@ -314,7 +317,7 @@ static void counts(block, col, pos)
    int seq, aa, aa1;
  
    col->totcnt = col->totraw = col->totreg = 0.0;
@@ -1322,7 +656,7 @@
      col->cnt[aa] = col->raw[aa] = col->reg[aa] = 0.0;
    }
  
-@@ -358,7 +361,7 @@
+@@ -356,7 +359,7 @@ static int count_residues(col)
       struct working *col;
  {
    int aa, nr;
@@ -1331,7 +665,7 @@
    nr = 0;
    for (aa = 1; aa < AAS; aa++) {
      if (col->cnt[aa] > 0.0) nr++;
-@@ -375,9 +378,9 @@
+@@ -373,9 +376,9 @@ static void pseudo_alts(col, qij, beta)
       double beta;
  {
    int aa, row;
@@ -1343,7 +677,7 @@
    /*---------- get the pseudo counts -------------------------------*/
    for (aa=1; aa < AAS; aa++) {
      col->reg[aa] = 0.0;
-@@ -395,7 +398,7 @@
+@@ -393,7 +396,7 @@ static void pseudo_alts(col, qij, beta)
  int
  find_min_aa_in_pssm (struct working* col, struct work_pssm* pssm, const int pos)
  {
@@ -1352,7 +686,7 @@
  	double min_value;
  
  	min_value = 1000;
-@@ -422,7 +425,7 @@
+@@ -420,7 +423,7 @@ void range_on_pssm (struct working* col,
  	min_aa = find_min_aa_in_pssm(col, pssm, pos);
          min = pssm->value[pos][min_aa] * threshold;
          for (aa = 0; aa < AAS; aa++) {
@@ -1361,7 +695,7 @@
  	}
  
  
-@@ -438,14 +441,14 @@
+@@ -436,14 +439,14 @@ scoring_matrix_profile (Block* block, Ma
  	FILE* matrixfp;
  	char matrix_file[LARGE_BUFF_LENGTH];
  	int pos, original_aa, aa;
@@ -1380,51 +714,7 @@
     if ( (matrixfp = fopen (matrix_file, "r")) == NULL) {
          fprintf (errorfp, "can't read the matrix %s\n", matrix_file);
          exit (-1);
-@@ -479,7 +482,7 @@
- 
- } /* end of qij_matrix_profile */
- 
--	
-+
- static void Pauline_pseudo_alts (col, qij, epsilon)
- 	struct working* col;
-      struct float_qij *qij;
-@@ -487,7 +490,7 @@
- {
-   int aa, row;
- 
--	col->totreg = 0.0; 
-+	col->totreg = 0.0;
-   /*---------- get the pseudo counts -------------------------------*/
-   for (aa=1; aa < AAS; aa++) {
-     col->reg[aa] = 0.0;
-@@ -508,13 +511,13 @@
-      struct work_pssm *pssm;
- {
-   int aa;
--  
--  pssm->sum[pos] = 0.0; 
-+
-+  pssm->sum[pos] = 0.0;
-   for (aa=1; aa < AAS; aa++)
-   {
-     pssm->value[pos][aa] = col->cnt[aa] + col->reg[aa];
-     pssm->value[pos][aa] /= (col->totcnt + col->totreg);
--    
-+
-     /*     compute the odds ratio   */
-     if (freqs[aa] > 0.0) {
-       pssm->value[pos][aa] /= freqs[aa];
-@@ -524,7 +527,7 @@
-     if (pssm->value[pos][aa] > 0.0) {
-       pssm->value[pos][aa] = log(pssm->value[pos][aa]);
-     }
--    
-+
-     pssm->sum[pos] += pssm->value[pos][aa];
-   }
- }  /* end of log_odds */
-@@ -553,17 +556,17 @@
+@@ -502,17 +505,17 @@ static void compute_BZX(frequency, matri
    /*
     * find the partitions of D, N, E, and Q for B and Z
     */
@@ -1447,7 +737,7 @@
        (part_D * matrix->weights[aa_atob['D']][col] +
         part_N * matrix->weights[aa_atob['N']][col]);
      matrix->weights[aa_atob['Z']][col] =
-@@ -589,7 +592,7 @@
+@@ -538,7 +541,7 @@ static void compute_BZX(frequency, matri
  
  /*=========================================================================
        Adds negative minval to give all positive matrix,
@@ -1456,7 +746,7 @@
        NOTE: Not 0 to 100 because "output_matrix" routine might not leave
  	    enough space.
  ===========================================================================*/
-@@ -609,7 +612,7 @@
+@@ -558,7 +561,7 @@ static void positive_matrix(freqs, pssm,
        if (pssm->value[pos][aa] > maxval) maxval = pssm->value[pos][aa];
      }
    }
@@ -1465,7 +755,7 @@
    if (minval < 0.0) {
      factor = 99.0 / (maxval - minval);
    }
-@@ -638,7 +641,7 @@
+@@ -587,7 +590,7 @@ initialize_cutoff_freqs (double* newfreq
  {
  	int aa;
  
@@ -1474,7 +764,7 @@
  	assert (oldfreqs[MATRIX_AA_WIDTH] != NULL);
  	assert (newfreqs[MATRIX_AA_WIDTH] != NULL);
  */
-@@ -653,7 +656,7 @@
+@@ -602,7 +605,7 @@ initialize_cutoff_freqs (double* newfreq
  
  
  /* pseudocounts from Altschul's 1997 NAR gapped blast and PSI-BLAST paper */
@@ -1483,7 +773,7 @@
  psiblast_alts (Block* block, Matrix* matrix, double* freqs, struct float_qij* qij)
  {
  	double beta;
-@@ -703,14 +706,14 @@
+@@ -652,14 +655,14 @@ psiblast_alts (Block* block, Matrix* mat
    free (pssm->value); free(pssm->sum);
    free(pssm);
  
@@ -1502,7 +792,7 @@
  	for (aa = 1; aa < AAS; aa++) {
  		if (col->cnt[aa] > max) {
  			max = col->cnt[aa];
-@@ -724,7 +727,7 @@
+@@ -673,7 +676,7 @@ find_max_aa_in_col (struct working* col)
  int
  find_max_aa_in_pssm (struct work_pssm* pssm , int pos)
  {
@@ -1511,7 +801,7 @@
  	double max;
  
  	max = 0.0;
-@@ -736,7 +739,7 @@
+@@ -685,7 +688,7 @@ find_max_aa_in_pssm (struct work_pssm* p
  	}
  	return max_aa;
  }
@@ -1520,7 +810,7 @@
  /*==========================================================================
       Uses Altschul's method of getting pseudo-counts with a qij matrix,
  ===========================================================================*/
-@@ -756,12 +759,12 @@
+@@ -705,12 +708,12 @@ static void PN_make_alts(block, matrix,
    int original_aa;
    struct dirichlet* diric;
    int min_aa, max_aa;
@@ -1535,7 +825,7 @@
    char diri_file[LARGE_BUFF_LENGTH];
  
  	if (scale == 30) {
-@@ -774,15 +777,15 @@
+@@ -723,15 +726,15 @@ static void PN_make_alts(block, matrix,
    col = make_col();
    pssm = PN_make_pssm(block->width);
  
@@ -1556,7 +846,7 @@
    /*--------------  Do one position at a time -------------------*/
    for (pos = 0; pos < block->width; pos++)
    {
-@@ -796,8 +799,8 @@
+@@ -745,8 +748,8 @@ printf ("diri file loaded\n");
  	if (itemp ==1 ) {epsilon = 0; }
  	else {
  		original_aa = block->residues[0][pos];
@@ -1567,7 +857,7 @@
         }
  
      } else if (scale == 20) {
-@@ -813,7 +816,7 @@
+@@ -762,7 +765,7 @@ printf ("diri file loaded\n");
      /*---------- get the pseudo counts -------------------------------*/
      if (scale == 27 || scale == 29 || scale == 30 || scale == 26) {
                  diri_pseudo = TRUE;
@@ -1576,7 +866,7 @@
      } else {
          pseudo_alts(col, qij, epsilon);
      }
-@@ -832,8 +835,8 @@
+@@ -781,8 +784,8 @@ printf ("diri file loaded\n");
  
         /*    Count+pseudo proportions; returned if scale == 20   */
         if (scale <= 20 || scale == 22 || scale == 25 || scale == 23
@@ -1587,7 +877,7 @@
         {
            pssm->value[pos][aa] = col->cnt[aa] + col->reg[aa];
          if ( (col->totcnt + col->totreg) > 0.0)
-@@ -890,7 +893,7 @@
+@@ -839,7 +842,7 @@ printf ("diri file loaded\n");
    /*       by subtracting the min. value for all positions ----- */
    if (!scale) positive_matrix(freqs, pssm, matrix);
  
@@ -1596,7 +886,7 @@
    free (diric);
    free(col);
    free_struct_work_pssm (pssm );
-@@ -903,7 +906,7 @@
+@@ -852,7 +855,7 @@ printf ("left make _alts\n");
  option:  diri_pseudocounts
  	  TRUE: use 13-component Dirichlet
  	  FALSE use BLOSUM62 qij's
@@ -1605,7 +895,7 @@
  	      FALSE - just look at 20 amino acids
  option:  exp (m)
  	 m=0 # of amino acids at pos (default)
-@@ -919,9 +922,9 @@
+@@ -868,9 +871,9 @@ SIFT_prediction (Block* block, int diri_
  	Matrix* pssm;
  
  	pssm =  copy_block_info_to_matrix (block);
@@ -1617,7 +907,7 @@
                  exit (-1);
          }
          normalize  (block);
-@@ -963,13 +966,13 @@
+@@ -912,13 +915,13 @@ void calculate_counts (Block* block)
  		for (aa = 1; aa < AAS; aa++) {
  			printf ("pos %d aa %c counts %.2f weight %.2f\n",
  			pos, aa_btoa[aa], col->cnt[aa], col->totcnt);
@@ -1635,7 +925,7 @@
  		int exp_option, int subtract_threshold)
  {
    double dtemp, dtemp2, epsilon;
-@@ -984,7 +987,7 @@
+@@ -933,7 +936,7 @@ static void SIFT_alts(Block* block, Matr
    int div_by_max;
    int rank_matrix[AAS][AAS];
    FILE* rfp;
@@ -1644,7 +934,7 @@
    char diri_file[LARGE_BUFF_LENGTH];
  
    div_by_max = TRUE;
-@@ -992,25 +995,25 @@
+@@ -941,25 +944,25 @@ static void SIFT_alts(Block* block, Matr
    col = make_col();
    pssm = PN_make_pssm(block->width);
  
@@ -1676,7 +966,7 @@
  
      /*-------- determine total number of pseudo-counts in column ------*/
      epsilon = 0;
-@@ -1020,24 +1023,24 @@
+@@ -969,24 +972,24 @@ static void SIFT_alts(Block* block, Matr
      if (exp_option == 1) {
  	/*printf ("pos %d :  ", pos); */
  	dtemp = similarity_dependent_scale_0(col, rank_matrix, original_aa);
@@ -1710,7 +1000,7 @@
  
      /*---------   Fill in the matrix entries --------------------*/
      pssm->sum[pos] = 0.0;
-@@ -1058,11 +1061,11 @@
+@@ -1007,11 +1010,11 @@ static void SIFT_alts(Block* block, Matr
         for (aa = 1; aa < AAS; aa++) {
  		pssm->value[pos][aa] /= min_freq;
  	}
@@ -1724,7 +1014,7 @@
     	}
     }
  
-@@ -1078,7 +1081,7 @@
+@@ -1027,7 +1030,7 @@ static void SIFT_alts(Block* block, Matr
  	if (  (matrix->weights[original_aa][pos] < TOLERANCE_PROB_THRESHOLD
  			 && (!subtract_threshold))
  		||
@@ -1733,7 +1023,7 @@
  	) {
  		printf ("WARNING!!! Amino acid %c at pos %d in your original sequence had score %.3f and was not allowed by the prediction.<BR>\n", aa_btoa[original_aa], pos + 1, matrix->weights[original_aa][pos]);
  	}
-@@ -1111,7 +1114,7 @@
+@@ -1060,7 +1063,7 @@ void SIFT_alts_test(Block* block, Matrix
    int div_by_max;
    int rank_matrix[AAS][AAS];
    FILE* rfp;
@@ -1742,7 +1032,7 @@
    char diri_file[LARGE_BUFF_LENGTH];
    char matrix_file[LARGE_BUFF_LENGTH];
  
-@@ -1121,7 +1124,7 @@
+@@ -1070,7 +1073,7 @@ void SIFT_alts_test(Block* block, Matrix
    col = make_col();
    pssm = PN_make_pssm(block->width);
    diri_pseudocounts = TRUE;
@@ -1751,7 +1041,7 @@
  
     sprintf (diri_file , "%s/docs/default.diri", blimps_dir);
  
-@@ -1132,8 +1135,8 @@
+@@ -1080,8 +1083,8 @@ void SIFT_alts_test(Block* block, Matrix
  
          construct_rank_matrix ( rank_matrix);
     }
@@ -1760,9 +1050,9 @@
 +  sprintf (matrix_file, "%s/docs/default.qij", blimps_dir );
 +  init_frq_qij_for_matrix (matrix_file);
  
-   /*--------------  Do one position at a time -------------------*/
    for (pos = 0; pos < block->width; pos++)
-@@ -1262,7 +1265,7 @@
+   {
+@@ -1200,7 +1203,7 @@ gap_pseudocounts ( struct working* col,
  
  }
  
@@ -1771,7 +1061,7 @@
  ratio_mutated_to_normal (struct working* col, int standard_aa)
  {
  	int aa;
-@@ -1280,7 +1283,7 @@
+@@ -1218,7 +1221,7 @@ assign_gap_positive_scores (Matrix* matr
  {
  	int gaps;
  	int seq;
@@ -1780,7 +1070,7 @@
  	assert (matrix->block != NULL);
  /* 	printf ("entering gap_positive scores\n"); */
  	gaps = 0;
-@@ -1292,7 +1295,7 @@
+@@ -1230,7 +1233,7 @@ assign_gap_positive_scores (Matrix* matr
  	if (gaps == 0) { /* printf ("no gaps\n"); */return; }
  	else { /* printf ("gaps %d\n", gaps) ; */
  			assign_positive_scores_to_column (matrix, pos, gaps); }
@@ -1789,7 +1079,7 @@
  } /* end of assign_gap_positive_scores */
  
  void
-@@ -1305,7 +1308,7 @@
+@@ -1242,7 +1245,7 @@ assign_positive_scores_to_column (Matrix
  	for (aa = 1; aa < AAS; aa++) {
  		matrix->weights[aa][pos] = 0.05;
  	}
@@ -1798,7 +1088,7 @@
  
  /*=========================================================================
      Normalize sequence weights to add up to the number of sequences
-@@ -1337,11 +1340,11 @@
+@@ -1274,11 +1277,11 @@ PN_altschul_data_dependent_conversion_me
      }
  
    /* check to see if the block has sequence weights */
@@ -1814,57 +1104,7 @@
  }
  
  /*
-@@ -1383,7 +1386,7 @@
-   for (clust=0; clust<block->num_clusters; clust++) {
-     weight = 1.0/(double)block->clusters[clust].num_sequences;
-     /* fill each sequence in the cluster */
--    for (seq=seq_num; seq<seq_num+block->clusters[clust].num_sequences; 
-+    for (seq=seq_num; seq<seq_num+block->clusters[clust].num_sequences;
- 	 seq++) {
-       seq_weight[seq] = weight;
-     }
-@@ -1402,7 +1405,7 @@
-  *   Return codes: a pointer to the sequence weights array.
-  *   Error codes: NULL if all of the weights in the block are <= zero.
-  */
-- 
-+
- static double *pre_weighted_sequences(block)
-      Block* block;
- {
-@@ -1422,9 +1425,9 @@
-   CheckMem(
- 	   seq_weight = (double *) calloc(block->num_sequences, sizeof(double))
- 	   );
--  
-+
-   num_seqs = block->num_sequences;
--  
-+
-   /* fill each sequence weight from the block */
-   max_weight = 0.0;
-   for (seq=0; seq<num_seqs; seq++) {
-@@ -1437,16 +1440,16 @@
-   if (max_weight <= 0) {
-     /* all weights were zero */
-     free(seq_weight);
--    
-+
-     return NULL;  /* the error is handled in the calling function */
--  }	    
-+  }
- 
-   return seq_weight;
- }  /* end of pre_weighted_sequences  */
- 
- 
- /*
-- * Matrix construction methods.  Build matricies from blocks and 
-+ * Matrix construction methods.  Build matricies from blocks and
-  * sequence weights.
-  */
- 
-@@ -1456,7 +1459,7 @@
+@@ -1304,7 +1307,7 @@ printf ("exit PN_make_alts\n");
   */
  
  
@@ -1873,7 +1113,7 @@
   * basic_matrix_construction
   *   This is the most general matrix construction method.  Each
   *   occurence of a residue in a sequence contributes the sequence
-@@ -1468,7 +1471,7 @@
+@@ -1316,7 +1319,7 @@ printf ("exit PN_make_alts\n");
   *     X, '-', '*', & non-code scores are read straight from the frequencies
   *     the frequencies for B and Z are ignored, when a B or Z is encountered
   *       it is partitioned between D & N or E & Q.
@@ -1882,7 +1122,7 @@
   *       D & N and E & Q.
   *   Parameters:
   *     Block *block:       the block to be converted
-@@ -1512,13 +1515,13 @@
+@@ -1360,13 +1363,13 @@ static void basic_matrix_construction(bl
    /*
     * find the partitions of D, N, E, and Q for B and Z
     */
@@ -1900,7 +1140,7 @@
      ( frequency[aa_atob['E']] + frequency[aa_atob['Q']] );
  
  
-@@ -1553,13 +1556,13 @@
+@@ -1401,13 +1404,13 @@ static void basic_matrix_construction(bl
        /* otherwise, if it is B, partition B between D and N */
        else if (res == aa_atob['B']) {
  	if (frequency[aa_atob['D']] != 0.0) { /* try to protect div by zero */
@@ -1916,7 +1156,7 @@
  	    (part_N * seq_weight[seq]) / frequency[aa_atob['N']];
  	  total +=
  	    (part_N * seq_weight[seq]) / frequency[aa_atob['N']];
-@@ -1568,13 +1571,13 @@
+@@ -1416,13 +1419,13 @@ static void basic_matrix_construction(bl
        /* otherwise, if it is Z, partition Z between E and Q */
        else if (res == aa_atob['Z']) {
  	if (frequency[aa_atob['E']] != 0.0) { /* try to protect div by zero */
@@ -1932,7 +1172,7 @@
  	    (part_Q * seq_weight[seq]) / frequency[aa_atob['Q']];
  	  total +=
  	    (part_Q * seq_weight[seq]) / frequency[aa_atob['Q']];
-@@ -1602,7 +1605,7 @@
+@@ -1450,7 +1453,7 @@ static void basic_matrix_construction(bl
      }
  
      /* fill in the matrix for B, Z, X, gap, stop and non */
@@ -1941,7 +1181,7 @@
        (part_D * matrix->weights[aa_atob['D']][col] +
         part_N * matrix->weights[aa_atob['N']][col]);
      matrix->weights[aa_atob['Z']][col] =
-@@ -1637,7 +1640,7 @@
+@@ -1485,7 +1488,7 @@ get_consensus (Matrix* matrix)
  	int pos;
  
  	seq = (Sequence *) malloc (sizeof (Sequence));
@@ -1950,7 +1190,7 @@
  	strcpy (seq->name, "CONSENSUS");
  	seq->info[0] = '\0';
  	seq->position = 0;
-@@ -1647,7 +1650,7 @@
+@@ -1495,7 +1498,7 @@ get_consensus (Matrix* matrix)
  	for (pos = 0; pos < matrix->width; pos++) {
  		res = find_max_aa_in_pos (matrix, pos);
  		seq->sequence[pos] = res;
@@ -1959,7 +1199,7 @@
  	}
  	return seq;
  
-@@ -1709,7 +1712,7 @@
+@@ -1557,7 +1560,7 @@ cumulative_prob (double col[MATRIX_AA_WI
  {
  	int i;
  	double index;
@@ -1968,7 +1208,7 @@
  
  	index = 0;
  
-@@ -1721,7 +1724,7 @@
+@@ -1569,7 +1572,7 @@ cumulative_prob (double col[MATRIX_AA_WI
  }
  
  
@@ -1977,7 +1217,7 @@
  MATRIX_AA_WIDTH states ranging from 0 to 1 */
  int
  random_pick (double* P)
-@@ -1732,13 +1735,13 @@
+@@ -1580,13 +1583,13 @@ random_pick (double* P)
  /*	printf ("random pick: "); */
          random =   (double) rand() /  (double) RAND_MAX * 100 ;
          while (random > P[i] && i < MATRIX_AA_WIDTH) {
@@ -1993,7 +1233,7 @@
          	return (i);
  	}
  }
-@@ -1924,21 +1927,21 @@
+@@ -1772,21 +1775,21 @@ int scores[24][24];
  
  /*=====================================================================*/
  /*   This routine initializes the blimps global variables
@@ -2019,7 +1259,7 @@
     RTot = LOCAL_QIJ_RTOT;
  }  /* end of frq_qij */
  
-@@ -1995,7 +1998,7 @@
+@@ -1843,7 +1846,7 @@ void pseudo_diric(struct working* col, s
        {
           col->probj[j] = log(diric->q[j]) + col->probn[j] - denom;
  /*       printf("j=%d probn[j]=%f probj[j]=%f\n",
@@ -2028,7 +1268,7 @@
  
        }
  
-@@ -2004,31 +2007,31 @@
+@@ -1852,31 +1855,31 @@ void pseudo_diric(struct working* col, s
  	 for (aa = 1; aa < AAS; aa++)
        {
           for (j = 0; j < diric->ncomp; j++) {
@@ -2067,7 +1307,7 @@
          double min;
  
          min = 10000;
-@@ -2042,10 +2045,10 @@
+@@ -1890,10 +1893,10 @@ find_min_aa_in_col_reg (struct working*
          return min_aa;
  }
  
@@ -2080,7 +1320,7 @@
  	double min;
  
  	min = 1000;
-@@ -2073,7 +2076,7 @@
+@@ -1921,7 +1924,7 @@ struct dirichlet *load_diri_file (char f
          struct dirichlet *diric;
  	double denom;
  	double background_frequency[21];
@@ -2089,7 +1329,7 @@
  	if ((fin = fopen (filename, "r")) == NULL) {
  		fprintf (errorfp, "Cannot open dirichlet file %s\n", filename);
  		exit (-1);
-@@ -2124,7 +2127,7 @@
+@@ -1972,7 +1975,7 @@ struct dirichlet *load_diri_file (char f
  	for (aa = 1; aa < AAS; aa++) {
  		denom = 0.0;
  		for (i = 0; i < numc; i++) {
@@ -2098,7 +1338,7 @@
  							diric->altot[i]);
  		}
  		background_frequency[aa] = denom;
-@@ -2132,7 +2135,7 @@
+@@ -1980,7 +1983,7 @@ struct dirichlet *load_diri_file (char f
  	for (i =0; i < numc; i++) {
  	/*	printf ("Component %d ratio of aa relative to background \n", i); */
  		for (aa = 1; aa < AAS; aa++) {
@@ -2107,7 +1347,7 @@
  	diric->alpha[i][aa]/(diric->altot[i] * background_frequency[aa]);
  		}
  	}
-@@ -2142,7 +2145,7 @@
+@@ -1990,7 +1993,7 @@ struct dirichlet *load_diri_file (char f
  
  
  
@@ -2116,7 +1356,7 @@
  cutoff_target_freq (double* cutoff_freq, int original_aa, struct float_qij *qij)
  {
  
-@@ -2160,8 +2163,9 @@
+@@ -2008,8 +2011,9 @@ cutoff_target_freq (double* cutoff_freq,
  void init_frq_qij()
  {
     FILE *fqij;
@@ -2128,7 +1368,7 @@
  	/*"/howard/servers/blimps/blimps";*/ /* getenv("BLIMPS_DIR"); */
     if (blimps_dir != NULL)
     {
-@@ -2177,6 +2181,13 @@
+@@ -2025,6 +2029,13 @@ void init_frq_qij()
     Qij = NULL;
     if ( (fqij=fopen(qijname, "r")) != NULL)
     { Qij = load_qij(fqij); fclose(fqij);  }
@@ -2142,7 +1382,7 @@
     RTot = LOCAL_QIJ_RTOT;
  }  /* end of frq_qij */
  
-@@ -2195,7 +2206,7 @@
+@@ -2043,7 +2054,7 @@ similarity_dependent_scale_0 (struct wor
    original_aa = max_aa; /* change to max aa 10/24/00 */
  
    n = 0;
@@ -2151,7 +1391,7 @@
    for (aa = 1; aa <= 20 ; aa++) {
          if (col->cnt[aa] > 0.0) {
                  n++;
-@@ -2217,20 +2228,20 @@
+@@ -2065,20 +2076,20 @@ construct_rank_matrix (int rank_matrix[A
  	struct float_qij* rank_Qij;
  	FILE* qijfp;
  	int aa;
@@ -2177,7 +1417,7 @@
  
          for (original_aa = 0; original_aa < AAS; original_aa++) {
                  copy_values_to_ranklist (aalist, original_aa, rank_Qij);
-@@ -2248,14 +2259,14 @@
+@@ -2096,14 +2107,14 @@ assign_ranks (int rank_matrix[AAS][AAS],
  
          for (rank = 0; rank < AAS; rank++) {
                  aa = aalist[rank].aa;
@@ -2194,7 +1434,7 @@
  			struct float_qij* rankQij) {
  
          int aa;
-@@ -2263,8 +2274,8 @@
+@@ -2111,8 +2122,8 @@ copy_values_to_ranklist (struct rank_cel
  	/* 01/03/00 rankQij has -1 for gap, which will mess up
  	ranks.  Assign it a really negative value so it will have
  	the lowest rank */
@@ -2205,7 +1445,7 @@
  	aalist[0].value = -50;
  
          for (aa = 1; aa < AAS; aa++) {
-@@ -2332,7 +2343,7 @@
+@@ -2180,7 +2191,7 @@ number_of_real_aminoacids (Block* block,
  
  	count = 0;
  	for (seq = 0; seq < block->num_sequences; seq++) {
@@ -2214,7 +1454,7 @@
  			block->residues[seq][pos] <=20) {
  			count++;
  		}
-@@ -2341,7 +2352,7 @@
+@@ -2189,7 +2200,7 @@ number_of_real_aminoacids (Block* block,
  } /* end of number_of_real_aminoacids */
  
  double*
@@ -2223,7 +1463,7 @@
  {
  	double* fraction_stored;
  	double percent_obsaa_div_seq;
-@@ -2371,15 +2382,15 @@
+@@ -2219,15 +2230,15 @@ calculate_basic_aa_stored (Block* block)
  }
  
  void
@@ -2242,9 +1482,11 @@
  
  }
  
---- a/src/Protdist.c
-+++ b/src/Protdist.c
-@@ -124,7 +124,7 @@
+Index: sift/src/Protdist.c
+===================================================================
+--- sift.orig/src/Protdist.c
++++ sift/src/Protdist.c
+@@ -124,7 +124,7 @@ seq_with_max_dist (struct score_pair* pa
  {
  	double max_dist;
  	int i;
@@ -2253,8 +1495,10 @@
  
  	max_dist = 0;
  
---- a/src/Psiblast.c
-+++ b/src/Psiblast.c
+Index: sift/src/Psiblast.c
+===================================================================
+--- sift.orig/src/Psiblast.c
++++ sift/src/Psiblast.c
 @@ -1,6 +1,6 @@
  /* (C) Copyright 2000, Fred Hutchinson Cancer Research Center */
  /* Use, modification or distribution of these programs is subject to */
@@ -2263,15 +1507,7 @@
  
  #ifndef _PSIBLAST_C_
  #define _PSIBLAST_C_
-@@ -9,6 +9,7 @@
- #include "Alignment.c" /* for the function read_psiblast_header_until_first*/
- #include "PN_convert.c"
- #include "stringhash.c"
-+#include <inttypes.h>
- 
- void process_sequence_line(Sequence* seq, char* buff);
- 
-@@ -18,7 +19,7 @@
+@@ -20,7 +20,7 @@ read_psiblast_entry ( FILE* fp, char Buf
  /* passing first line in entry that begins with >seq_id in Buffer */
          Aligned_Pair* alignment, *new_alignment;
  	Aligned_Pair * cursor;
@@ -2280,7 +1516,7 @@
          alignment = initialize_Aligned_Pair (Buffer);
  	cursor = alignment;
  
-@@ -33,14 +34,14 @@
+@@ -35,14 +35,14 @@ read_psiblast_entry ( FILE* fp, char Buf
  		new_alignment =initialize_Aligned_Pair (Buffer);
  		cursor->next = new_alignment;
  		cursor = new_alignment;
@@ -2297,7 +1533,7 @@
  {
  	Aligned_Pair* alignment;
  	char* stringptr;
-@@ -68,7 +69,7 @@
+@@ -70,7 +70,7 @@ initialize_Aligned_Pair (char Buffer[LAR
  } /* end of initialize_Aligned_Pair*/
  
  void
@@ -2306,7 +1542,7 @@
  				char Buffer[LARGE_BUFF_LENGTH], FILE* fp)
  {
          char* buff;
-@@ -165,7 +166,7 @@
+@@ -167,7 +167,7 @@ void process_sequence_line(Sequence* seq
    /* Note: The buff may have characters that are not residues, this is */
    /*       ok, there will just be a little extra space */
    while ((saved_length + estimated_length) > seq->max_length) {
@@ -2315,7 +1551,7 @@
    }
  
    /* temporarily increase the room to put the sequence into */
-@@ -192,23 +193,23 @@
+@@ -194,23 +194,23 @@ free_aligned_pair (Aligned_Pair* alignme
  		free (alignment);
  	}
  	alignment = NULL;
@@ -2347,77 +1583,7 @@
  	for (pos = 0; pos < block->width; pos++)
  	{
  		ctemp[0] = toupper (aa_btoa[block->sequences[0].sequence[pos]]);
-@@ -222,24 +223,24 @@
- 		}
- 	}
- 	free_matrix (pssm);
--printf ("finished converting to checkpointsuccessful\n");
--	
-+fprintf( stderr, "finished converting to checkpoint successful\n");
-+
- } /* end block_to_checkpoint_file */
- 
- void
- psiblast_system_call (char chkpoint_filename[], char database[],
- 			 char result_file[], char query_seq_file[], FILE* outfp)
- {
-+	int ret;
- 	char command_line[LARGE_BUFF_LENGTH * 4];
--        char* ncbi_dir;
--
--	ncbi_dir = getenv ("NCBI");
- 
--	sprintf (command_line, "%s/blastpgp -d %s -i %s -o %s -m 6 -R %s\n",
--		ncbi_dir, database, query_seq_file, result_file, 
-+	sprintf (command_line, "blastpgp -d %s -i %s -o %s -m 6 -R %s",
-+		database, query_seq_file, result_file,
- 		chkpoint_filename);
--	system (command_line);
-+	fprintf( stderr, "%s:%d About to call '%s'\n", __FILE__, __LINE__, command_line );
-+	ret = system (command_line);
- 
-+	if( ret ) { fprintf( stderr, "%s:%d Error calling '%s'!\n", __FILE__, __LINE__, command_line ); exit(-1); }
- }
- 
- void
-@@ -247,29 +248,27 @@
- {
- 	char command_line[LARGE_BUFF_LENGTH];
- 
--	sprintf (command_line, "rm -f %s\n", filename);
--	system ("unalias rm");
-+	sprintf (command_line, "\\rm -f %s\n", filename);
-+	//system ("unalias rm");
- 	system (command_line);
- }
- 
--void 
-+void
- formatdb_system_call (char database[])
- {
- 	char command_line[LARGE_BUFF_LENGTH *2];
--	char* ncbi_dir;
- 
--	ncbi_dir = getenv ("NCBI");
--	sprintf (command_line, "%s/formatdb -i %s -o T -p T\n", ncbi_dir, database);
--	printf ("formatting database command_line %s\n", command_line);
-+	sprintf (command_line, "formatdb -i %s -o T -p T\n", database);
-+	fprintf( stderr, "formatting database command_line %s\n", command_line);
- 	system (command_line);
--	printf ("finished formatting database\n");
-+	fprintf( stderr, "finished formatting database\n");
- } /* end formatdb_system_call */
- 
- /* opens psiblast result file and reads the top-scoring matches.  The top match
- that isn't already in the sequence name hash is returned in next_seq_to_add.
- */
- void
--get_top_seq (char next_seq_to_add[], HashTable namehash, 
-+get_top_seq (char next_seq_to_add[], HashTable namehash,
- 		char psiblastres_file[])
- {
- 	FILE* psiblastfp;
-@@ -286,7 +285,7 @@
+@@ -313,7 +313,7 @@ get_top_seq (char next_seq_to_add[], Has
  
  
  	if (read_psiblast_header_until_first_no_error (psiblastfp, FALSE) == -1) {
@@ -2426,7 +1592,7 @@
  	} else {
  
  	fgets (line, LINE_LEN, psiblastfp);
-@@ -295,24 +294,24 @@
+@@ -322,24 +322,24 @@ get_top_seq (char next_seq_to_add[], Has
  	assert ( strlen(strptr) < KEY_WIDTH);
  	strncpy (name, strptr, KEY_WIDTH);
  	name[KEY_WIDTH-1] = '\0';
@@ -2455,10 +1621,12 @@
 +
  } /* end get_top_seq */
  
- #endif
---- a/src/psiblast_res_to_fasta_dbpairwise.c
-+++ b/src/psiblast_res_to_fasta_dbpairwise.c
-@@ -32,8 +32,8 @@
+ char* substring(Sequence* seq, int begin, int len)
+Index: sift/src/psiblast_res_to_fasta_dbpairwise.c
+===================================================================
+--- sift.orig/src/psiblast_res_to_fasta_dbpairwise.c
++++ sift/src/psiblast_res_to_fasta_dbpairwise.c
+@@ -32,8 +32,8 @@ Output2: Sequences found with residues f
  #include "Protdist.c"
  #include "Psiblast.c"
  
@@ -2469,7 +1637,7 @@
  #define LINE_LEN 800
  #define FALSE 0
  #define TRUE 1
-@@ -113,17 +113,17 @@
+@@ -113,17 +113,17 @@ int main
  
  	free_seqs (alignedseqs, nseqs);
          if (nseqs < MIN_SEQ) {
@@ -2493,49 +1661,7 @@
  } /* end main */
  
  void getargs (int argc, char* argv[], FILE** psiblastfp, 
-@@ -147,33 +147,33 @@
- 	else
- 	{
- 		printf ("Enter name of psiblast outfile with pairwise alignments:\n");
--		gets (psiblastfilename);
-+		fgets( psiblastfilename, LARGE_BUFF_LENGTH, stdin );
- 	}
- 
- 	if ((*psiblastfp = fopen (psiblastfilename, "r")) == NULL)
- 	{
--		printf ("cannot open file %s \n", psiblastfilename);
-+		fprintf(stderr, "cannot open file %s \n", psiblastfilename);
- 		exit (-1);
- 	}
- 
- 	if (argc > 2) strcpy (queryaligned_outfilename, argv[2]);
-         else
-         {
--                printf ("Enter name of output file for which the psiblast \n");
--		printf ("alignment to the query will be printed out in \n");
--		printf ("fasta format\n");
--                gets (queryaligned_outfilename);
-+                fprintf( stderr, "Enter name of output file for which the psiblast \n");
-+		fprintf( stderr, "alignment to the query will be printed out in \n");
-+		fprintf( stderr, "fasta format\n");
-+                fgets( queryaligned_outfilename, LARGE_BUFF_LENGTH, stdin );
-         }
- 
- 	if ((*outfpqueryalign = fopen (queryaligned_outfilename, "w")) == NULL)
- 	{
--		printf ("cannot open file %s\n", queryaligned_outfilename);
-+		fprintf( stderr, "cannot open file %s\n", queryaligned_outfilename);
- 		exit (-1);
- 	}
- 	strcpy (errorfilename, queryaligned_outfilename);
- 	strcat (errorfilename, ".error");
- 	if ((errorfp = fopen (errorfilename, "w")) == NULL) {
--		printf ("couldn't open file %s\n", errorfilename);
-+		fprintf (stderr, "couldn't open file %s\n", errorfilename);
- 		exit (-1);
- 	}
- 
-@@ -201,6 +201,7 @@
+@@ -201,6 +201,7 @@ read_sequence_from_filename (char filena
  	Sequence* seq;
  
  	if ((fp = fopen (filename, "r")) == NULL) {
@@ -2543,9 +1669,11 @@
  		fprintf (errorfp, "couldn't open %s in processing PSIBLAST results\n", filename);
  		exit (-1);
  	}
---- a/src/seqs_from_psiblast_res.c
-+++ b/src/seqs_from_psiblast_res.c
-@@ -23,7 +23,7 @@
+Index: sift/src/seqs_from_psiblast_res.c
+===================================================================
+--- sift.orig/src/seqs_from_psiblast_res.c
++++ sift/src/seqs_from_psiblast_res.c
+@@ -23,7 +23,7 @@ and prints out the complete sequence fro
  #include "stringhash.c"
  #include "Psiblast.c"
  
@@ -2554,32 +1682,10 @@
  #define LINE_LEN 800
  #define FALSE 0
  #define TRUE 1
-@@ -154,8 +154,8 @@
- 	if (argc > 1) strcpy (psiblastfilename, argv[1]);
- 	else
- 	{
--		printf ("Enter name of psiblast outfile with pairwise alignments:\n");
--		gets (psiblastfilename);
-+		fprintf( stderr, "Enter name of psiblast outfile with pairwise alignments:\n");
-+		fgets( psiblastfilename, LARGE_BUFF_LENGTH, stdin );
- 	}
- 
- 	if ((*psiblastfp = fopen (psiblastfilename, "r")) == NULL)
-@@ -167,9 +167,9 @@
- 	if (argc > 2) strcpy (seqfilename, argv[2]);
-         else
-         {
--                printf ("Enter name of seq file for which the psiblast \n");
--		printf ("sequences will be printed \n");
--                gets (seqfilename);
-+                fprintf( stderr, "Enter name of seq file for which the psiblast \n");
-+		fprintf( stderr, "sequences will be printed \n");
-+                fgets( seqfilename, LARGE_BUFF_LENGTH, stdin );
-         }
- 
- 	if ((*seqfp = fopen (seqfilename, "r")) == NULL)
+Index: sift/src/sift_blimps.h
+===================================================================
 --- /dev/null
-+++ b/src/sift_blimps.h
++++ sift/src/sift_blimps.h
 @@ -0,0 +1,12 @@
 +#ifndef SIFT_BLIMPS_H
 +#define SIFT_BLIMPS_H
@@ -2593,9 +1699,11 @@
 +}
 +
 +#endif
---- a/src/SortList.c
-+++ b/src/SortList.c
-@@ -13,7 +13,7 @@
+Index: sift/src/SortList.c
+===================================================================
+--- sift.orig/src/SortList.c
++++ sift/src/SortList.c
+@@ -13,7 +13,7 @@ int
  lowest_scoring_aa (Matrix* matrix, int pos)
  {
  	struct working* col;
@@ -2604,8 +1712,10 @@
  	double min;
  
  	min = 10000;
+Index: sift/SIFT_for_submitting_fasta_seq.csh.pod
+===================================================================
 --- /dev/null
-+++ b/SIFT_for_submitting_fasta_seq.csh.pod
++++ sift/SIFT_for_submitting_fasta_seq.csh.pod
 @@ -0,0 +1,55 @@
 +=head1 NAME
 +
@@ -2662,131 +1772,11 @@
 +=head1 SEE ALSO
 +
 +L<info_on_seqs>
---- a/bin/Classify_SNPs_Indels.pl
-+++ b/bin/Classify_SNPs_Indels.pl
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/perl
-+#!/usr/bin/perl
- $SIFT_HOME = $ENV{'SIFT_HOME'};
- $bin = "$SIFT_HOME/bin";
-  
---- a/bin/SIFT_intersect_cds.pl
-+++ b/bin/SIFT_intersect_cds.pl
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/perl
-+#!/usr/bin/perl
- $| = 1;
- use Getopt::Std;
- use File::Basename;
---- a/bin/SNPClassifier/Classify_SNPs.pl
-+++ b/bin/SNPClassifier/Classify_SNPs.pl
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/perl
-+#!/usr/bin/perl
- 
- ###############################################################################
- #                                                                             #
---- a/bin/SNPClassifier/Extract_Coding_Info.pl
-+++ b/bin/SNPClassifier/Extract_Coding_Info.pl
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/perl
-+#!/usr/bin/perl
- 
- ###############################################################################
- #                                                                             #
---- a/bin/detect_indel.pl
-+++ b/bin/detect_indel.pl
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/perl -w
-+#!/usr/bin/perl -w
- use strict;
- 
- # This program is licensed to you under the Fred
---- a/bin/detect_repeat.pl
-+++ b/bin/detect_repeat.pl
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/perl 
-+#!/usr/bin/perl
- 
- # This program is licensed to you under the Fred
- # Hutchinos Cancer Research Center (FHCRC)
---- a/bin/get_sequences.pl
-+++ b/bin/get_sequences.pl
-@@ -1,4 +1,4 @@
--#! /opt/local/bin/perl5 -w
-+#!/usr/bin/perl -w
- 
- #####################################################################
- #
---- a/bin/indelfile_to_gff.pl
-+++ b/bin/indelfile_to_gff.pl
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/perl
-+#!/usr/bin/perl
- # This program is licensed to you under the Fred
- # Hutchinos Cancer Research Center (FHCRC)
- # NONCOMMERICAL LICENSE.  A copy of the license may be found at
---- a/bin/map_coords_to_bin.pl
-+++ b/bin/map_coords_to_bin.pl
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/perl
-+#!/usr/bin/perl
- 
- # This program is licensed to you under the Fred
- # Hutchinos Cancer Research Center (FHCRC)
---- a/bin/map_coords_to_bin_indels.pl
-+++ b/bin/map_coords_to_bin_indels.pl
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/perl
-+#!/usr/bin/perl
- 
- 
- # This program is licensed to you under the Fred
---- a/bin/model_transcript.pl
-+++ b/bin/model_transcript.pl
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/perl -w
-+#!/usr/bin/perl -w
- use strict;
- use DBI;
- my $SIFT_HOME = $ENV{'SIFT_HOME'};
---- a/bin/reformat_chrfile.pl
-+++ b/bin/reformat_chrfile.pl
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/perl 
-+#!/usr/bin/perl
- 
- # This program is licensed to you under the Fred
- # Hutchinos Cancer Research Center (FHCRC)
---- a/bin/sift_feed_to_chr_coords_batch.pl
-+++ b/bin/sift_feed_to_chr_coords_batch.pl
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/perl
-+#!/usr/bin/perl
- my $SIFT_HOME = $ENV{'SIFT_HOME'};
- my $bin             = "$SIFT_HOME/bin";
- 
---- a/bin/snv_db_engine.pl
-+++ b/bin/snv_db_engine.pl
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/perl
-+#!/usr/bin/perl
- use Class::Struct;
- 
- #
-@@ -17,7 +17,8 @@
- system("umask 006");
- my $bin             = "$SIFT_HOME/bin";
- $snp_classifier     = "$bin/Classify_SNPs.pl";
--require 'SIFT_subroutines.pm';
-+use lib '/usr/lib/sift/bin';
-+use SIFT_subroutines;
- my $tmp = $ARGV[0];
- my $Variation_db_dir = $ARGV[1];
- my $master_pid = $ARGV[2];
---- a/src/Clumping.c
-+++ b/src/Clumping.c
-@@ -183,7 +183,7 @@
+Index: sift/src/Clumping.c
+===================================================================
+--- sift.orig/src/Clumping.c
++++ sift/src/Clumping.c
+@@ -175,7 +175,7 @@ printf ("entered if statment\n");
   printf ("Clumped %d sequences into %d clusters\n", nseq, iclus);
   /* keep this print because get # of clustersin awk statement */
    free(pairs);
@@ -2795,7 +1785,7 @@
   return clusters_of_seqs;
  }  /* end of cluster */
  
-@@ -440,7 +440,7 @@
+@@ -432,7 +432,7 @@ printf ("entered if statment\n");
   printf ("Clumped %d sequences into %d clusters\n", nseq, i2);
   /* keep this print because get # of clustersin awk statement */
    free(pairs);
@@ -2804,8 +1794,10 @@
   return no_of_clumps;
  }  /* end of cluster */
  
+Index: sift/info_on_seqs.pod
+===================================================================
 --- /dev/null
-+++ b/info_on_seqs.pod
++++ sift/info_on_seqs.pod
 @@ -0,0 +1,46 @@
 +=head1 NAME
 +


=====================================
debian/patches/jarfile deleted
=====================================
--- a/debian/patches/jarfile
+++ /dev/null
@@ -1,10 +0,0 @@
-Author: Laszlo Kajan <lkajan at rostlab.org>
-Description: path to IntersectFeatures.jar
- IntersectFeatures.jar file now in /usr/share, patch for calling script.
---- a/bin/IntersectLocations.sh
-+++ b/bin/IntersectLocations.sh
-@@ -1,3 +1,3 @@
- #!/bin/sh
--bin="/usr/local/projects/SIFT/sift4.0/bin/"
-+bin="/usr/share/sift"
- java -Xmx500m -jar $bin/IntersectFeatures.jar $1 $2 $3 $4 $5


=====================================
debian/patches/ld-as-needed
=====================================
--- a/debian/patches/ld-as-needed
+++ b/debian/patches/ld-as-needed
@@ -10,18 +10,20 @@ Description: src/Makefile patch
  same result.
 Author: Michael Bienia <geser at ubuntu.com>
 Author: Laszlo Kajan <lkajan at rostlab.org>
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -9,8 +9,10 @@
+Index: sift/src/Makefile
+===================================================================
+--- sift.orig/src/Makefile
++++ sift/src/Makefile
+@@ -9,8 +9,10 @@ BIN :=	choose_seqs_via_psiblastseedmedia
  	seqs_from_psiblast_res
  
  CC := gcc
 -CFLAGS := -I$(include-prefix)/include/blimps -O2 -D__MAKE_PREFIX__=\"$(prefix)\" $(CFLAGS)
 -LDFLAGS := -L$(lib-prefix)/lib -lblimps $(LDFLAGS)
-+CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
-+CFLAGS := $(shell dpkg-buildflags --get CFLAGS) -Wno-unused-result -I$(include-prefix)/include/blimps -O2 -D__MAKE_PREFIX__=\"$(prefix)\"
-+LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) -L$(lib-prefix)/lib
-+LDLIBS := -lblimps -lm
++CPPFLAGS ?= $(shell dpkg-buildflags --get CPPFLAGS)
++CFLAGS += -Wno-unused-result -I$(include-prefix)/include/blimps -O2 -D__MAKE_PREFIX__=\"$(prefix)\"
++LDFLAGS += -L$(lib-prefix)/lib
++LDLIBS  += -lblimps -lm
  
  all: bin
  


=====================================
debian/patches/series
=====================================
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,3 @@
 fix_perl_interpreter_and_lib_path
 ld-as-needed
 fix_gcc_warnings
-jarfile


=====================================
debian/rules
=====================================
--- a/debian/rules
+++ b/debian/rules
@@ -1,11 +1,15 @@
 #!/usr/bin/make -f
 
 # Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
+export DH_VERBOSE = 1
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
+export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+
 
 PACKAGE:=sift
 DESTDIR:=$(CURDIR)/debian/$(PACKAGE)
-VERSION:=4.0.3b
+VERSION:=6.2.1
 prefix:=/usr
 pkgdatadir:=$(prefix)/share/$(PACKAGE)
 
@@ -38,6 +42,14 @@ override_dh_auto_clean:
 	rm -f bin/process_alignment
 	rm -f bin/psiblast_res_to_fasta_dbpairwise
 	rm -f bin/seqs_from_psiblast_res
+	rm -f src/choose_seqs_via_psiblastseedmedian
+	rm -f src/clump_output_alignedseq
+	rm -f src/consensus_to_seq
+	rm -f src/deps.mk
+	rm -f src/info_on_seqs
+	rm -f src/psiblast_res_to_fasta_dbpairwise
+	rm -f src/seqs_from_psiblast_res
+	find . -name "*.o" -delete
 
 override_dh_auto_build: man
 	make -j$(parallel) -C src prefix=$(prefix) VERSION=$(VERSION) deps.mk && \
@@ -49,24 +61,43 @@ override_dh_auto_install:
 override_dh_install:
 	# lkajan: fastaseqs comes from the blimps package, this source does not have rules for creating it
 	dh_install -X.svn -X.swp -XIntersectFeatures.jar -XManuals -Xfastaseqs -Xlinux -Xsolaris bin $(prefix)/lib/sift/
-	dh_install bin/IntersectFeatures.jar $(pkgdatadir)/
+	#dh_install bin/IntersectFeatures.jar $(pkgdatadir)/
 	dh_install -X.svn -X.swp blimps/docs $(prefix)/share/sift/blimps/
+	
 	#Links are created by debian/links
 	for f in SIFT_for_submitting_fasta_seq.csh SIFT_for_submitting_NCBI_gi_id.csh; do \
 		sed --in-place -e 's|\b__MAKE_PREFIX__\b|$(prefix)|g;s|__SIFT_SCRIPTDIR__|$(SIFT_SCRIPTDIR)|g;s|__SIFT_BINDIR__|$(SIFT_BINDIR)|g;' $(DESTDIR)$(SIFT_SCRIPTDIR)/$$f; \
 	done;
-	for f in seqs_chosen_via_median_info.csh SIFT_for_submitting_fasta_seq.csh SIFT_for_submitting_NCBI_gi_id.csh; do \
+	
+	for f in seqs_chosen_via_median_info.csh \
+	         SIFT_for_submitting_fasta_seq.csh \
+		 SIFT_for_submitting_NCBI_gi_id.csh; \
+	do \
 		sed --in-place -e 's|\b__MAKE_PREFIX__\b|$(prefix)|g;s|__SIFT_SCRIPTDIR__|$(SIFT_SCRIPTDIR)|g;s|__SIFT_BINDIR__|$(SIFT_BINDIR)|g;' $(DESTDIR)$(SIFT_SCRIPTDIR)/$$f; \
 	done;
-	chmod +x $(DESTDIR)$(prefix)/lib/sift/bin/perlscripts/separate_query_from_rest_of_seqs.pl
+	
 	# look out: DNA_PROT_SUBROUTINES.pl is really a module (should be pm)!
-	for f in SIFT_subroutines.pm DNA_PROT_SUBROUTINES.pl; do \
-		chmod -x $(DESTDIR)$(prefix)/lib/sift/bin/$$f; \
+	# Update: Not existing at all in 6.2.1
+	for f in SIFT_subroutines.pm \
+		 DNA_PROT_SUBROUTINES.pl \
+		 perlscripts/get_BLINK_seq.pl \
+		 perlscripts/separate_query_from_rest_of_seqs.pl \
+		 perlscripts/separate_query_from_database.pl; \
+	do \
+		ff="$(DESTDIR)$(prefix)/lib/sift/bin/$$f"; \
+		if [ -r "$$ff" ]; then \
+			sed -i '1s%/usr/local/bin/%/usr/bin/%' $$ff; \
+			chmod +x $$ff; \
+		fi; \
 	done;
+	
 	for f in IntersectFeatures.jar; do \
-		chmod -x $(DESTDIR)$(pkgdatadir)/$$f; \
+		if [ -r "$(DESTDIR)$(pkgdatadir)/$$f" ]; then \
+			chmod -x $(DESTDIR)$(pkgdatadir)/$$f; \
+		fi; \
 	done;
 
 get-orig-source:
 	mkdir -p ../tarballs
 	uscan --verbose --force-download --destdir=../tarballs
+


=====================================
debian/source/lintian-overrides
=====================================
--- /dev/null
+++ b/debian/source/lintian-overrides
@@ -0,0 +1,7 @@
+sift source: source-includes-file-in-files-excluded bin/choose_seqs_via_psiblastseedmedian
+sift source: source-includes-file-in-files-excluded bin/clump_output_alignedseq
+sift source: source-includes-file-in-files-excluded bin/consensus_to_seq
+sift source: source-includes-file-in-files-excluded bin/info_on_seqs
+sift source: source-includes-file-in-files-excluded bin/psiblast_res_to_fasta_dbpairwise
+sift source: source-includes-file-in-files-excluded bin/seqs_from_psiblast_res
+



View it on GitLab: https://salsa.debian.org/med-team/sift/commit/4a2c15772a02139e4e87f8c5aaf901d8ea9f4cad

-- 
View it on GitLab: https://salsa.debian.org/med-team/sift/commit/4a2c15772a02139e4e87f8c5aaf901d8ea9f4cad
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20180713/236c7d9b/attachment-0001.html>


More information about the debian-med-commit mailing list