Projects/laydi
Projects
/
laydi
Archived
7
0
Fork 0

in write_ftsv: adjusted so it splits specifically on tab, whitespace allowed in annotations

This commit is contained in:
Arnar Flatberg 2007-03-14 10:24:49 +00:00
parent 6cbf6d0689
commit 9cbefb5705
1 changed files with 2 additions and 2 deletions

View File

@ -78,7 +78,7 @@ def read_annotations_file(filename):
## Read the first line, which contains the dimension name and ## Read the first line, which contains the dimension name and
## annotation names. ## annotation names.
line = fd.readline() line = fd.readline()
values = [x.strip() for x in line.split()] values = [x.strip() for x in line.split('\t')]
dimname = values[0] dimname = values[0]
annotation_names = values[1:] annotation_names = values[1:]
annotation_dicts = [{} for x in annotation_names] annotation_dicts = [{} for x in annotation_names]
@ -86,7 +86,7 @@ def read_annotations_file(filename):
## Read the lines containing the annotations. The first value on ## Read the lines containing the annotations. The first value on
## each line is an id along the dimension. ## each line is an id along the dimension.
while line: while line:
values = [x.strip() for x in line.split()] values = [x.strip() for x in line.split('\t')]
for i, x in enumerate(values[1:]): for i, x in enumerate(values[1:]):
annotation_dicts[i][values[0]] = x annotation_dicts[i][values[0]] = x
line = fd.readline() line = fd.readline()