bcftools view remove (.) id
0
0
Entering edit mode
2.1 years ago

Hello I have a txt file that consists from CHROM,ID,POS, REF and ALT ( 48 variants ) I want to subset this txt with original VCF to make a new VCF I try to use bcftools using this query

bcftools view -T variants.txt mydata.vcf > variant1.vcf

but the problem , I have 4 variants in txt that don't have ID ( The ID of them = . ) and bcftools delete this 4 variants ( So my new VCF = 44 variants )

how can I save this 4 variants and don't delete them , So, my new VCF must be 48?

Thanks.

Refresh : I try to make my txt file consists from CHROM and POS only and try this code :

bcftools view -R variants.txt mydata.vcf.gz > variant1.vcf

but the results : I get 60 variants (+12 variants) I guess ( but I'm not sure ) it add also any variants between 2 number that I really want. for example : ch3 have 2 locations :14933179 and 195781647 but when I do bcftools view -R , it have 8 locations: 14933179, 195781570, 195781607, 195781618 , 195781619 , 195781628 ,195781635 and 195781647

So , how can I print just my 48 variants without adding or losing :) ?

bcftools • 1.2k views
ADD COMMENT
0
Entering edit mode

What if you just use the CHROM and POS columns of your text file with -R parameter instead of -T?

ADD REPLY
0
Entering edit mode

now I try, but it give me 60 variants! ( +12 variants ) ? what is the problem?

ADD REPLY
0
Entering edit mode

I want to try but there is another problem -R requires .vcf.gz and I have .vcf.gz.tbi , I want to uncompress .tbi to try thee query .. How can I uncompress .vcf.gz.tbi to .vcf.gz?

tbi is the associated index file. IMHO You'd better read the manual to have a clear view of what if an indexed vcf file

ADD REPLY
0
Entering edit mode

I'm finish this problem now, and I get ".vcf.gz" and I also bcftools view -R but the problem it appear 60 variants (+12 what I want ) .. I guess ( but I'm not sure ) it add also any variants between 2 number that I want. for example : ch3 have 2 locations :14933179 and 195781647 but when I do bcftools view -R , it have 8 locations: 14933179, 195781570, 195781607, 195781618 , 195781619 , 195781628 ,195781635 and 195781647. So, how can I avoid this problem?

ADD REPLY

Login before adding your answer.

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