Adds a reader for NGS filter files and change some API for the apat library

This commit is contained in:
2022-01-18 13:09:32 +01:00
parent 6571296bb2
commit 4551df08b1
13 changed files with 301 additions and 96 deletions

View File

@@ -0,0 +1 @@
package obimultiplex

View File

@@ -10,12 +10,18 @@ import (
// obiseq.BioSequenceBatch containing the selected amplicon sequences.
func PCR(iterator obiseq.IBioSequenceBatch) (obiseq.IBioSequenceBatch, error) {
forward := ForwardPrimer()
reverse := ReversePrimer()
opts := make([]obiapat.WithOption, 0, 10)
opts = append(opts, obiapat.OptionForwardError(AllowedMismatch()),
obiapat.OptionReverseError(AllowedMismatch()))
opts = append(opts,
obiapat.OptionForwardPrimer(
ForwardPrimer(),
AllowedMismatch(),
),
obiapat.OptionReversePrimer(
ReversePrimer(),
AllowedMismatch(),
),
)
if MinLength() > 0 {
opts = append(opts, obiapat.OptionMinLength(MinLength()))
@@ -29,7 +35,7 @@ func PCR(iterator obiseq.IBioSequenceBatch) (obiseq.IBioSequenceBatch, error) {
opts = append(opts, obiapat.OptionCircular(Circular()))
}
worker := obiapat.PCRSliceWorker(forward, reverse, opts...)
worker := obiapat.PCRSliceWorker(opts...)
return iterator.MakeISliceWorker(worker), nil
}