Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:15:05) [MSC v.1600 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> ================================ RESTART ================================ >>> >>> s1 = "GATTAGCCGTAGATTGA" >>> s2 = "AGGAAGGATGCCGTGAAA" >>> longest_common_ss(s1,s2) 'GCCGT' >>> ================================ RESTART ================================ >>> >>> longest_common_ss(s1,s2) Traceback (most recent call last): File "", line 1, in longest_common_ss(s1,s2) NameError: name 's1' is not defined >>> s1 = "GATTAGCCGTAGATTGA" >>> s2 = "AGGAAGGATGCCGTGAAA" >>> longest_common_ss(s1,s2) found common ss of length 1 A found common ss of length 2 AG found common ss of length 3 GAT found common ss of length 4 GCCG found common ss of length 5 GCCGT 'GCCGT' >>> common_substring_set2(s1,s2,6) >>> longest_common_ss(Mycobacterium_leprae, Salmonella_enterica) found common ss of length 1 A found common ss of length 2 AG found common ss of length 3 AGA found common ss of length 4 AGAG found common ss of length 5 AGAGA found common ss of length 6 AGAGAT found common ss of length 7 AGAGATT found common ss of length 8 AGAGATTA found common ss of length 9 AGAGATTAC found common ss of length 10 AGATTACGTC found common ss of length 11 ACGTCTGGTTG found common ss of length 12 ACGTCTGGTTGC found common ss of length 13 ACGTCTGGTTGCA found common ss of length 14 CCGCATCAGCACCA found common ss of length 15 TGCTTTGCCGAATAT found common ss of length 16 TCAGCGATGCCGAACG found common ss of length 17 CCGCCGTGCTGGCCGCC found common ss of length 18 CGTTGACGGCACGTTGCT found common ss of length 19 GCGGGCGTGGTCGCCAACG found common ss of length 20 AACTCTAACCCGGCCACCAT found common ss of length 21 AACTCTAACCCGGCCACCATC found common ss of length 22 AACTCTAACCCGGCCACCATCA found common ss of length 23 AACTCTAACCCGGCCACCATCAT found common ss of length 24 AACTCTAACCCGGCCACCATCATG found common ss of length 25 AACTCTAACCCGGCCACCATCATGA found common ss of length 26 AACTCTAACCCGGCCACCATCATGAC found common ss of length 27 AACTCTAACCCGGCCACCATCATGACC found common ss of length 28 AACTCTAACCCGGCCACCATCATGACCG found common ss of length 29 AACTCTAACCCGGCCACCATCATGACCGA found common ss of length 30 CCAGACTCCTACGGGAGGCAGCAGTGGGGA found common ss of length 31 CCAGACTCCTACGGGAGGCAGCAGTGGGGAA found common ss of length 32 CCAGACTCCTACGGGAGGCAGCAGTGGGGAAT found common ss of length 33 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATA found common ss of length 34 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATAT found common ss of length 35 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATT found common ss of length 36 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTG found common ss of length 37 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGC found common ss of length 38 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCA found common ss of length 39 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCAC found common ss of length 40 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCACA found common ss of length 41 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCACAA found common ss of length 42 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCACAAT found common ss of length 43 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCACAATG found common ss of length 44 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCACAATGG found common ss of length 45 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCACAATGGG found common ss of length 46 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCACAATGGGC found common ss of length 47 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCACAATGGGCG found common ss of length 48 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCACAATGGGCGC found common ss of length 49 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCACAATGGGCGCA found common ss of length 50 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCACAATGGGCGCAA found common ss of length 51 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCACAATGGGCGCAAG found common ss of length 52 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCACAATGGGCGCAAGC found common ss of length 53 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCACAATGGGCGCAAGCC found common ss of length 54 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCACAATGGGCGCAAGCCT found common ss of length 55 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCACAATGGGCGCAAGCCTG found common ss of length 56 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCACAATGGGCGCAAGCCTGA found common ss of length 57 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCACAATGGGCGCAAGCCTGAT found common ss of length 58 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCACAATGGGCGCAAGCCTGATG found common ss of length 59 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCACAATGGGCGCAAGCCTGATGC found common ss of length 60 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCACAATGGGCGCAAGCCTGATGCA found common ss of length 61 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCACAATGGGCGCAAGCCTGATGCAG found common ss of length 62 CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCACAATGGGCGCAAGCCTGATGCAGC 'CCAGACTCCTACGGGAGGCAGCAGTGGGGAATATTGCACAATGGGCGCAAGCCTGATGCAGC' >>> Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:15:05) [MSC v.1600 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> ================================ RESTART ================================ >>> >>> >>> hasTata("GGCTATAACCCTTGGG") True >>> hasTata("GGCTATGACCCTTGGG") False >>> re.search("TATAA[ACGT]{3}TT", "GGCTATAACCCTTGGG") <_sre.SRE_Match object; span=(3, 13), match='TATAACCCTT'> >>> res = re.search("TATAA[ACGT]{3}TT", "GGCTATAACCCTTGGG") >>> res.group() 'TATAACCCTT' >>> res.span() (3, 13) >>> is_orf_almost("ATGCCCCTAG") True >>> is_orf("ATGCCCCTAG") False >>> re.search("^A[ATCG]*A*$|^T[ATCG]*T*$", "ACCA") <_sre.SRE_Match object; span=(0, 4), match='ACCA'> >>> re.findall("^A[ATCG]*A*$|^T[ATCG]*T*$", "ACCA") ['ACCA'] >>> re.findall("^A[ATCG]*A*$|^T[ATCG]*T*$", "ACC") ['ACC'] >>>