hoffmangroup / genomedata

The Genomedata format for storing large-scale functional genomics data.
https://genomedata.hoffmanlab.org/
GNU General Public License v2.0
2 stars 1 forks source link

Accessing track-dependent attributes of archives without any tracks results in a fatal error #26

Open EricR86 opened 7 years ago

EricR86 commented 7 years ago

Original report (archived issue) by Coby Viner (Bitbucket: cviner2, GitHub: cviner).

The original report had attachments: genome_attrs.log


While Genomedata archives can be created without any tracks (1e0bf78f9f9186908e92134239a9f4e0a4ca2345), attempting to access any track-related attributes for such archives fails with a somewhat cryptic error, instead of (ideally) returning empty attributes or a clear error message.

Attempting to access track attributes, via either the command-line interface or Python API, fails, eventually resulting in an error in the __getattr__ method of tables/attributeset.py:

    "'%s'" % (name, self._v__nodepath))
AttributeError: Attribute 'tracknames' does not exist in node: '/'

This error can be easily reproduced by invoking genomedata-info tracknames <archive>, while genomedata-info sizes <archive> results in the expected output. This also occurs with other track-dependent attributes, such as num_tracks_continuous or vars, accessible from the Python API.

This appears to occur due to Genomedata archives without tracks not having any track-dependent attributes, like num_tracks_continuous. Refer to the enclosed file, containing Python output, listing all attributes of a loaded Genomedata archive without any tracks (the result of pprint(genome.__dict__), in which genome = Genome(<archive>).

Ideally, such archives should still contain all track-related attributes, initialized to their standard empty values, such as num_tracks_continuous = 0 and vars = np.array([]).

EricR86 commented 5 years ago

Original comment by Coby Viner (Bitbucket: cviner2, GitHub: cviner).