#! /usr/bin/env python """ collection of regular expression patterns used by sequence handling programs $Id: Patterns.py,v 1.1 2004/10/10 02:53:09 nghoffma Exp $ """ import re #to find all single gaps singleGaps = r"[-.~]" singleGapsReo = re.compile( singleGaps, re.I) #fasta recognizing pattern #fastaPattern = r">(?P[ \t]*\S+)[ \t]*(?P.*)\n(?P[-*a-z~.\s]+)\n" fastaPattern = r">(?P[ \t]*\S+)[ \t]*(?P.*)\n(?P[-*a-z~.\s?]+)\n" fastaPatternReo = re.compile( fastaPattern, re.I ) #selex pattern #selexPattern = r"^[ \t]*(?P\S+)[ \t]+(?P[-_*a-z~. ]+)\n" selexPattern = r"^\s*(?P\S+)\s+(?P[-_*a-z~. \t]+)\n" selexPatternReo = re.compile( selexPattern, re.I | re.M ) # recognizes whitespace, digits, and non-alphanumeric characters allButAlphaRexp = re.compile(r'[^a-zA-Z]') def describe(): """ Patterns.py Collection of regular expression patterns used by sequence handling programs. """ print describe.__doc__ if __name__ == '__main__': describe()