Skip to content

Commit fc6c9b6

Browse files
authored
Merge pull request #43 from maize-genetics/fix-nuqseqio-gz
Fix nuqseqio gz
2 parents 9910c64 + 93984b7 commit fc6c9b6

File tree

6 files changed

+24
-4
lines changed

6 files changed

+24
-4
lines changed

.github/workflows/run-tests-on-pr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
checks: write # See: https://github.com/mikepenz/action-junit-report/issues/23#issuecomment-1412597753
1818
steps:
1919
- uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 0
2022
- uses: actions/setup-java@v3
2123
with:
2224
distribution: temurin

src/main/kotlin/biokotlin/packages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ of a transcript, you must know that it is a transcript.
132132

133133
Parsing a GFF file to a tree requires only a single line:
134134
```kotlin
135-
val genome = Genome.fromGFF("pathname.gff")
135+
val genome = Genome.fromFile("pathname.gff")
136136
```
137137

138138
GFFs that do not adhere to the structure will crash. Those that contain feature types that are not currently

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,8 @@ fun reader(filename: String, format: SeqFormat? = null, type: SeqType = SeqType.
6767
format
6868
} else {
6969

70-
val extension = File(filename).extension
71-
7270
val guessFormat = SeqFormat.values().find {
73-
it.suffixes.contains(extension)
71+
it.suffixes.any { suffix -> filename.endsWith(suffix) }
7472
}
7573

7674
guessFormat ?: throw IllegalArgumentException("Unknown file type: $filename")
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package biokotlin.seqIO
2+
3+
import io.kotest.core.spec.style.StringSpec
4+
import org.junit.jupiter.api.assertDoesNotThrow
5+
6+
class SeqIOTest : StringSpec({
7+
8+
val fasta = "src/test/resources/biokotlin/seqIO/B73_Ref_Subset.fa"
9+
val fastaZipped = "src/test/resources/biokotlin/seqIO/B73_Ref_Subset.fa.gz"
10+
val fastq = "src/test/resources/biokotlin/seqIO/example.fq"
11+
val fastqZipped = "src/test/resources/biokotlin/seqIO/example.fq.gz"
12+
13+
"Verify file type recognized" {
14+
assertDoesNotThrow { NucSeqIO(fasta) }
15+
assertDoesNotThrow { NucSeqIO(fastaZipped) }
16+
assertDoesNotThrow { FastqIO(fastq) }
17+
assertDoesNotThrow { FastqIO(fastqZipped) }
18+
}
19+
20+
})
Binary file not shown.
133 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)