Skip to content

Commit

Permalink
LociConversions
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-williams committed Feb 3, 2017
1 parent 1445521 commit b5429f8
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 41 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.hammerlab.genomics.reads

import org.hammerlab.genomics.cigar._
import org.hammerlab.genomics.reference.test.LocusUtil._
import org.hammerlab.genomics.reference.test.LociConversions._

class MappedReadSerializerSuite
extends ReadSerializerSuite {
Expand Down
76 changes: 39 additions & 37 deletions src/test/scala/org/hammerlab/genomics/reads/MappedReadSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,58 @@ package org.hammerlab.genomics.reads
import htsjdk.samtools.{ SAMFileHeader, SAMRecord, TextCigarCodec }
import org.hammerlab.genomics.bases.BasesUtil
import org.hammerlab.genomics.cigar.makeCigar
import org.hammerlab.genomics.reference.test.LocusUtil
import org.hammerlab.genomics.reference.test.LociConversions._
import org.hammerlab.test.Suite

class MappedReadSuite
extends Suite
with BasesUtil
with LocusUtil {
with BasesUtil {

test("mappedread is mapped") {
val read = MappedRead(
"read1",
"TCGACCCTCGA",
Array[Byte]((10 to 20).map(_.toByte): _*),
isDuplicate = true,
"chr5",
50,
325352323,
TextCigarCodec.decode(""),
failedVendorQualityChecks = false,
isPositiveStrand = true,
isPaired = true
)
val read =
MappedRead(
"read1",
"TCGACCCTCGA",
Array[Byte]((10 to 20).map(_.toByte): _*),
isDuplicate = true,
"chr5",
50,
325352323,
TextCigarCodec.decode(""),
failedVendorQualityChecks = false,
isPositiveStrand = true,
isPaired = true
)

read.isMapped should be(true)
read.asInstanceOf[Read].isMapped should be(true)
}

test("mixed collections mapped and unmapped reads") {
val uread = UnmappedRead(
"read1",
"TCGACCCTCGA",
Array[Byte]((10 to 20).map(_.toByte): _*),
isDuplicate = true,
failedVendorQualityChecks = false,
isPaired = true
)
val uread =
UnmappedRead(
"read1",
"TCGACCCTCGA",
Array[Byte]((10 to 20).map(_.toByte): _*),
isDuplicate = true,
failedVendorQualityChecks = false,
isPaired = true
)

val mread = MappedRead(
"read1",
"TCGACCCTCGA",
Array[Byte]((10 to 20).map(_.toByte): _*),
isDuplicate = true,
"chr5",
50,
325352323,
TextCigarCodec.decode(""),
failedVendorQualityChecks = false,
isPositiveStrand = true,
isPaired = true
)
val mread =
MappedRead(
"read1",
"TCGACCCTCGA",
Array[Byte]((10 to 20).map(_.toByte): _*),
isDuplicate = true,
"chr5",
50,
325352323,
TextCigarCodec.decode(""),
failedVendorQualityChecks = false,
isPositiveStrand = true,
isPaired = true
)

val collectionMappedReads: Seq[Read] = Seq(uread, mread)
collectionMappedReads(0).isMapped should ===(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ package org.hammerlab.genomics.reads

import htsjdk.samtools.TextCigarCodec
import org.hammerlab.genomics.bases.BasesUtil
import org.hammerlab.genomics.reference.test.LocusUtil
import org.hammerlab.genomics.reference.test.LociConversions._
import org.hammerlab.test.Suite

class PairedReadSuite
extends Suite
with BasesUtil
with LocusUtil {
with BasesUtil {

test("unmappedread paired read is not mapped") {
val unmappedRead =
Expand Down

0 comments on commit b5429f8

Please sign in to comment.