Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dist #34

Merged
merged 9 commits into from
May 28, 2019
Merged

Dist #34

merged 9 commits into from
May 28, 2019

Conversation

standage
Copy link
Member

@standage standage commented May 27, 2019

This update enables more seamless comparisons between simulated and observed genotypes, both at the Python level and the CLI. The mixture module can now also output a BED file containing genotype data from all contributors to enable equality and distance comparisons. Closes #33.

@codecov-io
Copy link

codecov-io commented May 27, 2019

Codecov Report

Merging #34 into master will increase coverage by 0.6%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #34     +/-   ##
=========================================
+ Coverage   93.11%   93.71%   +0.6%     
=========================================
  Files          19       19             
  Lines         668      700     +32     
  Branches      120      128      +8     
=========================================
+ Hits          622      656     +34     
  Misses         39       39             
+ Partials        7        5      -2
Impacted Files Coverage Δ
microhapulator/mixture.py 100% <100%> (ø) ⬆️
microhapulator/cli/dist.py 100% <100%> (ø) ⬆️
microhapulator/dist.py 100% <100%> (+9.09%) ⬆️
microhapulator/genotype.py 100% <100%> (ø) ⬆️
microhapulator/cli/mixture.py 100% <100%> (ø) ⬆️

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 b31b6b6...384de76. Read the comment docs.

'gt1', help='genotype data (in JSON format) for individual 1'
'-p', '--ploidy', type=int, metavar='PLD', default=2,
help='for simulated genotypes, the number of distinct haplotypes '
'present in the sample; default is 2 (for a single diploid genotype)'
Copy link
Member Author

Choose a reason for hiding this comment

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

It should be possible to infer the ploidy automatically when populating SimulatedGenotype objects from BED data. I don't like having to state this explicitly, but we'll leave it in for now.

if locus in gt2.data:
allele2 = gt2.data[locus]['genotype']
allele1 = gt1.alleles(locus)
allele2 = gt2.alleles(locus)
Copy link
Member Author

Choose a reason for hiding this comment

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

Updated the SimulatedGenotype and ObservedGenotype classes so that their alleles() and loci() methods perform identically to take advantage of duck typing.

@standage standage merged commit 2e53822 into master May 28, 2019
@standage standage deleted the dist branch May 28, 2019 13:42
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.

Enable comparison of simulated and observed genotypes via CLI
2 participants