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
I'm using vcfpy to add an extra field in FORMAT of each record of a multisamples vcf file. From the document, i think that the function add_format would help me to do that. However, it keeps adding the same values for every sample. How can i add different value for each sample?
The text was updated successfully, but these errors were encountered:
def add_format(self, key, value=None):
"""Add an entry to format
The record's calls ``data[key]`` will be set to ``value`` if not yet
set and value is not ``None``. If key is already in FORMAT then
nothing is done.
"""
if key in self.FORMAT:
return
self.FORMAT.append(key)
if value is not None:
for call in self:
call.data.setdefault(key, value)
What I understand is that, in this code line "call.data.setdefault(key,value)", key here should be the new field in the Format,and value should be the value for that new field. If so, then it will add the same value for all samples ?
I'm using vcfpy to add an extra field in FORMAT of each record of a multisamples vcf file. From the document, i think that the function add_format would help me to do that. However, it keeps adding the same values for every sample. How can i add different value for each sample?
The text was updated successfully, but these errors were encountered: