This is a test version of Biostars. For the public version, visit https://www.biostars.org.
HOW EDIT VCF FILE COLUMNS

I want to change position column in vcf files. Please tell me any script or tool which solve the following issues. I am new in programming

If I have a vcf file like this

pos ref alt
1 C G
2 A T
3 C G
4 T C
5 G C
6 T A
7 T G
8 C T
9 A C
10 C A

Now I want to add some value in vcf positions values untill ending position come like add 10 into position values until 15 then move next value 18 and add until 25 come

10-15
18-25
40-50

I want output like this

pos ref alt
11 C G
12 A T
13 C G
14 T C
15 G C (when 15 come it stops addition and move next value)
24 T A
25 T G (second ending position come now move next)
48 C T
49 A C
50 C A

Please give me any idea about it

Thanks

vcf perl snp

Hello misbahabas!

We believe that this post does not fit the main topic of this site.

Closed until you address your previous questions. See Pierre's comment here: C: HOW EDIT VCF FILE COLUMNS

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

1 answer

You're not editing VCF fields here, you're restricting the regions on which variant calling is being done by providing intervals to skip. Each variant caller has provisions to call variants on only certain intervals, see GATK-HaplotypeCaller's -L flag for example.

If you already have the VCF output, you can also filter it and restrict it to certain intervals. See GATK's SelectVariants with the -L flag. You should be able to invert the selection criteria to exclude intervals - you might want to experiment a little on that.

As a sidenote, editing VCF fields is a bad idea. You do not want to mess with the data format of a file that many (tools and people) assume to follow a standard format. As another sidenote, you should phrase your question title better. Using all caps without good cause/absolute necessity is a strict no-no on professional/scientific forums.

I want to annotate variants in cds of gene in two species, I have a only coding sequences. i use snpeff to annotate now i want to convert cds variants position into gnomic coordinates. thats why i want to replace column of position in vcf with genomic coordinates positions. So i need above output

Log in to answer this question.