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

Fix SNP writers related to pathlib. Refactor and document Ancestry Objects, SNPObject, and dim reduction classes #5

Merged
merged 11 commits into from
Nov 15, 2024

Conversation

miriambt
Copy link
Collaborator

No description provided.

- Rename average_strands to is_phased.
- Add common_variants_intersection to subset_to_common_variants.
- Add common_markers_intersection to subset_to_common_markers.
- Rename filename to file.
- Rename correct_snp_variants to correct_flipped_variants.
- Refine docstrings for improved clarity and consistency.
…ean_ attributes. Remove repeated properties and setters. Solve bug in SNP_PCA.ipynb
@miriambt miriambt requested a review from salcc November 15, 2024 19:51
Copy link
Member

@salcc salcc left a comment

Choose a reason for hiding this comment

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

I tried doing:

import snputils as su
input_path = "/private/groups/ioannidislab/salcc/snputils_data/bed/"
filename = "ALL.chr22.shapeit2_integrated_v1a.GRCh38.20181129.phased"
output_path = "/private/home/mcomajoa/snputils/"
snpobj = su.read_bed(input_path + filename)

and then either of these options:

  1. snpobj.save_vcf(output_path + filename)
  2. snpobj.save_bed(output_path + filename)
  3. snpobj.save_pgen(output_path + filename)

and all of them result in a different error. I think only the save_bed error is related to the changes in this PR, and I see that before the PR it also resulted in another error, but it would still be nice to have all the writers working. If you think it's too much work let me know, and I can approve this PR for the doc changes and we create another one later to fix these issues.

snputils/snp/io/write/bed.py Outdated Show resolved Hide resolved
- Fixed issue with  when handling filenames not ending in .
- Resolved unintended modification of  within the BEDWriter class by using a deep copy.
Copy link
Member

@salcc salcc left a comment

Choose a reason for hiding this comment

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

Now the path handling seems to work correctly. Thanks!

@salcc salcc merged commit 1c4bfe4 into main Nov 15, 2024
7 checks passed
@salcc salcc deleted the refactor-and-document branch November 15, 2024 23: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.

2 participants