Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
nh13 authored May 20, 2024
1 parent a316211 commit 05e573a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/scala/com/fulcrumgenomics/fastq/FastqToBam.scala
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class FastqToBam
validate(input.length == actualReadStructures.length, "input and read-structure must be supplied the same number of times.")
validate(1 to 2 contains actualReadStructures.flatMap(_.templateSegments).size, "read structures must contain 1-2 template reads total.")
validate(!extractUmisFromReadNames || umiQualTag.isEmpty, "Cannot extract UMI qualities when also extracting UMI from read names.")
validate(!extractUmisFromReadComment || umiQualTag.isEmpty, "Cannot extract UMI qualities when also extracting UMI from read description.")
validate(!extractUmisFromReadComment || umiQualTag.isEmpty, "Cannot extract UMI qualities when also extracting UMI from the comment in the read name.")

override def execute(): Unit = {
val encoding = qualityEncoding
Expand Down
6 changes: 3 additions & 3 deletions src/test/scala/com/fulcrumgenomics/umi/UmisTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class UmisTest extends UnitSpec with OptionValues {
Umis.extractUmisFromReadName("1:2:3:4:5:6:7:ACGTACGT", strict=true).value shouldBe "ACGTACGT"
}

it should "return None if the read has only 7 parts in strict mode" in {
it should "return None if the read name has only 7 parts in strict mode" in {
Umis.extractUmisFromReadName("1:2:3:4:5:6:7", strict=true) shouldBe None
}

Expand Down Expand Up @@ -126,7 +126,7 @@ class UmisTest extends UnitSpec with OptionValues {
copyUmiFromReadName(rec=rec("UMI:C:ACC+GGT"), removeUmi=true).nameAndUmi shouldBe ("UMI:C", "ACC-GGT")
}

it should "split on a different delimiter if specified" in {
it should "split on a different delimiter name if specified" in {
copyUmiFromReadName(rec=rec("UMI-A"), delimiter='-').nameAndUmi shouldBe ("UMI-A", "A")
copyUmiFromReadName(rec=rec("UMI-C-A"), delimiter='-').nameAndUmi shouldBe ("UMI-C-A", "A")
copyUmiFromReadName(rec=rec("UMI-C-ACC+GGT"), delimiter='-').nameAndUmi shouldBe ("UMI-C-ACC+GGT", "ACC-GGT")
Expand All @@ -136,7 +136,7 @@ class UmisTest extends UnitSpec with OptionValues {
copyUmiFromReadName(rec=rec("UMI:C:ACC+GGT")).nameAndUmi shouldBe ("UMI:C:ACC+GGT", "ACC-GGT")
}

it should "fail if the read has only one field" in {
it should "fail if the read name has only one field" in {
an[Exception] should be thrownBy copyUmiFromReadName(rec=rec("NAME"))
an[Exception] should be thrownBy copyUmiFromReadName(rec=rec("1-2"))
}
Expand Down

0 comments on commit 05e573a

Please sign in to comment.