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
The ordinary vcf entrys is stored by there header names, like
31
+
32
+
variant['CHROM']
33
+
variant['ALT']
34
+
35
+
etc.
36
+
23
37
The genotype information is converted to a genotype object and stored in a dictionary
24
38
25
39
variant['genotypes']
@@ -53,7 +67,8 @@ Vep information, if present, is parsed into
53
67
54
68
and looks like:
55
69
56
-
'vep_info': {'NOC2L': {'Allele': 'G',
70
+
'vep_info': {<alternative_allele>: {
71
+
'Allele': 'G',
57
72
'Amino_acids': '',
58
73
'CDS_position': '',
59
74
'Codons': '',
@@ -74,7 +89,8 @@ and looks like:
74
89
'SYMBOL': 'NOC2L',
75
90
'SYMBOL_SOURCE': '',
76
91
'cDNA_position': ''},
77
-
'SAMD11': {'Allele': 'G',
92
+
<alternative_allele>: {
93
+
'Allele': 'G',
78
94
'Amino_acids': '',
79
95
'CDS_position': '',
80
96
'Codons': '',
@@ -94,36 +110,43 @@ and looks like:
94
110
'STRAND': '1',
95
111
'SYMBOL': 'SAMD11',
96
112
'SYMBOL_SOURCE': '',
97
-
'cDNA_position': ''}}
113
+
'cDNA_position': ''
114
+
}
115
+
'gene_ids':set([SAMD1, NOC2L])
116
+
}
98
117
99
-
INFO field is parsed into
118
+
INFO field is parsed into, where the keys are the names of the info field. Values are lists, if there is no value in the vcf the value in info_dict is False.
100
119
101
120
variant['info_dict]
102
121
103
122
and looks like
104
123
105
-
'info_dict': {'AC': '1',
106
-
'AF': '0.167',
107
-
'AN': '6',
108
-
'BaseQRankSum': '2.286',
109
-
'DB': True,
110
-
'DP': '1306',
111
-
'FS': '1.539',
112
-
'InbreedingCoeff': '0.1379',
113
-
'MQ': '39.83',
114
-
'MQ0': '0',
115
-
'MQRankSum': '-2.146',
116
-
'POSITIVE_TRAIN_SITE': True,
117
-
'QD': '29.57',
118
-
'ReadPosRankSum': '0.897',
119
-
'VQSLOD': '4.52',
120
-
'culprit': 'FS',
121
-
'set': 'variant'}
122
-
123
-
124
-
###Print a variant in it´s original format:###
125
-
126
-
print '\t'.join([[variant[head] for head in my_parser.header])
124
+
'info_dict': {'AC': ['1'],
125
+
'AF': ['0.167'],
126
+
'AN': ['6'],
127
+
'BaseQRankSum': ['2.286'],
128
+
'DB': False,
129
+
'DP': ['1306'],
130
+
'FS': ['1.539'],
131
+
'InbreedingCoeff': ['0.1379'],
132
+
'MQ': ['39.83'],
133
+
'MQ0': ['0'],
134
+
'MQRankSum': ['-2.146'],
135
+
'POSITIVE_TRAIN_SITE': False,
136
+
'QD': ['29.57'],
137
+
'ReadPosRankSum': ['0.897'],
138
+
'VQSLOD': ['4.52'],
139
+
'culprit': ['FS'],
140
+
'set': ['variant']}
141
+
142
+
143
+
### Print a vcf in it´s original format: ###
144
+
145
+
my_parser = parser.VCFParser(infile='infile.vcf')
146
+
for line in my_parser.metadata.print_header():
147
+
print(line)
148
+
for variant in my_parser:
149
+
print('\t'.join([[variant[head] for head in my_parser.header]))
0 commit comments