Skip to content

Commit 37ca82b

Browse files
author
Alagu Ganesan
committed
added comments as to why I used substring(1) and added an '@' before record ID
1 parent ae3fc89 commit 37ca82b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/kotlin/biokotlin/seqIO/FastqIO.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ fun writeFastq(input: Collection<SeqRecord>, filename: String) {
153153
is NucSeqRecord -> record.sequence.toString()
154154
else -> throw IllegalStateException("writeFastq trying to output something other than Nuc Seq.")
155155
}
156-
outputFile.write("@${record.id}\n")
156+
outputFile.write("@${record.id}\n") // adding @ to record because when using FastqIO iterator removes @ from original header
157157
outputFile.write("${seq}\n")
158158
outputFile.write("+\n")
159159
require (record.letterAnnotations["quality"]?.size != 0) { "Letter annotations cannot be empty" }

src/test/kotlin/biokotlin/seqIO/FastqIOTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class FastqIOTest : StringSpec({
9090
letterAnnotationsImmutableMapBuilder.putAll(letterAnnotations)
9191
val immutableLetterAnnotations = letterAnnotationsImmutableMapBuilder.build()
9292

93-
val fastqEntry = NucSeqRecord(NucSeq(sequence), header.substring(1), "", "", immutableAnnotations, immutableLetterAnnotations)
93+
val fastqEntry = NucSeqRecord(NucSeq(sequence), header.substring(1), "", "", immutableAnnotations, immutableLetterAnnotations) // doing header.substring(1) becuase FastqIO iterator removes @ symbol
9494
fastqEntries.add(fastqEntry)
9595
}
9696
}

0 commit comments

Comments
 (0)