Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in the namedtuple when category names are not valid field names #3

Closed
agbeltran opened this issue Jun 22, 2012 · 1 comment
Closed

Comments

@agbeltran
Copy link
Contributor

There are no restrictions in the category names in ISA-TAB and the parser fails when they are not valid field names for the namedtuple.

rec = isatab.parse("/Users/agbeltran/workspace/datasets/harvard-CD133")
Traceback (most recent call last):
File "", line 1, in
File "bcbio/isatab/parser.py", line 57, in parse
rec = s_parser.parse(rec)
File "bcbio/isatab/parser.py", line 192, in parse
["Raw Data File", "Derived Data File", "Image File"])
File "bcbio/isatab/parser.py", line 228, in _parse_study
node.metadata)
File "bcbio/isatab/parser.py", line 246, in _line_keyvals
self._collapse_attributes)
File "bcbio/isatab/parser.py", line 260, in _line_by_type
val = collapse_quals_fn(line, header, hgroups[index])
File "bcbio/isatab/parser.py", line 275, in _collapse_attributes
Attrs = collections.namedtuple('Attrs', names)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/collections.py", line 253, in namedtuple
ValueError: Type names and field names cannot start with a number: '57B_antigen_expression_by_IHC'

@chapmanb
Copy link
Member

Alejandra;
Thanks for the problem report. The approach I took was to prefix headers starting with numbers so they can be cleanly handled by namedtuples. The fix is here and your dataset now parses cleanly:

835754e

Thanks much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants