mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-12-08 16:50:27 +00:00
new --version option and qualities method in obiscript
Former-commit-id: 7b0ce2901785d5c7494dec3a7a95d1fc5dc4a52b
This commit is contained in:
@@ -48,6 +48,7 @@ func newObiSeq(luaState *lua.LState) int {
|
||||
var bioSequenceMethods = map[string]lua.LGFunction{
|
||||
"id": bioSequenceGetSetId,
|
||||
"sequence": bioSequenceGetSetSequence,
|
||||
"qualities": bioSequenceGetSetQualities,
|
||||
"definition": bioSequenceGetSetDefinition,
|
||||
"count": bioSequenceGetSetCount,
|
||||
"taxid": bioSequenceGetSetTaxid,
|
||||
@@ -99,6 +100,29 @@ func bioSequenceGetSetSequence(luaState *lua.LState) int {
|
||||
return 1
|
||||
}
|
||||
|
||||
func bioSequenceGetSetQualities(luaState *lua.LState) int {
|
||||
s := checkBioSequence(luaState)
|
||||
if luaState.GetTop() == 2 {
|
||||
ud := luaState.CheckAny(2)
|
||||
|
||||
//
|
||||
// Perhaps the code needs some type checking on ud.Value
|
||||
// It's a first test
|
||||
//
|
||||
|
||||
if v, ok := ud.(*lua.LTable); ok {
|
||||
s.SetQualities(Table2ByteSlice(luaState, v))
|
||||
return 0
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
value := []byte(s.Qualities())
|
||||
pushInterfaceToLua(luaState, value)
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
func bioSequenceGetSetDefinition(luaState *lua.LState) int {
|
||||
s := checkBioSequence(luaState)
|
||||
if luaState.GetTop() == 2 {
|
||||
|
||||
Reference in New Issue
Block a user