Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
9 changes: 1 addition & 8 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,8 @@
{
"name": "poly-devcontainer",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:bullseye",
"image": "mcr.microsoft.com/devcontainers/go:1.23-bookworm",

"features": {
"ghcr.io/devcontainers/features/go:1": {
"version": "latest",
"golangciLintVersion": "latest"
},
},

"extensions": ["golang.go"],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
Expand Down
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ linters:
- stylecheck
- unconvert
- unparam
- whitespace
linters-settings:
stylecheck:
# https://staticcheck.io/docs/options#checks
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- Made it possible to simulate primers shorter than design minimum.

## [0.31.1] - 2024-01-31

### Added
- Fixed package level doc strings for search and bwt packages.

[0.31.1]: https://github.com/TimothyStiles/poly/releases/tag/v0.31.0

## [0.31.0] - 2024-01-31

### Added
- Basic BWT for sub-sequence count and offset for sequence alignment. Only supports exact matches for now.
- Moved `BWT`, `align`, and `mash` packages to new `search` sub-directory.
- Implemented Run-Length Burrows Wheeler Transform.

[0.31.0]: https://github.com/TimothyStiles/poly/releases/tag/v0.31.0


## [0.30.0] - 2023-12-18
Oops, we weren't keeping a changelog before this tag!
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2023 Timothy Stiles
Copyright (c) 2024 Timothy Stiles

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (Poly)merase <img align="right" src="https://cdn.discordapp.com/attachments/766785755305213953/777596834734145546/ProfileFrameArtboard_1.png" width="100">
# (Poly)merase <img align="right" src="https://raw.githubusercontent.com/bebop/presskit/main/gopher.png" width="100">

[![PkgGoDev](https://pkg.go.dev/badge/github.com/bebop/poly)](https://pkg.go.dev/github.com/bebop/poly)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/bebop/poly/blob/main/LICENSE)
Expand Down Expand Up @@ -47,4 +47,4 @@ Poly is a Go package for engineering organisms.

* [MIT](LICENSE)

* Copyright (c) 2023 Timothy Stiles
* Copyright (c) 2024 Timothy Stiles
11 changes: 11 additions & 0 deletions fold/fold_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package fold

import (
"fmt"
"math"
"strings"
"testing"
Expand Down Expand Up @@ -201,3 +202,13 @@ func TestFold(t *testing.T) {
assert.InDelta(t, struc.energy, -4.2, 0.2)
})
}
func TestZuker_ErrorCreatingFoldingContext(t *testing.T) {
seq := "ATGGATTTAGATAGATADFQ#(RSDOFIA)"
temp := 4000.0

expectedErr := fmt.Errorf("error creating folding context: the sequence ATGGATTTAGATAGATADFQ#(RSDOFIA) is not RNA or DNA")

_, err := Zuker(seq, temp)
require.Error(t, err)
assert.Equal(t, expectedErr.Error(), err.Error())
}
43 changes: 43 additions & 0 deletions fold/seqfold_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package fold

import (
"fmt"
"math"
"testing"
)

func TestResult_MinimumFreeEnergy_LengthZero(t *testing.T) {
result := Result{} // Create a Result instance with empty structs

expectedEnergy := math.Inf(1)
actualEnergy := result.MinimumFreeEnergy()

if actualEnergy != expectedEnergy {
t.Errorf("expected energy to be %f, but got %f", expectedEnergy, actualEnergy)
}
}

func TestResult_DotBracket_LengthZero(t *testing.T) {
result := Result{} // Create a Result instance with empty structs

expectedDotBracket := ""
actualDotBracket := result.DotBracket()

if actualDotBracket != expectedDotBracket {
t.Errorf("expected dot bracket to be %s, but got %s", expectedDotBracket, actualDotBracket)
}
}

func TestNewFoldingContext_InvalidSequence(t *testing.T) {
seq := "XYZ"
temp := 37.0

_, err := newFoldingContext(seq, temp)
if err == nil {
t.Errorf("expected error, but got nil")
}
expectedError := fmt.Errorf("the sequence %s is not RNA or DNA", seq)
if err.Error() != expectedError.Error() {
t.Errorf("expected error message to be %q, but got %q", expectedError.Error(), err.Error())
}
}
Loading
Loading