First complete version of obimultiplex2

Former-commit-id: 170593bd597c7914d3f1fd3d2b865186d7f11966
This commit is contained in:
Eric Coissac
2024-06-06 23:11:13 +02:00
parent 985c91452a
commit 1b43fa4247
9 changed files with 778 additions and 165 deletions

View File

@ -3,7 +3,6 @@ package obingslibrary
import (
"errors"
"fmt"
"strings"
log "github.com/sirupsen/logrus"
@ -26,24 +25,12 @@ type DemultiplexMatch struct {
Error error
}
func (library *NGSLibrary) Compile(maxError int, allowsIndel bool) error {
for primers, marker := range library.Markers {
err := marker.Compile(primers.Forward,
primers.Reverse,
maxError, allowsIndel)
if err != nil {
return err
}
}
return nil
}
func (library *NGSLibrary) Match(sequence *obiseq.BioSequence) *DemultiplexMatch {
for primers, marker := range library.Markers {
m := marker.Match(sequence)
if m != nil {
m.ForwardPrimer = strings.ToLower(primers.Forward)
m.ReversePrimer = strings.ToLower(primers.Reverse)
m.ForwardPrimer = primers.Forward
m.ReversePrimer = primers.Reverse
return m
}
}