Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/scala/emc/rna/RNA.scala
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ final class RNA private(val slots: Array[Int], val length: Int)

/** Returns a codon iterator for this sequence starting at given reading frame,
* which will drop `rf` nucleotides first, RNA library writers may as conjugated
* with RNA application writers may prefer to read `codons` as `skip`.
* with RNA application writers prefer to read the `codons` reference frame as `skip`.
*
* @return A codon iterator for this RNA sequence.
*/
Expand Down
24 changes: 13 additions & 11 deletions src/test/scala/emc/rna/RNASpecification.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,10 @@ package rna
import org.scalatest.funspec.*
import org.scalatest.matchers.should.*

val fixture: RNA =
rna"CCCCC" ++ // semi-random prefix
Codon.Start.asRNA ++ // [A,U,G]
rna"AUGCCC" ++ // semi-random post-start junk rna
Codon.Stop.Amber.asRNA ++ // known amber codon, also a stop codon
rna"CCC" ++ // semi-random junk rna
Codon.Stop.Opal.asRNA ++ // known opal codon, also a stop codon
Codon.Start.asRNA ++ // start again,...
rna"CAUG" // but include [A,U,G], after just one nucleotide

class RNASpecification extends AnyFunSpec with Matchers:

import Nucleotide.*
import AminoAcid.*
import RNASpecification.*

describe("An RNA sequence"):

Expand Down Expand Up @@ -56,3 +46,15 @@ class RNASpecification extends AnyFunSpec with Matchers:
Codon(A, U, G),
Codon(C, A, U))
)

object RNASpecification:

val fixture: RNA =
rna"CCCCC" ++ // semi-random prefix
Codon.Start.asRNA ++ // [A,U,G]
rna"AUGCCC" ++ // semi-random post-start junk rna
Codon.Stop.Amber.asRNA ++ // known amber codon, also a stop codon
rna"CCC" ++ // semi-random junk rna
Codon.Stop.Opal.asRNA ++ // known opal codon, also a stop codon
Codon.Start.asRNA ++ // start again,...
rna"CAUG" // but include [A,U,G], after just one nucleotide
2 changes: 1 addition & 1 deletion src/test/scala/emc/rna/RibosomeSpecification.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import org.scalatest.matchers.should.Matchers

class RibosomeSpecification extends AnyFunSpec with Matchers:

import Nucleotide.*
import AminoAcid.*
import RNASpecification.*

// expected results at given reference frame
val expected: Map[Int, Seq[Seq[AminoAcid]]] =
Expand Down