def formatted(self): now = datetime.datetime.utcnow() 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
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)
def __init__(self, path): self._jfile = Env.jutils().writeFile(path, Env.hc()._jhc) super(HadoopWriter, self).__init__()
def __init__(self, path): self._jfile = Env.jutils().readFile(path, Env.hc()._jhc) super(HadoopReader, self).__init__()
def __init__(self, reference_genome=None, required = False): self._rg = reference_genome if reference_genome else Env.hc().default_reference jtype = scala_object(Env.hail().expr, 'TInterval').apply(self._rg._jrep, required) super(TInterval, self).__init__(jtype)