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

Exporting genotype to a file #348

Open
vappiah opened this issue Jan 27, 2021 · 3 comments
Open

Exporting genotype to a file #348

vappiah opened this issue Jan 27, 2021 · 3 comments

Comments

@vappiah
Copy link

vappiah commented Jan 27, 2021

Is there a way to save genotype data structure to a file for furthur processing in allel?

I will like to generate manhattan plot and the tool requires data to be in the genotype format. Please find attached a sample of the expected output

geno

@hardingnj
Copy link
Collaborator

Hi @vappiah. This looks like you need uncompressed VCF?

Can you describe your workflow in a bit more detail- and hopefully we can help. ie:

  • what is your starting format for variation data
  • how are you using allel to process it?
  • is the output file you need VCF?

PS This issue tracker is for bugs; user queries should be directed to: [email protected]

@vappiah
Copy link
Author

vappiah commented Jan 31, 2021

Hi @hardingnj . My starting format is a vcf file generated using gatk pipeline. Using allel, I first convert to h5 format, open the h5 and create the genotypechunked array. So what I want is to save the genotypechunkedarray to another file and use that for downstream analysis. But I am yet to find a function in allel that can do the export. Below is the code

callset=h5py.File(h5,mode='r')
calldata = callset['calldata']
genotype = allel.GenotypeChunkedArray(callset['calldata/GT'])

@hardingnj
Copy link
Collaborator

Hi-

There is no function in scikit-allel to generate .geno files, or other text files. I would suggest using something like: https://vcftools.github.io/man_latest.html to convert between text-based formats.

Alternatively- it would be fairly straightforward to loop though rows and write the columns required by the tool to a file.

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

No branches or pull requests

2 participants