Beispiel #1
0
 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
Beispiel #2
0
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)
Beispiel #3
0
 def __init__(self, path):
     self._jfile = Env.jutils().writeFile(path, Env.hc()._jhc)
     super(HadoopWriter, self).__init__()
Beispiel #4
0
 def __init__(self, path):
     self._jfile = Env.jutils().readFile(path, Env.hc()._jhc)
     super(HadoopReader, self).__init__()
Beispiel #5
0
 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)