mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
refactoring of the file chunck writing
This commit is contained in:
@ -16,11 +16,12 @@ import (
|
||||
//
|
||||
// Returns:
|
||||
// - A set of strings containing the keys of the BioSequence attributes.
|
||||
func (s *BioSequence) AttributeKeys(skip_container bool) obiutils.Set[string] {
|
||||
func (s *BioSequence) AttributeKeys(skip_container, skip_definition bool) obiutils.Set[string] {
|
||||
keys := obiutils.MakeSet[string]()
|
||||
|
||||
for k, v := range s.Annotations() {
|
||||
if !skip_container || !obiutils.IsAContainer(v) {
|
||||
if !((skip_container && obiutils.IsAContainer(v)) ||
|
||||
(skip_definition && k == "definition")) {
|
||||
keys.Add(k)
|
||||
}
|
||||
}
|
||||
@ -38,8 +39,8 @@ func (s *BioSequence) AttributeKeys(skip_container bool) obiutils.Set[string] {
|
||||
//
|
||||
// Returns:
|
||||
// - A set of strings containing the keys of the BioSequence.
|
||||
func (s *BioSequence) Keys(skip_container bool) obiutils.Set[string] {
|
||||
keys := s.AttributeKeys(skip_container)
|
||||
func (s *BioSequence) Keys(skip_container, skip_definition bool) obiutils.Set[string] {
|
||||
keys := s.AttributeKeys(skip_container, skip_definition)
|
||||
keys.Add("id")
|
||||
|
||||
if s.HasSequence() {
|
||||
|
@ -150,11 +150,11 @@ func (s BioSequenceSlice) Size() int {
|
||||
return size
|
||||
}
|
||||
|
||||
func (s BioSequenceSlice) AttributeKeys(skip_map bool) obiutils.Set[string] {
|
||||
func (s BioSequenceSlice) AttributeKeys(skip_map, skip_definition bool) obiutils.Set[string] {
|
||||
keys := obiutils.MakeSet[string]()
|
||||
|
||||
for _, k := range s {
|
||||
keys = keys.Union(k.AttributeKeys(skip_map))
|
||||
keys = keys.Union(k.AttributeKeys(skip_map, skip_definition))
|
||||
}
|
||||
|
||||
return keys
|
||||
|
Reference in New Issue
Block a user