This repository has been archived on 2024-07-04. You can view files and clone it, but cannot push or open issues or pull requests.
laydi/scripts/illumina2ftsv/illumina2ftsv

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)