Skip to content

Finish Variant Class - #2326

Merged
mergify[bot] merged 1 commit into
tskit-dev:mainfrom
benjeffery:finish_variant
Jun 9, 2022
Merged

mergify[bot] merged 1 commit into
tskit-dev:mainfrom
benjeffery:finish_variant

Conversation

@benjeffery

Copy link
Copy Markdown
Member

Fixes #2176

@codecov

codecov Bot commented Jun 8, 2022 •

Copy link
Copy Markdown

Codecov Report

Merging #2326 (e585667) into main (afd63ac) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2326   +/-   ##
=======================================
  Coverage   93.30%   93.30%           
=======================================
  Files          28       28           
  Lines       26510    26553   +43     
  Branches     1211     1213    +2     
=======================================
+ Hits        24734    24776   +42     
- Misses       1744     1745    +1     
  Partials       32       32           
Flag Coverage Δ
c-tests 92.32% <ø> (ø)
lwt-tests 89.05% <ø> (ø)
python-c-tests 71.38% <76.74%> (+0.02%) ⬆️
python-tests 98.86% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
python/_tskitmodule.c 90.71% <100.00%> (+0.05%) ⬆️
python/tskit/genotypes.py 98.46% <100.00%> (+0.46%) ⬆️
python/tskit/metadata.py 98.76% <0.00%> (-0.25%) ⬇️
python/tskit/trees.py 98.11% <0.00%> (-0.06%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update afd63ac...e585667. Read the comment docs.

@benjeffery
benjeffery force-pushed the finish_variant branch 3 times, most recently from 776db74 to 88c10f6 Compare June 9, 2022 11:51
@benjeffery benjeffery changed the title WIP - Finish Variant Class Finish Variant Class Jun 9, 2022
@benjeffery
benjeffery marked this pull request as ready for review June 9, 2022 11:56
@benjeffery

Copy link
Copy Markdown
Member Author

Getting some codecov weirdness here, I'm sure the lines are covered that it says aren't.

@jeromekelleher jeromekelleher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, few minor comments.

Comment thread python/tests/test_lowlevel.py Outdated

def test_isolated_as_missing(self):
ts = self.get_example_tree_sequence()
v = _tskit.Variant(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Odd formatting here?

Comment thread python/tskit/genotypes.py Outdated
After creation a Variant is not yet decoded, and has no genotypes.
To decode a Variant, call the :meth:`decode` method. The Variant class will then
use a Tree, internal to the Variant, to seek to the position of the site and decode
the genotypes at that site. As such it is currently much more efficient to decode

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'll always be more efficient to do it this way, indexes will just make it less inefficient to randomly seek. I'd say "It is therefore much more efficient to sites in sequential genomic order, either in a forwards or backwards direction, than to do so randomly".

Comment thread python/tskit/genotypes.py Outdated
samples at the current site.
"""
return self._ll_variant.alleles[-1] is None
return (

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is creating the alleles tuple twice I guess? This gets called a lot, so makes sense to keep it tight.

@benjeffery

Copy link
Copy Markdown
Member Author

Fixed the comments, thanks!

@mergify
mergify Bot merged commit b97c6f1 into tskit-dev:main Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Variant.decode to Python API

2 participants