Randomly pick variants from VCF file for 10000 iteration
1
0
Entering edit mode
2.1 years ago

Hi ,

I have a multisample VCF file containing nearly 6k variants. I want to pick randomly 1 variant at each iteration from total 10000 iteration and check whether this variant is present in another two vcf file. If its present in first vcf file and not in the second one, how I can count them?

VCF • 1.4k views
ADD COMMENT
0
Entering edit mode

Hi! What is the question exactly? How to pick a random variant in a VCF? How to make an iteration? How to find a variant in a VCF? How to count the matches?

ADD REPLY
0
Entering edit mode

Yes. Kind of all of them

ADD REPLY
0
Entering edit mode

What exactly does it mean for the VCF to have a variant? That one or more samples have the variant? Why not just combine these VCF files and count samples that are not 0/0 or ./.?

ADD REPLY
0
Entering edit mode

It would be a great help if you please share a pseudocode for this.

ADD REPLY
1
Entering edit mode
2.1 years ago

1) extract the intervals with bcftools query 2) run a loop on the intervals file , pipe in shuf 3) for each random interval , search the variant with bcftools view

ADD COMMENT
0
Entering edit mode

As I am a newbee in Bioinformatics. Can you please suggest a code?

ADD REPLY
0
Entering edit mode

It would be a great help if you please share a pseudocode for this.

ADD REPLY

Login before adding your answer.

Traffic: 1465 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