Register
It is currently Mon Sep 01, 2014 1:34 am

Join awk


All times are UTC - 6 hours


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Wed Oct 03, 2012 6:05 am   

Joined: Wed Oct 03, 2012 5:37 am
Posts: 1
Hello,
I have a problem to join two files

i have a first file:
Chr1 2242256 2 Parent=AT1G07290.1
Chr1 2242257 2 Parent=AT1G07290.1
Chr1 2242258 2 Parent=AT1G07290.1
Chr1 2242259 2 Parent=AT1G07290.1
Chr1 2242260 2 Parent=AT1G07290.1
Chr1 2242261 2 Parent=AT1G07290.1
Chr1 2242262 2 Parent=AT1G07290.1
Chr1 2242263 2 Parent=AT1G07290.1
Chr1 2242264 2 Parent=AT1G07290.1
Chr1 2242265 2 Parent=AT1G07290.1
.
and a second one

AT1G01010.1 1688
AT1G01020.1 1623
AT1G01020.2 1085
AT1G01030.1 1905
AT1G01040.1 6251
AT1G01040.2 5877
AT1G01046.1 207
AT1G01050.1 976
AT1G01060.1 2704
AT1G01060.2 2814


When i'm doing
Code:
cat /data/a2e/kassam/Thaliana/file.covexons.Chr[12345] | awk -F "\t" '{sub('/Parent='/,"");print}' |awk '{cov[$1"_"$2]=cov[$1"_"$2]+$3} END {for (pos in cov) {p=pos ; sub(/_/," ",pos) ; print pos,cov[p]}}' |awk '{pos[$1]=pos[$1]+1 ; bp[$1]=bp[$1]+$3} END {for (feat in pos) {print feat,bp[feat],pos[feat]}}' | sort -k1,1 |join -1 1 -2 1 /Quesneville_GFF3_exons_only.lens - > /data/file.covexonsByTranscript

i have an empty file, i think my join 1 of the first file after the awk is a chr and not an AT1...... so how can I can change it?


Top
 Profile  
 PostPosted: Wed Oct 03, 2012 1:20 pm   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 535
hi,

all those awk are useless: piping an awk to awk and again to awk
I mean only one call to awk should do all the job.

what are they supposed to do?

you don't show the desired output.


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP