KalinNonchev / gnomAD_DB

This package scales the huge gnomAD files to a SQLite database, which is easy and fast to query. It extracts from a gnomAD vcf the minor allele frequency for each variant.
MIT License
35 stars 10 forks source link

Simultaneously upload gnomAD v4.0.0 wgs and wes file #26

Closed heomanism closed 9 months ago

heomanism commented 9 months ago

Helllo, I want to use combined values in gnomAD v4.0.0 (wgs & wes) file.

Is there any method for doing this ?

KalinNonchev commented 9 months ago

Hello @heomanism,

Thank you for your question. You can download both WGS and WES and query them together and concatenate the output. Something like:

database_location_WGS = "database_location_WGS"
database_location_WES = "database_location_WES"
db_WGS = gnomAD_DB(database_location_WGS, gnomad_version="v4")
db_WES = gnomAD_DB(database_location_WES, gnomad_version="v4")

res_WGS = db_WGS.get_info_from_str("21:9825790:C>T", "AF")
res_WES = db_WES.get_info_from_str("21:9825790:C>T", "AF")

pandas.merge([res_WGS, res_WES]) # please adjust this, probably you would have to rename values
heomanism commented 9 months ago

Thank you for quick answer :)

However, I want values the sum of the WGS and WES results, like the Total column in this image!

If not available, I will calculate it based on your code for each value :)

image

KalinNonchev commented 9 months ago

You'll need to calculate it on your own. Thank you for the question, and please don't hesitate to reopen or raise new issues if you have more questions.

heomanism commented 9 months ago

Hello, @KalinNonchev .

I try to calculate allele frequency in each ancestry using WGS + WES data.

But, I need allele number of each ancestry, but gnomAD_DB give me only allle frequency(AF) of each ancestry only.