def __init__(self, vcf_shards_output_dir, number_of_variants_per_shard):
        # type: (str, int) -> None
        """Initializes `_WriteVariantsToVCFShards` object.

    Args:
      vcf_shards_output_dir: The location for all VCF shards.
      number_of_variants_per_shard: The maximum number of variants that is
        written into one VCF shard.
    """
        self._vcf_shards_output_dir = vcf_shards_output_dir
        self._number_of_variants_per_shard = number_of_variants_per_shard
        self._coder = vcfio._ToVcfRecordCoder()
        self._sample_names = []
        self._variant_lines = []
        self._counter = 0
Пример #2
0
    def __init__(self, vcf_shards_output_dir, number_of_variants_per_shard):
        # type: (str, int) -> None
        """Initializes `_WriteVariantsToVCFShards` object.

    Args:
      vcf_shards_output_dir: The location for all VCF shards.
      number_of_variants_per_shard: The maximum number of variants that is
        written into one VCF shard.
    """
        self._vcf_shards_output_dir = vcf_shards_output_dir
        self._number_of_variants_per_shard = number_of_variants_per_shard
        # Write shards as is.
        # This piece of code is triggered from vcf_to_bq._shard_variants() which
        # reads variants with the --use_1_based_coordinate=False option, regardless
        # if the flag was passed with that value or not. Therefore, write the shards
        # into BQ with 0-based coordinate assumption.
        self._coder = vcfio._ToVcfRecordCoder(bq_uses_1_based_coordinate=False)
        self._sample_names = []
        self._variant_lines = []
        self._counter = 0
Пример #3
0
 def _get_coder(self):
     return vcfio._ToVcfRecordCoder()
Пример #4
0
 def _get_coder(self, bq_uses_1_based_coordinate=False):
   return vcfio._ToVcfRecordCoder(bq_uses_1_based_coordinate)