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

Build/create PED files #5

Open
robinandeer opened this issue Apr 13, 2015 · 7 comments
Open

Build/create PED files #5

robinandeer opened this issue Apr 13, 2015 · 7 comments

Comments

@robinandeer
Copy link
Contributor

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 in extra_info. I would like for this information to also be serialized - is this supported?

@moonso
Copy link
Owner

moonso commented Apr 13, 2015

Hi,

this should work, i will look into it.
Can you post the whole codeblock so I can see how you do it?

@robinandeer
Copy link
Contributor Author

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'}

@moonso
Copy link
Owner

moonso commented Apr 13, 2015

Would you like to have to_ped in the Individual class?
Or are you gonna make a ped file from the json info?

@robinandeer
Copy link
Contributor Author

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?

@moonso
Copy link
Owner

moonso commented Apr 13, 2015

Yes but i'm thinking about making it possible on all levels, don't really know what is most reasonable

@robinandeer
Copy link
Contributor Author

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?

@robinandeer
Copy link
Contributor Author

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?

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