an alternative "join" option for annotated-vcf handling in trios
1
0
Entering edit mode
6.2 years ago
emmanouil.a ▴ 120

Server Linux, Bash 4.2.25

Hi,

I'm using this code to handle annotated-vcf files in trios:

join -t "`echo -e "\t"`" -e ND -a1  FILE1 FILE2 > OUTPUT

example:

FILE1 (space = tab)
chr1_11086439_11086439_C_T aaa,asf
chr1_11086717_11086717_A_G dad,ada
chr1_11087524_11087524_G_A asd,thh

FILE2 (space = tab)
chr1_11086439_11086439_C_T 1:1:1
chr1_11087524_11087524_G_A  2:2:2

OUTPUT (space = tab)
chr1_11086439_11086439_C_T aaa,asf 1:1:1
chr1_11086717_11086717_A_G dad,ada ND
chr1_11087524_11087524_G_A asd,thh 2:2:2

Considering that I have some times "sorting" problems, however my input files are already sorted !!! ...

I'm looking for an another code to do the same job! ... any suggestion?

All the best

trio vcf • 1.3k views
ADD COMMENT
0
Entering edit mode

what is

"sorting" problems

? how did you sort those files ?

ADD REPLY
0
Entering edit mode

you flagged this post with 'vcf', how about merging the VCF using a standard tool like "gatk combinevariants" ?

ADD REPLY
0
Entering edit mode

I sorted my files according to the first column (chr_start_end_ref_alt)... and some times the script works well and other time no... :-/

Ok, I will try with gatk and I will let you know, thank!

ADD REPLY
0
Entering edit mode

how did you sort those files ? show me the cmd line please.

ADD REPLY
0
Entering edit mode

just using the sort command

sort sample1 > FILE1

ADD REPLY
0
Entering edit mode

join -t "echo -e "\t""

join -t $'\t'

or use Ctrl-V + tab to insert a tab

ADD REPLY
0
Entering edit mode
6.2 years ago

sort sample1 > FILE1

this is just wrong.

sort -t $'\t' -k1,1 sample1 > FILE1

and better:

LC_ALL=C sort -t $'\t' -k1,1 sample1 > FILE1
LC_ALL=C sort -t $'\t' -k1,1 sample2 > FILE2
LC_ALL=C join -t $'\t' -1 1 -2 1 FILE1 FILE2
ADD COMMENT
0
Entering edit mode

many thanks! I will try and I let you know ^_*

ADD REPLY

Login before adding your answer.

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