VariantSpark icon indicating copy to clipboard operation
VariantSpark copied to clipboard

num Case/Control in JSON model file

Open ArashBayatDev opened this issue 5 years ago • 2 comments

Include number of samples from each class in the JSON model file.

ArashBayatDev avatar Jul 22 '20 23:07 ArashBayatDev

I mean for each node

ArashBayatDev avatar Jul 22 '20 23:07 ArashBayatDev

HI @ArashBayatDev I have added a new attribute classCounts to the JSON tree nodes, which is an array with the count of samples from each of the classes. Also I have added a new method to the HAIL API to save the model json reprsentation. An example how to do this is python/examples/chr21_GRCh38_hail.py Essentially you need to call to_json() on the model object.

    def to_json(self, filename, resolve_names = True):
        """ Save the model JSON representation to a file. If `resolve_names` is set
        includes the variable names as well as indexes in the output. This does however
        incur performance penalty for creation of in-memory variable index.
        :param str filename: The file to save the model to.
        :param bool resolve_names: Resolve variable names in the saved JSON.
        """

This has been released to biospark v1.0.3

piotrszul avatar Aug 21 '20 01:08 piotrszul