Entering edit mode
10.6 years ago
hosseinv
▴
20
Hi,
I want to replace the values of the two fields (CHROM and POS) of my vcf file with their corresponding values in a txt file containing only these two columns.
An example of my vcf file (simplified):
##fileformat=VCFv4.1
##filedate=20140505
##INFO=<ID=DP,...
##...
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT NH0001
CHROM-A-g11-0015-147754-150523 207 - - - - - - - 0/0
CHROM-A-g11-0015-147754-150523 241 - - - - - - - 0/0
CHROM-B-g11-0017-150523-151267 53 - - - - - - - 0/1
And my txt file:
#CHROM POS
A 147961
A 147995
B 150576
Can anyone tell me how to do the replacing?
Thank you!
Hossein
Thank you Dariober.
This is working good enough. I am wondering what if I want to change only one field, say ID field where I have its correct values in a text file of one column?
Thanks again
Hossein