Class HtsjdkReadsRddStorage


  • public class HtsjdkReadsRddStorage
    extends Object
    The entry point for reading or writing a HtsjdkReadsRdd.
    • Method Detail

      • validationStringency

        public HtsjdkReadsRddStorage validationStringency​(htsjdk.samtools.ValidationStringency validationStringency)
        Parameters:
        validationStringency - the validation stringency for reading
        Returns:
        the current HtsjdkReadsRddStorage
      • sbiIndexGranularity

        public HtsjdkReadsRddStorage sbiIndexGranularity​(long sbiIndexGranularity)
        Parameters:
        sbiIndexGranularity - the granularity to use when writing SBI index files; only used when writing single BAM files.
        Returns:
        the current HtsjdkReadsRddStorage
      • read

        public HtsjdkReadsRdd read​(String path)
                            throws IOException
        Read reads from the given path. The input files may be in any format (BAM/CRAM/SAM).
        Parameters:
        path - the file or directory to read from
        Returns:
        a HtsjdkReadsRdd that allows access to the reads
        Throws:
        IOException - if an IO error occurs while determining the format of the files and reading the header
      • read

        public <T extends htsjdk.samtools.util.Locatable> HtsjdkReadsRdd read​(String path,
                                                                              HtsjdkReadsTraversalParameters<T> traversalParameters)
                                                                       throws IOException
        Read reads from the given path, using the given traversal parameters to filter the reads. The input files may be in any format (BAM/CRAM/SAM).
        Type Parameters:
        T - the type of Locatable for specifying intervals
        Parameters:
        path - the file or directory to read from
        traversalParameters - parameters that determine which reads should be returned, allows filtering by interval
        Returns:
        a HtsjdkReadsRdd that allows access to the reads
        Throws:
        IOException - if an IO error occurs while determining the format of the files
      • write

        public void write​(HtsjdkReadsRdd htsjdkReadsRdd,
                          String path,
                          WriteOption... writeOptions)
                   throws IOException
        Write reads to a file or files specified by the given path. Write options may be specified to control the format to write in (BAM/CRAM/SAM, if not clear from the path extension), and the number of files to write (single vs. multiple).
        Parameters:
        htsjdkReadsRdd - a HtsjdkReadsRdd containing the header and the reads
        path - the file or directory to write to
        writeOptions - options to control aspects of how to write the reads (e.g. ReadsFormatWriteOption and FileCardinalityWriteOption
        Throws:
        IOException - if an IO error occurs while writing