Question: How to separate chrY from a WGS vcf file?
0
gravatar for krt
5 weeks ago by
krt0
krt0 wrote:

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?

bam yfull dantelabs tabix wgs • 172 views
ADD COMMENTlink modified 5 weeks ago • written 5 weeks ago by krt0
1

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 REPLYlink written 5 weeks ago by Pierre Lindenbaum120k

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 REPLYlink modified 4 weeks ago • written 4 weeks ago by krt0
2

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 REPLYlink modified 4 weeks ago • written 4 weeks ago by Pierre Lindenbaum120k

Tabix listed from chr1 to chr22 plus chrX and chrY

ADD REPLYlink written 4 weeks ago by krt0

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 REPLYlink written 4 weeks ago by krt0
1

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

ADD REPLYlink written 4 weeks ago by jared.andrews072.3k

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 REPLYlink written 4 weeks ago by krt0
1

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 REPLYlink modified 4 weeks ago • written 4 weeks ago by Pierre Lindenbaum120k
1

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 REPLYlink written 4 weeks ago by jared.andrews072.3k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1053 users visited in the last hour