Package org.disq_bio.disq
Class HtsjdkVariantsRddStorage
- java.lang.Object
-
- org.disq_bio.disq.HtsjdkVariantsRddStorage
-
public class HtsjdkVariantsRddStorage extends Object
The entry point for reading or writing aHtsjdkVariantsRdd.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HtsjdkVariantsRddStoragemakeDefault(org.apache.spark.api.java.JavaSparkContext sparkContext)Create aHtsjdkVariantsRddStoragefrom a Spark context object.HtsjdkVariantsRddread(String path)Read variants from the given path.<T extends htsjdk.samtools.util.Locatable>
HtsjdkVariantsRddread(String path, List<T> intervals)Read variants from the given path, using the given intervals to filter the variants.HtsjdkVariantsRddStoragesplitSize(int splitSize)voidwrite(HtsjdkVariantsRdd htsjdkVariantsRdd, String path, WriteOption... writeOptions)Write variants to a file or files specified by the given path.
-
-
-
Method Detail
-
makeDefault
public static HtsjdkVariantsRddStorage makeDefault(org.apache.spark.api.java.JavaSparkContext sparkContext)
Create aHtsjdkVariantsRddStoragefrom a Spark context object.- Parameters:
sparkContext- the Spark context to use- Returns:
- a
HtsjdkVariantsRddStorage
-
splitSize
public HtsjdkVariantsRddStorage splitSize(int splitSize)
- Parameters:
splitSize- the requested size of file splits in bytes when reading- Returns:
- the current
HtsjdkVariantsRddStorage
-
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
HtsjdkVariantsRddthat 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 fromintervals- intervals to filter variants by- Returns:
- a
HtsjdkVariantsRddthat 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- aHtsjdkVariantsRddcontaining the header and the variantspath- the file or directory to write towriteOptions- options to control aspects of how to write the variants (e.g.VariantsFormatWriteOptionandFileCardinalityWriteOption- Throws:
IOException- if an IO error occurs while writing
-
-