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