PROGRAM checkseq c CHECKSEQ compares sequence in Diamond file with those in c ALPHA.SEQ and BETA.SEQ and call attention to the differences CHARACTER*1 upperc, lowerc CHARACTER*3 seq1(600), seq2(600), res CHARACTER*4 label CHARACTER*80 filnam DATA seq1/600*' '/, seq2/600*' '/ c Read ALPHA.SEQ OPEN (unit=1, form='FORMATTED', status='OLD', readonly, 1 file='/home/ohlen/pcd/ALPHA.SEQ') READ (1, 1001) (seq1(i), i=1, 200) 1001 FORMAT (20(a3,1x)) CLOSE (unit=1) c Read BETA.SEQ OPEN (unit=1, form='FORMATTED', status='OLD', readonly, 1 file='/home/ohlen/pcd/BETA.SEQ') READ (1, 1001) (seq1(i), i=301, 538) CLOSE (unit=1) c Read Diamond file WRITE (6, 1000) 'Enter filename for input Diamond file:' 1000 FORMAT (a) READ (5, 1000) filnam len = length(filnam) WRITE (6, 1000) filnam(1:len) OPEN (unit=1, form='FORMATTED', status='OLD', readonly, 1 file=filnam(1:len)) READ (1, 1000) READ (1, 1000) READ (1, 1000) DO WHILE (.TRUE.) READ (1, 1002, end=9) res, n, label 1002 FORMAT (65x, a3, i4, 3x, a4) IF (label .EQ. 'CA ') THEN seq2(n) = res endIF endDO 9 CLOSE (unit=1) c Be sure both lists as in the same case DO i = 1,600 seq1(i)(1:1) = upperc(seq1(i)(1:1)) seq1(i)(2:2) = lowerc(seq1(i)(2:2)) seq1(i)(3:3) = lowerc(seq1(i)(3:3)) seq2(i)(1:1) = upperc(seq2(i)(1:1)) seq2(i)(2:2) = lowerc(seq2(i)(2:2)) seq2(i)(3:3) = lowerc(seq2(i)(3:3)) endDO c Blank out second sequence if it is the same as first sequence DO i = 1,600 IF (seq2(i) .EQ. seq1(i)) THEN seq2(i) = ' ' ELSE IF (seq2(i) .EQ. ' ') THEN seq2(i) = '---' endIF endDO c Write result WRITE (6, 1000) 'Enter filename for output file:' READ (5, 1000) filnam len = length(filnam) WRITE (6, 1000) filnam(1:len) OPEN (unit=1, form='FORMATTED', status='UNKNOWN', file=filnam, 1 carriagecontrol='LIST') DO is = 1,201,20 WRITE (1, 1003) (i, i=is, is+19) 1003 FORMAT (20(i3,1x)) WRITE (1, 1001) (seq1(i), i=is, is+19) WRITE (1, 1001) (seq2(i), i=is, is+19) WRITE (1, 1000) endDO DO is = 301,521,20 WRITE (1, 1003) (i, i=is, is+19) WRITE (1, 1001) (seq1(i), i=is, is+19) WRITE (1, 1001) (seq2(i), i=is, is+19) WRITE (1, 1000) endDO CLOSE (unit=1) end CHARACTER*1 function upperc(ch) CHARACTER*1 ch INTEGER*2 k k = ICHAR(ch) IF (k .GE. 97 .AND. k .LE. 122) k = k - 32 upperc = CHAR(k) return end CHARACTER*1 function lowerc(ch) CHARACTER*1 ch INTEGER*2 k k = ICHAR(ch) IF (k .GE. 65 .AND. k .LE. 90) k = k + 32 lowerc = CHAR(k) return end INTEGER FUNCTION length(line) CHARACTER*80 line DO i = 80,1,-1 IF (line(i:i) .NE. ' ') goto 9 endDO 9 length = i return end