mirror of
https://github.com/metabarcoding/obitools4.git
synced 2026-11-09 17:24:41 +00:00
Add a reverse complement worker
This commit is contained in:
1 parent
935fc31982
commit
d9c18ab0b5
2 files changed
+17
-1
No files matched your search
@@ -1,6 +1,6 @@
|
||||
package obiseq
|
||||
|
||||
// ".ABCDEFGHIJKLMNOPQRSTUVWXYZ#![]"
|
||||
// ".ABCDEFGHIJKLMNOPQRSTUVWXYZ#![]"
|
||||
var __revcmp_dna__ = []byte(".TVGHEFCDIJMLKNOPQYSAABWXRZ#!][")
|
||||
|
||||
// Reverse complements a DNA sequence.
|
||||
@@ -20,5 +20,13 @@ func (sequence *BioSequence) ReverseComplement(inplace bool) *BioSequence {
|
||||
j++
|
||||
}
|
||||
|
||||
if sequence.HasQualities() {
|
||||
s := sequence.qualities
|
||||
for i, j := sequence.Length()-1, 0; i >= j; i-- {
|
||||
s[j], s[i] = s[i], s[j]
|
||||
j++
|
||||
}
|
||||
}
|
||||
|
||||
return sequence
|
||||
}
|
||||
Reference in new issue
Block a user