%!PS-Adobe-3.0 %%Title: GP3xCLI.awk %%For: Tony Reverter-Gomez %%Creator: a2ps version 4.13 %%CreationDate: Sun Jan 29 20:46:33 2006 %%BoundingBox: 24 24 588 768 %%DocumentData: Clean7Bit %%Orientation: Portrait %%Pages: 5 %%PageOrder: Ascend %%DocumentMedia: Letter 612 792 0 () () %%DocumentNeededResources: font Courier %%+ font Courier-Bold %%+ font Courier-BoldOblique %%+ font Courier-Oblique %%+ font Helvetica %%+ font Helvetica-Bold %%+ font Symbol %%+ font Times-Bold %%+ font Times-Roman %%DocumentProcessColors: Black %%DocumentSuppliedResources: procset a2ps-a2ps-hdr %%+ procset a2ps-black+white-Prolog %%+ encoding ISO-8859-1Encoding %%EndComments /a2psdict 200 dict def a2psdict begin %%BeginProlog %%Copyright: (c) 1988, 89, 90, 91, 92, 93 Miguel Santana %%Copyright: (c) 1995, 96, 97, 98 Akim Demaille, Miguel Santana % Check PostScript language level. /languagelevel where { pop /gs_languagelevel languagelevel def } { /gs_languagelevel 1 def } ifelse % EPSF import as in the Red Book /BeginInclude { /b4_Inc_state save def % Save state for cleanup /dict_count countdictstack def % Count objects on dict stack /op_count count 1 sub def % Count objects on operand stack userdict begin 0 setgray 0 setlinecap 1 setlinewidth 0 setlinejoin 10 setmiterlimit [ ] 0 setdash newpath gs_languagelevel 1 ne { false setstrokeadjust false setoverprint } if } bind def /EndInclude { count op_count sub { pos } repeat % Clean up stacks countdictstack dict_count sub { end } repeat b4_Inc_state restore } bind def /BeginEPSF { BeginInclude /showpage { } def } bind def /EndEPSF { EndInclude } bind def % Page prefeed /page_prefeed { % bool -> - statusdict /prefeed known { statusdict exch /prefeed exch put } { pop } ifelse } bind def /deffont { findfont exch scalefont def } bind def /reencode_font { findfont reencode 2 copy definefont pop def } bind def % Function c-show (str => -) % centers text only according to x axis. /c-show { dup stringwidth pop 2 div neg 0 rmoveto show } bind def % Function l-show (str => -) % prints texts so that it ends at currentpoint /l-show { dup stringwidth pop neg 0 rmoveto show } bind def % center-fit show (str w => -) % show centered, and scale currentfont so that the width is less than w /cfshow { exch dup stringwidth pop % If the title is too big, try to make it smaller 3 2 roll 2 copy gt { % if, i.e. too big exch div currentfont exch scalefont setfont } { % ifelse pop pop } ifelse c-show % center title } bind def % Return the y size of the current font % - => fontsize /currentfontsize { currentfont /FontType get 0 eq { currentfont /FontMatrix get 3 get }{ currentfont /FontMatrix get 3 get 1000 mul } ifelse } bind def % reencode the font % -> /reencode { %def dup length 5 add dict begin { %forall 1 index /FID ne { def }{ pop pop } ifelse } forall /Encoding exch def % Use the font's bounding box to determine the ascent, descent, % and overall height; don't forget that these values have to be % transformed using the font's matrix. % We use `load' because sometimes BBox is executable, sometimes not. % Since we need 4 numbers an not an array avoid BBox from being executed /FontBBox load aload pop FontMatrix transform /Ascent exch def pop FontMatrix transform /Descent exch def pop /FontHeight Ascent Descent sub def % Define these in case they're not in the FontInfo (also, here % they're easier to get to. /UnderlinePosition 1 def /UnderlineThickness 1 def % Get the underline position and thickness if they're defined. currentdict /FontInfo known { FontInfo dup /UnderlinePosition known { dup /UnderlinePosition get 0 exch FontMatrix transform exch pop /UnderlinePosition exch def } if dup /UnderlineThickness known { /UnderlineThickness get 0 exch FontMatrix transform exch pop /UnderlineThickness exch def } if } if currentdict end } bind def % composite fonts for ASCII-EUC mixed string % Version 1.2 1/31/1990 % Orignal Ken'ichi HANDA (handa@etl.go.jp) % Modified Norio Katayama (katayama@rd.nacsis.ac.jp),1998 % Extend & Fix Koji Nakamaru (maru@on.cs.keio.ac.jp), 1999 % Anyone can freely copy, modify, distribute this program. /copyfont { % font-dic extra-entry-count copyfont font-dic 1 index maxlength add dict begin { 1 index /FID ne 2 index /UniqueID ne and {def} {pop pop} ifelse } forall currentdict end } bind def /compositefont { % ASCIIFontName EUCFontName RomanScale RomanOffset Rot(T/F) compositefont font /RomanRotation exch def /RomanOffset exch def /RomanScale exch def userdict /fixeucfont_dict known not { userdict begin /fixeucfont_dict 2 dict begin /UpperByteEncoding [ 16#00 1 16#20 { pop 0 } for 16#21 1 16#28 { 16#20 sub } for 16#29 1 16#2F { pop 0 } for 16#30 1 16#74 { 16#27 sub } for 16#75 1 16#FF { pop 0 } for ] def /LowerByteEncoding [ 16#00 1 16#A0 { pop /.notdef } for 16#A1 1 16#FE { 16#80 sub 16 2 string cvrs (cXX) dup 1 4 -1 roll putinterval cvn } for /.notdef ] def currentdict end def end } if findfont dup /FontType get 0 eq { 14 dict begin % % 7+8 bit EUC font % 12 dict begin /EUCFont exch def /FontInfo (7+8 bit EUC font) readonly def /PaintType 0 def /FontType 0 def /FontMatrix matrix def % /FontName /Encoding fixeucfont_dict /UpperByteEncoding get def /FMapType 2 def EUCFont /WMode known { EUCFont /WMode get /WMode exch def } { /WMode 0 def } ifelse /FDepVector [ EUCFont /FDepVector get 0 get [ 16#21 1 16#28 {} for 16#30 1 16#74 {} for ] { 13 dict begin /EUCFont EUCFont def /UpperByte exch 16#80 add def % /FontName /FontInfo (EUC lower byte font) readonly def /PaintType 0 def /FontType 3 def /FontMatrix matrix def /FontBBox {0 0 0 0} def /Encoding fixeucfont_dict /LowerByteEncoding get def % /UniqueID % /WMode /BuildChar { gsave exch dup /EUCFont get setfont /UpperByte get 2 string dup 0 4 -1 roll put dup 1 4 -1 roll put dup stringwidth setcharwidth 0 0 moveto show grestore } bind def currentdict end /lowerbytefont exch definefont } forall ] def currentdict end /eucfont exch definefont exch findfont 1 copyfont dup begin RomanRotation { /FontMatrix FontMatrix [ 0 RomanScale neg RomanScale 0 RomanOffset neg 0 ] matrix concatmatrix def }{ /FontMatrix FontMatrix [ RomanScale 0 0 RomanScale 0 RomanOffset ] matrix concatmatrix def /CDevProc {pop pop pop pop 0 exch -1000 exch 2 div 880} def } ifelse end /asciifont exch definefont exch /FDepVector [ 4 2 roll ] def /FontType 0 def /WMode 0 def /FMapType 4 def /FontMatrix matrix def /Encoding [0 1] def /FontBBox {0 0 0 0} def % /FontHeight 1.0 def % XXXX /FontHeight RomanScale 1.0 ge { RomanScale }{ 1.0 } ifelse def /Descent -0.3 def % XXXX currentdict end /tmpfont exch definefont pop /tmpfont findfont }{ pop findfont 0 copyfont } ifelse } def /slantfont { % FontName slant-degree slantfont font' exch findfont 1 copyfont begin [ 1 0 4 -1 roll 1 0 0 ] FontMatrix exch matrix concatmatrix /FontMatrix exch def currentdict end } def % Function print line number ( # -) /# { gsave sx cw mul neg 2 div 0 rmoveto f# setfont c-show grestore } bind def % -------- Some routines to enlight plain b/w printings --------- % Underline % width -- /dounderline { currentpoint gsave moveto 0 currentfont /Descent get currentfontsize mul rmoveto 0 rlineto stroke grestore } bind def % Underline a string % string -- /dounderlinestring { stringwidth pop dounderline } bind def /UL { /ul exch store } bind def % Draw a box of WIDTH wrt current font % width -- /dobox { currentpoint gsave newpath moveto 0 currentfont /Descent get currentfontsize mul rmoveto dup 0 rlineto 0 currentfont /FontHeight get currentfontsize mul rlineto neg 0 rlineto closepath stroke grestore } bind def /BX { /bx exch store } bind def % Box a string % string -- /doboxstring { stringwidth pop dobox } bind def % % ------------- Color routines --------------- % /FG /setrgbcolor load def % Draw the background % width -- /dobackground { currentpoint gsave newpath moveto 0 currentfont /Descent get currentfontsize mul rmoveto dup 0 rlineto 0 currentfont /FontHeight get currentfontsize mul rlineto neg 0 rlineto closepath bgcolor aload pop setrgbcolor fill grestore } bind def % Draw bg for a string % string -- /dobackgroundstring { stringwidth pop dobackground } bind def /BG { dup /bg exch store { mark 4 1 roll ] /bgcolor exch store } if } bind def /Show { bg { dup dobackgroundstring } if ul { dup dounderlinestring } if bx { dup doboxstring } if show } bind def % Function T(ab), jumps to the n-th tabulation in the current line /T { cw mul x0 add bg { dup currentpoint pop sub dobackground } if ul { dup currentpoint pop sub dounderline } if bx { dup currentpoint pop sub dobox } if y0 moveto } bind def % Function n: move to the next line /n { /y0 y0 bfs sub store x0 y0 moveto } bind def % Function N: show and move to the next line /N { Show /y0 y0 bfs sub store x0 y0 moveto } bind def /S { Show } bind def %%BeginResource: procset a2ps-a2ps-hdr 2.0 2 %%Copyright: (c) 1988, 89, 90, 91, 92, 93 Miguel Santana %%Copyright: (c) 1995, 96, 97, 98 Akim Demaille, Miguel Santana % Function title: prints page header. % are passed as argument /title { % 1. Draw the background x v get y v get moveto gsave 0 th 2 div neg rmoveto th setlinewidth 0.95 setgray pw 0 rlineto stroke grestore % 2. Border it gsave 0.7 setlinewidth pw 0 rlineto 0 th neg rlineto pw neg 0 rlineto closepath stroke grestore % stk: ct rt lt x v get y v get th sub 1 add moveto %%IncludeResource: font Helvetica fHelvetica fnfs 0.8 mul scalefont setfont % 3. The left title gsave dup stringwidth pop fnfs 0.8 mul add exch % leave space took on stack fnfs 0.8 mul hm rmoveto show % left title grestore exch % stk: ct ltw rt % 4. the right title gsave dup stringwidth pop fnfs 0.8 mul add exch % leave space took on stack dup pw exch stringwidth pop fnfs 0.8 mul add sub hm rmoveto show % right title grestore % stk: ct ltw rtw % 5. the center title gsave pw 3 1 roll % stk: ct pw ltw rtw 3 copy % Move to the center of the left room sub add 2 div hm rmoveto % What is the available space in here? add sub fnfs 0.8 mul sub fnfs 0.8 mul sub % stk: ct space_left %%IncludeResource: font Helvetica-Bold fHelvetica-Bold fnfs scalefont setfont cfshow grestore } bind def % Function border: prints virtual page border /border { %def gsave % print four sides 0 setgray x v get y v get moveto 0.7 setlinewidth % of the square pw 0 rlineto 0 ph neg rlineto pw neg 0 rlineto closepath stroke grestore } bind def % Function water: prints a water mark in background /water { %def gsave scx scy moveto rotate %%IncludeResource: font Times-Bold fTimes-Bold 100 scalefont setfont .97 setgray dup stringwidth pop 2 div neg -50 rmoveto show grestore } bind def % Function rhead: prints the right header /rhead { %def lx ly moveto fHelvetica fnfs 0.8 mul scalefont setfont l-show } bind def % Function footer (cf rf lf -> -) /footer { fHelvetica fnfs 0.8 mul scalefont setfont dx dy moveto show snx sny moveto l-show fnx fny moveto c-show } bind def %%EndResource %%BeginResource: procset a2ps-black+white-Prolog 2.0 1 % Function T(ab), jumps to the n-th tabulation in the current line /T { cw mul x0 add y0 moveto } bind def % Function n: move to the next line /n { %def /y0 y0 bfs sub store x0 y0 moveto } bind def % Function N: show and move to the next line /N { Show /y0 y0 bfs sub store x0 y0 moveto } bind def /S { Show } bind def /p { false UL false BX fCourier bfs scalefont setfont Show } bind def /sy { false UL false BX fSymbol bfs scalefont setfont Show } bind def /k { false UL false BX fCourier-Oblique bfs scalefont setfont Show } bind def /K { false UL false BX fCourier-Bold bfs scalefont setfont Show } bind def /c { false UL false BX fCourier-Oblique bfs scalefont setfont Show } bind def /C { false UL false BX fCourier-BoldOblique bfs scalefont setfont Show } bind def /l { false UL false BX fHelvetica bfs scalefont setfont Show } bind def /L { false UL false BX fHelvetica-Bold bfs scalefont setfont Show } bind def /str{ false UL false BX fTimes-Roman bfs scalefont setfont Show } bind def /e{ false UL true BX fHelvetica-Bold bfs scalefont setfont Show } bind def %%EndResource %%EndProlog %%BeginSetup %%IncludeResource: font Courier %%IncludeResource: font Courier-Oblique %%IncludeResource: font Courier-Bold %%IncludeResource: font Times-Roman %%IncludeResource: font Symbol %%IncludeResource: font Courier-BoldOblique %%BeginResource: encoding ISO-8859-1Encoding /ISO-8859-1Encoding [ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright /parenleft /parenright /asterisk /plus /comma /minus /period /slash /zero /one /two /three /four /five /six /seven /eight /nine /colon /semicolon /less /equal /greater /question /at /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore /quoteleft /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y /z /braceleft /bar /braceright /asciitilde /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /exclamdown /cent /sterling /currency /yen /brokenbar /section /dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron /degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph /bullet /cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf /threequarters /questiondown /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla /Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis /Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply /Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /germandbls /agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis /eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide /oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn /ydieresis ] def %%EndResource % Initialize page description variables. /sh 792 def /sw 612 def /llx 24 def /urx 588 def /ury 768 def /lly 24 def /#copies 1 def /th 20.000000 def /fnfs 15 def /bfs 10.000000 def /cw 6.000000 def % Dictionary for ISO-8859-1 support /iso1dict 8 dict begin /fCourier ISO-8859-1Encoding /Courier reencode_font /fCourier-Bold ISO-8859-1Encoding /Courier-Bold reencode_font /fCourier-BoldOblique ISO-8859-1Encoding /Courier-BoldOblique reencode_font /fCourier-Oblique ISO-8859-1Encoding /Courier-Oblique reencode_font /fHelvetica ISO-8859-1Encoding /Helvetica reencode_font /fHelvetica-Bold ISO-8859-1Encoding /Helvetica-Bold reencode_font /fTimes-Bold ISO-8859-1Encoding /Times-Bold reencode_font /fTimes-Roman ISO-8859-1Encoding /Times-Roman reencode_font currentdict end def /bgcolor [ 0 0 0 ] def /bg false def /ul false def /bx false def % The font for line numbering /f# /Helvetica findfont bfs .6 mul scalefont def /fSymbol /Symbol findfont def /hm fnfs 0.25 mul def /pw cw 93.400000 mul def /ph 697.000000 th add def /pmw 0 def /pmh 0 def /v 0 def /x [ 0 ] def /y [ pmh ph add 0 mul ph add ] def /scx sw 2 div def /scy sh 2 div def /snx urx def /sny lly 2 add def /dx llx def /dy sny def /fnx scx def /fny dy def /lx snx def /ly ury fnfs 0.8 mul sub def /sx 0 def /tab 8 def /x0 0 def /y0 0 def %%EndSetup %%Page: (1) 1 %%BeginPageSetup /pagesave save def %%EndPageSetup iso1dict begin gsave llx lly 12 add translate /v 0 store /x0 x v get 4.200000 add sx cw mul add store /y0 y v get bfs th add sub store x0 y0 moveto (########################################################################) c n (# #) N (# CCCCCC SSSSSS IIIII RRRRRR OOOO L IIIII #) N (# C S I R R O O L I #) N (# C SSSSSS I RRRRRR O O ===== L I #) N (# C S I R RR O O L I #) N (# CCCCCC SSSSSS IIIII R RR OOOO LLLLL IIIII #) N (# #) N (########################################################################) N (echo ") p ( ##############################################################) str (") p n (echo ") S ( # #) str (") p n (echo ") S ( # GP3xCLI #) str (") p n (echo ") S ( # GenePix Processing Program by CSIRO Livestock Industries #) str (") p n (echo ") S ( # Bioinformatics Group #) str (") p n (echo ") S ( # #) str (") p n (echo ") S ( # Enquiries: Tony.Reverter-Gomez@csiro.au #) str (") p n (echo ") S ( # Copyright \(c\) 2003-2005 CSIRO Livestock Industries #) str (") p n (echo ") S ( # #) str (") p n (echo ") S ( ##############################################################) str (") p n () N (echo) N (filename=`ls -l $1 | awk '{) S (print) K ( $) p (NF) K (}'`) p n (echo ") S (GPR Input:) str (" $filename | \\) p n ( awk '{) S (printf) K (") p (%3s%7s%5s%-30s\\n) str (", $1, $2, ") p ( ) str (", $3}') p n () N (date | awk '{) S (printf) K (") p (%9s%4s%5s%4s%3s%9s%4s%5s\\n) str (", \\) p n ( ") S (Processed) str (", ") p (on:) str (", $1, $2, $3, $4, $5, $6}') p n (echo) N () N (#########################################################################) c n (#) N (# Column Location for bits of interest \(Starts at row 31\)) N (#) N (# 1. Block) S 16 T ( 2. Row) S 24 T () S 32 T ( 3. Colum ) S 48 T ( 5. Gene ID) N (# 9. R fg Med) S 16 T (10. R fg Mean) S 32 T (12. R bg Med) S 48 T (14. R bg SD ) N (# 18. G fg Med) S 16 T (19. G fg Mean) S 32 T (21. G bg Med) S 48 T (23. G bg SD ) N (# 43. Q Flag) N (#) N (# NB: Some Gene ID contain a "." to accommodate GeneSpring limitations) N (# Needs to build "tempo0" file once and everything resolves from it) N (#) N (#########################################################################) N () p n (awk ') S (NR) K (>30 {) p (print) K ( $5}' $1 | sed ") p (s/\\./ /g) str (" | awk '{) p (print) K ( $1}' > id.nodot) p n (awk ') S (NR) K (>30 {) p (print) K ( $1, $2, $3, \\) p n ( $9, $10, $12, $14, \\) N ( $18, $19, $21, $23, \\) N ( $43}' $1 | \\) N (paste - id.nodot | \\) N (awk '{) S (print) K ( $1, $2, $3, $13, \\) p n ( $4, $5, $6, $7, $8, $9, $10, $11, $12}' > tempo0) N (rm id.nodot) N () N (echo) N (echo ") S ( =-=-=-=-=-=-= IMAGE QUALITY =-=-=-=-=-=-=-=) str (") p n (echo) N (T=` awk '{) S (print) K ( $0}' tempo0 | wc | awk '{) p (print) K ( $1}'`) p n (echo ") S (Total No. of Spots ------------------------>) str (" $T) p n () N (echo) N (echo ") S ( QUALITY FLAG SPOTS) str (") p n (echo ") S ( ------------ -----) str (") p n (awk '{) S (print) K ( $13}' tempo0 | sort | \\) p n ( awk ') S (BEGIN) K ({pcg="";n=1};) p n ( {) S (if) K (\($1==pcg\) n++;) p n ( ) S (else) K ({ ) p (if) K (\(pcg!=""\)) p (printf) K (") p (%14s%9d\\n) str (", pcg, n;) p n ( n=1;) N ( pcg=$1};) N ( }) S (END) K ({ ) p (printf) K (") p (%14s%9d\\n) str (", pcg, n}') p n (GP3xCLI.awk) (Page 1/5) (Jan 29, 06 16:37) title border grestore (Printed by Tony Reverter-Gomez) rhead () (1/5) (Sunday January 29, 2006) footer end % of iso1dict pagesave restore showpage %%Page: (2) 2 %%BeginPageSetup /pagesave save def %%EndPageSetup iso1dict begin gsave llx lly 12 add translate /v 0 store /x0 x v get 4.200000 add sx cw mul add store /y0 y v get bfs th add sub store x0 y0 moveto () p n (echo) N (N=`awk '$7>$5 {) S (print) K ( $0}' tempo0 | wc | awk '{) p (print) K ( $1}'`) p n (echo ") S (Red dye with Background >= Foreground --->) str (" $N | \\) p n (awk '{) S (printf) K (") p (%3s%6s%5s%11s%3s%11s%5s%6d\\n) str (", \\) p n ( $1, $2, $3, $4, $5, $6, $7, $8}') N () N (N=`awk '$11>$9 {) S (print) K ( $0}' tempo0 | wc | awk '{) p (print) K ( $1}'`) p n (echo ") S (Green dye with Background >= Foreground --->) str (" $N | \\) p n (awk '{) S (printf) K (") p (%5s%4s%5s%11s%3s%11s%5s%6d\\n) str (", \\) p n ( $1, $2, $3, $4, $5, $6, $7, $8}') N () N (echo) N (echo ") S ( Median to Mean Correlation Analysis:) str (") p n (echo) N () N (# NB: Set zeroes to twos so their log exist) c n () p n (awk '$5==") S (0) str (" {$5=") p (2) str ("}; $6==") p (0) str (" {$6=") p (2) str ("}; \\) p n ( $9==") S (0) str (" {$9=") p (2) str ("}; $10==") p (0) str (" {$10=") p (2) str ("}; \\) p n ( {) S (print) K ( $5, $6, $9, $10, \\) p n ( ) S (log) K (\($5\)/) p (log) K (\(2\), ) p (log) K (\($6\)/) p (log) K (\(2\), \\) p n ( ) S (log) K (\($9\)/) p (log) K (\(2\), ) p (log) K (\($10\)/) p (log) K (\(2\)}' tempo0 > rg) p n () N (awk '{) S (print) K ( \($1>$2?$2/$1:$1/$2\)}' rg > rr) p n (awk '{) S (print) K ( \($3>$4?$4/$3:$3/$4\)}' rg > gr) p n (awk '{) S (print) K ( \($5>$6?$6/$5:$5/$6\)}' rg > rl) p n (awk '{) S (print) K ( \($7>$8?$8/$7:$7/$8\)}' rg > gl) p n () N (echo ") S ( DATA LEFT) str (") p n (echo ") S ( RED GREEN) str (") p n (echo ") S ( Corr Raw Log2 Raw Log2) str (") p n (echo ") S ( ______________________________________) str (") p n () N (for) K ( minr ) p (in) K ( 0 0.2 0.4 0.6 0.8 0.85 0.9) p n (do) K n ( T1=`awk -v corr=$minr '$1>corr {) p (print) K ( $0}' rr | wc | awk '{) p (print) K ( $1}'`) p n ( T2=`awk -v corr=$minr '$1>corr {) S (print) K ( $0}' rl | wc | awk '{) p (print) K ( $1}'`) p n ( T3=`awk -v corr=$minr '$1>corr {) S (print) K ( $0}' gr | wc | awk '{) p (print) K ( $1}'`) p n ( T4=`awk -v corr=$minr '$1>corr {) S (print) K ( $0}' gl | wc | awk '{) p (print) K ( $1}'`) p n ( echo ") S (> ) str (" $minr $T1 $T2 $T3 $T4 | \\) p n ( awk '{) S (printf) K (") p (%2s%5.2f%9d%7d%9d%7d\\n) str (", $1, $2, $3, $4, $5, $6}') p n (done) N () N (rm rg rr rl gr gl) N () N (echo) N (echo ") S ( =-=-=-=-=-=-= VALID SPOTS* =-=-=-=-=-=-=-=) str (") p n (echo) N (V=`awk '$13==0 && $5>$7 && $9>$11 {) S (print) K ( $0}' tempo0 | wc | \\) p n ( awk '{) S (print) K ( $1}'`) p n (echo ") S (Total No. of Valid Spots ----------------->) str (" $V | \\) p n (awk '{) S (printf) K (") p (%5s%4s%4s%6s%6s%19s%6d\\n) str (", \\) p n ( $1, $2, $3, $4, $5, $6, $7, $8}') N () N (N=`echo $V $T | awk '{) S (printf) K (") p (%7.1f\\n) str (", $1/$2*100}'`) p n (echo ") S (Percentage of Valid Spots ----------------->) str (" $N | \\) p n (awk '{) S (printf) K (") p (%10s%3s%6s%6s%19s%6.1f\\n) str (", \\) p n ( $1, $2, $3, $4, $5, $6, $7}') N () N (echo) N () N (awk '$13==0 && $5>$7 && $9>$11 {) S (print) K ( $4}' tempo0 | sort | \\) p n ( awk ') S (BEGIN) K ({pcg="";n=1}; \\) p n ( {) S (if) K (\($1==pcg\) n++; \\) p n ( ) S (else) K ({ ) p (if) K (\(pcg!=""\)) p (print) K ( pcg, n; \\) p n ( n=1; \\) N ( pcg=$1}; \\) N ( }) S (END) K ({ ) p (print) K ( pcg, n}' > gcnt) p n (GP3xCLI.awk) (Page 2/5) (Jan 29, 06 16:37) title border grestore (Printed by Tony Reverter-Gomez) rhead () (Sunday January 29, 2006) (2/5) footer end % of iso1dict pagesave restore showpage %%Page: (3) 3 %%BeginPageSetup /pagesave save def %%EndPageSetup iso1dict begin gsave llx lly 12 add translate /v 0 store /x0 x v get 4.200000 add sx cw mul add store /y0 y v get bfs th add sub store x0 y0 moveto () p n (G=`wc gcnt | awk '{) S (print) K ( $1}'`) p n (echo ") S (Total No. of Genes ------------------------>) str (" $G | \\) p n (awk '{) S (printf) K (") p (%5s%4s%3s%6s%26s%6d\\n) str (", $1, $2, $3, $4, $5, $6}') p n () N (R=`awk '{) S (print) K ( $2}' gcnt | awk '{sum += $1}; ) p (END) K ({) p (print) K ( ) p (int) K (\(sum/) p (NR) K (+0.5\)}'`) p n (NG=`awk -v nr=$R '$2==nr {) S (print) K ( $0}' gcnt | wc | awk '{) p (print) K ( $1}'`) p n (echo ") S (Mean No. Repetitions ----->) str (" $R ") p ( for) str (" $NG ") p ( Genes) str (" | \\) p n ( awk '{) S (printf) K (") p (%4s%5s%12s%7s%4d%5s%6d%7s\\n) str (", \\) p n ( $1, $2, $3, $4, $5, $6, $7, $8}') N () N (MIN=`awk '{) S (print) K ( $2}' gcnt | sort -n | head -1 | awk '{) p (print) K ( $1}'`) p n (NG=`awk -v min=$MIN '$2==min {) S (print) K ( $0}' gcnt | wc | awk '{) p (print) K ( $1}'`) p n (echo ") S (Min. No. Repetitions ----->) str (" $MIN ") p ( for) str (" $NG ") p ( Genes) str (" | \\) p n ( awk '{) S (printf) K (") p (%4s%5s%12s%7s%4d%5s%6d%7s\\n) str (", \\) p n ( $1, $2, $3, $4, $5, $6, $7, $8}') N () N (MAX=`awk '{) S (print) K ( $2}' gcnt | sort -n | tail -1 | awk '{) p (print) K ( $1}'`) p n (NG=`awk -v max=$MAX '$2==max {) S (print) K ( $0}' gcnt | wc | awk '{) p (print) K ( $1}'`) p n (echo ") S (Max. No. Repetitions ----->) str (" $MAX ") p ( for) str (" $NG ") p ( Genes) str (" | \\) p n ( awk '{) S (printf) K (") p (%4s%5s%12s%7s%4d%5s%6d%7s\\n) str (", \\) p n ( $1, $2, $3, $4, $5, $6, $7, $8}') N () N (rm gcnt) N () N (#############################################) c n (# Build and process 'rgma' #) N (#############################################) N () p n (awk '$13==0 && $5>$7 && $9>$11 {) S (print) K ( $4, $5-$7, $9-$11}' tempo0 | \\) p n ( awk '{) S (print) K ( $2, $3, ) p (log) K (\($2/$3\)/) p (log) K (\(2\), 0.5*) p (log) K (\($2*$3\)/) p (log) K (\(2\)}' > rgma) p n () N (echo) N (echo) N (echo ") S ( Log\(R/G\) vs 0.5*Log\(R*G\)) str (") p n (echo ") S ( ________ ____________) str (") p n () N (awk '{) S (print) K ( $3, $4}' rgma | \\) p n ( awk '{ v1[) S (NR) K (]=$1; v2[) p (NR) K (]=$2}; \\) p n ( ) S (END) K ({ min1=min2=99999; max1=max2=-99999; \\) p n ( ) S (for) K (\(i=1;i<=) p (NR) K (;i++\){ \\) p n ( ) S (if) K (\( v1[i] < min1 \) min1 = v1[i]; \\) p n ( ) S (if) K (\( v2[i] < min2 \) min2 = v2[i]; \\) p n ( ) S (if) K (\( v1[i] > max1 \) max1 = v1[i]; \\) p n ( ) S (if) K (\( v2[i] > max2 \) max2 = v2[i]; \\) p n ( s1 += v1[i]; ss1 += v1[i]*v1[i]; \\) N ( s2 += v2[i]; ss2 += v2[i]*v2[i]; \\) N ( ss12 += v1[i]*v2[i] }; \\) N ( mean1 = s1/) S (NR) K (; \\) p n ( mean2 = s2/) S (NR) K (; \\) p n ( std1 = ) S (sqrt) K (\(\( ss1 - \(s1*s1\)/) p (NR) K ( \) / \() p (NR) K (-1\)\); \\) p n ( std2 = ) S (sqrt) K (\(\( ss2 - \(s2*s2\)/) p (NR) K ( \) / \() p (NR) K (-1\)\); \\) p n ( num = \( ss12 - \(s1*s2\)/) S (NR) K ( \) / \() p (NR) K (-1\); \\) p n ( den = std1 * std2; \\) N ( corr = num / den; \\) N ( ) S (printf) K (") p (%10s%11d%17d\\n) str (",") p (N) str (",) p (NR) K (,) p (NR) K (; \\) p n ( ) S (printf) K (") p (%10s%11.3f%17.3f\\n) str (",") p (Mean) str (",mean1,mean2; \\) p n ( ) S (printf) K (") p (%10s%11.3f%17.3f\\n) str (",") p (Std) str (",std1,std2; \\) p n ( ) S (printf) K (") p (%10s%11.3f%17.3f\\n) str (",") p (Min) str (",min1,min2; \\) p n ( ) S (printf) K (") p (%10s%11.3f%17.3f\\n) str (",") p (Max) str (",max1,max2; \\) p n ( ) S (printf) K (") p (%18s%10.3f\\n) str (",") p (Correlation) str (",corr; \\) p n ( }') N () N () N (echo) N (echo ") S ( Log\(R/G\) across Intensity Values ) str (") p n (echo ") S ( Intensity Spots % <0 % >0) str (") p n (echo ") S ( __________________________________) str (") p n () N (GP3xCLI.awk) (Page 3/5) (Jan 29, 06 16:37) title border grestore (Printed by Tony Reverter-Gomez) rhead () (3/5) (Sunday January 29, 2006) footer end % of iso1dict pagesave restore showpage %%Page: (4) 4 %%BeginPageSetup /pagesave save def %%EndPageSetup iso1dict begin gsave llx lly 12 add translate /v 0 store /x0 x v get 4.200000 add sx cw mul add store /y0 y v get bfs th add sub store x0 y0 moveto (LOW=0) p n (UPP=4) N (MAX=16) N (while) K ( [ $UPP -le $MAX ]) p n (do) K n () p n ( T=`awk -v min=$LOW -v max=$UPP \\) N ( '$4>=min && $4=min && $40 {) S (print) K ( $4}' rgma | wc -l`) p n ( N=`awk -v min=$LOW -v max=$UPP \\) N ( '$4>=min && $40 {$3=$1/$2*100}; $2==0 {$3=0}; {) S (print) K ( $3}'`) p n ( N=`echo $N $T | awk '$2>0 {$3=$1/$2*100}; $2==0 {$3=0}; {) S (print) K ( $3}'`) p n ( echo ") S (\() str (" $LOW ") p (,) str (" $UPP ") p (\) ) str (" $T $N $P | \\) p n ( awk '{) S (printf) K (") p (%7s%2d%2s%3d%-2s%9d%8.1f%7.1f\\n) str (", \\) p n ( $1, $2, $3, $4, $5, $6, $7, $8}') N () N ( LOW=`expr $LOW + 4`) N ( UPP=`expr $UPP + 4`) N (done) N (echo ") S ( __________________________________) str (") p n () N (echo) N (echo ") S (*NB: Valid Spot defined as spots with Background < Foreground for) str (") p n (echo ") S ( both Red and Green channels and with a Quality Flag of 0.) str (") p n () N (#############################################) c n (# Compute densities of variables in rgma file) N (#############################################) N () p n (awk '{) S (print) K ( ) p (log) K (\($1\)/) p (log) K (\(2\)}' rgma | sort -n | \\) p n ( awk '{ data[) S (NR) K (] = $1 };) p n ( ) S (END) K ( { min = data[1]; max = data[) p (NR) K (]; range = max - min;) p n ( n_int = \( ) S (int) K (\() p (NR) K (/10\) > 1000 ? 1000: ) p (int) K (\() p (NR) K (/10\) \)) p n ( size = range / n_int;) N ( mn_int = min + size/2;) N ( ) S (for) K (\(i=1; i<=) p (NR) K (; i++\){) p n ( aux = ) S (int) K (\(\(data[i] - min\)/size\) + 1;) p n ( q[aux]++;) N ( };) N ( ) S (for) K (\(i=1; i<=n_int; i++\){) p n ( ) S (if) K (\( q[i] < 1 \) q[i] = 1;) p n ( ) S (print) K ( mn_int, q[i];) p n ( mn_int += size;) N ( };) N ( }' > logr.d) N () N (awk '{) S (print) K ( ) p (log) K (\($2\)/) p (log) K (\(2\)}' rgma | sort -n | \\) p n ( awk '{ data[) S (NR) K (] = $1 };) p n ( ) S (END) K ( { min = data[1]; max = data[) p (NR) K (]; range = max - min;) p n ( n_int = \( ) S (int) K (\() p (NR) K (/10\) > 1000 ? 1000: ) p (int) K (\() p (NR) K (/10\) \)) p n ( size = range / n_int;) N ( mn_int = min + size/2;) N ( ) S (for) K (\(i=1; i<=) p (NR) K (; i++\){) p n ( aux = ) S (int) K (\(\(data[i] - min\)/size\) + 1;) p n ( q[aux]++;) N ( };) N ( ) S (for) K (\(i=1; i<=n_int; i++\){) p n ( ) S (if) K (\( q[i] < 1 \) q[i] = 1;) p n ( ) S (print) K ( mn_int, q[i];) p n ( mn_int += size;) N ( };) N ( }' > logg.d) N () N (awk '{) S (printf) K (") p (%10.5f\\n) str (", $3}' rgma | sort -n | \\) p n ( awk '{ data[) S (NR) K (] = $1 };) p n ( ) S (END) K ( { min = data[1]; max = data[) p (NR) K (]; range = max - min;) p n (GP3xCLI.awk) (Page 4/5) (Jan 29, 06 16:37) title border grestore (Printed by Tony Reverter-Gomez) rhead () (Sunday January 29, 2006) (4/5) footer end % of iso1dict pagesave restore showpage %%Page: (5) 5 %%BeginPageSetup /pagesave save def %%EndPageSetup iso1dict begin gsave llx lly 12 add translate /v 0 store /x0 x v get 4.200000 add sx cw mul add store /y0 y v get bfs th add sub store x0 y0 moveto ( n_int = \( ) p (int) K (\() p (NR) K (/10\) > 1000 ? 1000: ) p (int) K (\() p (NR) K (/10\) \)) p n ( size = range / n_int;) N ( mn_int = min + size/2;) N ( ) S (for) K (\(i=1; i<=) p (NR) K (; i++\){) p n ( aux = ) S (int) K (\(\(data[i] - min\)/size\) + 1;) p n ( q[aux]++;) N ( };) N ( ) S (for) K (\(i=1; i<=n_int; i++\){) p n ( ) S (if) K (\( q[i] < 1 \) q[i] = 1;) p n ( ) S (print) K ( mn_int, q[i];) p n ( mn_int += size;) N ( };) N ( }' > m.d) N () N (awk '{) S (print) K ( $4}' rgma | sort -n | \\) p n ( awk '{ data[) S (NR) K (] = $1 };) p n ( ) S (END) K ( { min = data[1]; max = data[) p (NR) K (]; range = max - min;) p n ( n_int = \( ) S (int) K (\() p (NR) K (/10\) > 1000 ? 1000: ) p (int) K (\() p (NR) K (/10\) \)) p n ( size = range / n_int;) N ( mn_int = min + size/2;) N ( ) S (for) K (\(i=1; i<=) p (NR) K (; i++\){) p n ( aux = ) S (int) K (\(\(data[i] - min\)/size\) + 1;) p n ( q[aux]++;) N ( };) N ( ) S (for) K (\(i=1; i<=n_int; i++\){) p n ( ) S (if) K (\( q[i] < 1 \) q[i] = 1;) p n ( ) S (print) K ( mn_int, q[i];) p n ( mn_int += size;) N ( };) N ( }' > a.d) N () N (rm tempo0) N (GP3xCLI.awk) (Page 5/5) (Jan 29, 06 16:37) title border grestore (Printed by Tony Reverter-Gomez) rhead () (5/5) (Sunday January 29, 2006) footer end % of iso1dict pagesave restore showpage %%Trailer end %%EOF