Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3] on linux2 Type "copyright", "credits" or "license()" for more information. **************************************************************** Personal firewall software may warn about the connection IDLE makes to its subprocess using this computer's internal loopback interface. This connection is not visible on any external interface and no data is sent to or received from the Internet. **************************************************************** IDLE 2.6.5 >>> a = [] >>> i = 1 >>> a.append([]) >>> a [[]] >>> j = 1 >>> a[-1].append(i**j) >>> a [[1]] >>> j += 1 >>> a[-1].append(i**j) >>> a [[1, 1]] >>> a[-1][-1] 1 >>> a[-1][0] 1 >>> i += 1 >>> j = 1 >>> a.append([]) >>> a [[1, 1], []] >>> a[-1].append(i**j) >>> a [[1, 1], [2]] >>> j += 1 >>> a[-1].append(i**j) >>> a [[1, 1], [2, 4]] >>> a[2][1] Traceback (most recent call last): File "", line 1, in a[2][1] IndexError: list index out of range >>> a[1][0] 2 >>> >>> >>> a = float("3.0") >>> a 3.0 >>> b = int(a) >>> b 3 >>> b = str(a) >>> b '3.0' >>> a = float("bacteria") Traceback (most recent call last): File "", line 1, in a = float("bacteria") ValueError: invalid literal for float(): bacteria >>> import parseTdt >>> expression = parseTdt.parseTdt("supp2data.tdt") >>> len(expression) 3 >>> len(expression[0]) 2467 >>> len(expression[1]) 2467 >>> len(expression[2]) 2467 >>> reload(parseTdt) >>> expression = parseTdt.parseTdt("supp2data.tdt") >>> len(expression[0]) 2467 >>> len(expression[0]) 2467 >>> expression[0][:5] ['YBR166C', 'YOR357C', 'YLR292C', 'YGL112C', 'YIL118W'] >>> expression[1][:5] ['TYR1 TYROSINE BIOSYNTHESIS PREPHENATE DEHYDROGENASE (NADP+', 'GRD19 SECRETION GOLGI PROTEIN RETENTION', 'SEC72 SECRETION ER PROTEIN TRANSLOCATION SUBCOMPLEX SUBUNIT', 'TAF60 TRANSCRIPTION TFIID 60 KD SUBUNIT', 'RHO3 CYTOSKELETON GTP-BINDING PROTEIN, RHO FAMILY'] >>> len(expression[0]) 2467 >>> len(expression[0][0]) 7 >>> len(expression[2]) 2467 >>> len(expression[2][0]) 79 >>> count = 0 >>> for i in expression[2][0]: if(count == None): count KeyboardInterrupt >>> for i in expression[2][0]: if(i == None): count += 1 >>> count 1 >>> sum(1 for i in expression[2][0] if (i == None)) 1 >>> ratios = expression[2] >>> ratios[3][21] -0.040000000000000001 >>> (genes, annotations, ratios)= expression >>> genes[3] 'YGL112C' >>> annotations[32] 'DRS2 TRANSPORT CA(2+) TRANSPORTING ATPASE' >>> ratios[4][1] 0.01 >>> ratios[4][1:23] [0.01, -0.81000000000000005, None, -0.29999999999999999, 0.48999999999999999, 0.080000000000000002, 0.19, -0.029999999999999999, -0.32000000000000001, -0.34000000000000002, -0.22, -0.029999999999999999, -0.059999999999999998, 0.059999999999999998, 0.070000000000000007, 0.10000000000000001, 0.029999999999999999, -0.17999999999999999, -0.20000000000000001, -0.12, 0.16, -0.17000000000000001] >>> import tdtClass >>> expression = tdtClass("supp2data") Traceback (most recent call last): File "", line 1, in expression = tdtClass("supp2data") TypeError: 'module' object is not callable >>> expression = tdtClass.TdtRatios("supp2data") Traceback (most recent call last): File "", line 1, in expression = tdtClass.TdtRatios("supp2data") File "/home/karmic/Projects/Courses/BmsMinicourse/examples2/tdtClass.py", line 8, in __siit__ fp = open(filename) IOError: [Errno 2] No such file or directory: 'supp2data' >>> expression = tdtClass.TdtRatios("supp2data.tdt") >>> expression >>> dir(expression) ['__doc__', '__init__', '__module__', 'annotations', 'genes', 'header', 'ratios'] >>> expression.genes[4] 'YIL118W' >>>