FINDPATTERNS

[ Program Manual | User's Guide | Data Files | Databases ]

Table of Contents
FUNCTION
DESCRIPTION
EXAMPLE
OUTPUT
INPUT FILES
RELATED PROGRAMS
RESTRICTIONS
LIST REFINEMENT
DEFINING PATTERNS
CONSIDERATIONS
SPECIFYING SEQUENCES
LARGE DATA SETS
PATTERN FILE
COMMAND-LINE SUMMARY
LOCAL DATA FILES
OPTIONAL PARAMETERS

FUNCTION

[ Top | Next ]

FindPatterns identifies sequences that contain short patterns like GAATTC or YRYRYRYR. You can define the patterns ambiguously and allow mismatches. You can provide the patterns in a file or simply type them in from the terminal.

DESCRIPTION

[ Previous | Top | Next ]

FindPatterns locates short sequence patterns. If you are trying to find a pattern in a sequence or if you know of a sequence that you think occurs somewhere within a larger one, you can find your place with FindPatterns. FindPatterns can look through large data sets for any short sequence patterns you specify. FindPatterns can recognize patterns with some symbols mismatched but not with gaps. It supports the IUPAC-IUB nucleotide ambiguity codes (see Appendix III) for searching through nucleotide sequences.

FindPatterns searches both strands of a nucleotide sequence if the patterns you specify are not identical on both strands. If your sequence is a peptide, FindPatterns searches for a simple symbol match between your pattern and the peptide sequence.

FindPatterns names each file on the screen as it is searched. The output file shows only sequences where a pattern was found unless you use the command-line parameter -SHOw. Five symbols from the original sequence are shown on either side of each "find." The word /Rev occurs if the reverse of the pattern is found. If you run FindPatterns with the command-line parameter -NAMes, the output file is written as a list file, which you can use as input to other Wisconsin Package(TM) programs that support indirect file specifications.

When FindPatterns finishes searching for your patterns, it returns to the first prompt in the program, FINDPATTERNS in what sequence(s) ? If you simply press <Return> at the prompt, FindPatterns stops.

FindPatterns writes all of its results in the same output file (or on the screen). FindPatterns prints a short summary on your screen and in the output file when the entire session is over.

EXAMPLE

[ Previous | Top | Next ]

Here is a session using FindPatterns to determine if there are any EcoRI or BamHI sites in the human immunoglobulin sequences of the GenBank database (The program Fetch was used first to make a copy of the file pattern.dat):


% findpatterns

 FINDPATTERNS in what sequence(s) ?  GenBank:Humig*

 Search patterns read from "pattern.dat"

 What should I call the output file (* findpatterns.find *) ?

           HUMIG10H len:        408
           HUMIG10L len:        387
           HUMIG12H len:        417

          //////////////////////////

           HUMIGXJAA len:         69
           HUMIGXJAB len:         69
           HUMIGXPSA len:        237

 FINDPATTERNS in what sequence(s) ?

     Total finds:        695
    Total length:    738,064
 Total sequences:      1,596
        CPU time:      13.73

    Output file: /usr/users/burgess/search/findpatterns.find

%

OUTPUT

[ Previous | Top | Next ]

Here is some of the output file:


! FINDPATTERNS on genbank:humig* allowing 0 mismatches

! Using patterns from: pattern.dat  September 30, 1996 15:56 ..

            HUMIG10H  ck: 1075  len: 408   ! L38425 Homo sapiens Ig rearra

BamHI                 GGATCC
           170: GGGCT GGATCC GCCAG

             HUMIG1L  ck: 7509  len: 318   ! L38432 Homo sapiens Ig rearra

BamHI                 GGATCC
           167: CTCAG GGATCC CTGAG

             HUMIG9H  ck: 8709  len: 426   ! L38435 Homo sapiens Ig rearra

BamHI                 GGATCC
            17: CTGGA GGATCC TTTTC

           HUMIGAMKB  ck: 9203  len: 406   ! L28050 Human Ig rearranged al

BamHI                 GGATCC
           144: GAGCT GGATCC GTCAG

//////////////////////////////////////////////////////////////////////////

           HUMIGVL4C  ck: 6038  len: 402   ! L35918 Human immunoglobulin l

BamHI                 GGATCC
           224: CTCAG GGATCC CAGAC

Promotor /Rev         CAT(N){20,30}TATTA
                        CATN{23}TATTA
           119: GATCA CATGCCAAGGAGACAGCCTCAGAAGCTATTA TGCAA

           HUMIGVL4D  ck: 9567  len: 635   ! L35919 Human germline immunog

BamHI                 GGATCC
           370: CTCAG GGATCC CAGAC

Promotor /Rev         CAT(N){20,30}TATTA
                        CATN{28}TATTA
            42: CTTTG CATAGGTGCTGCCTCCCAGGGCTCAACCCCATATTA TCATG

                        CATN{23}TATTA
           265: GATCA CATGCCAAGGAGACAGCCTCAGAAGCTATTA TGCAA

           HUMIGVL4E  ck: 164   len: 411   ! L35920 Human immunoglobulin l

BamHI                 GGATCC
           224: CTCAG GGATCC CAGAC

Promotor /Rev         CAT(N){20,30}TATTA
                        CATN{23}TATTA
           119: GATCA CATGCCAAGGAGACAGCCTCAGAAGCTATTA TGCAA

          HUMIGVLC8A  ck: 3152  len: 324   ! L39131 Homo sapiens Ig light

BamHI                 GGATCC
           179: GGACG GGATCC CTGAT

 Databases searched:
        GenBank, Release 95.0, Released on 21Jun96, Formatted on 21Jul1996

     Total finds:        695
    Total length:    738,064
 Total sequences:      1,596
        CPU time:      13.73

If the pattern is a complex expression, it will be written above each find along with a simplification of the pattern so that you can see what was actually found. In the above example, the Promoter pattern CAT(N){20,30}TATTA is the pattern being searched, and in the first case shown, CATN{23}TATTA is the pattern actually found. Five symbols from the original sequence are shown on either side of the find. In the example above, 119 is the coordinate of the first C in CATGCCAA ... not of the G of the flanking symbols GATCA.

INPUT FILES

[ Previous | Top | Next ]

FindPatterns takes single or multiple sequences as input. You can specify multiple sequences in a number of ways: by using a list file, for example @project.list; by using an MSF or RSF file, for example project.msf{*}; or by using a sequence specification with an asterisk (*) wildcard, for example GenEMBL:*. The function of FindPatterns depends on whether your input sequence(s) are protein or nucleotide. Programs determine the type of a sequence by the presence of either Type: N or Type: P on the last line of the text heading just above the sequence. If your sequence(s) are not the correct type, turn to Appendix VI for information on how to change or set the type of a sequence.

RELATED PROGRAMS

[ Previous | Top | Next ]

The Wisconsin Package mapping programs Map, MapPlot and MapSort can be used to mark finds in the context of a DNA restriction map. Motifs looks for sequence motifs by searching through proteins for the patterns defined in the PROSITE Dictionary of Protein Sites and Patterns. These programs all use the same search algorithm and input data file format as FindPatterns.

RESTRICTIONS

[ Previous | Top | Next ]

Patterns typed in from the terminal may not be longer than 132 characters. Patterns from a data file may not be longer than 350 characters.

FindPatterns can search for a maximum of 5,000 patterns in a nucleotide sequence. If your pattern.dat file contains more than 5,000 patterns, only the first 5,000 are used.

The restrictions specified with the -MINCuts and -MAXCuts command-line parameters must be fulfilled on a single strand of a nucleotide sequence in order for the find to be reported. For instance, if you use the command % findpatterns -MINCuts=2 -PATterns=CCCC with the sequence CCCCGGGG, no finds will be reported, even though there is one instance of the pattern on each strand.

LIST REFINEMENT

[ Previous | Top | Next ]

The database programs Lookup, Names, StringSearch, FindPatterns, FastA, TFastA, and WordSearch can be used for list refinement if you are looking for sequences with something in common. For instance, you could identify human globin nucleotide sequences with Lookup. The output list from Lookup could then be refined further with FindPatterns to show only those human globin sequences containing EcoRI sites. You could then do a sequence search on the output from FindPatterns with FastA to see if a sequence you have is similar to any of these EcoRI-containing human globin sequences.

Adding Lists Together

You can add two lists together by simply appending one of the files to the other. It is better if you use a text editor to modify the heading of the combined list so that the annotation in the list correctly reflects what you have done. Remember to delete the text heading from the second file so that it does not occur in the middle of the list.

Suppressing Items

Suppress any item in a list by typing an exclamation point (!) in front of the item. You can also put comments into a list anywhere on a line by placing an exclamation point before the comment.

DEFINING PATTERNS

[ Previous | Top | Next ]

FindPatterns, Map, MapSort, MapPlot, and Motifs all let you search with ambiguous expressions that match many different sequences. The expressions can include any legal GCG sequence character (see Appendix III). The expressions can also include several non-sequence characters, which are used to specify OR matching, NOT matching, begin and end constraints, and repeat counts. For instance, the expression TAATA(N){20,30}ATG means TAATA, followed by 20 to 30 of any base, followed by ATG. Following is an explanation of the syntax for pattern specification.

Implied Sets and Repeat Counts

Parentheses () enclose one or more symbols that can be repeated some number of times. Braces {} enclose numbers that tell how many times the symbols within the preceding parentheses must be found.

Sometimes, you can leave out part of an expression. If braces appear without preceding parentheses, the numbers in the braces define the number of repeats for the immediately preceding symbol. One or both of the numbers within the braces may be missing. For instance, both the pattern GATG{2,}A and the pattern GATG{2}A mean GAT, followed by G repeated from 2 to 350,000 times, followed by A; the pattern GATG{}A means GAT, followed by G repeated from 0 to 350,000 times, followed by A; the pattern GAT(TG){,2}A means GAT, followed by TG repeated from 0 to 2 times, followed by A; the pattern GAT(TG){2,2}A means GAT, followed by TG repeated exactly 2 times, followed by A. (If the pattern in the parentheses is an OR expression (see below), it cannot be repeated more than 2,000 times.)

OR Matching

If you are searching nucleic acids, the ambiguity symbols defined in Appendix III let you define any combination of G, A, T, or C. If you are searching proteins, you can specify any of several symbol choices by enclosing the different choices in parentheses and separating the choices with commas. For instance, RGF(Q,A)S means RGF followed by either Q or A followed by S. The length of choices need not be the same, and there can be up to 31 different choices within each set of parentheses. The pattern GAT(TG,T,G){1,4}A means GAT followed by any combination of TG, T, or G from 1 to 4 times followed by A. The sequence GATTGGA matches this pattern. There can be several parentheses in a pattern, but parentheses cannot be nested.

NOT Matching

The pattern GC~CAT means GC, followed by any symbol except C, followed by AT. The pattern GC~(A,T)CC means GC, followed by any symbol except A or T, followed by CC.

Begin and End Constraints

The pattern <GACCAT can only be found if it occurs at the beginning of the sequence range being searched. Likewise, the pattern GACCAT> would only be found if it occurs at the end of the sequence range.

CONSIDERATIONS

[ Previous | Top | Next ]

FindPatterns will not introduce gaps but it can tolerate mismatches when it is run with the command-line parameter -MISmatch. Mismatched finds are shown in the output in lowercase.

If you are entering patterns from the command line with the -PATterns parameter, any pattern containing a comma must be enclosed in double quotes; otherwise, the comma is assumed to separate different patterns on the command line.

SPECIFYING SEQUENCES

[ Previous | Top | Next ]

There is information on specifying sets of sequences in Chapter 2, Using Sequence Files and Databases of the User's Guide.

LARGE DATA SETS

[ Previous | Top | Next ]

FindPatterns is one of the few programs in the Wisconsin Package that can take more than a few minutes to run. Large searches should probably be run in the batch queue. You can specify that this program run at a later time in the batch queue by using the command-line parameter -BATch. Run this way, the program prompts you for all the required parameters and then automatically submits itself to the batch or at queue. For more information, see "Using the Batch Queue" in Chapter 3, Using Programs in the User's Guide. Very large comparisons may exceed the CPU limit set by some systems.

Patterns that start with complicated OR or NOT expressions take longer to search than simple expressions like GATTC.

PATTERN FILE

[ Previous | Top | Next ]

You can put any patterns you want to search for into a file like the one below. The pattern data files for FindPatterns are modeled on the enzyme data files for the mapping programs described in Appendix VII. The names should not have more than eight letters. The offset field is ignored by FindPatterns, but the field should have a number in it to make these files compatible with the files that are read by mapping programs.

The exact column used for each field does not matter, only the order of the fields in the line. You can give several patterns the same name, but put all of the entries for that name on adjacent lines of the file. The patterns may not be more than 350 characters long. Blank lines and lines that start with an exclamation point (!) are ignored.

If the overhang field is a period (.) instead of a number, only the top strand of a nucleic acid sequence is searched for the pattern. Any number implies that both strands are to be searched. The value of the overhang number has no significance to FindPatterns. Here is the pattern data file used in the example above:


!!PATTERNS 1.0
An example of a pattern data file for the program FINDPATTERNS.

Name    Offset  Pattern             Overhang  Documentation  ..

BamHI        1  GGATCC                     0  !
EcoRI        1  GAATTC                     0  !
Promotor     1  TAATA(N){20,30}ATG         0  !

COMMAND-LINE SUMMARY

[ Previous | Top | Next ]

All parameters for this program may be put on the command line. Use the parameter -CHEck to see the summary below and to have a chance to add things to the command line before the program executes. In the summary below, the capitalized letters in the parameter names are the letters that you must type in order to use the parameter. Square brackets ([ and ]) enclose parameter values that are optional. For more information, see "Using Program Parameters" in Chapter 3, Using Programs in the User's Guide.


Minimal Syntax: % findpatterns [-INfile=]Genbank:Humig* -Default

Prompted Parameters:

-PATterns=GAATTC,RGGAY         patterns to be found
[-OUTfile=]findpatterns.find   the output file name

Local Data Files:

-DATa=pattern.dat      a file with a set of patterns

Optional Parameters:

-MISmatch=1     allows mismatches in the search for your subsequence
-NAMes          writes the output as a list file
-ONEstrand      searches only the top strand of nucleotide sequences
-SIXbase        searches only for patterns with six or more symbols
-CIRcular       searches all sequences as if they were circular
-ALL            does an "overlapping-set" search in nucleotide sequences
-PERFect        looks only for perfect matches
-APPend         appends the pattern data file to the output file
-SHOw           shows every file searched even if there are no finds
-TERminal       writes output to the terminal screen instead of a file
-NOMONitor      suppresses the screen trace showing each file
-ONCe           limits finds to patterns found a maximum of 1 time
-MINCuts=1      limits finds to patterns found a minimum of 1 time
-MAXCuts=3      limits finds to patterns found a maximum of 3 times
-EXCLude=n1,n2  excludes patterns found between positions n1 and n2
-SINce=6.90     limits search to sequences dated on or after June 1990
-BATch          Submits the program to run in the batch queue

LOCAL DATA FILES

[ Previous | Top | Next ]

The files described below supply auxiliary data to this program. The program automatically reads them from a public data directory unless you either 1) have a data file with exactly the same name in your current working directory; or 2) name a file on the command line with an expression like -DATa1=myfile.dat. For more information see Chapter 4, Using Data Files in the User's Guide.

FindPatterns can read the patterns you want to find from the file pattern.dat in your working directory. If you don't have a file called pattern.dat in your directory, FindPatterns asks you to type in the patterns you want to find. If you want to use a pattern data file with a name other than pattern.dat, include -DATa=filename on the command line.

OPTIONAL PARAMETERS

[ Previous | Top | Next ]

The parameters listed below can be set from the command line. For more information, see "Using Program Parameters" in Chapter 3, Using Programs in the User's Guide.

-NAMes

writes the output file as a list file suitable for input to other Wisconsin Package programs that support indirect file specification (see Chapter 2, Using Sequence Files and Databases of the User's Guide). All of the output showing the location of the patterns found is suppressed when the output is written as a list file.

-SINce=6.90

limits the search to sequences that have been entered into the database or modified since June 1990. As this is being written, only the EMBL, GenBank, and SWISS-PROT databases support this parameter.

-CIRcular

searches past the end of the sequence into the beginning of the sequence as if the molecule were continuous. Patterns that span the origin can only be found if the search is -CIRcular.

-ONEstrand

searches only the top strand of nucleotide sequences.

-SHOw

Normally, FindPatterns shows that a file was searched only if there were one or more finds in sequence. With the -SHOw command-line parameter, FindPatterns shows every file searched whether or not a pattern was actually found in it. (-SHOw is equivalent to setting -MINCuts=0.)

-TERminal

writes output on the terminal screen and suppresses the output file query. If you use FindPatterns often in this mode, you should assign a logical symbol that runs FindPatterns with terminal output as the default. Answering the output file query with term has the same effect on FindPatterns as this command-line parameter.

-BATch

submits the program to the batch queue for processing after prompting you for all required user inputs. Any information that would normally appear on the screen while the program is running is written into a log file. Whether that log file is deleted, printed, or saved to your current directory depends on how your system manager has set up the command that submits this program to the batch queue. All output files are written to your current directory, unless you direct the output to another directory when you specify the output file.

-MONitor

This program normally monitors its progress on your screen. However, when you use -Default to suppress all program interaction, you also suppress the monitor. You can turn it back on with this parameter. If you are running the program in batch, the monitor will appear in the log file.

The descriptions of the exclusionary parameters below were written for the Wisconsin Package mapping programs. A find in these applications is referred to as a cut while a pattern is referred to as a restriction enzyme recognition site.

The parameters -MINSitelen and -OVErhang restrict the domain of enzymes selected.

-MINSitelen=6

selects only enzymes with six or more bases in the recognition site. You can display the cuts from any enzyme in the enzyme data file that you take the trouble to name individually, but when you use * (meaning all), the program uses all of the other enzymes whose recognition sites have six or more non-N, non-X bases. -MINSitelen=6 replaces the -SIXbase parameter from earlier versions of the Wisconsin Package.

-OVErhang=0

selects only enzymes that leave blunt ends. Use a 5 with this parameter to search only with enzymes that leave 5' overhangs and a 3 to search only with enzymes that leave a 3' overhang. You can use multiple values, separated by commas. For instance, -OVErhang=5,3 searches with all enzymes that leave either 5' or 3' overhangs. You can display the cuts from any enzyme in the enzyme data file that you take the trouble to name individually, but when you use * (meaning all), the program uses all of the enzymes whose overhangs conform to your choice with this parameter.

The -MINCuts, -MAXCuts, -ONCe, and -EXCLude parameters suppress the display of selected enzymes. The list of excluded enzymes in the program output includes both selected enzymes that cut within excluded ranges and selected enzymes that did not cut the right number of times.

-MINCuts=2

excludes enzymes that do not cut at least two times.

-MAXCuts=2

excludes enzymes that cut more than two times.

-ONCe

excludes, from the set of enzymes displayed, those enzymes that cut your sequence more than once (equivalent to setting both mincuts and maxcuts to one).

-EXCLude=n1,n2[n3,n4,...]

excludes enzymes that cut anywhere within one or more ranges of the sequence. If an enzyme is found within an excluded range, then the enzyme is not displayed. The list of excluded enzymes includes enzymes that cut within excluded ranges. The ranges are defined with sets of two numbers. The numbers are separated by commas. Spaces between numbers are not allowed. The numbers must be integers that fall within the sequence beginning and ending points you have chosen. The range may be circular if circular mapping is being done. Exclusion is not done if there are any non-numeric characters in the numbers or numbers out of range or if there is an odd number of integers following the parameter.

-MISmatch=1

causes the program to recognize sites that are like the recognition site but with one (or more) mismatches. If you allow too many mismatches, you may get ridiculous results. The output from most mapping programs distinguishes between real sites and sites with one or more mismatches.

-PERFect

sets the program to look for a perfect alphabetic match between the site and the sequence. Ambiguity codes are normally expanded so that the site RXY would find sequences like ACT or GAC. With this parameter the ambiguity codes are not expanded so the site RXY would only match the sequence RXY. This parameter is not the same as -MISismatch=0.

-ALL

makes an overlap set map instead of the usual subset map. If your sequence is very ambiguous (as for instance a back-translated sequence would be) and you want to see where restriction sites could be, then you should create an overlap-set map. Overlap-set and subset pattern recognition are discussed in more detail in the Program Manual entry for the Window program.

-APPend

appends the input enzyme data file to your output file.

Printed: November 18, 1996 13:06 (1162)

[ Program Manual | User's Guide | Data Files | Databases ]


Documentation Comments: doc-comments@gcg.com
Technical Support: help@gcg.com

Copyright (c) 1982, 1983, 1985, 1986, 1987, 1989, 1991, 1994, 1995, 1996, 1997 Genetics Computer Group, Inc. a wholly owned subsidiary of Oxford Molecular Group, Inc. All rights reserved.

Licenses and Trademarks Wisconsin Package is a trademark of Genetics Computer Group, Inc. GCG and the GCG logo are registered trademarks of Genetics Computer Group, Inc.

All other product names mentioned in this documentation may be trademarks, and if so, are trademarks or registered trademarks of their respective holders and are used in this documentation for identification purposes only.

Genetics Computer Group

www.gcg.com