# 500 IF PRTFLG=1 THEN OPEN +quot;LPT1:+quot; FOR OUTPUT AS #2 505 IF PRTFLG=2 THEN INPUT +q

```

500 IF PRTFLG=1 THEN OPEN "LPT1:" FOR OUTPUT AS #2
505 IF PRTFLG=2 THEN INPUT "Enter the file which is to recieve the output: ",A\$:OPEN DISK\$+A\$ FOR OUTPUT AS #2:PRINT
510 DIM SEQ(3000)
515 LNGTH=0
520 INPUT "Enter the number of sequences to be compared: ",NSEQ
525 FOR I=1 TO NSEQ
530 PRINT :PRINT USING "Enter sequence number##:";I;
535 INPUT " ",A\$
540 FLAG=INSTR("~=FIRST AND K<=LAST THEN LNGTH=LNGTH+1:LGTH=LGTH+1:SEQ(LNGTH)=INSTR("ACGT",MID\$(A\$,J,1))-1
655 NEXT J
660 IF K>LAST THEN LGTH(I)=LGTH:GOTO 670
665 IF SEQ(LNGTH)>-1 GOTO 600 ELSE LGTH(I)=LGTH-1:LNGTH=LNGTH-1
670 PRINT:PRINT USING "#### bases read.";LGTH(I):PRINT
675 CLOSE 1
680 ON FLAG GOSUB 695,710
685 NEXT I
690 GOTO 770
695 FOR J=LNGTH-LGTH(I)+1 TO LNGTH
700 SEQ(J)=3-SEQ(J)
705 NEXT
710 FOR J=1 TO LGTH(I)/2
715 SWAP SEQ(LNGTH-LGTH(I)+J),SEQ(LNGTH-J+1)
720 NEXT
725 RETURN
730 PRINT:PRINT TITLE\$:PRINT:PRINT LENGTH;"BASES":PRINT:PRINT "One moment please.":PRINT
735 IF PRTFLG THEN IF FLAG=1 THEN PRINT #2,"inverse compliment: "; ELSE IF FLAG=2 THEN PRINT #2,"inverse: ";
740 IF PRTFLG THEN PRINT #2,TITLE\$
745 FOR J = 1 TO LENGTH
750 LNGTH=LNGTH+1:SEQ(LNGTH)=INSTR("ACGT",MID\$(SEQ\$((J-1)\250+1),(J-1) MOD 250+1,1))-1
755 NEXT
760 LGTH(I)=LENGTH
765 RETURN
770 DIM S(LNGTH),M(LNGTH),T(4096)
775 PRINT "ENCODING THE SEQUENCE. PLEASE WAIT."
780 FOR I=1 TO LNGTH-5
785 FOR J=0 TO 5:S(I)=S(I)+SEQ(I+J)*4^J:NEXT
790 NEXT
795 PRINT "SCANNING THE SEQUENCE. PLEASE WAIT."
800 FOR I=1 TO LNGTH
805 M(I)=T(S(I))
810 T(S(I))=I
815 NEXT
820 PRINT "SEARCHING FOR OVERLAPS.  PLEASE WAIT."
825 NOVER=0:ERASE SEQ,S:DIM LAP(4096)
830 FOR I=1 TO 4096
835 IF M(T(I))=0 GOTO 860
840 NOVER=NOVER+1
845 LAP(NOVER)=T(I)
850 FOR J=1 TO NOVER-1:IF LAP(J)>LAP(NOVER) THEN SWAP LAP(J),LAP(NOVER)
855 NEXT
860 NEXT
865 FOR I=1 TO NOVER
870 N=LAP(I):GOSUB 950
875 T(I)=M(LAP(I))
880 IF M(T(I))=0 GOTO 895
885 N=T(I):GOSUB 950
890 T(I)=M(T(I)):GOTO 880
895 N=T(I):GOSUB 950:PRINT:IF PRTFLG THEN PRINT #2,""
900 IF SCRFLG OR (I MOD 22 <> 0) THEN 915
905 BEEP
910 A\$=INKEY\$:IF A\$="" THEN 910
915 NEXT
920 PRINT:PRINT "Do you want to search for another overlap? (Y/N)"
925 A\$=INKEY\$:IF A\$="" GOTO 925
930 ERASE M,T,LAP
935 IF A\$="Y" OR A\$="y" GOTO 510
940 RETURN
945 END
950 J=1
955 WHILE N>LGTH(J):N=N-LGTH(J):J=J+1:WEND
960 PRINT USING "##:####  ";J,N;
965 IF PRTFLG THEN PRINT #2,USING "##:####  ";J,N;
970 CLOSE:RETURN
1000 END

```

E-Mail Fredric L. Rice / The Skeptic Tank