コード例 #1
0
 def _compute_type(self):
     child_typ = self.child.typ
     self._type = hl.tmatrix(
         child_typ.global_type, child_typ.col_type, child_typ.col_key,
         child_typ.row_type._insert_field(self.root,
                                          self.table.typ.value_type),
         child_typ.row_key, child_typ.entry_type)
コード例 #2
0
ファイル: matrix_ir.py プロジェクト: shutianxu/hail
 def _compute_type(self):
     child_typ = self.child.typ
     a = child_typ.col_type._index_path(self.path)
     new_col_type = child_typ.col_type._insert(self.path, a.element_type)
     self._type = hl.tmatrix(child_typ.global_type, new_col_type,
                             child_typ.col_key, child_typ.row_type,
                             child_typ.row_key, child_typ.entry_type)
コード例 #3
0
ファイル: matrix_ir.py プロジェクト: shutianxu/hail
 def _compute_type(self):
     child_typ = self.child.typ
     self.new_col._compute_type(child_typ.col_env(), child_typ.entry_env())
     self._type = hl.tmatrix(
         child_typ.global_type, self.new_col.typ,
         self.new_key if self.new_key is not None else child_typ.col_key,
         child_typ.row_type, child_typ.row_key, child_typ.entry_type)
コード例 #4
0
ファイル: matrix_ir.py プロジェクト: jigold/hail
 def _compute_type(self):
     child_typ = self.child.typ
     self._type = hl.tmatrix(
         child_typ.global_type,
         child_typ.col_type,
         child_typ.col_key,
         child_typ.row_type,
         self.keys,
         child_typ.entry_type)
コード例 #5
0
ファイル: matrix_ir.py プロジェクト: shutianxu/hail
 def _compute_type(self):
     child_typ = self.child.typ
     self._type = hl.tmatrix(
         child_typ.global_type._drop_fields([self.cols_field_name]),
         child_typ.global_type[self.cols_field_name].element_type,
         self.col_key,
         child_typ.row_type._drop_fields([self.entries_field_name]),
         child_typ.row_key,
         child_typ.row_type[self.entries_field_name].element_type)
コード例 #6
0
ファイル: matrix_ir.py プロジェクト: nawatts/hail
 def _compute_type(self):
     child_typ = self.child.typ
     self._type = hl.tmatrix(
         child_typ.global_type,
         child_typ.col_type,
         child_typ.col_key,
         child_typ.row_type,
         self.keys,
         child_typ.entry_type)
コード例 #7
0
ファイル: matrix_ir.py プロジェクト: jigold/hail
 def _compute_type(self):
     child_typ = self.child.typ
     self._type = hl.tmatrix(
         child_typ.global_type,
         child_typ.col_type._insert_field(self.root, self.table.typ.value_type),
         child_typ.col_key,
         child_typ.row_type,
         child_typ.row_key,
         child_typ.entry_type)
コード例 #8
0
ファイル: matrix_ir.py プロジェクト: jigold/hail
 def _compute_type(self):
     child_typ = self.child.typ
     self._type = hl.tmatrix(
         child_typ.global_type._drop_fields([self.cols_field_name]),
         child_typ.global_type[self.cols_field_name].element_type,
         self.col_key,
         child_typ.row_type._drop_fields([self.entries_field_name]),
         child_typ.row_key,
         child_typ.row_type[self.entries_field_name].element_type)
コード例 #9
0
ファイル: matrix_ir.py プロジェクト: jigold/hail
 def _compute_type(self):
     child_typ = self.child.typ
     self.new_row._compute_type(child_typ.row_env(), child_typ.entry_env())
     self._type = hl.tmatrix(
         child_typ.global_type,
         child_typ.col_type,
         child_typ.col_key,
         self.new_row.typ,
         child_typ.row_key,
         child_typ.entry_type)
コード例 #10
0
ファイル: matrix_ir.py プロジェクト: jigold/hail
 def _compute_type(self):
     child_typ = self.child.typ
     self.new_col._compute_type(child_typ.col_env(), child_typ.entry_env())
     self._type = hl.tmatrix(
         child_typ.global_type,
         self.new_col.typ,
         self.new_key if self.new_key is not None else child_typ.col_key,
         child_typ.row_type,
         child_typ.row_key,
         child_typ.entry_type)
コード例 #11
0
ファイル: matrix_ir.py プロジェクト: nawatts/hail
 def _compute_type(self):
     child_typ = self.child.typ
     self.new_global._compute_type(child_typ.global_env(), None)
     self._type = hl.tmatrix(
         self.new_global.typ,
         child_typ.col_type,
         child_typ.col_key,
         child_typ.row_type,
         child_typ.row_key,
         child_typ.entry_type)
コード例 #12
0
ファイル: matrix_ir.py プロジェクト: nawatts/hail
 def _compute_type(self):
     child_typ = self.child.typ
     self._type = hl.tmatrix(
         child_typ.global_type,
         child_typ.col_key_type._concat(
             hl.tstruct(**{f: hl.tarray(t) for f, t in child_typ.col_value_type.items()})),
         child_typ.col_key,
         child_typ.row_type,
         child_typ.row_key,
         hl.tstruct(**{f: hl.tarray(t) for f, t in child_typ.entry_type.items()}))
コード例 #13
0
ファイル: matrix_ir.py プロジェクト: nawatts/hail
 def _compute_type(self):
     child_typ = self.child.typ
     self.new_row._compute_type({**child_typ.row_env(), 'n_cols': hl.tint32}, child_typ.entry_env())
     self._type = hl.tmatrix(
         child_typ.global_type,
         child_typ.col_type,
         child_typ.col_key,
         self.new_row.typ,
         child_typ.row_key,
         child_typ.entry_type)
コード例 #14
0
ファイル: matrix_ir.py プロジェクト: shutianxu/hail
 def _compute_type(self):
     child_typ = self.child.typ
     if self.product:
         value_type = hl.tarray(self.table.typ.value_type)
     else:
         value_type = self.table.typ.value_type
     self._type = hl.tmatrix(
         child_typ.global_type, child_typ.col_type, child_typ.col_key,
         child_typ.row_type._insert_field(self.root, value_type),
         child_typ.row_key, child_typ.entry_type)
コード例 #15
0
ファイル: matrix_ir.py プロジェクト: jigold/hail
 def _compute_type(self):
     child_typ = self.child.typ
     self.new_global._compute_type(child_typ.global_env(), None)
     self._type = hl.tmatrix(
         self.new_global.typ,
         child_typ.col_type,
         child_typ.col_key,
         child_typ.row_type,
         child_typ.row_key,
         child_typ.entry_type)
コード例 #16
0
ファイル: matrix_ir.py プロジェクト: shutianxu/hail
 def _compute_type(self):
     child_typ = self.child.typ
     self.entry_expr._compute_type(child_typ.col_env(),
                                   child_typ.entry_env())
     self.row_expr._compute_type(child_typ.global_env(),
                                 child_typ.row_env())
     self._type = hl.tmatrix(
         child_typ.global_type, child_typ.col_type, child_typ.col_key,
         child_typ.row_key_type._concat(self.row_expr.typ),
         child_typ.row_key, self.entry_expr.typ)
コード例 #17
0
ファイル: matrix_ir.py プロジェクト: jigold/hail
 def _compute_type(self):
     child_typ = self.child.typ
     self._type = hl.tmatrix(
         child_typ.global_type,
         child_typ.col_key_type._concat(
             hl.tstruct(**{f: hl.tarray(t) for f, t in child_typ.col_value_type.items()})),
         child_typ.col_key,
         child_typ.row_type,
         child_typ.row_key,
         hl.tstruct(**{f: hl.tarray(t) for f, t in child_typ.entry_type.items()}))
コード例 #18
0
ファイル: matrix_ir.py プロジェクト: jigold/hail
 def _compute_type(self):
     child_typ = self.child.typ
     self.entry_expr._compute_type(child_typ.row_env(), child_typ.entry_env())
     self.col_expr._compute_type(child_typ.global_env(), child_typ.col_env())
     self._type = hl.tmatrix(
         child_typ.global_type,
         child_typ.col_key_type._concat(self.col_expr.typ),
         child_typ.col_key,
         child_typ.row_type,
         child_typ.row_key,
         self.entry_expr.typ)
コード例 #19
0
ファイル: matrix_ir.py プロジェクト: jigold/hail
 def _compute_type(self):
     child_typ = self.child.typ
     a = child_typ.col_type._index_path(self.path)
     new_col_type = child_typ.col_type._insert(self.path, a.element_type)
     self._type = hl.tmatrix(
         child_typ.global_type,
         new_col_type,
         child_typ.col_key,
         child_typ.row_type,
         child_typ.row_key,
         child_typ.entry_type)
コード例 #20
0
ファイル: matrix_ir.py プロジェクト: nawatts/hail
 def _compute_type(self):
     name = self.config['name']
     child_typ = self.child.typ
     if name == 'MatrixFilterPartitions':
         self._type = child_typ
     else:
         assert name == 'WindowByLocus', name
         self._type = hl.tmatrix(
             child_typ.global_type,
             child_typ.col_type,
             child_typ.col_key,
             child_typ.row_type._insert_field('prev_rows', hl.tarray(child_typ.row_type)),
             child_typ.row_key,
             child_typ.entry_type._insert_field('prev_entries', hl.tarray(child_typ.entry_type)))
コード例 #21
0
ファイル: matrix_ir.py プロジェクト: jigold/hail
 def _compute_type(self):
     name = self.config['name']
     child_typ = self.child.typ
     if (name == 'MatrixFilterPartitions'
             or name == 'MatrixFilterIntervals'):
         self._type = child_typ
     else:
         assert name == 'WindowByLocus', name
         self._type = hl.tmatrix(
             child_typ.global_type,
             child_typ.col_type,
             child_typ.col_key,
             child_typ.row_type._insert_field('prev_rows', hl.tarray(child_typ.row_type)),
             child_typ.row_key,
             child_typ.entry_type._insert_field('prev_entries', hl.tarray(child_typ.entry_type)))
コード例 #22
0
 def _compute_type(self):
     child_typ = self.child.typ
     other_field_set = set(self.row_key + self.row_fields + self.col_key +
                           self.col_fields)
     entry_fields = [
         f for f in list(child_typ.row_type) if f not in other_field_set
     ]
     self._type = hl.tmatrix(
         child_typ.global_type,
         hl.tstruct(**{
             f: child_typ.row_type[f]
             for f in self.col_key + self.col_fields
         }), self.col_key,
         hl.tstruct(**{
             f: child_typ.row_type[f]
             for f in self.row_key + self.row_fields
         }), self.row_key,
         hl.tstruct(**{f: child_typ.row_type[f]
                       for f in entry_fields}))