Commit 0886c76f authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Added general vcf utils

parent 2150ef84
package nl.lumc.sasc.biopet.util
import htsjdk.variant.variantcontext.VariantContext
import scala.collection.JavaConversions._
/** Utility object for general vcf file/records functions. */
object VcfUtils {
/**
* Return longest allele of VariantContext.
*
* @param vcfRecord record to check
* @return allele with most nucleotides
*/
def getLongestAllele(vcfRecord: VariantContext) = {
val alleles = vcfRecord.getAlleles
val longestAlleleId = alleles.map(_.getBases.length).zipWithIndex.maxBy(_._1)._2
alleles(longestAlleleId)
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment