mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
few small correction
Former-commit-id: 9319387ef5379b66e008233dbd7b6ea60b5d3b1e
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
package obiiter
|
package obiiter
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"log"
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (b BioSequenceBatch) IsPaired() bool {
|
func (b BioSequenceBatch) IsPaired() bool {
|
||||||
|
@ -182,6 +182,11 @@ func (marker *Marker) Match(sequence *obiseq.BioSequence) *DemultiplexMatch {
|
|||||||
return &m
|
return &m
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// At this point the forward primer didn't match.
|
||||||
|
// We try now with the reverse primer
|
||||||
|
//
|
||||||
|
|
||||||
start, end, nerr, matched = marker.reverse.BestMatch(aseq, marker.taglength, -1)
|
start, end, nerr, matched = marker.reverse.BestMatch(aseq, marker.taglength, -1)
|
||||||
|
|
||||||
if matched {
|
if matched {
|
||||||
|
@ -124,7 +124,7 @@ func SplitPattern(sequence *obiseq.BioSequence,
|
|||||||
matches := LocatePatterns(sequence, patterns)
|
matches := LocatePatterns(sequence, patterns)
|
||||||
|
|
||||||
from := Pattern_match{
|
from := Pattern_match{
|
||||||
name: "5extremity",
|
name: "extremity",
|
||||||
pattern: "",
|
pattern: "",
|
||||||
match: "",
|
match: "",
|
||||||
begin: 0,
|
begin: 0,
|
||||||
@ -169,10 +169,19 @@ func SplitPattern(sequence *obiseq.BioSequence,
|
|||||||
if from.name == to.name {
|
if from.name == to.name {
|
||||||
sub.SetAttribute("obisplit_group", from.name)
|
sub.SetAttribute("obisplit_group", from.name)
|
||||||
} else {
|
} else {
|
||||||
sub.SetAttribute("obisplit_group", fmt.Sprintf("%s-%s", from.name, to.name))
|
fname := from.name
|
||||||
|
tname := to.name
|
||||||
|
if tname == "extremity" {
|
||||||
|
fname, tname = tname, fname
|
||||||
|
} else {
|
||||||
|
if tname < fname && fname != "extremity" {
|
||||||
|
fname, tname = tname, fname
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sub.SetAttribute("obisplit_group", fmt.Sprintf("%s-%s", fname, tname))
|
||||||
}
|
}
|
||||||
|
|
||||||
sub.SetAttribute("obisplit_location", fmt.Sprintf("%d..%d", start, end))
|
sub.SetAttribute("obisplit_location", fmt.Sprintf("%d..%d", start+1, end))
|
||||||
|
|
||||||
sub.SetAttribute("obisplit_right_error", to.nerrors)
|
sub.SetAttribute("obisplit_right_error", to.nerrors)
|
||||||
sub.SetAttribute("obisplit_left_error", from.nerrors)
|
sub.SetAttribute("obisplit_left_error", from.nerrors)
|
||||||
@ -191,7 +200,7 @@ func SplitPattern(sequence *obiseq.BioSequence,
|
|||||||
|
|
||||||
if from.end < sequence.Len() {
|
if from.end < sequence.Len() {
|
||||||
to := Pattern_match{
|
to := Pattern_match{
|
||||||
name: "3extremity",
|
name: "extremity",
|
||||||
pattern: "",
|
pattern: "",
|
||||||
match: "",
|
match: "",
|
||||||
begin: sequence.Len(),
|
begin: sequence.Len(),
|
||||||
@ -218,9 +227,18 @@ func SplitPattern(sequence *obiseq.BioSequence,
|
|||||||
if from.name == to.name {
|
if from.name == to.name {
|
||||||
sub.SetAttribute("obisplit_group", from.name)
|
sub.SetAttribute("obisplit_group", from.name)
|
||||||
} else {
|
} else {
|
||||||
sub.SetAttribute("obisplit_group", fmt.Sprintf("%s-%s", from.name, to.name))
|
fname := from.name
|
||||||
|
tname := to.name
|
||||||
|
if tname == "extremity" {
|
||||||
|
fname, tname = tname, fname
|
||||||
|
} else {
|
||||||
|
if tname < fname && fname != "extremity" {
|
||||||
|
fname, tname = tname, fname
|
||||||
}
|
}
|
||||||
sub.SetAttribute("obisplit_location", fmt.Sprintf("%d..%d", start, end))
|
}
|
||||||
|
sub.SetAttribute("obisplit_group", fmt.Sprintf("%s-%s", fname, tname))
|
||||||
|
}
|
||||||
|
sub.SetAttribute("obisplit_location", fmt.Sprintf("%d..%d", start+1, end))
|
||||||
|
|
||||||
sub.SetAttribute("obisplit_right_error", to.nerrors)
|
sub.SetAttribute("obisplit_right_error", to.nerrors)
|
||||||
sub.SetAttribute("obisplit_left_error", from.nerrors)
|
sub.SetAttribute("obisplit_left_error", from.nerrors)
|
||||||
|
Reference in New Issue
Block a user