You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+50-39Lines changed: 50 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,10 @@
4
4
A small tool for parsing files in the [pedigree (.ped) format](http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#ped).
5
5
The parser will create a family object for each family found in the pedigree file and a individual object for each individual found.
6
6
The tool can be used to access information from ped files or convert the data to [madeline2](http://eyegene.ophthy.med.umich.edu/madeline/index.php) format for drawing pedigree trees.
7
+
Also it is possible to create family objects and individual object and print the in ped and madeline formats.
7
8
8
9
## General ##
9
10
10
-
11
11
Parse a file with family info, this can be a .ped file, a .fam, a .txt(alternative ped style)
12
12
file or another ped based alternative.
13
13
@@ -66,7 +66,7 @@ In this case use:
66
66
67
67
ped_parser infile.ped --family_type alt
68
68
69
-
## Madeline2 conversion ##
69
+
###Madeline2 conversion###
70
70
71
71
72
72
[Madeline2](http://eyegene.ophthy.med.umich.edu/madeline/index.php) is an excellent tool to draw pedigrees but they use there own input formats. ped_parser can now produce madeline2 input files from ped files by using
@@ -80,40 +80,51 @@ The following columns will be added to the madeline file:
80
80
Since only the first six of these columns are the standard ped format columns ped parser allows for alternative pedigree files with the following rules:
81
81
82
82
83
-
##Methods##
84
-
85
-
my_parser.get_json()
86
-
87
-
returns the families in a list of dictionaries that can be made to json object. Looks like:
88
-
89
-
````
90
-
[
91
-
{'family_id': '1',
92
-
'individuals': [
93
-
{'father': '0',
94
-
'individual_id': 'mother',
95
-
'mother': '0',
96
-
'phenotype': 1,
97
-
'sex:': 2
98
-
},
99
-
{'father': 'father',
100
-
'individual_id': 'daughter',
101
-
'mother': 'mother',
102
-
'phenotype': 2,
103
-
'sex:': 1
104
-
},
105
-
{'father': '0',
106
-
'individual_id': 'father',
107
-
'mother': '0',
108
-
'phenotype': 1,
109
-
'sex:': 1
110
-
},
111
-
{'father': 'father',
112
-
'individual_id': 'proband',
113
-
'mother': 'mother',
114
-
'phenotype': 2,
115
-
'sex:': 1
116
-
}
117
-
]
118
-
}
119
-
]```
83
+
### json conversion ###
84
+
85
+
86
+
87
+
ped_parser input.ped --to_json [-o output.txt]
88
+
89
+
This is a list with lists that represents families, families have
90
+
dictionaries that represents individuals like
91
+
92
+
```json
93
+
[
94
+
[
95
+
{
96
+
'family_id:family_id',
97
+
'id':individual_id,
98
+
'sex':gender_code,
99
+
'phenotype': phenotype_code,
100
+
'mother': mother_id,
101
+
'father': father_id
102
+
},
103
+
{
104
+
...
105
+
}
106
+
],
107
+
[
108
+
109
+
]
110
+
]
111
+
```
112
+
113
+
### Create ped like objects ###
114
+
115
+
Ped like objects can be created from within a python program and convert them to ped, json or madeline output like this
0 commit comments