[go: nahoru, domu]

Skip to content

Commit

Permalink
try out new manifest methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ctb committed Apr 30, 2023
1 parent d05d83e commit c116776
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/sourmash/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,32 @@ def __contains__(self, ss):
def to_picklist(self):
"Convert manifest to a picklist."

def ksizes(self):
"Return a set of all k-mer sizes 'ksize' in this manifest"
return set(( row['ksize'] for row in self.rows ))

def moltypes(self):
"Return a set of all moltypes in this manifest"
return set(( row['moltypes'] for row in self.rows ))

def any_num(self):
for row in self.rows:
if row['num'] != 0:
return True
return False

Check warning on line 226 in src/sourmash/manifest.py

View check run for this annotation

Codecov / codecov/patch

src/sourmash/manifest.py#L225-L226

Added lines #L225 - L226 were not covered by tests

def any_scaled(self):
for row in self.rows:
if row['scaled'] != 0:
return True
return False

Check warning on line 232 in src/sourmash/manifest.py

View check run for this annotation

Codecov / codecov/patch

src/sourmash/manifest.py#L231-L232

Added lines #L231 - L232 were not covered by tests

def any_abundance(self):
for row in self.rows:
if row['with_abundance']:
return True
return False

Check warning on line 238 in src/sourmash/manifest.py

View check run for this annotation

Codecov / codecov/patch

src/sourmash/manifest.py#L237-L238

Added lines #L237 - L238 were not covered by tests


class CollectionManifest(BaseCollectionManifest):
"""
Expand Down

0 comments on commit c116776

Please sign in to comment.