How to separate chrY from a WGS vcf file?
0
0
Entering edit mode
5.0 years ago
krt • 0

I need to separate only chromY from my "wgs.vcf.gz", I tried the Tabix solution posted here: How to split vcf file by chromosome? However it resulted in a final chrY.vcf file with 0kb size. I've successfully done it for chr2.vcf getting a file with 73,000kb size. What would be the best way to do it for chrY?

tabix dantelabs wgs yfull bam • 2.5k views
ADD COMMENT
1
Entering edit mode

what was the command line ? are you sure you have chrY (or just 'Y' ?) in the VCF ? did you ask tabix to also print the header ?

ADD REPLY
0
Entering edit mode

Hi Pierre, I am not sure having the chrY in VCF I just supposed it because it's a WGS file from dantelabs. I used:

  • bgzip -c myvcf.vcf > myvcf.vcf.gz
  • tabix -p vcf myvcf.vcf.gz
  • tabix myvcf.vcf.gz chrY > chrY.vcf
ADD REPLY
2
Entering edit mode

Hi Pierre, I am not sure having the chrY in VCF

tabix --list-chroms  myvcf.vcf.gz

or

gunzip -c myvcf.vcf.gz | grep -v "#" | cut -f1 | uniq

it resulted in a final chrY.vcf file with 0kb size.

tabix --print-header myvcf.vcf.gz chrY > chrY.vcf
ADD REPLY
0
Entering edit mode

Tabix listed from chr1 to chr22 plus chrX and chrY

ADD REPLY
0
Entering edit mode

I did a re-run of: tabix myvcf.vcf.gz chrY > chrY and now I have got a file with 649kb. Does it seam alright?

ADD REPLY
1
Entering edit mode

Look at the file and see if it worked, why are you asking us?

ADD REPLY
0
Entering edit mode

Because I have no idea how many snps i should expect from this type of test. I don't know if 649kb is a reasonable size. If you can't answer, just ignore it.

ADD REPLY
1
Entering edit mode

If you can't answer, just ignore it.

but, as said @jared.andrews07, why don't you look in the vcf and check that there are only variants mapped on chrY ? why don't you check that this number if the number expected from your original vcf ?

ADD REPLY
1
Entering edit mode

We have no idea if that's an appropriate size or not - we know nothing about the size of your original VCF. We literally can't answer that - only you can. I'm honestly not trying to be a jerk, I just don't know how you expect us to verify something like that. Check the file and see if they're all chrY records. If so, it worked. If not, it didn't.

ADD REPLY

Login before adding your answer.

Traffic: 1693 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6