本文整理汇总了Python中hail.java.Env类的典型用法代码示例。如果您正苦于以下问题:Python Env类的具体用法?Python Env怎么用?Python Env使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Env类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _convert_to_j
def _convert_to_j(self, annotation):
if annotation is not None:
return scala_object(Env.hail().annotations, 'Annotation').fromSeq(
Env.jutils().arrayListToISeq(
[f.typ._convert_to_j(annotation.get(f.name)) for f in self.fields]
)
)
else:
return annotation
示例2: __init__
def __init__(self, element_type):
"""
:param :class:`.Type` element_type: Hail type of set element
"""
jtype = scala_object(Env.hail().expr, 'TSet').apply(element_type._jtype)
self.element_type = element_type
super(TSet, self).__init__(jtype)
示例3: parse
def parse(string):
"""Parses a locus object from a CHR:POS string.
:rtype: :class:`.Locus`
"""
return Locus._from_java(scala_object(Env.hail().variant, 'Locus').parse(string))
示例4: __init__
def __init__(self, contig, position):
if isinstance(contig, int):
contig = str(contig)
jrep = scala_object(Env.hail().variant, 'Locus').apply(contig, position)
self._init_from_java(jrep)
self._contig = contig
self._position = position
示例5: hadoop_copy
def hadoop_copy(src, dest):
"""Copy a file through the Hadoop filesystem API.
Supports distributed file systems like hdfs, gs, and s3.
**Examples**
>>> hadoop_copy('gs://hail-common/LCR.interval_list', 'file:///mnt/data/LCR.interval_list') # doctest: +SKIP
**Notes**
The provided source and destination file paths must be URIs
(uniform resource identifiers).
:param str src: Source file URI.
:param str dest: Destination file URI.
"""
Env.jutils().copyFile(src, dest, Env.hc()._jhc)
示例6: _convert_to_py
def _convert_to_py(self, annotation):
if annotation:
lst = Env.jutils().iterableToArrayList(annotation)
d = dict()
for x in lst:
d[self.key_type._convert_to_py(x._1())] = self.value_type._convert_to_py(x._2())
return d
else:
return annotation
示例7: parse
def parse(cls, string):
"""Parses a locus object from a CHR:POS string.
**Examples**
>>> l1 = Locus.parse('1:101230')
>>> l2 = Locus.parse('X:4201230')
:rtype: :class:`.Locus`
"""
return Locus._from_java(scala_object(Env.hail().variant, 'Locus').parse(string))
示例8: formatted
def formatted(self):
now = datetime.datetime.now()
history = "# {}\n# version: {}\n\n".format(now.isoformat(), Env.hc().version)
history += "from hail import *\n\n"
for stmt in self.statements:
history += (stmt + "\n\n")
history += ("(" + self.expr + ")")
try:
import autopep8
return autopep8.fix_code(history)
except ImportError:
return history
示例9: _init_from_java
def _init_from_java(self, jtype):
jfields = Env.jutils().iterableToArrayList(jtype.fields())
self.fields = [Field(f.name(), Type._from_java(f.typ()), dict(f.attrsJava())) for f in jfields]
示例10: functions_rst
def functions_rst(self, file_name):
Env.hail().utils.FunctionDocumentation.makeFunctionsDocs(file_name)
示例11: _jrep
def _jrep(self):
return Env.hail().stats.TruncatedBetaDist.apply(float(self.a), float(self.b), float(self.minVal), float(self.maxVal))