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

Add support for alternative chromosome styles #158

Merged
merged 1 commit into from
Jul 13, 2023
Merged

Add support for alternative chromosome styles #158

merged 1 commit into from
Jul 13, 2023

Conversation

mykmal
Copy link
Contributor

@mykmal mykmal commented Jul 13, 2023

This update replaces the rmv_chrPrefix parameter in format_sumstats() with a chr_style parameter, as discussed in PR https://github.com/neurogenomics/MungeSumstats/pull/157.

The new chr_style parameter supports all four of the chromosome naming styles available in GenomeInfoDb (NCBI, UCSC, dbSNP, and Ensembl), with Ensembl being the default. Thus, the default setting matches the previous default behavior of MSS while more robustly handling improperly-formatted chromosome names. I have also updated all relevant documentation, vignettes, and tests.

The updated functions worked as expected on my GWAS, but it would be great if you can also double-check the code.

Note that the chr_check() function now serves to standardize chromosome names to the default Ensembl/NCBI style and remove SNPs on nonstandard or user-specified chromosomes. Chromosome name mapping to chr_style, on the other hand, is performed directly in format_sumstats() right before the final summary statistics data.table is written to disk. This order of operations is necessary because several of the checks that come after chr_check() (e.g. liftover) expect chromosome names to be formatted according to the default Ensembl/NCBI style, and I did not want to modify them.

@Al-Murphy Al-Murphy merged commit 7867c01 into Al-Murphy:master Jul 13, 2023
@Al-Murphy
Copy link
Owner

This all looks good to me! Thanks again for all the work on this!

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.

3 participants