column modifications related to SNP
1
0
Entering edit mode
6 weeks ago
rheab1230 ▴ 20

This is my dataset: chr1_KI270706v1_random,153401,rs867658023,chr1_KI270706v1_random_153401 chr1_KI270706v1_random,154751,rs1030747857,chr1_KI270706v1_random_154751 chr1_KI270706v1_random,156703,rs900345029,chr1_KI270706v1_random_156703 chr1_KI270706v1_random,156856,rs576837150,chr1_KI270706v1_random_156856 I actually want it to be like:

chr1,153401,rs1867658023,chr1_153401

Basically I want to remove the extra value like KI_random from column 1 and column 4. I tried this command but I am not getting the desired output:

awk 'NR >1 {split($1, array, ""); print array[1] "" array[2]; split($2, array, ""); print array[1] "_" array[2]}' outfile > rsid.csv
modify snp vcf • 184 views
ADD COMMENT
3
Entering edit mode
6 weeks ago
sed 's/_KI270706v1_random//g'
ADD COMMENT
0
Entering edit mode

Thank you so much. It worked.

ADD REPLY

Login before adding your answer.

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