Class HtsjdkVariantsRddStorage

    • Method Detail

      • read

        public HtsjdkVariantsRdd read​(String path)
                               throws IOException
        Read variants from the given path. The input files must be VCF format, optionally compressed.
        Parameters:
        path - the file or directory to read from
        Returns:
        a HtsjdkVariantsRdd that allows access to the variants
        Throws:
        IOException - if an IO error occurs while reading the header
      • read

        public <T extends htsjdk.samtools.util.Locatable> HtsjdkVariantsRdd read​(String path,
                                                                                 List<T> intervals)
                                                                          throws IOException
        Read variants from the given path, using the given intervals to filter the variants. The input files must be VCF format, optionally compressed.
        Type Parameters:
        T - the type of Locatable for specifying intervals
        Parameters:
        path - the file or directory to read from
        intervals - intervals to filter variants by
        Returns:
        a HtsjdkVariantsRdd that allows access to the variants
        Throws:
        IOException - if an IO error occurs while reading the header
      • write

        public void write​(HtsjdkVariantsRdd htsjdkVariantsRdd,
                          String path,
                          WriteOption... writeOptions)
                   throws IOException
        Write variants to a file or files specified by the given path. Write options may be specified to control the format and compression options to use (if not clear from the path extension), and the number of files to write (single vs. multiple).
        Parameters:
        htsjdkVariantsRdd - a HtsjdkVariantsRdd containing the header and the variants
        path - the file or directory to write to
        writeOptions - options to control aspects of how to write the variants (e.g. VariantsFormatWriteOption and FileCardinalityWriteOption
        Throws:
        IOException - if an IO error occurs while writing