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

Already on GitHub? Sign in to your account

Added method to return alt. allele frequencies when there is more than o... #131

Merged
merged 3 commits into from Dec 3, 2013

Conversation

Projects
None yet
3 participants

mgymrek commented Nov 29, 2013

Added method to return a list of alt. allele frequencies when there is more than one alternate allele. This is useful at multi-allelic loci such as microsatellites, small indels, and CNVs. I modified test_aaf to check that this is working as expected.

Collaborator

martijnvermaat commented Nov 30, 2013

Thanks @mgymrek!

I have a few thoughts on this:

  1. Could you change collections.defaultdict(int) to collections.Counter?
  2. I'd prefer aaf to have a consistent return type, i.e., a list.

Of course the second point would break the current API and I assume that was also your reasoning. However, it might not be the best choice for the long term.

@jamescasbon, how do you feel about breaking the API to have aaf always return a list?

Owner

jamescasbon commented Dec 2, 2013

@martijnvermaat It probably should be a list, in that everything should be a list because ALT is, right?

Collaborator

martijnvermaat commented Dec 2, 2013

@jamescasbon Indeed, that is what I was thinking.

mgymrek commented Dec 2, 2013

@jamescasbon @martijnvermaat I agree a list makes sense for this. I edited the aaf function to use collections.Counter and return a list, and updated wherever I found aaf (test cases, README, and where it is used in nucl_diversity)

@jamescasbon jamescasbon added a commit that referenced this pull request Dec 3, 2013

@jamescasbon jamescasbon Merge pull request #131 from mgymrek/master
Added method to return alt. allele frequencies when there is more than o...
d1218a6

@jamescasbon jamescasbon merged commit d1218a6 into jamescasbon:master Dec 3, 2013

Owner

jamescasbon commented Dec 3, 2013

Merged, thanks for the PR!

@martijnvermaat martijnvermaat added a commit to martijnvermaat/PyVCF that referenced this pull request Dec 3, 2013

@martijnvermaat martijnvermaat Add dependency on collections.Counter implementation for Python 2.6
As per my suggestion in PR jamescasbon#131, defaultdict(int) was changed
to Counter(). However, I didn't realize it was only added in Python 2.7
and we target Python 2.6.

This approach follows what we already did for collections.OrderedDict.
226f56a

@gotgenes gotgenes pushed a commit to gotgenes/PyVCF that referenced this pull request May 13, 2014

@jamescasbon jamescasbon Merge pull request #131 from mgymrek/master
Added method to return alt. allele frequencies when there is more than o...
f1b1b9f

@gotgenes gotgenes pushed a commit to gotgenes/PyVCF that referenced this pull request May 13, 2014

@martijnvermaat martijnvermaat Add dependency on collections.Counter implementation for Python 2.6
As per my suggestion in PR jamescasbon#131, defaultdict(int) was changed
to Counter(). However, I didn't realize it was only added in Python 2.7
and we target Python 2.6.

This approach follows what we already did for collections.OrderedDict.
46d9a29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment