Skip to content

Comments

Improvements af#22

Merged
Ale-pinto-alba merged 15 commits intodevelopfrom
improvements-af
Apr 1, 2025
Merged

Improvements af#22
Ale-pinto-alba merged 15 commits intodevelopfrom
improvements-af

Conversation

@Ale-pinto-alba
Copy link
Collaborator

  • Create a method to get the allele frequency from the GnomAD's VCF file. Usually, the alleles frequencies are in a tuple of an unique float, but there could be a list, so I tried to manage all the possibilities, even if it does not have an AF (None).

  • Change the assertions to exceptions in the prepare_alt_seq function. I think the past AssertionError was too prohibitive and when I was plotting the results, I found impossible to continue with them. So, I thought it handling them as ExceptionError was a better way to proceed.

  • Make personalized errors messages for better readability and update corresponding error test.

@Ale-pinto-alba Ale-pinto-alba requested a review from ielis March 13, 2025 14:47
Copy link
Collaborator

@ielis ielis left a comment

Choose a reason for hiding this comment

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

Hi,

thanks a lot for the code!

I have two comments, please see below. The get_allele_frequency might need to be updated, and pls consider the other comment as well. Apart from these issues, the code looks good to me.

@Ale-pinto-alba
Copy link
Collaborator Author

Yes, I agree with you.

On the one hand, I decided to go through the possible alternatives alleles in case there is more than one, keeping the index stored and then splicing the corresponding AF tuple with it. I am assuming the AFs are in the same order as the alleles alts.

On the other hand, I created a separate function to check the errors separately, I kept the Reference alleles do not match in the function because I think it is easier this way and I consider it should be checked too because there are some variants that don't fit.

@Ale-pinto-alba
Copy link
Collaborator Author

It's true that can induce bugs, I didn't realize, so I just kept the second part of the method. Making sure that the alternative allele given in the VariantCoordinates is in the VCF file, independently if it is a tuple with only one alternative allele or with several. Therefore, returning the corresponding AF.

@Ale-pinto-alba Ale-pinto-alba merged commit d11ae5c into develop Apr 1, 2025
1 check passed
@Ale-pinto-alba Ale-pinto-alba deleted the improvements-af branch April 11, 2025 13:19
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