def test_createFlowHeader(self): """header_info dict turned into flowgram header""" f = Flowgram('0.5 1.0 4.0 0.0 1.5 0.0 0.0 2.0', Name='a', header_info = {'Bases':'TACCCCTTGG','Name Length':'14'}) self.assertEqual(f.createFlowHeader(), """>a\n Name Length:\t14\nBases:\tTACCCCTTGG\nFlowgram:\t0.5\t1.0\t4.0\t0.0\t1.5\t0.0\t0.0\t2.0\n""")
def test_cmpByName(self): """Flowgrams should be the same if name, bases, or to_seqs are equal""" f = Flowgram('0.5 1.0 4.0 0.0', Name = 'a',floworder = "TACG", header_info = {'Bases':'TACCCC'}) f2 = Flowgram('0.5 1.0 4.0 0.0', Name = 'a',floworder = "TACG", header_info = {'Bases':'TACCCC'}) self.assertEqual(f.cmpByName(f2), 0) self.assertEqual(f.cmpByName(f), 0) f2 = Flowgram('0.5 1.0 4.0 0.0', Name = 'b',floworder = "TACG", header_info = {'Bases':'TACCCC'}) self.assertNotEqual(f.cmpByName(f2), 0)
def test_toFasta(self): """Flowgram toFasta() should return Fasta-format string""" even = '0.5 1.0 4.0 0.0' odd = '0.5 1.0 4.0 1.0' even_f = Flowgram(even, Name='even', floworder = "TACG") odd_f = Flowgram(odd, Name='odd', floworder = "TACG") self.assertEqual(even_f.toFasta(), '>even\nTACCCC') #set line wrap to small number so we can test that it works self.assertEqual(even_f.toFasta(LineWrap = 2), '>even\nTA\nCC\nCC') self.assertEqual(odd_f.toFasta(LineWrap = 2), '>odd\nTA\nCC\nCC\nG') even_f = Flowgram(even, Name='even', floworder = "TACG", header_info ={'Bases':'TACCCG'}) odd_f = Flowgram(odd, Name='odd', floworder = "TACG", header_info ={'Bases':'TACCCGG'}) self.assertEqual(even_f.toFasta(), '>even\nTACCCG') #set line wrap to small number so we can test that it works self.assertEqual(even_f.toFasta(LineWrap = 2), '>even\nTA\nCC\nCG') self.assertEqual(odd_f.toFasta(LineWrap = 2), '>odd\nTA\nCC\nCG\nG')
def test_getQualityTrimmedFlowgram(self): """getQualityTrimmedFlowgram trims the flowgram correctly""" f = Flowgram('0.5 1.0 4.1 0.0 0.0 1.23 0.0 3.1', Name = 'a', floworder = "TACG", header_info = {'Bases':'TACCCCAGGG', 'Clip Qual Right': 7, 'Flow Indexes': "1\t2\t3\t3\t3\t3\t6\t8\t8\t8"}) trimmed = f.getQualityTrimmedFlowgram() self.assertEqual(trimmed.toSeq(), "TACCCCA") self.assertEqual(str(trimmed), "0.5\t1.0\t4.1\t0.0\t0.0\t1.23") # tests on real data flow1 = self.flows[0] flow2 = self.flows[1] flow1_trimmed = flow1.getQualityTrimmedFlowgram() self.assertEqual(str(flow1_trimmed), "1.06 0.08 1.04 0.08 0.05 0.94 0.10 2.01 0.10 0.07 0.96 0.09 1.04 1.96 1.07 0.10 1.01 0.13 0.08 1.01 1.06 1.83 2.89 0.18 0.96 0.13 0.99 0.11 1.94 0.12 0.13 1.92 0.21 0.07 0.94 0.17 0.03 0.97 2.76 0.15 0.05 1.02 1.14 0.10 0.98 2.54 1.13 0.96 0.15 0.21 1.90 0.16 0.07 1.78 0.22 0.07 0.93 0.22 0.97 0.08 2.02 0.15 0.19 1.02 0.19 0.09 1.02 0.17 0.99 0.09 0.18 1.84 0.16 0.91 0.10 1.10 1.00 0.20 0.09 1.11 3.01 1.07 1.98 0.14 0.22 1.09 0.17 1.99 0.15 0.20 0.92 0.17 0.07 1.01 2.96 0.15 0.07 1.06 0.20 1.00 0.10 0.12 1.00 0.15 0.08 1.90 0.19 0.10 0.99 0.18 0.09 0.99 1.08 0.15 0.07 1.06 0.14 1.84 0.13 0.11 0.95 1.05 0.13 1.04 1.10 0.18 0.94 0.14 0.10 0.97") self.assertEqual(flow1_trimmed.Bases, "tcagGCTAACTGTAACCCTCTTGGCACCCACTAAACGCCAATCTTGCTGGAGTGTTTACCAGGCACCCAGCAATGTGAATAGTCA") flow2_trimmed = flow2.getQualityTrimmedFlowgram() self.assertEqual(str(flow2_trimmed), "1.04 0.00 1.01 0.00 0.00 1.00 0.00 1.00 0.00 1.05 0.00 0.91 0.10 1.07 0.95 1.01 0.00 0.06 0.93 0.02 0.03 1.06 1.18 0.09 1.00 0.05 0.90 0.11 0.07 1.99 0.11 0.02 1.96 1.04 0.13 0.01 2.83 0.10 1.97 0.06 0.11 1.04 0.13 0.03 0.98 1.15 0.07 1.00 0.07 0.08 0.98 0.11 1.92 0.05 0.04 2.96 1.02 1.02 0.04 0.93 1.00 0.13 0.04 1.00 1.03 0.08 0.97 0.13 0.11 1.88 0.09 0.05 1.02 1.89 0.07 0.11 0.98 0.05 0.07 1.01 0.08 0.05 1.01 0.13 1.00 0.07 0.10 1.04 0.10 0.04 0.98 0.12 1.03 0.96 0.11 0.07 1.00 0.09 0.03 1.03 0.11 1.95 1.06 0.13 0.05 1.00 0.13 0.11 1.00 0.09 0.03 2.89 0.08 0.95 0.09 1.03 1.02 1.05 1.07 0.08 0.12 2.81 0.08 0.08 1.00 1.07 0.07 0.05 1.86 0.12 0.98 0.06 2.00 0.11 1.02 0.11 0.08 1.88 0.13 1.03 0.13 0.98 0.15 0.11 1.03 1.03 1.04 0.18 0.98 0.13 0.15 1.04 0.11 1.01 0.13 0.06 1.01 0.06 1.02 0.08 0.99 0.14 0.99 0.09 0.05 1.09 0.04 0.07 2.96 0.09 2.03 0.13 2.96 1.13 0.08 1.03 0.07 0.99 0.11 0.05 1.05 1.04 0.09 0.07 1.00 1.03 0.09 0.06 1.06 1.04 2.94 0.18 0.06 0.93 0.10 1.10 0.11 2.02 0.17 1.00 1.03 0.06 0.11 0.96 0.04 3.00 0.11 0.07 1.99 0.10 2.03 0.12 0.97 0.16 0.01 2.09 0.14 1.04 0.16 0.06 1.03 0.14 1.12 0.12 0.05 0.96 1.01 0.10 0.14 0.94 0.03 0.12 1.10 0.92 0.09 1.10 1.04 1.02 0.12 0.97 2.00 0.15 1.08 0.04 1.03 1.04 0.03 0.09 5.16 1.02 0.09 0.13 2.66 0.09 0.05 1.06 0.07 0.89 0.05 0.12 1.10 0.16 0.06 1.01 0.13 1.00 0.14 0.98 0.09 2.92 1.28 0.03 2.95 0.98 0.16 0.08 0.95 0.96 1.09 0.08 1.07 1.01 0.16 0.06 4.52 0.12 1.03 0.07 0.09 1.03 0.14 0.03 1.01 1.99") self.assertEqual(flow2_trimmed.Bases, "tcagAGACGCACTCAATTATTTCCATAGCTTGGGTAGTGTCAATAATGCTGCTATGAACATGGGAGTACAAATATTCTTCAAGATACTGATCTCATTTCCTTTAGATATATACCCAGAAGTGAAATTCCTGGATCACATAGTAGTTCTATTTTTATTTGATGAGAAACTTTATACTATTTTTCATAA")
def test_cmpSeqToString(self): """Sequence should compare equal to same string.""" f = Flowgram('0.5 1.0 4.0 0.0', Name = 'a',floworder = "TACG", header_info = {'Bases':'TACCCC'}) self.assertTrue(f.cmpSeqToString('TACCCC')) self.assertFalse(f.cmpSeqToString('TACCC')) f = Flowgram('0.5 1.0 4.0 0.0',floworder = "TACG") self.assertTrue(f.cmpSeqToString('TACCCC')) self.assertFalse(f.cmpSeqToString('TACCC'))
def test_toSeq(self): """toSeq should Translate flowgram to sequence""" f = Flowgram('0.5 1.0 4.0 0.0', Name='a', floworder="TACG", header_info={'Bases': 'TACCCG'}) self.assertEqual(f.toSeq(), 'TACCCG') self.assertEqual(isinstance(f.toSeq(), Sequence), True) self.assertEqual(f.toSeq(Bases=False), 'TACCCC') f = Flowgram('0.5 1.0 4.0 0.0 0.0 1.23 0.0 6.1', Name='a', floworder="TACG", header_info={'Bases': 'TACCCG'}) self.assertEqual(f.toSeq(), 'TACCCG') self.assertEqual(f.toSeq(Bases=False), 'TACCCCAGGGGGG') f = Flowgram('0.5 1.0 4.0 0.0', Name='a', floworder="TACG", header_info={}) self.assertEqual(f.toSeq(), 'TACCCC') self.assertEqual(isinstance(f.toSeq(), Sequence), True) self.assertEqual(f.toSeq(Bases=False), 'TACCCC') f = Flowgram('0.5 1.0 4.0 0.0 0.0 1.23 0.0 6.1', Name='a', floworder="TACG", header_info={}) self.assertEqual(f.toSeq(Bases=True), 'TACCCCAGGGGGG') f = Flowgram('0.4 0.0 0.0 0.0 0.0 1.23 0.0 1.1', Name='a', floworder="TACG", header_info={}) self.assertEqual(f.toSeq(), 'NAG')
def test_str(self): """__str__ returns self._flowgram unmodified.""" f = Flowgram('0.5 1.0 4.0 0.0') self.assertEqual(str(f), '0.5\t1.0\t4.0\t0.0') f = Flowgram([0.5, 1.0, 4.0, 0.0]) self.assertEqual(str(f), '0.5\t1.0\t4.0\t0.0')
def test_iter(self): """Flowgram iter should iterate over sequence""" f = Flowgram('0.5 1.0 4.0 0.0') self.assertEqual(list(f), [0.5, 1.0, 4.0, 0.0])
def test_toFasta(self): """Flowgram toFasta() should return Fasta-format string""" even = '0.5 1.0 4.0 0.0' odd = '0.5 1.0 4.0 1.0' even_f = Flowgram(even, Name='even', floworder="TACG") odd_f = Flowgram(odd, Name='odd', floworder="TACG") self.assertEqual(even_f.toFasta(), '>even\nTACCCC') #set line wrap to small number so we can test that it works self.assertEqual(even_f.toFasta(LineWrap=2), '>even\nTA\nCC\nCC') self.assertEqual(odd_f.toFasta(LineWrap=2), '>odd\nTA\nCC\nCC\nG') even_f = Flowgram(even, Name='even', floworder="TACG", header_info={'Bases': 'TACCCG'}) odd_f = Flowgram(odd, Name='odd', floworder="TACG", header_info={'Bases': 'TACCCGG'}) self.assertEqual(even_f.toFasta(), '>even\nTACCCG') #set line wrap to small number so we can test that it works self.assertEqual(even_f.toFasta(LineWrap=2), '>even\nTA\nCC\nCG') self.assertEqual(odd_f.toFasta(LineWrap=2), '>odd\nTA\nCC\nCG\nG')
flowgram = Flowgram("0.99 0.00 0.99 0.00 0.00 1.02 0.00 1.00 1.00 1.12\t\t" + "0.01 0.01 1.89 0.01 0.95 0.95 0.97 0.00 0.02 0.98\t" + "0.97 0.00 0.97 0.05 0.01 1.06 0.03 0.97 0.00 0.03\t" + "0.97 0.02 0.00 1.09 0.02 0.01 0.96 0.00 0.00 1.01\t" + "0.04 0.00 0.99 0.06 0.97 0.00 0.09 0.97 0.04 0.00\t" + "1.94 0.09 1.02 0.00 2.86 1.02 1.00 1.11 0.10 1.97\t" + "0.12 0.98 0.01 0.99 2.90 0.03 0.04 1.93 0.15 1.02\t" + "1.95 1.00 1.02 0.00 0.12 1.00 0.97 0.00 1.00 0.06\t" + "0.97 0.00 0.96 0.05 0.10 1.03 0.12 0.99 1.98 0.09\t" + "1.99 0.08 0.13 2.10 0.14 0.05 1.00 0.10 0.00 1.00\t" + "1.00 0.00 0.07 4.82 0.10 1.04 2.05 0.00 2.01 0.04\t" + "1.96 0.08 0.93 0.00 0.93 0.03 0.99 0.02 1.01 0.06\t" + "0.09 1.04 0.14 1.06 0.07 2.04 3.49 0.15 1.02 0.80\t" + "0.23 0.07 1.07 0.17 1.91 0.07 0.18 1.00 0.32 0.07\t" + "0.97 0.11 0.96 0.96 0.14 1.96 0.19 2.01 2.84 0.28\t" + "0.08 2.03 1.32 0.06 0.05 1.10 0.17 0.88 0.09 0.95\t" + "0.14 0.13 1.85 1.07 1.78 0.89 1.94 0.19 1.09 0.14\t" + "1.09 0.13 0.13 0.86 1.85 0.07 0.09 1.97 1.20 0.08\t" + "0.95 0.23 0.09 0.94 0.16 0.11 1.92 0.12 0.89 1.95\t" + "0.21 0.12 0.97 0.14 0.16 1.86 0.12 1.89 1.00 1.07\t" + "0.06 0.16 1.05 0.11 0.06 0.95 0.12 0.13 1.01 0.15\t" + "3.79 0.14 0.15 0.98 0.40 0.11 1.00 0.19 1.01 1.09\t" + "0.12 0.94 0.11 0.15 1.00 2.04 2.03 0.95 0.06 3.05\t" + "0.22 0.08 1.82 0.21 1.02 0.09 2.88 1.88 0.15 0.07\t" + "1.05 1.89 0.08 0.06 1.87 2.87 1.87 0.06 0.15 1.15\t" + "0.25 0.08 0.96 0.12 0.06 0.95 0.09 0.13 1.05 1.95\t" + "3.81 1.02 0.13 0.17 2.14 1.08 0.19 0.13 1.08 1.01\t" + "1.99 0.11 0.18 1.06 0.17 0.04 0.98 0.08 1.01 2.86\t" + "1.06 0.96 0.10 0.22 1.99 2.04 0.14 0.00 0.97 0.16\t" + "0.95 0.07 2.75 0.02 0.98 0.12 2.94 0.00 0.99 1.03\t" + "0.26 2.89 0.15 1.87 0.10 0.15 0.98 0.17 1.07 0.92\t" + "0.00 0.09 1.08 0.16 3.78 1.01 0.07 0.87 0.22 0.98\t" + "1.97 1.09 0.08 0.17 1.08 0.03 0.97 2.04 0.18 0.14\t" + "1.03 0.03 0.00 1.16 0.12 1.81 2.06 0.18 0.17 2.06\t" + "0.14 0.85 0.21 0.12 1.01 1.05 1.05 0.94 0.99 0.11\t" + "0.15 1.08 2.00 1.02 0.99 0.13 1.07 0.13 0.98 0.16\t" + "0.09 0.99 3.00 1.05 1.02 0.02 0.10 0.93 0.11 0.09\t" + "0.81 0.97 0.13 0.05 2.04 1.93 1.12 0.04 0.93 0.93\t" + "0.11 0.06 1.96 0.06 0.09 1.14 0.15 0.06 1.08 0.06\t" + "0.94 0.11 0.00 0.88 1.11 0.10 2.08 1.05 0.15 0.09")
def seqs_to_flows(seqs, keyseq = default_keyseq, floworder = default_floworder, numflows = None, probs = None, bin_size = 0.01, header_info = {}): """ Transfrom a sequence into an ideal flow seqs: a list of name sequence object tuples (name,tuple) keyseq: the flowgram key Sequence floworder: The chars needed to convert seq to flow numflows: number of total flows in each flowgram, if it is specified the flowgram will be padded to that number probs: dictionary defining the probability distribution for each homopolymer WARNING:each distributions probabilities must add to 1.0 """ flows = [] homopolymer_counter = 1.0 if probs: for p in probs: if round(sum(probs[p]),1) != 1.0: raise ValueError, 'probs[%s] does not add to 1.0' % p for name,seq in seqs: flow_seq = FakeRandom(floworder,True) flow = [] seq_len = len(seq) for i, nuc in enumerate(seq): if i < seq_len-1 and seq[i+1] == nuc: homopolymer_counter += 1.0 else: while flow_seq() != nuc: if probs is None: val = 0.0 else: val = pick_from_prob_density(probs[0],bin_size) flow.append(val) if (probs is None) or (homopolymer_counter > 9): val = homopolymer_counter else: val = pick_from_prob_density(probs[int(homopolymer_counter)],bin_size) flow.append(val) homopolymer_counter = 1.0 len_flow = len(flow) len_order = len(floworder) if numflows is not None and numflows % len_order != 0: raise ValueError, "numflows must be divisable by the length of floworder" if (len_flow % len_order != 0): right_missing = len_order - (len_flow % len_order) if numflows != (len_flow + right_missing) and numflows is not None: right_missing += (numflows - (len_flow+right_missing)) if probs is None: flow.extend([0.0]*right_missing) else: for i in range(0,right_missing): flow.append(pick_from_prob_density(probs[0],bin_size)) flows.append((name, Flowgram(flow, id, keyseq, floworder))) if keyseq is not None: keylen = len(keyseq) else: keylen = None header_info.update({'Key Sequence':keyseq,'Flow Chars':floworder, 'Key Length':keylen}) return FlowgramCollection(flows, header_info = header_info)
def test_toSeq(self): """toSeq should Translate flowgram to sequence""" f = Flowgram('0.5 1.0 4.0 0.0', Name = 'a',floworder = "TACG", header_info = {'Bases':'TACCCG'}) self.assertEqual(f.toSeq(), 'TACCCG') self.assertEqual(isinstance(f.toSeq(),Sequence), True) self.assertEqual(f.toSeq(Bases = False), 'TACCCC') f = Flowgram('0.5 1.0 4.0 0.0 0.0 1.23 0.0 6.1', Name = 'a',floworder = "TACG", header_info = {'Bases':'TACCCG'}) self.assertEqual(f.toSeq(), 'TACCCG') self.assertEqual(f.toSeq(Bases = False), 'TACCCCAGGGGGG') f = Flowgram('0.5 1.0 4.0 0.0', Name = 'a',floworder = "TACG", header_info = {}) self.assertEqual(f.toSeq(), 'TACCCC') self.assertEqual(isinstance(f.toSeq(),Sequence), True) self.assertEqual(f.toSeq(Bases = False), 'TACCCC') f = Flowgram('0.5 1.0 4.0 0.0 0.0 1.23 0.0 6.1', Name = 'a',floworder = "TACG", header_info = {}) self.assertEqual(f.toSeq(Bases = True), 'TACCCCAGGGGGG') f = Flowgram('0.4 0.0 0.0 0.0 0.0 1.23 0.0 1.1', Name = 'a',floworder = "TACG", header_info = {}) self.assertEqual(f.toSeq(), 'NAG')
def test_getPrimerTrimmedFlowgram(self): """getPrimerTrimmedFlowgram cuts the barcode of the flowgram correctly""" f = Flowgram('0.5 1.0 4.1 0.0 0.0 1.23 0.0 3.1', Name = 'a', floworder = "TACG", header_info = {'Bases':'TACCCCAGGG', 'Clip Qual Right': 7, 'Flow Indexes': "1\t2\t3\t3\t3\t3\t6\t8\t8\t8"}) trimmed = f.getPrimerTrimmedFlowgram(primerseq="TA") #test primer trimming self.assertEqual(trimmed.toSeq(), "CCCCAGGG") self.assertEqual(str(trimmed), "0.00\t0.00\t4.10\t0.00\t0.00\t1.23\t0.00\t3.10") for (a,b) in zip(trimmed.flowgram, [0.0,0.0,4.1,0.0,0.0,1.23,0.0,3.1]): self.assertFloatEqual(a,b) trimmed = f.getPrimerTrimmedFlowgram(primerseq="TACC") for (a,b) in zip(trimmed.flowgram, [0.0,0.0,2.1,0.0,0.0,1.23,0.0,3.1]): self.assertFloatEqual(a,b) self.assertEqual(trimmed.toSeq(), "CCAGGG") self.assertEqual(str(trimmed), "0.00\t0.00\t2.10\t0.00\t0.00\t1.23\t0.00\t3.10") # test that primer trimming does not leave ambig flow at begin trimmed = f.getPrimerTrimmedFlowgram(primerseq="TACCCC") for (a,b) in zip(trimmed.flowgram, [0.0,1.23,0.0,3.1]): self.assertFloatEqual(a,b) self.assertEqual(trimmed.toSeq(), "AGGG") self.assertEqual(str(trimmed), "0.00\t1.23\t0.00\t3.10") # tests on real data flow1 = self.flows[0] flow2 = self.flows[1] flow3 = self.flows[2] flow1_trimmed = flow1.getPrimerTrimmedFlowgram(primerseq="TCAG"+"GCTAACTGTAA") self.assertEqual(str(flow1_trimmed), "0.00\t0.00\t2.89 0.18 0.96 0.13 0.99 0.11 1.94 0.12 0.13 1.92 0.21 0.07 0.94 0.17 0.03 0.97 2.76 0.15 0.05 1.02 1.14 0.10 0.98 2.54 1.13 0.96 0.15 0.21 1.90 0.16 0.07 1.78 0.22 0.07 0.93 0.22 0.97 0.08 2.02 0.15 0.19 1.02 0.19 0.09 1.02 0.17 0.99 0.09 0.18 1.84 0.16 0.91 0.10 1.10 1.00 0.20 0.09 1.11 3.01 1.07 1.98 0.14 0.22 1.09 0.17 1.99 0.15 0.20 0.92 0.17 0.07 1.01 2.96 0.15 0.07 1.06 0.20 1.00 0.10 0.12 1.00 0.15 0.08 1.90 0.19 0.10 0.99 0.18 0.09 0.99 1.08 0.15 0.07 1.06 0.14 1.84 0.13 0.11 0.95 1.05 0.13 1.04 1.10 0.18 0.94 0.14 0.10 0.97 1.08 0.12 1.08 0.18 0.08 1.00 0.13 0.98 0.15 0.87 0.13 0.19 1.01 3.06 0.17 0.11 1.04 0.09 1.03 0.10 0.11 2.02 0.16 0.11 1.04 0.04 0.09 1.87 0.13 2.09 0.13 0.10 0.97 0.17 0.08 0.08 0.04 0.12 0.05 0.08 0.07 0.08 0.05 0.07 0.06 0.07 0.03 0.05 0.04 0.09 0.04 0.07 0.04 0.07 0.06 0.03 0.06 0.06 0.06 0.06 0.07 0.09 0.04 0.05 0.08 0.05 0.04 0.09 0.06 0.03 0.02 0.08 0.04 0.06 0.05 0.08 0.03 0.08 0.05 0.05 0.05 0.10 0.05 0.05 0.07 0.06 0.04 0.06 0.05 0.03 0.04 0.05 0.06 0.04 0.04 0.07 0.04 0.04 0.05 0.05 0.04 0.07 0.06 0.05 0.03 0.08 0.05 0.06 0.04 0.06 0.05 0.04 0.04 0.04 0.05 0.06 0.04 0.05 0.04 0.05 0.05 0.06 0.05 0.06 0.04 0.06 0.07 0.06 0.05 0.05 0.05 0.06 0.06 0.04 0.05 0.06 0.03 0.06 0.04 0.06 0.05 0.03 0.06 0.06 0.05 0.06 0.04 0.03 0.06 0.06 0.06 0.03 0.04 0.05 0.05 0.07 0.04 0.05 0.06 0.07 0.07 0.05 0.07 0.06 0.05 0.06 0.05 0.07 0.06 0.05 0.06 0.07 0.05 0.06 0.04 0.06 0.05 0.05 0.06 0.04 0.06 0.04 0.03 0.06 0.05 0.05 0.04 0.05 0.05 0.04 0.04 0.05 0.06 0.06 0.04 0.04 0.05 0.06 0.04 0.04 0.04 0.05 0.05 0.04 0.05 0.05 0.03 0.06 0.06 0.06 0.04 0.07 0.05 0.05 0.04 0.06 0.06 0.05 0.05 0.07 0.04 0.06 0.06 0.06 0.04 0.06 0.03 0.06 0.04 0.06 0.04 0.09 0.05 0.05 0.05 0.07 0.06 0.05 0.05 0.06 0.05 0.05 0.05 0.04 0.04 0.06 0.05 0.05 0.05 0.05 0.04 0.05 0.05 0.06 0.04 0.05 0.05 0.05 0.05 0.05 0.04 0.06 0.04 0.05 0.05 0.04 0.05 0.05 0.05 0.04") self.assertEqual(flow1_trimmed.Bases, "CCCTCTTGGCACCCACTAAACGCCAATCTTGCTGGAGTGTTTACCAGGCACCCAGCAATGTGAATAGTCActgagcgggctggcaaggc") flow1_trimmed = flow1.getPrimerTrimmedFlowgram(primerseq="TCAG"+"GCTAACTGTAAC") self.assertEqual(str(flow1_trimmed), "0.00\t0.00\t1.89 0.18 0.96 0.13 0.99 0.11 1.94 0.12 0.13 1.92 0.21 0.07 0.94 0.17 0.03 0.97 2.76 0.15 0.05 1.02 1.14 0.10 0.98 2.54 1.13 0.96 0.15 0.21 1.90 0.16 0.07 1.78 0.22 0.07 0.93 0.22 0.97 0.08 2.02 0.15 0.19 1.02 0.19 0.09 1.02 0.17 0.99 0.09 0.18 1.84 0.16 0.91 0.10 1.10 1.00 0.20 0.09 1.11 3.01 1.07 1.98 0.14 0.22 1.09 0.17 1.99 0.15 0.20 0.92 0.17 0.07 1.01 2.96 0.15 0.07 1.06 0.20 1.00 0.10 0.12 1.00 0.15 0.08 1.90 0.19 0.10 0.99 0.18 0.09 0.99 1.08 0.15 0.07 1.06 0.14 1.84 0.13 0.11 0.95 1.05 0.13 1.04 1.10 0.18 0.94 0.14 0.10 0.97 1.08 0.12 1.08 0.18 0.08 1.00 0.13 0.98 0.15 0.87 0.13 0.19 1.01 3.06 0.17 0.11 1.04 0.09 1.03 0.10 0.11 2.02 0.16 0.11 1.04 0.04 0.09 1.87 0.13 2.09 0.13 0.10 0.97 0.17 0.08 0.08 0.04 0.12 0.05 0.08 0.07 0.08 0.05 0.07 0.06 0.07 0.03 0.05 0.04 0.09 0.04 0.07 0.04 0.07 0.06 0.03 0.06 0.06 0.06 0.06 0.07 0.09 0.04 0.05 0.08 0.05 0.04 0.09 0.06 0.03 0.02 0.08 0.04 0.06 0.05 0.08 0.03 0.08 0.05 0.05 0.05 0.10 0.05 0.05 0.07 0.06 0.04 0.06 0.05 0.03 0.04 0.05 0.06 0.04 0.04 0.07 0.04 0.04 0.05 0.05 0.04 0.07 0.06 0.05 0.03 0.08 0.05 0.06 0.04 0.06 0.05 0.04 0.04 0.04 0.05 0.06 0.04 0.05 0.04 0.05 0.05 0.06 0.05 0.06 0.04 0.06 0.07 0.06 0.05 0.05 0.05 0.06 0.06 0.04 0.05 0.06 0.03 0.06 0.04 0.06 0.05 0.03 0.06 0.06 0.05 0.06 0.04 0.03 0.06 0.06 0.06 0.03 0.04 0.05 0.05 0.07 0.04 0.05 0.06 0.07 0.07 0.05 0.07 0.06 0.05 0.06 0.05 0.07 0.06 0.05 0.06 0.07 0.05 0.06 0.04 0.06 0.05 0.05 0.06 0.04 0.06 0.04 0.03 0.06 0.05 0.05 0.04 0.05 0.05 0.04 0.04 0.05 0.06 0.06 0.04 0.04 0.05 0.06 0.04 0.04 0.04 0.05 0.05 0.04 0.05 0.05 0.03 0.06 0.06 0.06 0.04 0.07 0.05 0.05 0.04 0.06 0.06 0.05 0.05 0.07 0.04 0.06 0.06 0.06 0.04 0.06 0.03 0.06 0.04 0.06 0.04 0.09 0.05 0.05 0.05 0.07 0.06 0.05 0.05 0.06 0.05 0.05 0.05 0.04 0.04 0.06 0.05 0.05 0.05 0.05 0.04 0.05 0.05 0.06 0.04 0.05 0.05 0.05 0.05 0.05 0.04 0.06 0.04 0.05 0.05 0.04 0.05 0.05 0.05 0.04") self.assertEqual(flow1_trimmed.Bases, "CCTCTTGGCACCCACTAAACGCCAATCTTGCTGGAGTGTTTACCAGGCACCCAGCAATGTGAATAGTCActgagcgggctggcaaggc") #test that trimming does not leave 4 zero flows (homopolymer) flow1_trimmed = flow1.getPrimerTrimmedFlowgram(primerseq="TCAG"+"GCTAACTGTAACCC") self.assertEqual(str(flow1_trimmed), "0.96 0.13 0.99 0.11 1.94 0.12 0.13 1.92 0.21 0.07 0.94 0.17 0.03 0.97 2.76 0.15 0.05 1.02 1.14 0.10 0.98 2.54 1.13 0.96 0.15 0.21 1.90 0.16 0.07 1.78 0.22 0.07 0.93 0.22 0.97 0.08 2.02 0.15 0.19 1.02 0.19 0.09 1.02 0.17 0.99 0.09 0.18 1.84 0.16 0.91 0.10 1.10 1.00 0.20 0.09 1.11 3.01 1.07 1.98 0.14 0.22 1.09 0.17 1.99 0.15 0.20 0.92 0.17 0.07 1.01 2.96 0.15 0.07 1.06 0.20 1.00 0.10 0.12 1.00 0.15 0.08 1.90 0.19 0.10 0.99 0.18 0.09 0.99 1.08 0.15 0.07 1.06 0.14 1.84 0.13 0.11 0.95 1.05 0.13 1.04 1.10 0.18 0.94 0.14 0.10 0.97 1.08 0.12 1.08 0.18 0.08 1.00 0.13 0.98 0.15 0.87 0.13 0.19 1.01 3.06 0.17 0.11 1.04 0.09 1.03 0.10 0.11 2.02 0.16 0.11 1.04 0.04 0.09 1.87 0.13 2.09 0.13 0.10 0.97 0.17 0.08 0.08 0.04 0.12 0.05 0.08 0.07 0.08 0.05 0.07 0.06 0.07 0.03 0.05 0.04 0.09 0.04 0.07 0.04 0.07 0.06 0.03 0.06 0.06 0.06 0.06 0.07 0.09 0.04 0.05 0.08 0.05 0.04 0.09 0.06 0.03 0.02 0.08 0.04 0.06 0.05 0.08 0.03 0.08 0.05 0.05 0.05 0.10 0.05 0.05 0.07 0.06 0.04 0.06 0.05 0.03 0.04 0.05 0.06 0.04 0.04 0.07 0.04 0.04 0.05 0.05 0.04 0.07 0.06 0.05 0.03 0.08 0.05 0.06 0.04 0.06 0.05 0.04 0.04 0.04 0.05 0.06 0.04 0.05 0.04 0.05 0.05 0.06 0.05 0.06 0.04 0.06 0.07 0.06 0.05 0.05 0.05 0.06 0.06 0.04 0.05 0.06 0.03 0.06 0.04 0.06 0.05 0.03 0.06 0.06 0.05 0.06 0.04 0.03 0.06 0.06 0.06 0.03 0.04 0.05 0.05 0.07 0.04 0.05 0.06 0.07 0.07 0.05 0.07 0.06 0.05 0.06 0.05 0.07 0.06 0.05 0.06 0.07 0.05 0.06 0.04 0.06 0.05 0.05 0.06 0.04 0.06 0.04 0.03 0.06 0.05 0.05 0.04 0.05 0.05 0.04 0.04 0.05 0.06 0.06 0.04 0.04 0.05 0.06 0.04 0.04 0.04 0.05 0.05 0.04 0.05 0.05 0.03 0.06 0.06 0.06 0.04 0.07 0.05 0.05 0.04 0.06 0.06 0.05 0.05 0.07 0.04 0.06 0.06 0.06 0.04 0.06 0.03 0.06 0.04 0.06 0.04 0.09 0.05 0.05 0.05 0.07 0.06 0.05 0.05 0.06 0.05 0.05 0.05 0.04 0.04 0.06 0.05 0.05 0.05 0.05 0.04 0.05 0.05 0.06 0.04 0.05 0.05 0.05 0.05 0.05 0.04 0.06 0.04 0.05 0.05 0.04 0.05 0.05 0.05 0.04") self.assertEqual(flow1_trimmed.Bases, "TCTTGGCACCCACTAAACGCCAATCTTGCTGGAGTGTTTACCAGGCACCCAGCAATGTGAATAGTCActgagcgggctggcaaggc") #test that trimming does not leave 4 zero flows (signal <1.5) flow1_trimmed = flow1.getPrimerTrimmedFlowgram(primerseq="TCAG"+"GCTAACTGTAACCCTC") self.assertEqual(str(flow1_trimmed), "1.94 0.12 0.13 1.92 0.21 0.07 0.94 0.17 0.03 0.97 2.76 0.15 0.05 1.02 1.14 0.10 0.98 2.54 1.13 0.96 0.15 0.21 1.90 0.16 0.07 1.78 0.22 0.07 0.93 0.22 0.97 0.08 2.02 0.15 0.19 1.02 0.19 0.09 1.02 0.17 0.99 0.09 0.18 1.84 0.16 0.91 0.10 1.10 1.00 0.20 0.09 1.11 3.01 1.07 1.98 0.14 0.22 1.09 0.17 1.99 0.15 0.20 0.92 0.17 0.07 1.01 2.96 0.15 0.07 1.06 0.20 1.00 0.10 0.12 1.00 0.15 0.08 1.90 0.19 0.10 0.99 0.18 0.09 0.99 1.08 0.15 0.07 1.06 0.14 1.84 0.13 0.11 0.95 1.05 0.13 1.04 1.10 0.18 0.94 0.14 0.10 0.97 1.08 0.12 1.08 0.18 0.08 1.00 0.13 0.98 0.15 0.87 0.13 0.19 1.01 3.06 0.17 0.11 1.04 0.09 1.03 0.10 0.11 2.02 0.16 0.11 1.04 0.04 0.09 1.87 0.13 2.09 0.13 0.10 0.97 0.17 0.08 0.08 0.04 0.12 0.05 0.08 0.07 0.08 0.05 0.07 0.06 0.07 0.03 0.05 0.04 0.09 0.04 0.07 0.04 0.07 0.06 0.03 0.06 0.06 0.06 0.06 0.07 0.09 0.04 0.05 0.08 0.05 0.04 0.09 0.06 0.03 0.02 0.08 0.04 0.06 0.05 0.08 0.03 0.08 0.05 0.05 0.05 0.10 0.05 0.05 0.07 0.06 0.04 0.06 0.05 0.03 0.04 0.05 0.06 0.04 0.04 0.07 0.04 0.04 0.05 0.05 0.04 0.07 0.06 0.05 0.03 0.08 0.05 0.06 0.04 0.06 0.05 0.04 0.04 0.04 0.05 0.06 0.04 0.05 0.04 0.05 0.05 0.06 0.05 0.06 0.04 0.06 0.07 0.06 0.05 0.05 0.05 0.06 0.06 0.04 0.05 0.06 0.03 0.06 0.04 0.06 0.05 0.03 0.06 0.06 0.05 0.06 0.04 0.03 0.06 0.06 0.06 0.03 0.04 0.05 0.05 0.07 0.04 0.05 0.06 0.07 0.07 0.05 0.07 0.06 0.05 0.06 0.05 0.07 0.06 0.05 0.06 0.07 0.05 0.06 0.04 0.06 0.05 0.05 0.06 0.04 0.06 0.04 0.03 0.06 0.05 0.05 0.04 0.05 0.05 0.04 0.04 0.05 0.06 0.06 0.04 0.04 0.05 0.06 0.04 0.04 0.04 0.05 0.05 0.04 0.05 0.05 0.03 0.06 0.06 0.06 0.04 0.07 0.05 0.05 0.04 0.06 0.06 0.05 0.05 0.07 0.04 0.06 0.06 0.06 0.04 0.06 0.03 0.06 0.04 0.06 0.04 0.09 0.05 0.05 0.05 0.07 0.06 0.05 0.05 0.06 0.05 0.05 0.05 0.04 0.04 0.06 0.05 0.05 0.05 0.05 0.04 0.05 0.05 0.06 0.04 0.05 0.05 0.05 0.05 0.05 0.04 0.06 0.04 0.05 0.05 0.04 0.05 0.05 0.05 0.04") self.assertEqual(flow1_trimmed.Bases, "TTGGCACCCACTAAACGCCAATCTTGCTGGAGTGTTTACCAGGCACCCAGCAATGTGAATAGTCActgagcgggctggcaaggc") flow1_untrimmed= flow1.getPrimerTrimmedFlowgram("") self.assertEqual(str(flow1_untrimmed), "1.06 0.08 1.04 0.08 0.05 0.94 0.10 2.01 0.10 0.07 0.96 0.09 1.04 1.96 1.07 0.10 1.01 0.13 0.08 1.01 1.06 1.83 2.89 0.18 0.96 0.13 0.99 0.11 1.94 0.12 0.13 1.92 0.21 0.07 0.94 0.17 0.03 0.97 2.76 0.15 0.05 1.02 1.14 0.10 0.98 2.54 1.13 0.96 0.15 0.21 1.90 0.16 0.07 1.78 0.22 0.07 0.93 0.22 0.97 0.08 2.02 0.15 0.19 1.02 0.19 0.09 1.02 0.17 0.99 0.09 0.18 1.84 0.16 0.91 0.10 1.10 1.00 0.20 0.09 1.11 3.01 1.07 1.98 0.14 0.22 1.09 0.17 1.99 0.15 0.20 0.92 0.17 0.07 1.01 2.96 0.15 0.07 1.06 0.20 1.00 0.10 0.12 1.00 0.15 0.08 1.90 0.19 0.10 0.99 0.18 0.09 0.99 1.08 0.15 0.07 1.06 0.14 1.84 0.13 0.11 0.95 1.05 0.13 1.04 1.10 0.18 0.94 0.14 0.10 0.97 1.08 0.12 1.08 0.18 0.08 1.00 0.13 0.98 0.15 0.87 0.13 0.19 1.01 3.06 0.17 0.11 1.04 0.09 1.03 0.10 0.11 2.02 0.16 0.11 1.04 0.04 0.09 1.87 0.13 2.09 0.13 0.10 0.97 0.17 0.08 0.08 0.04 0.12 0.05 0.08 0.07 0.08 0.05 0.07 0.06 0.07 0.03 0.05 0.04 0.09 0.04 0.07 0.04 0.07 0.06 0.03 0.06 0.06 0.06 0.06 0.07 0.09 0.04 0.05 0.08 0.05 0.04 0.09 0.06 0.03 0.02 0.08 0.04 0.06 0.05 0.08 0.03 0.08 0.05 0.05 0.05 0.10 0.05 0.05 0.07 0.06 0.04 0.06 0.05 0.03 0.04 0.05 0.06 0.04 0.04 0.07 0.04 0.04 0.05 0.05 0.04 0.07 0.06 0.05 0.03 0.08 0.05 0.06 0.04 0.06 0.05 0.04 0.04 0.04 0.05 0.06 0.04 0.05 0.04 0.05 0.05 0.06 0.05 0.06 0.04 0.06 0.07 0.06 0.05 0.05 0.05 0.06 0.06 0.04 0.05 0.06 0.03 0.06 0.04 0.06 0.05 0.03 0.06 0.06 0.05 0.06 0.04 0.03 0.06 0.06 0.06 0.03 0.04 0.05 0.05 0.07 0.04 0.05 0.06 0.07 0.07 0.05 0.07 0.06 0.05 0.06 0.05 0.07 0.06 0.05 0.06 0.07 0.05 0.06 0.04 0.06 0.05 0.05 0.06 0.04 0.06 0.04 0.03 0.06 0.05 0.05 0.04 0.05 0.05 0.04 0.04 0.05 0.06 0.06 0.04 0.04 0.05 0.06 0.04 0.04 0.04 0.05 0.05 0.04 0.05 0.05 0.03 0.06 0.06 0.06 0.04 0.07 0.05 0.05 0.04 0.06 0.06 0.05 0.05 0.07 0.04 0.06 0.06 0.06 0.04 0.06 0.03 0.06 0.04 0.06 0.04 0.09 0.05 0.05 0.05 0.07 0.06 0.05 0.05 0.06 0.05 0.05 0.05 0.04 0.04 0.06 0.05 0.05 0.05 0.05 0.04 0.05 0.05 0.06 0.04 0.05 0.05 0.05 0.05 0.05 0.04 0.06 0.04 0.05 0.05 0.04 0.05 0.05 0.05 0.04") self.assertEqual(flow1_untrimmed.Bases, "tcagGCTAACTGTAACCCTCTTGGCACCCACTAAACGCCAATCTTGCTGGAGTGTTTACCAGGCACCCAGCAATGTGAATAGTCActgagcgggctggcaaggc") flow2_trimmed = flow2.getPrimerTrimmedFlowgram(primerseq="TCAG"+"AGACGCACT") self.assertEqual(str(flow2_trimmed), "0.00\t0.05\t0.90 0.11 0.07 1.99 0.11 0.02 1.96 1.04 0.13 0.01 2.83 0.10 1.97 0.06 0.11 1.04 0.13 0.03 0.98 1.15 0.07 1.00 0.07 0.08 0.98 0.11 1.92 0.05 0.04 2.96 1.02 1.02 0.04 0.93 1.00 0.13 0.04 1.00 1.03 0.08 0.97 0.13 0.11 1.88 0.09 0.05 1.02 1.89 0.07 0.11 0.98 0.05 0.07 1.01 0.08 0.05 1.01 0.13 1.00 0.07 0.10 1.04 0.10 0.04 0.98 0.12 1.03 0.96 0.11 0.07 1.00 0.09 0.03 1.03 0.11 1.95 1.06 0.13 0.05 1.00 0.13 0.11 1.00 0.09 0.03 2.89 0.08 0.95 0.09 1.03 1.02 1.05 1.07 0.08 0.12 2.81 0.08 0.08 1.00 1.07 0.07 0.05 1.86 0.12 0.98 0.06 2.00 0.11 1.02 0.11 0.08 1.88 0.13 1.03 0.13 0.98 0.15 0.11 1.03 1.03 1.04 0.18 0.98 0.13 0.15 1.04 0.11 1.01 0.13 0.06 1.01 0.06 1.02 0.08 0.99 0.14 0.99 0.09 0.05 1.09 0.04 0.07 2.96 0.09 2.03 0.13 2.96 1.13 0.08 1.03 0.07 0.99 0.11 0.05 1.05 1.04 0.09 0.07 1.00 1.03 0.09 0.06 1.06 1.04 2.94 0.18 0.06 0.93 0.10 1.10 0.11 2.02 0.17 1.00 1.03 0.06 0.11 0.96 0.04 3.00 0.11 0.07 1.99 0.10 2.03 0.12 0.97 0.16 0.01 2.09 0.14 1.04 0.16 0.06 1.03 0.14 1.12 0.12 0.05 0.96 1.01 0.10 0.14 0.94 0.03 0.12 1.10 0.92 0.09 1.10 1.04 1.02 0.12 0.97 2.00 0.15 1.08 0.04 1.03 1.04 0.03 0.09 5.16 1.02 0.09 0.13 2.66 0.09 0.05 1.06 0.07 0.89 0.05 0.12 1.10 0.16 0.06 1.01 0.13 1.00 0.14 0.98 0.09 2.92 1.28 0.03 2.95 0.98 0.16 0.08 0.95 0.96 1.09 0.08 1.07 1.01 0.16 0.06 4.52 0.12 1.03 0.07 0.09 1.03 0.14 0.03 1.01 1.99 1.05 0.14 1.03 0.13 0.03 1.10 0.10 0.96 0.11 0.99 0.12 0.05 0.94 2.83 0.14 0.12 0.96 0.00 1.00 0.11 0.14 1.98 0.08 0.11 1.04 0.01 0.11 2.03 0.15 2.05 0.10 0.03 0.93 0.01 0.08 0.12 0.00 0.16 0.05 0.07 0.08 0.11 0.07 0.05 0.04 0.10 0.05 0.05 0.03 0.07 0.03 0.04 0.04 0.06 0.03 0.05 0.04 0.09 0.03 0.08 0.03 0.07 0.02 0.05 0.02 0.06 0.01 0.05 0.04 0.06 0.02 0.04 0.04 0.04 0.03 0.03 0.06 0.06 0.03 0.02 0.02 0.08 0.03 0.01 0.01 0.06 0.03 0.01 0.03 0.04 0.02 0.00 0.02 0.05 0.00 0.02 0.02 0.03 0.00 0.02 0.02 0.04 0.01 0.00 0.01 0.05") self.assertEqual(flow2_trimmed.Bases, "CAATTATTTCCATAGCTTGGGTAGTGTCAATAATGCTGCTATGAACATGGGAGTACAAATATTCTTCAAGATACTGATCTCATTTCCTTTAGATATATACCCAGAAGTGAAATTCCTGGATCACATAGTAGTTCTATTTTTATTTGATGAGAAACTTTATACTATTTTTCATAActgagcgggctggcaaggc") #trimming at the end of the flow cycle works flow3_trimmed = flow3.getPrimerTrimmedFlowgram(primerseq="TCAG"+"ATTAGATACCCNGGTAGG") self.assertEqual(str(flow3_trimmed), "0.05 0.05 2.04 0.10 0.03 1.06 1.05 1.01 0.07 0.09 2.07 1.01 0.93 2.88 1.06 1.95 1.00 0.05 0.05 2.97 0.09 0.00 0.93 1.01 0.06 0.05 0.99 0.09 0.98 1.01 0.03 1.02 1.92 0.07 0.01 1.03 1.01 0.01 0.05 0.96 0.09 0.05 0.98 1.07 0.02 2.02 2.05 0.09 1.87 0.12 2.15 0.05 0.13 0.92 1.05 1.96 3.01 0.13 0.04 1.05 0.96 0.05 0.05 0.95 0.12 0.01 1.00 2.02 0.03 0.03 0.99 1.01 0.05 0.06 0.98 0.13 0.06 0.97 0.11 1.01 0.08 0.12 1.02 0.12 1.02 2.19 1.03 1.01 0.08 0.11 0.96 0.09 0.08 1.01 0.08 0.06 2.10 2.11 0.12 1.04 0.13 0.09 0.94 1.03 0.08 0.05 3.06 0.12 1.00 0.03 0.09 0.95 0.10 0.03 2.09 0.21 0.99 0.06 0.11 4.06 0.10 1.04 0.04 1.05 1.05 1.04 1.02 0.97 0.13 0.93 0.10 0.12 1.08 0.12 0.99 1.06 0.10 0.11 0.98 0.10 0.02 2.01 0.10 1.01 0.09 0.96 0.07 0.11 2.03 4.12 1.05 0.08 1.01 0.04 0.98 0.14 0.12 2.96 0.13 1.98 0.12 2.08 0.10 0.12 1.99 0.13 0.07 0.98 0.03 0.93 0.86 4.10 0.13 0.10 3.99 1.13 0.07 0.06 1.07 0.09 0.05 1.03 1.12 0.13 0.05 2.01 0.08 0.80 0.05 0.11 0.98 0.13 0.04 1.01 0.07 1.02 0.07 0.11 1.07 2.19 0.06 0.97 0.11 1.03 0.05 0.11 1.05 0.14 0.06 1.03 0.13 0.10 0.97 0.16 0.13 1.00 0.13 0.06 1.02 2.15 0.02 0.16 0.95 0.09 2.06 2.12 0.07 0.07 2.08 0.12 0.97 1.00 0.03 0.99 1.02 1.01 0.03 0.15 0.90 0.07 0.01 2.00 1.01 1.00 0.06 0.11 1.08 1.00 0.03 1.99 0.03 1.00 0.02 1.85 1.93 0.14 1.97 0.91 1.83 0.06 0.04 1.97 0.05 2.08 0.04 0.06 1.05 0.05 2.13 0.16 0.09 1.17 0.01 1.01 1.07 0.09 0.14 0.91 0.06 0.08 1.03 1.04 0.08 0.05 1.05 1.03 1.16 0.06 0.05 1.01 0.06 2.15 0.06 1.99 0.13 0.04 1.08 0.97 0.11 0.07 1.05 0.08 0.07 2.13 0.14 0.09 1.10 0.15 0.00 1.02 0.07 1.05 0.05 0.95 0.09 1.00 0.15 0.95 0.08 0.15 1.11 0.07 0.12 1.05 1.06 0.09 1.03 0.07 0.11 1.01 0.05 0.05 1.05 0.98 0.00 0.93 0.08 0.12 1.85 1.11 0.10 0.07 1.00 0.01 0.10 1.87 0.05 2.14 1.10 0.03 1.06 0.10 0.91 0.10 0.06 1.05 1.02 1.02 0.07 0.06 0.98 0.95 1.09 0.06 0.14 0.97 0.04 2.44") self.assertEqual(flow3_trimmed.Bases, "CCACGCCGTAAACGGTGGGCGCTAGTTGTGCGAACCTTCCACGGTTTGTGCGGCGCAGCTAACGCATTAAGCGCCCTGCCTGGGGAGTACGATCGCAAGATTAAAACTCAAAGGAATTGACGGGGCCCCGCACAAGCAGCGGAGCATGCGGCTTAATTCGACGCAACGCGAAGAACCTTACCAAGGCTTGACATATACAGGAATATGGCAGAGATGTCATAGCCGCAAGGTCTGTATACAGG") flow3_trimmed = flow3.getPrimerTrimmedFlowgram(primerseq="TCAG"+"ATTAGATACCCNGGTAG") self.assertEqual(str(flow3_trimmed), "0.00\t0.00\t0.00 1.10 0.05 0.05 2.04 0.10 0.03 1.06 1.05 1.01 0.07 0.09 2.07 1.01 0.93 2.88 1.06 1.95 1.00 0.05 0.05 2.97 0.09 0.00 0.93 1.01 0.06 0.05 0.99 0.09 0.98 1.01 0.03 1.02 1.92 0.07 0.01 1.03 1.01 0.01 0.05 0.96 0.09 0.05 0.98 1.07 0.02 2.02 2.05 0.09 1.87 0.12 2.15 0.05 0.13 0.92 1.05 1.96 3.01 0.13 0.04 1.05 0.96 0.05 0.05 0.95 0.12 0.01 1.00 2.02 0.03 0.03 0.99 1.01 0.05 0.06 0.98 0.13 0.06 0.97 0.11 1.01 0.08 0.12 1.02 0.12 1.02 2.19 1.03 1.01 0.08 0.11 0.96 0.09 0.08 1.01 0.08 0.06 2.10 2.11 0.12 1.04 0.13 0.09 0.94 1.03 0.08 0.05 3.06 0.12 1.00 0.03 0.09 0.95 0.10 0.03 2.09 0.21 0.99 0.06 0.11 4.06 0.10 1.04 0.04 1.05 1.05 1.04 1.02 0.97 0.13 0.93 0.10 0.12 1.08 0.12 0.99 1.06 0.10 0.11 0.98 0.10 0.02 2.01 0.10 1.01 0.09 0.96 0.07 0.11 2.03 4.12 1.05 0.08 1.01 0.04 0.98 0.14 0.12 2.96 0.13 1.98 0.12 2.08 0.10 0.12 1.99 0.13 0.07 0.98 0.03 0.93 0.86 4.10 0.13 0.10 3.99 1.13 0.07 0.06 1.07 0.09 0.05 1.03 1.12 0.13 0.05 2.01 0.08 0.80 0.05 0.11 0.98 0.13 0.04 1.01 0.07 1.02 0.07 0.11 1.07 2.19 0.06 0.97 0.11 1.03 0.05 0.11 1.05 0.14 0.06 1.03 0.13 0.10 0.97 0.16 0.13 1.00 0.13 0.06 1.02 2.15 0.02 0.16 0.95 0.09 2.06 2.12 0.07 0.07 2.08 0.12 0.97 1.00 0.03 0.99 1.02 1.01 0.03 0.15 0.90 0.07 0.01 2.00 1.01 1.00 0.06 0.11 1.08 1.00 0.03 1.99 0.03 1.00 0.02 1.85 1.93 0.14 1.97 0.91 1.83 0.06 0.04 1.97 0.05 2.08 0.04 0.06 1.05 0.05 2.13 0.16 0.09 1.17 0.01 1.01 1.07 0.09 0.14 0.91 0.06 0.08 1.03 1.04 0.08 0.05 1.05 1.03 1.16 0.06 0.05 1.01 0.06 2.15 0.06 1.99 0.13 0.04 1.08 0.97 0.11 0.07 1.05 0.08 0.07 2.13 0.14 0.09 1.10 0.15 0.00 1.02 0.07 1.05 0.05 0.95 0.09 1.00 0.15 0.95 0.08 0.15 1.11 0.07 0.12 1.05 1.06 0.09 1.03 0.07 0.11 1.01 0.05 0.05 1.05 0.98 0.00 0.93 0.08 0.12 1.85 1.11 0.10 0.07 1.00 0.01 0.10 1.87 0.05 2.14 1.10 0.03 1.06 0.10 0.91 0.10 0.06 1.05 1.02 1.02 0.07 0.06 0.98 0.95 1.09 0.06 0.14 0.97 0.04 2.44") self.assertEqual(flow3_trimmed.Bases, "GCCACGCCGTAAACGGTGGGCGCTAGTTGTGCGAACCTTCCACGGTTTGTGCGGCGCAGCTAACGCATTAAGCGCCCTGCCTGGGGAGTACGATCGCAAGATTAAAACTCAAAGGAATTGACGGGGCCCCGCACAAGCAGCGGAGCATGCGGCTTAATTCGACGCAACGCGAAGAACCTTACCAAGGCTTGACATATACAGGAATATGGCAGAGATGTCATAGCCGCAAGGTCTGTATACAGG")
def test_init_empty(self): """Flowgram should init correctly.""" f = Flowgram() self.assertEqual(f._flowgram, '') self.assertEqual(f.flowgram, [])
def __init__(self, data, Name = None, Names = None, header_info = None, conversion_f = None, name_conversion_f = None, remove_duplicate_names = False): """Initialize self with data and optionally Info. Parameters: data: Data to convert into a FlowgramCollection Name: Name of the FlowgramCollection. conversion_f: Function to convert data into Flowgram. name_conversion_f: if present, converts name into f(name). header_info: contains info to be printed in the common header of an sff file, it is a dictionary. ex: Key Sequence:"ATCG" """ #read all the data in if we were passed a generator if isinstance(data, GeneratorType): data = list(data) #set the Name self.Name = Name if header_info is not None: self._check_header_info(header_info) for i in header_info: setattr(self,i,header_info[i]) if 'Key Sequence' in header_info: keyseq = header_info['Key Sequence'] else: keyseq = None if 'Flow Chars' in header_info: floworder = header_info['Flow Chars'] else: floworder = default_floworder else: keyseq = None floworder = default_floworder self.header_info = header_info per_flow_names, flows, name_order, info = \ self._names_flows_order(conversion_f, data, Names, \ name_conversion_f, remove_duplicate_names) self.Names = name_order #will take only the flows and names that are in name_order if per_flow_names != name_order: good_indices = [] for n in name_order: good_indices.append(per_flow_names.index(n)) flows = [flows[i] for i in good_indices] info = [info[i] for i in good_indices] per_flow_names = name_order self.flow_str= flows self.flows = [Flowgram(f,n,keyseq,floworder, i)\ for f,n, i in zip(flows,self.Names,info)] #create NamedFlows dict for fast lookups self.NamedFlows = self._make_named_flows(self.Names, self.flows)
def test_getPrimerTrimmedFlowgram(self): """getPrimerTrimmedFlowgram cuts the barcode of the flowgram correctly""" f = Flowgram('0.5 1.0 4.1 0.0 0.0 1.23 0.0 3.1', Name='a', floworder="TACG", header_info={ 'Bases': 'TACCCCAGGG', 'Clip Qual Right': 7, 'Flow Indexes': "1\t2\t3\t3\t3\t3\t6\t8\t8\t8" }) trimmed = f.getPrimerTrimmedFlowgram(primerseq="TA") #test primer trimming self.assertEqual(trimmed.toSeq(), "CCCCAGGG") self.assertEqual(str(trimmed), "0.00\t0.00\t4.10\t0.00\t0.00\t1.23\t0.00\t3.10") for (a, b) in zip(trimmed.flowgram, [0.0, 0.0, 4.1, 0.0, 0.0, 1.23, 0.0, 3.1]): self.assertFloatEqual(a, b) trimmed = f.getPrimerTrimmedFlowgram(primerseq="TACC") for (a, b) in zip(trimmed.flowgram, [0.0, 0.0, 2.1, 0.0, 0.0, 1.23, 0.0, 3.1]): self.assertFloatEqual(a, b) self.assertEqual(trimmed.toSeq(), "CCAGGG") self.assertEqual(str(trimmed), "0.00\t0.00\t2.10\t0.00\t0.00\t1.23\t0.00\t3.10") # test that primer trimming does not leave ambig flow at begin trimmed = f.getPrimerTrimmedFlowgram(primerseq="TACCCC") for (a, b) in zip(trimmed.flowgram, [0.0, 1.23, 0.0, 3.1]): self.assertFloatEqual(a, b) self.assertEqual(trimmed.toSeq(), "AGGG") self.assertEqual(str(trimmed), "0.00\t1.23\t0.00\t3.10") # tests on real data flow1 = self.flows[0] flow2 = self.flows[1] flow3 = self.flows[2] flow1_trimmed = flow1.getPrimerTrimmedFlowgram(primerseq="TCAG" + "GCTAACTGTAA") self.assertEqual( str(flow1_trimmed), "0.00\t0.00\t2.89 0.18 0.96 0.13 0.99 0.11 1.94 0.12 0.13 1.92 0.21 0.07 0.94 0.17 0.03 0.97 2.76 0.15 0.05 1.02 1.14 0.10 0.98 2.54 1.13 0.96 0.15 0.21 1.90 0.16 0.07 1.78 0.22 0.07 0.93 0.22 0.97 0.08 2.02 0.15 0.19 1.02 0.19 0.09 1.02 0.17 0.99 0.09 0.18 1.84 0.16 0.91 0.10 1.10 1.00 0.20 0.09 1.11 3.01 1.07 1.98 0.14 0.22 1.09 0.17 1.99 0.15 0.20 0.92 0.17 0.07 1.01 2.96 0.15 0.07 1.06 0.20 1.00 0.10 0.12 1.00 0.15 0.08 1.90 0.19 0.10 0.99 0.18 0.09 0.99 1.08 0.15 0.07 1.06 0.14 1.84 0.13 0.11 0.95 1.05 0.13 1.04 1.10 0.18 0.94 0.14 0.10 0.97 1.08 0.12 1.08 0.18 0.08 1.00 0.13 0.98 0.15 0.87 0.13 0.19 1.01 3.06 0.17 0.11 1.04 0.09 1.03 0.10 0.11 2.02 0.16 0.11 1.04 0.04 0.09 1.87 0.13 2.09 0.13 0.10 0.97 0.17 0.08 0.08 0.04 0.12 0.05 0.08 0.07 0.08 0.05 0.07 0.06 0.07 0.03 0.05 0.04 0.09 0.04 0.07 0.04 0.07 0.06 0.03 0.06 0.06 0.06 0.06 0.07 0.09 0.04 0.05 0.08 0.05 0.04 0.09 0.06 0.03 0.02 0.08 0.04 0.06 0.05 0.08 0.03 0.08 0.05 0.05 0.05 0.10 0.05 0.05 0.07 0.06 0.04 0.06 0.05 0.03 0.04 0.05 0.06 0.04 0.04 0.07 0.04 0.04 0.05 0.05 0.04 0.07 0.06 0.05 0.03 0.08 0.05 0.06 0.04 0.06 0.05 0.04 0.04 0.04 0.05 0.06 0.04 0.05 0.04 0.05 0.05 0.06 0.05 0.06 0.04 0.06 0.07 0.06 0.05 0.05 0.05 0.06 0.06 0.04 0.05 0.06 0.03 0.06 0.04 0.06 0.05 0.03 0.06 0.06 0.05 0.06 0.04 0.03 0.06 0.06 0.06 0.03 0.04 0.05 0.05 0.07 0.04 0.05 0.06 0.07 0.07 0.05 0.07 0.06 0.05 0.06 0.05 0.07 0.06 0.05 0.06 0.07 0.05 0.06 0.04 0.06 0.05 0.05 0.06 0.04 0.06 0.04 0.03 0.06 0.05 0.05 0.04 0.05 0.05 0.04 0.04 0.05 0.06 0.06 0.04 0.04 0.05 0.06 0.04 0.04 0.04 0.05 0.05 0.04 0.05 0.05 0.03 0.06 0.06 0.06 0.04 0.07 0.05 0.05 0.04 0.06 0.06 0.05 0.05 0.07 0.04 0.06 0.06 0.06 0.04 0.06 0.03 0.06 0.04 0.06 0.04 0.09 0.05 0.05 0.05 0.07 0.06 0.05 0.05 0.06 0.05 0.05 0.05 0.04 0.04 0.06 0.05 0.05 0.05 0.05 0.04 0.05 0.05 0.06 0.04 0.05 0.05 0.05 0.05 0.05 0.04 0.06 0.04 0.05 0.05 0.04 0.05 0.05 0.05 0.04" ) self.assertEqual( flow1_trimmed.Bases, "CCCTCTTGGCACCCACTAAACGCCAATCTTGCTGGAGTGTTTACCAGGCACCCAGCAATGTGAATAGTCActgagcgggctggcaaggc" ) flow1_trimmed = flow1.getPrimerTrimmedFlowgram(primerseq="TCAG" + "GCTAACTGTAAC") self.assertEqual( str(flow1_trimmed), "0.00\t0.00\t1.89 0.18 0.96 0.13 0.99 0.11 1.94 0.12 0.13 1.92 0.21 0.07 0.94 0.17 0.03 0.97 2.76 0.15 0.05 1.02 1.14 0.10 0.98 2.54 1.13 0.96 0.15 0.21 1.90 0.16 0.07 1.78 0.22 0.07 0.93 0.22 0.97 0.08 2.02 0.15 0.19 1.02 0.19 0.09 1.02 0.17 0.99 0.09 0.18 1.84 0.16 0.91 0.10 1.10 1.00 0.20 0.09 1.11 3.01 1.07 1.98 0.14 0.22 1.09 0.17 1.99 0.15 0.20 0.92 0.17 0.07 1.01 2.96 0.15 0.07 1.06 0.20 1.00 0.10 0.12 1.00 0.15 0.08 1.90 0.19 0.10 0.99 0.18 0.09 0.99 1.08 0.15 0.07 1.06 0.14 1.84 0.13 0.11 0.95 1.05 0.13 1.04 1.10 0.18 0.94 0.14 0.10 0.97 1.08 0.12 1.08 0.18 0.08 1.00 0.13 0.98 0.15 0.87 0.13 0.19 1.01 3.06 0.17 0.11 1.04 0.09 1.03 0.10 0.11 2.02 0.16 0.11 1.04 0.04 0.09 1.87 0.13 2.09 0.13 0.10 0.97 0.17 0.08 0.08 0.04 0.12 0.05 0.08 0.07 0.08 0.05 0.07 0.06 0.07 0.03 0.05 0.04 0.09 0.04 0.07 0.04 0.07 0.06 0.03 0.06 0.06 0.06 0.06 0.07 0.09 0.04 0.05 0.08 0.05 0.04 0.09 0.06 0.03 0.02 0.08 0.04 0.06 0.05 0.08 0.03 0.08 0.05 0.05 0.05 0.10 0.05 0.05 0.07 0.06 0.04 0.06 0.05 0.03 0.04 0.05 0.06 0.04 0.04 0.07 0.04 0.04 0.05 0.05 0.04 0.07 0.06 0.05 0.03 0.08 0.05 0.06 0.04 0.06 0.05 0.04 0.04 0.04 0.05 0.06 0.04 0.05 0.04 0.05 0.05 0.06 0.05 0.06 0.04 0.06 0.07 0.06 0.05 0.05 0.05 0.06 0.06 0.04 0.05 0.06 0.03 0.06 0.04 0.06 0.05 0.03 0.06 0.06 0.05 0.06 0.04 0.03 0.06 0.06 0.06 0.03 0.04 0.05 0.05 0.07 0.04 0.05 0.06 0.07 0.07 0.05 0.07 0.06 0.05 0.06 0.05 0.07 0.06 0.05 0.06 0.07 0.05 0.06 0.04 0.06 0.05 0.05 0.06 0.04 0.06 0.04 0.03 0.06 0.05 0.05 0.04 0.05 0.05 0.04 0.04 0.05 0.06 0.06 0.04 0.04 0.05 0.06 0.04 0.04 0.04 0.05 0.05 0.04 0.05 0.05 0.03 0.06 0.06 0.06 0.04 0.07 0.05 0.05 0.04 0.06 0.06 0.05 0.05 0.07 0.04 0.06 0.06 0.06 0.04 0.06 0.03 0.06 0.04 0.06 0.04 0.09 0.05 0.05 0.05 0.07 0.06 0.05 0.05 0.06 0.05 0.05 0.05 0.04 0.04 0.06 0.05 0.05 0.05 0.05 0.04 0.05 0.05 0.06 0.04 0.05 0.05 0.05 0.05 0.05 0.04 0.06 0.04 0.05 0.05 0.04 0.05 0.05 0.05 0.04" ) self.assertEqual( flow1_trimmed.Bases, "CCTCTTGGCACCCACTAAACGCCAATCTTGCTGGAGTGTTTACCAGGCACCCAGCAATGTGAATAGTCActgagcgggctggcaaggc" ) #test that trimming does not leave 4 zero flows (homopolymer) flow1_trimmed = flow1.getPrimerTrimmedFlowgram(primerseq="TCAG" + "GCTAACTGTAACCC") self.assertEqual( str(flow1_trimmed), "0.96 0.13 0.99 0.11 1.94 0.12 0.13 1.92 0.21 0.07 0.94 0.17 0.03 0.97 2.76 0.15 0.05 1.02 1.14 0.10 0.98 2.54 1.13 0.96 0.15 0.21 1.90 0.16 0.07 1.78 0.22 0.07 0.93 0.22 0.97 0.08 2.02 0.15 0.19 1.02 0.19 0.09 1.02 0.17 0.99 0.09 0.18 1.84 0.16 0.91 0.10 1.10 1.00 0.20 0.09 1.11 3.01 1.07 1.98 0.14 0.22 1.09 0.17 1.99 0.15 0.20 0.92 0.17 0.07 1.01 2.96 0.15 0.07 1.06 0.20 1.00 0.10 0.12 1.00 0.15 0.08 1.90 0.19 0.10 0.99 0.18 0.09 0.99 1.08 0.15 0.07 1.06 0.14 1.84 0.13 0.11 0.95 1.05 0.13 1.04 1.10 0.18 0.94 0.14 0.10 0.97 1.08 0.12 1.08 0.18 0.08 1.00 0.13 0.98 0.15 0.87 0.13 0.19 1.01 3.06 0.17 0.11 1.04 0.09 1.03 0.10 0.11 2.02 0.16 0.11 1.04 0.04 0.09 1.87 0.13 2.09 0.13 0.10 0.97 0.17 0.08 0.08 0.04 0.12 0.05 0.08 0.07 0.08 0.05 0.07 0.06 0.07 0.03 0.05 0.04 0.09 0.04 0.07 0.04 0.07 0.06 0.03 0.06 0.06 0.06 0.06 0.07 0.09 0.04 0.05 0.08 0.05 0.04 0.09 0.06 0.03 0.02 0.08 0.04 0.06 0.05 0.08 0.03 0.08 0.05 0.05 0.05 0.10 0.05 0.05 0.07 0.06 0.04 0.06 0.05 0.03 0.04 0.05 0.06 0.04 0.04 0.07 0.04 0.04 0.05 0.05 0.04 0.07 0.06 0.05 0.03 0.08 0.05 0.06 0.04 0.06 0.05 0.04 0.04 0.04 0.05 0.06 0.04 0.05 0.04 0.05 0.05 0.06 0.05 0.06 0.04 0.06 0.07 0.06 0.05 0.05 0.05 0.06 0.06 0.04 0.05 0.06 0.03 0.06 0.04 0.06 0.05 0.03 0.06 0.06 0.05 0.06 0.04 0.03 0.06 0.06 0.06 0.03 0.04 0.05 0.05 0.07 0.04 0.05 0.06 0.07 0.07 0.05 0.07 0.06 0.05 0.06 0.05 0.07 0.06 0.05 0.06 0.07 0.05 0.06 0.04 0.06 0.05 0.05 0.06 0.04 0.06 0.04 0.03 0.06 0.05 0.05 0.04 0.05 0.05 0.04 0.04 0.05 0.06 0.06 0.04 0.04 0.05 0.06 0.04 0.04 0.04 0.05 0.05 0.04 0.05 0.05 0.03 0.06 0.06 0.06 0.04 0.07 0.05 0.05 0.04 0.06 0.06 0.05 0.05 0.07 0.04 0.06 0.06 0.06 0.04 0.06 0.03 0.06 0.04 0.06 0.04 0.09 0.05 0.05 0.05 0.07 0.06 0.05 0.05 0.06 0.05 0.05 0.05 0.04 0.04 0.06 0.05 0.05 0.05 0.05 0.04 0.05 0.05 0.06 0.04 0.05 0.05 0.05 0.05 0.05 0.04 0.06 0.04 0.05 0.05 0.04 0.05 0.05 0.05 0.04" ) self.assertEqual( flow1_trimmed.Bases, "TCTTGGCACCCACTAAACGCCAATCTTGCTGGAGTGTTTACCAGGCACCCAGCAATGTGAATAGTCActgagcgggctggcaaggc" ) #test that trimming does not leave 4 zero flows (signal <1.5) flow1_trimmed = flow1.getPrimerTrimmedFlowgram(primerseq="TCAG" + "GCTAACTGTAACCCTC") self.assertEqual( str(flow1_trimmed), "1.94 0.12 0.13 1.92 0.21 0.07 0.94 0.17 0.03 0.97 2.76 0.15 0.05 1.02 1.14 0.10 0.98 2.54 1.13 0.96 0.15 0.21 1.90 0.16 0.07 1.78 0.22 0.07 0.93 0.22 0.97 0.08 2.02 0.15 0.19 1.02 0.19 0.09 1.02 0.17 0.99 0.09 0.18 1.84 0.16 0.91 0.10 1.10 1.00 0.20 0.09 1.11 3.01 1.07 1.98 0.14 0.22 1.09 0.17 1.99 0.15 0.20 0.92 0.17 0.07 1.01 2.96 0.15 0.07 1.06 0.20 1.00 0.10 0.12 1.00 0.15 0.08 1.90 0.19 0.10 0.99 0.18 0.09 0.99 1.08 0.15 0.07 1.06 0.14 1.84 0.13 0.11 0.95 1.05 0.13 1.04 1.10 0.18 0.94 0.14 0.10 0.97 1.08 0.12 1.08 0.18 0.08 1.00 0.13 0.98 0.15 0.87 0.13 0.19 1.01 3.06 0.17 0.11 1.04 0.09 1.03 0.10 0.11 2.02 0.16 0.11 1.04 0.04 0.09 1.87 0.13 2.09 0.13 0.10 0.97 0.17 0.08 0.08 0.04 0.12 0.05 0.08 0.07 0.08 0.05 0.07 0.06 0.07 0.03 0.05 0.04 0.09 0.04 0.07 0.04 0.07 0.06 0.03 0.06 0.06 0.06 0.06 0.07 0.09 0.04 0.05 0.08 0.05 0.04 0.09 0.06 0.03 0.02 0.08 0.04 0.06 0.05 0.08 0.03 0.08 0.05 0.05 0.05 0.10 0.05 0.05 0.07 0.06 0.04 0.06 0.05 0.03 0.04 0.05 0.06 0.04 0.04 0.07 0.04 0.04 0.05 0.05 0.04 0.07 0.06 0.05 0.03 0.08 0.05 0.06 0.04 0.06 0.05 0.04 0.04 0.04 0.05 0.06 0.04 0.05 0.04 0.05 0.05 0.06 0.05 0.06 0.04 0.06 0.07 0.06 0.05 0.05 0.05 0.06 0.06 0.04 0.05 0.06 0.03 0.06 0.04 0.06 0.05 0.03 0.06 0.06 0.05 0.06 0.04 0.03 0.06 0.06 0.06 0.03 0.04 0.05 0.05 0.07 0.04 0.05 0.06 0.07 0.07 0.05 0.07 0.06 0.05 0.06 0.05 0.07 0.06 0.05 0.06 0.07 0.05 0.06 0.04 0.06 0.05 0.05 0.06 0.04 0.06 0.04 0.03 0.06 0.05 0.05 0.04 0.05 0.05 0.04 0.04 0.05 0.06 0.06 0.04 0.04 0.05 0.06 0.04 0.04 0.04 0.05 0.05 0.04 0.05 0.05 0.03 0.06 0.06 0.06 0.04 0.07 0.05 0.05 0.04 0.06 0.06 0.05 0.05 0.07 0.04 0.06 0.06 0.06 0.04 0.06 0.03 0.06 0.04 0.06 0.04 0.09 0.05 0.05 0.05 0.07 0.06 0.05 0.05 0.06 0.05 0.05 0.05 0.04 0.04 0.06 0.05 0.05 0.05 0.05 0.04 0.05 0.05 0.06 0.04 0.05 0.05 0.05 0.05 0.05 0.04 0.06 0.04 0.05 0.05 0.04 0.05 0.05 0.05 0.04" ) self.assertEqual( flow1_trimmed.Bases, "TTGGCACCCACTAAACGCCAATCTTGCTGGAGTGTTTACCAGGCACCCAGCAATGTGAATAGTCActgagcgggctggcaaggc" ) flow1_untrimmed = flow1.getPrimerTrimmedFlowgram("") self.assertEqual( str(flow1_untrimmed), "1.06 0.08 1.04 0.08 0.05 0.94 0.10 2.01 0.10 0.07 0.96 0.09 1.04 1.96 1.07 0.10 1.01 0.13 0.08 1.01 1.06 1.83 2.89 0.18 0.96 0.13 0.99 0.11 1.94 0.12 0.13 1.92 0.21 0.07 0.94 0.17 0.03 0.97 2.76 0.15 0.05 1.02 1.14 0.10 0.98 2.54 1.13 0.96 0.15 0.21 1.90 0.16 0.07 1.78 0.22 0.07 0.93 0.22 0.97 0.08 2.02 0.15 0.19 1.02 0.19 0.09 1.02 0.17 0.99 0.09 0.18 1.84 0.16 0.91 0.10 1.10 1.00 0.20 0.09 1.11 3.01 1.07 1.98 0.14 0.22 1.09 0.17 1.99 0.15 0.20 0.92 0.17 0.07 1.01 2.96 0.15 0.07 1.06 0.20 1.00 0.10 0.12 1.00 0.15 0.08 1.90 0.19 0.10 0.99 0.18 0.09 0.99 1.08 0.15 0.07 1.06 0.14 1.84 0.13 0.11 0.95 1.05 0.13 1.04 1.10 0.18 0.94 0.14 0.10 0.97 1.08 0.12 1.08 0.18 0.08 1.00 0.13 0.98 0.15 0.87 0.13 0.19 1.01 3.06 0.17 0.11 1.04 0.09 1.03 0.10 0.11 2.02 0.16 0.11 1.04 0.04 0.09 1.87 0.13 2.09 0.13 0.10 0.97 0.17 0.08 0.08 0.04 0.12 0.05 0.08 0.07 0.08 0.05 0.07 0.06 0.07 0.03 0.05 0.04 0.09 0.04 0.07 0.04 0.07 0.06 0.03 0.06 0.06 0.06 0.06 0.07 0.09 0.04 0.05 0.08 0.05 0.04 0.09 0.06 0.03 0.02 0.08 0.04 0.06 0.05 0.08 0.03 0.08 0.05 0.05 0.05 0.10 0.05 0.05 0.07 0.06 0.04 0.06 0.05 0.03 0.04 0.05 0.06 0.04 0.04 0.07 0.04 0.04 0.05 0.05 0.04 0.07 0.06 0.05 0.03 0.08 0.05 0.06 0.04 0.06 0.05 0.04 0.04 0.04 0.05 0.06 0.04 0.05 0.04 0.05 0.05 0.06 0.05 0.06 0.04 0.06 0.07 0.06 0.05 0.05 0.05 0.06 0.06 0.04 0.05 0.06 0.03 0.06 0.04 0.06 0.05 0.03 0.06 0.06 0.05 0.06 0.04 0.03 0.06 0.06 0.06 0.03 0.04 0.05 0.05 0.07 0.04 0.05 0.06 0.07 0.07 0.05 0.07 0.06 0.05 0.06 0.05 0.07 0.06 0.05 0.06 0.07 0.05 0.06 0.04 0.06 0.05 0.05 0.06 0.04 0.06 0.04 0.03 0.06 0.05 0.05 0.04 0.05 0.05 0.04 0.04 0.05 0.06 0.06 0.04 0.04 0.05 0.06 0.04 0.04 0.04 0.05 0.05 0.04 0.05 0.05 0.03 0.06 0.06 0.06 0.04 0.07 0.05 0.05 0.04 0.06 0.06 0.05 0.05 0.07 0.04 0.06 0.06 0.06 0.04 0.06 0.03 0.06 0.04 0.06 0.04 0.09 0.05 0.05 0.05 0.07 0.06 0.05 0.05 0.06 0.05 0.05 0.05 0.04 0.04 0.06 0.05 0.05 0.05 0.05 0.04 0.05 0.05 0.06 0.04 0.05 0.05 0.05 0.05 0.05 0.04 0.06 0.04 0.05 0.05 0.04 0.05 0.05 0.05 0.04" ) self.assertEqual( flow1_untrimmed.Bases, "tcagGCTAACTGTAACCCTCTTGGCACCCACTAAACGCCAATCTTGCTGGAGTGTTTACCAGGCACCCAGCAATGTGAATAGTCActgagcgggctggcaaggc" ) flow2_trimmed = flow2.getPrimerTrimmedFlowgram(primerseq="TCAG" + "AGACGCACT") self.assertEqual( str(flow2_trimmed), "0.00\t0.05\t0.90 0.11 0.07 1.99 0.11 0.02 1.96 1.04 0.13 0.01 2.83 0.10 1.97 0.06 0.11 1.04 0.13 0.03 0.98 1.15 0.07 1.00 0.07 0.08 0.98 0.11 1.92 0.05 0.04 2.96 1.02 1.02 0.04 0.93 1.00 0.13 0.04 1.00 1.03 0.08 0.97 0.13 0.11 1.88 0.09 0.05 1.02 1.89 0.07 0.11 0.98 0.05 0.07 1.01 0.08 0.05 1.01 0.13 1.00 0.07 0.10 1.04 0.10 0.04 0.98 0.12 1.03 0.96 0.11 0.07 1.00 0.09 0.03 1.03 0.11 1.95 1.06 0.13 0.05 1.00 0.13 0.11 1.00 0.09 0.03 2.89 0.08 0.95 0.09 1.03 1.02 1.05 1.07 0.08 0.12 2.81 0.08 0.08 1.00 1.07 0.07 0.05 1.86 0.12 0.98 0.06 2.00 0.11 1.02 0.11 0.08 1.88 0.13 1.03 0.13 0.98 0.15 0.11 1.03 1.03 1.04 0.18 0.98 0.13 0.15 1.04 0.11 1.01 0.13 0.06 1.01 0.06 1.02 0.08 0.99 0.14 0.99 0.09 0.05 1.09 0.04 0.07 2.96 0.09 2.03 0.13 2.96 1.13 0.08 1.03 0.07 0.99 0.11 0.05 1.05 1.04 0.09 0.07 1.00 1.03 0.09 0.06 1.06 1.04 2.94 0.18 0.06 0.93 0.10 1.10 0.11 2.02 0.17 1.00 1.03 0.06 0.11 0.96 0.04 3.00 0.11 0.07 1.99 0.10 2.03 0.12 0.97 0.16 0.01 2.09 0.14 1.04 0.16 0.06 1.03 0.14 1.12 0.12 0.05 0.96 1.01 0.10 0.14 0.94 0.03 0.12 1.10 0.92 0.09 1.10 1.04 1.02 0.12 0.97 2.00 0.15 1.08 0.04 1.03 1.04 0.03 0.09 5.16 1.02 0.09 0.13 2.66 0.09 0.05 1.06 0.07 0.89 0.05 0.12 1.10 0.16 0.06 1.01 0.13 1.00 0.14 0.98 0.09 2.92 1.28 0.03 2.95 0.98 0.16 0.08 0.95 0.96 1.09 0.08 1.07 1.01 0.16 0.06 4.52 0.12 1.03 0.07 0.09 1.03 0.14 0.03 1.01 1.99 1.05 0.14 1.03 0.13 0.03 1.10 0.10 0.96 0.11 0.99 0.12 0.05 0.94 2.83 0.14 0.12 0.96 0.00 1.00 0.11 0.14 1.98 0.08 0.11 1.04 0.01 0.11 2.03 0.15 2.05 0.10 0.03 0.93 0.01 0.08 0.12 0.00 0.16 0.05 0.07 0.08 0.11 0.07 0.05 0.04 0.10 0.05 0.05 0.03 0.07 0.03 0.04 0.04 0.06 0.03 0.05 0.04 0.09 0.03 0.08 0.03 0.07 0.02 0.05 0.02 0.06 0.01 0.05 0.04 0.06 0.02 0.04 0.04 0.04 0.03 0.03 0.06 0.06 0.03 0.02 0.02 0.08 0.03 0.01 0.01 0.06 0.03 0.01 0.03 0.04 0.02 0.00 0.02 0.05 0.00 0.02 0.02 0.03 0.00 0.02 0.02 0.04 0.01 0.00 0.01 0.05" ) self.assertEqual( flow2_trimmed.Bases, "CAATTATTTCCATAGCTTGGGTAGTGTCAATAATGCTGCTATGAACATGGGAGTACAAATATTCTTCAAGATACTGATCTCATTTCCTTTAGATATATACCCAGAAGTGAAATTCCTGGATCACATAGTAGTTCTATTTTTATTTGATGAGAAACTTTATACTATTTTTCATAActgagcgggctggcaaggc" ) #trimming at the end of the flow cycle works flow3_trimmed = flow3.getPrimerTrimmedFlowgram(primerseq="TCAG" + "ATTAGATACCCNGGTAGG") self.assertEqual( str(flow3_trimmed), "0.05 0.05 2.04 0.10 0.03 1.06 1.05 1.01 0.07 0.09 2.07 1.01 0.93 2.88 1.06 1.95 1.00 0.05 0.05 2.97 0.09 0.00 0.93 1.01 0.06 0.05 0.99 0.09 0.98 1.01 0.03 1.02 1.92 0.07 0.01 1.03 1.01 0.01 0.05 0.96 0.09 0.05 0.98 1.07 0.02 2.02 2.05 0.09 1.87 0.12 2.15 0.05 0.13 0.92 1.05 1.96 3.01 0.13 0.04 1.05 0.96 0.05 0.05 0.95 0.12 0.01 1.00 2.02 0.03 0.03 0.99 1.01 0.05 0.06 0.98 0.13 0.06 0.97 0.11 1.01 0.08 0.12 1.02 0.12 1.02 2.19 1.03 1.01 0.08 0.11 0.96 0.09 0.08 1.01 0.08 0.06 2.10 2.11 0.12 1.04 0.13 0.09 0.94 1.03 0.08 0.05 3.06 0.12 1.00 0.03 0.09 0.95 0.10 0.03 2.09 0.21 0.99 0.06 0.11 4.06 0.10 1.04 0.04 1.05 1.05 1.04 1.02 0.97 0.13 0.93 0.10 0.12 1.08 0.12 0.99 1.06 0.10 0.11 0.98 0.10 0.02 2.01 0.10 1.01 0.09 0.96 0.07 0.11 2.03 4.12 1.05 0.08 1.01 0.04 0.98 0.14 0.12 2.96 0.13 1.98 0.12 2.08 0.10 0.12 1.99 0.13 0.07 0.98 0.03 0.93 0.86 4.10 0.13 0.10 3.99 1.13 0.07 0.06 1.07 0.09 0.05 1.03 1.12 0.13 0.05 2.01 0.08 0.80 0.05 0.11 0.98 0.13 0.04 1.01 0.07 1.02 0.07 0.11 1.07 2.19 0.06 0.97 0.11 1.03 0.05 0.11 1.05 0.14 0.06 1.03 0.13 0.10 0.97 0.16 0.13 1.00 0.13 0.06 1.02 2.15 0.02 0.16 0.95 0.09 2.06 2.12 0.07 0.07 2.08 0.12 0.97 1.00 0.03 0.99 1.02 1.01 0.03 0.15 0.90 0.07 0.01 2.00 1.01 1.00 0.06 0.11 1.08 1.00 0.03 1.99 0.03 1.00 0.02 1.85 1.93 0.14 1.97 0.91 1.83 0.06 0.04 1.97 0.05 2.08 0.04 0.06 1.05 0.05 2.13 0.16 0.09 1.17 0.01 1.01 1.07 0.09 0.14 0.91 0.06 0.08 1.03 1.04 0.08 0.05 1.05 1.03 1.16 0.06 0.05 1.01 0.06 2.15 0.06 1.99 0.13 0.04 1.08 0.97 0.11 0.07 1.05 0.08 0.07 2.13 0.14 0.09 1.10 0.15 0.00 1.02 0.07 1.05 0.05 0.95 0.09 1.00 0.15 0.95 0.08 0.15 1.11 0.07 0.12 1.05 1.06 0.09 1.03 0.07 0.11 1.01 0.05 0.05 1.05 0.98 0.00 0.93 0.08 0.12 1.85 1.11 0.10 0.07 1.00 0.01 0.10 1.87 0.05 2.14 1.10 0.03 1.06 0.10 0.91 0.10 0.06 1.05 1.02 1.02 0.07 0.06 0.98 0.95 1.09 0.06 0.14 0.97 0.04 2.44" ) self.assertEqual( flow3_trimmed.Bases, "CCACGCCGTAAACGGTGGGCGCTAGTTGTGCGAACCTTCCACGGTTTGTGCGGCGCAGCTAACGCATTAAGCGCCCTGCCTGGGGAGTACGATCGCAAGATTAAAACTCAAAGGAATTGACGGGGCCCCGCACAAGCAGCGGAGCATGCGGCTTAATTCGACGCAACGCGAAGAACCTTACCAAGGCTTGACATATACAGGAATATGGCAGAGATGTCATAGCCGCAAGGTCTGTATACAGG" ) flow3_trimmed = flow3.getPrimerTrimmedFlowgram(primerseq="TCAG" + "ATTAGATACCCNGGTAG") self.assertEqual( str(flow3_trimmed), "0.00\t0.00\t0.00 1.10 0.05 0.05 2.04 0.10 0.03 1.06 1.05 1.01 0.07 0.09 2.07 1.01 0.93 2.88 1.06 1.95 1.00 0.05 0.05 2.97 0.09 0.00 0.93 1.01 0.06 0.05 0.99 0.09 0.98 1.01 0.03 1.02 1.92 0.07 0.01 1.03 1.01 0.01 0.05 0.96 0.09 0.05 0.98 1.07 0.02 2.02 2.05 0.09 1.87 0.12 2.15 0.05 0.13 0.92 1.05 1.96 3.01 0.13 0.04 1.05 0.96 0.05 0.05 0.95 0.12 0.01 1.00 2.02 0.03 0.03 0.99 1.01 0.05 0.06 0.98 0.13 0.06 0.97 0.11 1.01 0.08 0.12 1.02 0.12 1.02 2.19 1.03 1.01 0.08 0.11 0.96 0.09 0.08 1.01 0.08 0.06 2.10 2.11 0.12 1.04 0.13 0.09 0.94 1.03 0.08 0.05 3.06 0.12 1.00 0.03 0.09 0.95 0.10 0.03 2.09 0.21 0.99 0.06 0.11 4.06 0.10 1.04 0.04 1.05 1.05 1.04 1.02 0.97 0.13 0.93 0.10 0.12 1.08 0.12 0.99 1.06 0.10 0.11 0.98 0.10 0.02 2.01 0.10 1.01 0.09 0.96 0.07 0.11 2.03 4.12 1.05 0.08 1.01 0.04 0.98 0.14 0.12 2.96 0.13 1.98 0.12 2.08 0.10 0.12 1.99 0.13 0.07 0.98 0.03 0.93 0.86 4.10 0.13 0.10 3.99 1.13 0.07 0.06 1.07 0.09 0.05 1.03 1.12 0.13 0.05 2.01 0.08 0.80 0.05 0.11 0.98 0.13 0.04 1.01 0.07 1.02 0.07 0.11 1.07 2.19 0.06 0.97 0.11 1.03 0.05 0.11 1.05 0.14 0.06 1.03 0.13 0.10 0.97 0.16 0.13 1.00 0.13 0.06 1.02 2.15 0.02 0.16 0.95 0.09 2.06 2.12 0.07 0.07 2.08 0.12 0.97 1.00 0.03 0.99 1.02 1.01 0.03 0.15 0.90 0.07 0.01 2.00 1.01 1.00 0.06 0.11 1.08 1.00 0.03 1.99 0.03 1.00 0.02 1.85 1.93 0.14 1.97 0.91 1.83 0.06 0.04 1.97 0.05 2.08 0.04 0.06 1.05 0.05 2.13 0.16 0.09 1.17 0.01 1.01 1.07 0.09 0.14 0.91 0.06 0.08 1.03 1.04 0.08 0.05 1.05 1.03 1.16 0.06 0.05 1.01 0.06 2.15 0.06 1.99 0.13 0.04 1.08 0.97 0.11 0.07 1.05 0.08 0.07 2.13 0.14 0.09 1.10 0.15 0.00 1.02 0.07 1.05 0.05 0.95 0.09 1.00 0.15 0.95 0.08 0.15 1.11 0.07 0.12 1.05 1.06 0.09 1.03 0.07 0.11 1.01 0.05 0.05 1.05 0.98 0.00 0.93 0.08 0.12 1.85 1.11 0.10 0.07 1.00 0.01 0.10 1.87 0.05 2.14 1.10 0.03 1.06 0.10 0.91 0.10 0.06 1.05 1.02 1.02 0.07 0.06 0.98 0.95 1.09 0.06 0.14 0.97 0.04 2.44" ) self.assertEqual( flow3_trimmed.Bases, "GCCACGCCGTAAACGGTGGGCGCTAGTTGTGCGAACCTTCCACGGTTTGTGCGGCGCAGCTAACGCATTAAGCGCCCTGCCTGGGGAGTACGATCGCAAGATTAAAACTCAAAGGAATTGACGGGGCCCCGCACAAGCAGCGGAGCATGCGGCTTAATTCGACGCAACGCGAAGAACCTTACCAAGGCTTGACATATACAGGAATATGGCAGAGATGTCATAGCCGCAAGGTCTGTATACAGG" )
def setUp(self): """Define some standard data""" self.rec = """Common Header: Magic Number: 0x2E736666 Version: 0001 Index Offset: 96099976 Index Length: 1158685 # of Reads: 57902 Header Length: 440 Key Length: 4 # of Flows: 400 Flowgram Code: 1 Flow Chars: TACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACG Key Sequence: TCAG >FIQU8OX05GCVRO Run Prefix: R_2008_10_15_16_11_02_ Region #: 5 XY Location: 2489_3906 Run Name: R_2008_10_15_16_11_02_FLX04070166_adminrig_1548jinnescurtisstanford Analysis Name: /data/2008_10_15/R_2008_10_15_16_11_02_FLX04070166_adminrig_1548jinnescurtisstanford/D_2008_10_15_15_12_26_FLX04070166_1548jinnescurtisstanford_FullAnalysis Full Path: /data/2008_10_15/R_2008_10_15_16_11_02_FLX04070166_adminrig_1548jinnescurtisstanford/D_2008_10_15_15_12_26_FLX04070166_1548jinnescurtisstanford_FullAnalysis Read Header Len: 32 Name Length: 14 # of Bases: 104 Clip Qual Left: 5 Clip Qual Right: 85 Clip Adap Left: 0 Clip Adap Right: 0 Flowgram: 1.06 0.08 1.04 0.08 0.05 0.94 0.10 2.01 0.10 0.07 0.96 0.09 1.04 1.96 1.07 0.10 1.01 0.13 0.08 1.01 1.06 1.83 2.89 0.18 0.96 0.13 0.99 0.11 1.94 0.12 0.13 1.92 0.21 0.07 0.94 0.17 0.03 0.97 2.76 0.15 0.05 1.02 1.14 0.10 0.98 2.54 1.13 0.96 0.15 0.21 1.90 0.16 0.07 1.78 0.22 0.07 0.93 0.22 0.97 0.08 2.02 0.15 0.19 1.02 0.19 0.09 1.02 0.17 0.99 0.09 0.18 1.84 0.16 0.91 0.10 1.10 1.00 0.20 0.09 1.11 3.01 1.07 1.98 0.14 0.22 1.09 0.17 1.99 0.15 0.20 0.92 0.17 0.07 1.01 2.96 0.15 0.07 1.06 0.20 1.00 0.10 0.12 1.00 0.15 0.08 1.90 0.19 0.10 0.99 0.18 0.09 0.99 1.08 0.15 0.07 1.06 0.14 1.84 0.13 0.11 0.95 1.05 0.13 1.04 1.10 0.18 0.94 0.14 0.10 0.97 1.08 0.12 1.08 0.18 0.08 1.00 0.13 0.98 0.15 0.87 0.13 0.19 1.01 3.06 0.17 0.11 1.04 0.09 1.03 0.10 0.11 2.02 0.16 0.11 1.04 0.04 0.09 1.87 0.13 2.09 0.13 0.10 0.97 0.17 0.08 0.08 0.04 0.12 0.05 0.08 0.07 0.08 0.05 0.07 0.06 0.07 0.03 0.05 0.04 0.09 0.04 0.07 0.04 0.07 0.06 0.03 0.06 0.06 0.06 0.06 0.07 0.09 0.04 0.05 0.08 0.05 0.04 0.09 0.06 0.03 0.02 0.08 0.04 0.06 0.05 0.08 0.03 0.08 0.05 0.05 0.05 0.10 0.05 0.05 0.07 0.06 0.04 0.06 0.05 0.03 0.04 0.05 0.06 0.04 0.04 0.07 0.04 0.04 0.05 0.05 0.04 0.07 0.06 0.05 0.03 0.08 0.05 0.06 0.04 0.06 0.05 0.04 0.04 0.04 0.05 0.06 0.04 0.05 0.04 0.05 0.05 0.06 0.05 0.06 0.04 0.06 0.07 0.06 0.05 0.05 0.05 0.06 0.06 0.04 0.05 0.06 0.03 0.06 0.04 0.06 0.05 0.03 0.06 0.06 0.05 0.06 0.04 0.03 0.06 0.06 0.06 0.03 0.04 0.05 0.05 0.07 0.04 0.05 0.06 0.07 0.07 0.05 0.07 0.06 0.05 0.06 0.05 0.07 0.06 0.05 0.06 0.07 0.05 0.06 0.04 0.06 0.05 0.05 0.06 0.04 0.06 0.04 0.03 0.06 0.05 0.05 0.04 0.05 0.05 0.04 0.04 0.05 0.06 0.06 0.04 0.04 0.05 0.06 0.04 0.04 0.04 0.05 0.05 0.04 0.05 0.05 0.03 0.06 0.06 0.06 0.04 0.07 0.05 0.05 0.04 0.06 0.06 0.05 0.05 0.07 0.04 0.06 0.06 0.06 0.04 0.06 0.03 0.06 0.04 0.06 0.04 0.09 0.05 0.05 0.05 0.07 0.06 0.05 0.05 0.06 0.05 0.05 0.05 0.04 0.04 0.06 0.05 0.05 0.05 0.05 0.04 0.05 0.05 0.06 0.04 0.05 0.05 0.05 0.05 0.05 0.04 0.06 0.04 0.05 0.05 0.04 0.05 0.05 0.05 0.04 Flow Indexes: 1 3 6 8 8 11 13 14 14 15 17 20 21 22 22 23 23 23 25 27 29 29 32 32 35 38 39 39 39 42 43 45 46 46 46 47 48 51 51 54 54 57 59 61 61 64 67 69 72 72 74 76 77 80 81 81 81 82 83 83 86 88 88 91 94 95 95 95 98 100 103 106 106 109 112 113 116 118 118 121 122 124 125 127 130 131 133 136 138 140 143 144 144 144 147 149 152 152 155 158 158 160 160 163 Bases: tcagGCTAACTGTAACCCTCTTGGCACCCACTAAACGCCAATCTTGCTGGAGTGTTTACCAGGCACCCAGCAATGTGAATAGTCActgagcgggctggcaaggc Quality Scores: 37 37 37 37 37 37 37 37 37 37 37 37 37 40 40 40 40 37 37 37 37 37 39 39 39 39 24 24 24 37 34 28 24 24 24 28 34 39 39 39 39 39 39 39 39 39 39 39 39 40 40 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 >FIQU8OX05F8ILF Run Prefix: R_2008_10_15_16_11_02_ Region #: 5 XY Location: 2440_0913 Run Name: R_2008_10_15_16_11_02_FLX04070166_adminrig_1548jinnescurtisstanford Analysis Name: /data/2008_10_15/R_2008_10_15_16_11_02_FLX04070166_adminrig_1548jinnescurtisstanford/D_2008_10_15_15_12_26_FLX04070166_1548jinnescurtisstanford_FullAnalysis Full Path: /data/2008_10_15/R_2008_10_15_16_11_02_FLX04070166_adminrig_1548jinnescurtisstanford/D_2008_10_15_15_12_26_FLX04070166_1548jinnescurtisstanford_FullAnalysis Read Header Len: 32 Name Length: 14 # of Bases: 206 Clip Qual Left: 5 Clip Qual Right: 187 Clip Adap Left: 0 Clip Adap Right: 0 Flowgram: 1.04 0.00 1.01 0.00 0.00 1.00 0.00 1.00 0.00 1.05 0.00 0.91 0.10 1.07 0.95 1.01 0.00 0.06 0.93 0.02 0.03 1.06 1.18 0.09 1.00 0.05 0.90 0.11 0.07 1.99 0.11 0.02 1.96 1.04 0.13 0.01 2.83 0.10 1.97 0.06 0.11 1.04 0.13 0.03 0.98 1.15 0.07 1.00 0.07 0.08 0.98 0.11 1.92 0.05 0.04 2.96 1.02 1.02 0.04 0.93 1.00 0.13 0.04 1.00 1.03 0.08 0.97 0.13 0.11 1.88 0.09 0.05 1.02 1.89 0.07 0.11 0.98 0.05 0.07 1.01 0.08 0.05 1.01 0.13 1.00 0.07 0.10 1.04 0.10 0.04 0.98 0.12 1.03 0.96 0.11 0.07 1.00 0.09 0.03 1.03 0.11 1.95 1.06 0.13 0.05 1.00 0.13 0.11 1.00 0.09 0.03 2.89 0.08 0.95 0.09 1.03 1.02 1.05 1.07 0.08 0.12 2.81 0.08 0.08 1.00 1.07 0.07 0.05 1.86 0.12 0.98 0.06 2.00 0.11 1.02 0.11 0.08 1.88 0.13 1.03 0.13 0.98 0.15 0.11 1.03 1.03 1.04 0.18 0.98 0.13 0.15 1.04 0.11 1.01 0.13 0.06 1.01 0.06 1.02 0.08 0.99 0.14 0.99 0.09 0.05 1.09 0.04 0.07 2.96 0.09 2.03 0.13 2.96 1.13 0.08 1.03 0.07 0.99 0.11 0.05 1.05 1.04 0.09 0.07 1.00 1.03 0.09 0.06 1.06 1.04 2.94 0.18 0.06 0.93 0.10 1.10 0.11 2.02 0.17 1.00 1.03 0.06 0.11 0.96 0.04 3.00 0.11 0.07 1.99 0.10 2.03 0.12 0.97 0.16 0.01 2.09 0.14 1.04 0.16 0.06 1.03 0.14 1.12 0.12 0.05 0.96 1.01 0.10 0.14 0.94 0.03 0.12 1.10 0.92 0.09 1.10 1.04 1.02 0.12 0.97 2.00 0.15 1.08 0.04 1.03 1.04 0.03 0.09 5.16 1.02 0.09 0.13 2.66 0.09 0.05 1.06 0.07 0.89 0.05 0.12 1.10 0.16 0.06 1.01 0.13 1.00 0.14 0.98 0.09 2.92 1.28 0.03 2.95 0.98 0.16 0.08 0.95 0.96 1.09 0.08 1.07 1.01 0.16 0.06 4.52 0.12 1.03 0.07 0.09 1.03 0.14 0.03 1.01 1.99 1.05 0.14 1.03 0.13 0.03 1.10 0.10 0.96 0.11 0.99 0.12 0.05 0.94 2.83 0.14 0.12 0.96 0.00 1.00 0.11 0.14 1.98 0.08 0.11 1.04 0.01 0.11 2.03 0.15 2.05 0.10 0.03 0.93 0.01 0.08 0.12 0.00 0.16 0.05 0.07 0.08 0.11 0.07 0.05 0.04 0.10 0.05 0.05 0.03 0.07 0.03 0.04 0.04 0.06 0.03 0.05 0.04 0.09 0.03 0.08 0.03 0.07 0.02 0.05 0.02 0.06 0.01 0.05 0.04 0.06 0.02 0.04 0.04 0.04 0.03 0.03 0.06 0.06 0.03 0.02 0.02 0.08 0.03 0.01 0.01 0.06 0.03 0.01 0.03 0.04 0.02 0.00 0.02 0.05 0.00 0.02 0.02 0.03 0.00 0.02 0.02 0.04 0.01 0.00 0.01 0.05 Flow Indexes: 1 3 6 8 10 12 14 15 16 19 22 23 25 27 30 30 33 33 34 37 37 37 39 39 42 45 46 48 51 53 53 56 56 56 57 58 60 61 64 65 67 70 70 73 74 74 77 80 83 85 88 91 93 94 97 100 102 102 103 106 109 112 112 112 114 116 117 118 119 122 122 122 125 126 129 129 131 133 133 135 138 138 140 142 145 146 147 149 152 154 157 159 161 163 166 169 169 169 171 171 173 173 173 174 176 178 181 182 185 186 189 190 191 191 191 194 196 198 198 200 201 204 206 206 206 209 209 211 211 213 216 216 218 221 223 226 227 230 233 234 236 237 238 240 241 241 243 245 246 249 249 249 249 249 250 253 253 253 256 258 261 264 266 268 270 270 270 271 273 273 273 274 277 278 279 281 282 285 285 285 285 285 287 290 293 294 294 295 297 300 302 304 307 308 308 308 311 313 316 316 319 322 322 324 324 327 Bases: tcagAGACGCACTCAATTATTTCCATAGCTTGGGTAGTGTCAATAATGCTGCTATGAACATGGGAGTACAAATATTCTTCAAGATACTGATCTCATTTCCTTTAGATATATACCCAGAAGTGAAATTCCTGGATCACATAGTAGTTCTATTTTTATTTGATGAGAAACTTTATACTATTTTTCATAActgagcgggctggcaaggc Quality Scores: 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 38 38 38 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 34 34 34 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 36 36 36 36 36 38 25 25 25 38 37 37 37 37 37 37 33 33 34 37 37 37 37 37 37 37 38 34 20 20 26 26 20 34 38 37 37 37 37 37 37 37 37 37 38 38 38 37 37 37 37 37 37 37 37 37 37 """.split('\n') self.flow = """1.06 0.08 1.04 0.08 0.05 0.94 0.10 2.01 0.10 0.07 0.96 0.09 1.04 1.96 1.07 0.10 1.01 0.13 0.08 1.01 1.06 1.83 2.89 0.18 0.96 0.13 0.99 0.11 1.94 0.12 0.13 1.92 0.21 0.07 0.94 0.17 0.03 0.97 2.76 0.15 0.05 1.02 1.14 0.10 0.98 2.54 1.13 0.96 0.15 0.21 1.90 0.16 0.07 1.78 0.22 0.07 0.93 0.22 0.97 0.08 2.02 0.15 0.19 1.02 0.19 0.09 1.02 0.17 0.99 0.09 0.18 1.84 0.16 0.91 0.10 1.10 1.00 0.20 0.09 1.11 3.01 1.07 1.98 0.14 0.22 1.09 0.17 1.99 0.15 0.20 0.92 0.17 0.07 1.01 2.96 0.15 0.07 1.06 0.20 1.00 0.10 0.12 1.00 0.15 0.08 1.90 0.19 0.10 0.99 0.18 0.09 0.99 1.08 0.15 0.07 1.06 0.14 1.84 0.13 0.11 0.95 1.05 0.13 1.04 1.10 0.18 0.94 0.14 0.10 0.97 1.08 0.12 1.08 0.18 0.08 1.00 0.13 0.98 0.15 0.87 0.13 0.19 1.01 3.06 0.17 0.11 1.04 0.09 1.03 0.10 0.11 2.02 0.16 0.11 1.04 0.04 0.09 1.87 0.13 2.09 0.13 0.10 0.97 0.17 0.08 0.08 0.04 0.12 0.05 0.08 0.07 0.08 0.05 0.07 0.06 0.07 0.03 0.05 0.04 0.09 0.04 0.07 0.04 0.07 0.06 0.03 0.06 0.06 0.06 0.06 0.07 0.09 0.04 0.05 0.08 0.05 0.04 0.09 0.06 0.03 0.02 0.08 0.04 0.06 0.05 0.08 0.03 0.08 0.05 0.05 0.05 0.10 0.05 0.05 0.07 0.06 0.04 0.06 0.05 0.03 0.04 0.05 0.06 0.04 0.04 0.07 0.04 0.04 0.05 0.05 0.04 0.07 0.06 0.05 0.03 0.08 0.05 0.06 0.04 0.06 0.05 0.04 0.04 0.04 0.05 0.06 0.04 0.05 0.04 0.05 0.05 0.06 0.05 0.06 0.04 0.06 0.07 0.06 0.05 0.05 0.05 0.06 0.06 0.04 0.05 0.06 0.03 0.06 0.04 0.06 0.05 0.03 0.06 0.06 0.05 0.06 0.04 0.03 0.06 0.06 0.06 0.03 0.04 0.05 0.05 0.07 0.04 0.05 0.06 0.07 0.07 0.05 0.07 0.06 0.05 0.06 0.05 0.07 0.06 0.05 0.06 0.07 0.05 0.06 0.04 0.06 0.05 0.05 0.06 0.04 0.06 0.04 0.03 0.06 0.05 0.05 0.04 0.05 0.05 0.04 0.04 0.05 0.06 0.06 0.04 0.04 0.05 0.06 0.04 0.04 0.04 0.05 0.05 0.04 0.05 0.05 0.03 0.06 0.06 0.06 0.04 0.07 0.05 0.05 0.04 0.06 0.06 0.05 0.05 0.07 0.04 0.06 0.06 0.06 0.04 0.06 0.03 0.06 0.04 0.06 0.04 0.09 0.05 0.05 0.05 0.07 0.06 0.05 0.05 0.06 0.05 0.05 0.05 0.04 0.04 0.06 0.05 0.05 0.05 0.05 0.04 0.05 0.05 0.06 0.04 0.05 0.05 0.05 0.05 0.05 0.04 0.06 0.04 0.05 0.05 0.04 0.05 0.05 0.05 0.04""" self.unordered = self.Class({'a':'0.0 1.1 3.0 1.0', 'b':'0.5 1.0 4.0 0.0'}) self.ordered1 = self.Class({'a':'0.0 1.1 3.0 1.0',\ 'b':'0.5 1.0 4.0 0.0'}, Names=['a','b']) self.ordered2 = self.Class({'a':'0.0 1.1 3.0 1.0',\ 'b':'0.5 1.0 4.0 0.0'}, Names=['b','a']) self.one_seq = self.Class({'a':'0.0 1.1 3.0 1.0'}) self.ambiguous = self.Class([Flowgram('0.5 1.0 4.0 0.0 1.5 0.0 0.0 2.0', Name='a', header_info = {'Bases':'TACCCCTTGG'}), Flowgram('0.0 0.0 0.0 0.0 2.0 1.0 2.0 2.0', Name = 'b', header_info = {'Bases':'NTTACCGG'}), Flowgram('1.5 1.0 2.0 0.0 1.5 0.0 0.0 2.0', Name='c', header_info = {'Bases':'TTACCTTGG'})], header_info = {'Flow Chars':'TACG'})