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

Consider refactoring genotype column #45

Open
apriha opened this issue Nov 28, 2019 · 6 comments
Open

Consider refactoring genotype column #45

apriha opened this issue Nov 28, 2019 · 6 comments
Labels
enhancement New feature or request

Comments

@apriha
Copy link
Owner

apriha commented Nov 28, 2019

Currently, snps normalizes data into a dataframe with four columns named rsid, chrom, pos, and genotype.

genotype can either be np.nan or a string of length 1 or 2. For autosomal SNPs and the X chromosome, the genotype is always a length 2 string. See #43.

The Y chromosome and mtDNA alleles are often strings of length 1; however, SNPs in the pseudoautosomal region on the X and Y chromosomes often have two alleles reported.

So, to better handle various numbers of alleles reported for the X, Y, and mtDNA chromosomes, consider refactoring the genotype column into allele1 and allele2.

Note that this would also more naturally support phased genotypes (vs. indexing a length 2 string genotype), wherein allele1 could be alleles on one chromosome, and allele2 could be alleles on the other. See #44.

@apriha
Copy link
Owner Author

apriha commented Nov 28, 2019

Hi @willgdjones, what are your thoughts on this?

@willgdjones
Copy link
Contributor

This seems like a sensible approach 👍 . We have just encountered the issue you describe in #43 ourselves in fact with Sano genotype data files where the X chromosome is duplicated for male samples.

@willgdjones
Copy link
Contributor

Hi @apriha - were you in the midst of tackling this? This is functionality that will be soon be important for us so I'm considering jumping in on this.

@willgdjones
Copy link
Contributor

In fact - it is more #43 that is directly relevant for us so I will look to fix that first.

@apriha
Copy link
Owner Author

apriha commented Dec 6, 2019

Hey @willgdjones , I started looking at this as part of #44 and plan to push some parsing updates related to this soon.

I was just thinking - perhaps for backwards compatibility, we can also on the fly optionally generate the current data frame structure (i.e., with the genotype column as described above) when requested, while using allele1 and allele2 in the underlying structure.

@willgdjones
Copy link
Contributor

I like that suggestion about keeping the genotype column for backward compatibility.

@apriha apriha added the enhancement New feature or request label Dec 20, 2019
apriha pushed a commit that referenced this issue Aug 24, 2022
handle unusual 23andme files with missing values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants