Package-level declarations

Types

Link copied to clipboard
data class AltHeaderMetaData(val id: String, val description: String, val source: String, val sampleGamete: SampleGamete, val regions: List<Pair<Position, Position>>, val checksum: String, val refRange: String, val refChecksum: String = "")
Link copied to clipboard
object BedUtils
Link copied to clipboard
class FastaLineWrapper(val wrapSize: Int = 60)

Simple class to place newline characters at fixed intervals while writing to output

Link copied to clipboard
class GetVCFVariants(inputFiles: List<String>, debug: Boolean = false)

Get the variant lines for the given positions from the VCF files. Input files, VCF Readers, Sample lists, and variants are kept in the same order. Sorted by the first sample name in each VCF file.

Link copied to clipboard

Merges GVCF files into a single VCF file. The GVCF files should have only one sample each. If a bedfile is provided, then the output VCF file is split into multiple files based on the ranges in the bedfile.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class SimpleVariant(val contig: String, val start: Int, val end: Int, val refAllele: String, val altAlleles: List<String>, val samples: List<String>, val genotypes: List<String>, val originalText: String? = null) : Comparable<SimpleVariant>

Data class to represent a simple VCF variant

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class ValidateVCFResults(val valid: Boolean, val mergedContigs: List<String>)
Link copied to clipboard
data class VCFReader(val filename: String, val altHeaders: Map<String, AltHeaderMetaData>, val samples: List<String>, variants: Channel<Deferred<LinkedList<SimpleVariant>>>, scope: CoroutineScope = CoroutineScope(Dispatchers.Default))

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
fun bufferedWriter(filename: String, append: Boolean = false): BufferedWriter
Link copied to clipboard
fun convertGVCFToFasta(gvcfFile: String, refFasta: String, outFile: String, sampleName: String? = null, missingRecordsAs: MissingType = MissingType.asRef, missingGenotypeAs: MissingType = MissingType.asN, alleleIdx: Int = 0)

Function to convert a genotype in a GVCF file to a fasta sequence. All records must use non-symbloic alleles (except ), and duplicated positions are not allowed. Supports multisample VCFs. Parameters: gvcfFile: path to the GVCF file to use. The script accepts VCF file format, but GVCFs should be used to ensure that all variants are accounted for refFasta: path to the reference FASTA file outFile: path to the output FASTA file sampleName: optional, the sample name to use in a multisample VCF. Defaults to the first sample listed missingRecordAs: optional, default asRef. Behavior for positions that lack a GVCF record (variant site or ref block). Option asRef treats missing positions like reference blocks. Option asN fills the region with N's. Option asNone omits the region entirely. missingGenotypeAs: optional, default asN. Behavior for records with a missing or no-call genotype (.). Option asRef treats missing genotypes as reference alleles. Option asN fills missing genotypes with N. The number of N's is equal to the length of the record on the reference. Option asNone omits the position entirely. alleleIdx: optional. In a diploid or polyploid, the index of the allele to use. Defaults to 0.

Link copied to clipboard
fun createGenericVCFHeaders(taxaNames: List<String>): VCFHeader

Function creates generic headers for a g/VCF file

Link copied to clipboard

Function to get all VCF files in a directory. Includes extensions .g.vcf, .g.vcf.gz, .gvcf, .gvcf.gz, .h.vcf, .h.vcf.gz, .hvcf, .hvcf.gz, .vcf, .vcf.gz

Link copied to clipboard
fun getGVCFFiles(gvcfDir: String): List<String>

Function to get all GVCF files in a directory. Includes extensions .g.vcf, .g.vcf.gz, .gvcf, .gvcf.gz

Link copied to clipboard

This is an example use of GetVCFVariants. See MergeGVCFs.kt for a similar example.

Link copied to clipboard
fun parseALTHeader(header: VCFHeader): Map<String, AltHeaderMetaData>

Helper function to parse out the ALT headers from the VCF file.

Link copied to clipboard

Sends all logging messages (including log4j) to standard out. The logging level will be DEBUG.

Link copied to clipboard
suspend fun validateVCFs(inputDir: String): ValidateVCFResults
suspend fun validateVCFs(inputFiles: List<String>): ValidateVCFResults
Link copied to clipboard
fun vcfReader(inputFile: String, debug: Boolean = false): VCFReader

Function to create a VCF reader from a file.