46 lines
904 B
Python
46 lines
904 B
Python
#!/usr/bin/python
|
|
|
|
import getopt
|
|
import sys
|
|
|
|
from laydi import dataset
|
|
|
|
def parse_options():
|
|
s_opts = ""
|
|
l_opts = []
|
|
|
|
options, params = getopt.getopt(sys.argv[1:], s_opts, l_opts)
|
|
|
|
return params
|
|
|
|
def read_illumina_file(fn):
|
|
fd = open(fn)
|
|
line = fd.readline()
|
|
if line != "Illumina Inc. GenomeStudio version 1.7.0":
|
|
raise Exception("File cannot be recognized as Illumina textual data")
|
|
|
|
headers = {}
|
|
line= fd.readline()
|
|
while line.strip() != "":
|
|
key, val = line.split("=", 1)
|
|
headers[key.strip()] = val.strip()
|
|
line = fd.readline()
|
|
|
|
col_headers = fd.readline().split('\t')
|
|
|
|
values = []
|
|
line = fd.readline()
|
|
while line != "":
|
|
values.append[x.strip() for x in line.split('\t')
|
|
|
|
probe_col = col_headers.find("ProbeID")
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
fn = params[0]
|
|
read_illumina_file(fn)
|
|
|
|
|