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

Replace getChr for getContig

parent 8360ae8d
......@@ -137,7 +137,7 @@ object AnnotateVcfWithBed extends ToolCommand {
logger.info("Start reading vcf records")
for (record <- reader) {
val overlaps = bedRecords.getOrElse(record.getChr, Nil).filter(x => {
val overlaps = bedRecords.getOrElse(record.getContig, Nil).filter(x => {
record.getStart <= x._2 && record.getEnd >= x._1
})
if (overlaps.isEmpty) {
......
......@@ -97,7 +97,7 @@ object CheckAllelesVcfInBam extends ToolCommand {
val countReports: Map[String, CountReport] = bamReaders.map(x => (x._1, new CountReport))
val refAllele = vcfRecord.getReference.getBaseString
for ((sample, bamReader) <- bamReaders) {
val queryInterval = new QueryInterval(bamHeaders(sample).getSequenceIndex(vcfRecord.getChr),
val queryInterval = new QueryInterval(bamHeaders(sample).getSequenceIndex(vcfRecord.getContig),
vcfRecord.getStart, vcfRecord.getStart + refAllele.length - 1)
val bamIter = bamReader.query(Array(queryInterval), false)
......
......@@ -131,7 +131,7 @@ object MergeAlleles extends ToolCommand {
}
val alleles: mutable.Set[Allele] = mutable.Set()
val builder = new VariantContextBuilder
builder.chr(records.head.getChr)
builder.chr(records.head.getContig)
builder.start(records.head.getStart)
for (record <- records) {
......
......@@ -542,7 +542,7 @@ object VcfStats extends ToolCommand {
else addToBuffer(tag, value, found = true)
}
Map(record.getChr -> buffer.toMap, "total" -> buffer.toMap)
Map(record.getContig -> buffer.toMap, "total" -> buffer.toMap)
}
/** Function to check sample/genotype specific stats */
......@@ -593,7 +593,7 @@ object VcfStats extends ToolCommand {
else addToBuffer(tag, value, found = true)
}
Map(record.getChr -> buffer.toMap, "total" -> buffer.toMap)
Map(record.getContig -> buffer.toMap, "total" -> buffer.toMap)
}
/** Function to write 1 specific genotype field */
......
......@@ -109,7 +109,7 @@ object VcfToTsv extends ToolCommand {
writer.println(sortedFields.mkString("#", commandArgs.separator, ""))
for (vcfRecord <- reader) {
val values: mutable.Map[String, Any] = mutable.Map()
values += "CHROM" -> vcfRecord.getChr
values += "CHROM" -> vcfRecord.getContig
values += "POS" -> vcfRecord.getStart
values += "ID" -> vcfRecord.getID
values += "REF" -> vcfRecord.getReference.getBaseString
......
......@@ -103,10 +103,10 @@ object VcfWithVcf extends ToolCommand {
var counter = 0
for (record <- reader) {
val secondaryRecords = if (commandArgs.matchAllele) {
secondaryReader.query(record.getChr, record.getStart, record.getEnd).toList.
secondaryReader.query(record.getContig, record.getStart, record.getEnd).toList.
filter(x => record.getAlternateAlleles.exists(x.hasAlternateAllele))
} else {
secondaryReader.query(record.getChr, record.getStart, record.getEnd).toList
secondaryReader.query(record.getContig, record.getStart, record.getEnd).toList
}
val fieldMap = (for (
......
......@@ -87,7 +87,7 @@ object WipeReads extends ToolCommand {
def makeIntervalFromBed(inFile: File): Iterator[Interval] =
asScalaIteratorConverter(getFeatureReader(inFile.toPath.toString, new BEDCodec(), false).iterator)
.asScala
.map(x => new Interval(x.getChr, x.getStart, x.getEnd))
.map(x => new Interval(x.getContig, x.getStart, x.getEnd))
/**
* Parses a refFlat file to yield Interval objects
......
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