Skip to content

Commit

Permalink
fix: Fix missing fields in str conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Rapsssito committed Mar 8, 2023
1 parent 6034c07 commit 4bbef95
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/variant_extractor/variants.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def _replace(self, **kwargs):

def _info_str(self, rec_str: List[str]) -> str:
# If info has not been loaded, return the original info string
if self._info is None:
if self._info is None and len(rec_str) > 7:
return rec_str[7]
info_list = []
for key, value in self.info.items():
Expand All @@ -208,13 +208,13 @@ def _info_str(self, rec_str: List[str]) -> str:

def _format_str(self, rec_str: List[str]) -> str:
# If format has not been loaded, return the original format string
if self._format is None:
if self._format is None and len(rec_str) > 8:
return rec_str[8]
return ":".join(self.format)

def _samples_str(self, rec_str: List[str]) -> str:
# If samples and format have not been loaded, return the original samples string
if self._samples is None and self._format is None:
if self._samples is None and self._format is None and len(rec_str) > 9:
return '\t'.join(rec_str[9:])
samples_list = [":".join([_convert_sample_value(k, self.samples[sample_name][k])
for k in self.format]) for sample_name in self.samples]
Expand Down

0 comments on commit 4bbef95

Please sign in to comment.