Advertisement
jhangyu

Merge FPKM files

May 25th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.49 KB | None | 0 0
  1. for ID in $(ls | grep -P -o '.*(?=(_Ballgown_Table))')
  2. do
  3.     cd ${ID}_Ballgown_Table
  4.     echo process cutting ${ID}
  5.     cat t_data.ctab | cut -f 12 | sed s/FPKM/${ID}/g > ../${ID}.fpkm
  6.     if [ ! -f ../t_name.txt ];then
  7.         cat t_data.ctab | cut -f 6 > ../t_name.txt
  8.     fi
  9.     pids="$pids $!"
  10.     echo
  11.     echo start waitting for finish cutting
  12.     wait $pids
  13.     cd ../
  14. done
  15.  
  16. if [ ! -f finish.fpkm ];then
  17.     paste `ls -tr *.fpkm` > only_all_id.fpkm
  18.     paste t_name.txt only_all_id.fpkm > finish.fpkm
  19. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement