Skip to content
Snippets Groups Projects
Commit 0886c76f authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Added general vcf utils

parent 2150ef84
No related branches found
No related tags found
No related merge requests found
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)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment