Question: an alternative "join" option for annotated-vcf handling in trios
0
gravatar for emmanouil.a
2.7 years ago by
emmanouil.a20
emmanouil.a20 wrote:

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

vcf trio • 500 views
ADD COMMENTlink modified 2.7 years ago by Pierre Lindenbaum131k • written 2.7 years ago by emmanouil.a20

what is

"sorting" problems

? how did you sort those files ?

ADD REPLYlink modified 2.7 years ago • written 2.7 years ago by Pierre Lindenbaum131k

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

ADD REPLYlink written 2.7 years ago by Pierre Lindenbaum131k

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 REPLYlink modified 2.7 years ago • written 2.7 years ago by emmanouil.a20

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

ADD REPLYlink modified 2.7 years ago • written 2.7 years ago by Pierre Lindenbaum131k

just using the sort command

sort sample1 > FILE1

ADD REPLYlink written 2.7 years ago by emmanouil.a20

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

join -t $'\t'

or use Ctrl-V + tab to insert a tab

ADD REPLYlink written 2.7 years ago by Pierre Lindenbaum131k
0
gravatar for Pierre Lindenbaum
2.7 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum131k wrote:

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 COMMENTlink modified 2.7 years ago • written 2.7 years ago by Pierre Lindenbaum131k

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

ADD REPLYlink written 2.7 years ago by emmanouil.a20
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1767 users visited in the last hour