Open robinandeer opened 9 years ago
Hi,
this should work, i will look into it. Can you post the whole codeblock so I can see how you do it?
I should always script in iPython Notebook... Well, well:
>>> from ped_parser import Individual
>>> individual = Individual('ADM995A1', family='112', mother='ADM995A2', father='ADM995A3', sex='1', phenotype='2')
>>> individual.extra_info['Capture_kit'] = 'Agilent_SureSelect.V5'
>>> individual.get_json()
{u'family_id': '112',
u'father': 'ADM995A3',
u'id': 'ADM995A1',
u'mother': 'ADM995A2',
u'phenotype': '2',
u'sex': '1'}
Would you like to have to_ped in the Individual class? Or are you gonna make a ped file from the json info?
I would probably create the Individual
objects, then add them to a Family
and lastly call .to_ped
on the Family
class. That way I also get the header row, right?
Yes but i'm thinking about making it possible on all levels, don't really know what is most reasonable
To me serializing to JSON would be nice on all levels. But serializing to PED on individual level is less interesting. Perhaps just make it a private method that is called by Family?
Following up:
When I call to_ped()
I don't get the "extra_info" columns as is the case in the JSON serialization. Any plans to include them in the output written in the PED format?
Is it possible to use the package to create pedigree files from scratch?
When I try to create
Individual
objects and call e.g.get_json
it only includes mandatory information and skips stuff inextra_info
. I would like for this information to also be serialized - is this supported?