annotate Static_Bubble_Plot_Cmdln.R @ 16:0a740024e014 draft

Uploaded
author bornea
date Wed, 11 May 2016 11:14:37 -0400
parents 651a602e0c7f
children efc13028725c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15
651a602e0c7f Uploaded
bornea
parents:
diff changeset
1 ###################################################################################################
651a602e0c7f Uploaded
bornea
parents:
diff changeset
2 # R-code: APOSTL Global Variables
651a602e0c7f Uploaded
bornea
parents:
diff changeset
3 # Author: Brent Kuenzi
651a602e0c7f Uploaded
bornea
parents:
diff changeset
4 ################################## Dependencies ###################################################
651a602e0c7f Uploaded
bornea
parents:
diff changeset
5 library(dplyr); library(tidyr); library(ggplot2); library(ggrepel)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
6 colors <- c("Air Force blue" = "#5D8AA8", "Alice blue" = "#F0F8FF", "Alizarin crimson" = "#E32636", "Almond" = "#EFDECD", "Amaranth" = "#E52B50", "Amber" = "#FFBF00", "American rose" = "#FF033E", "Amethyst" = "#9966CC", "Android Green" = "#A4C639", "Anti flash white" = "#F2F3F4", "Antique brass" = "#CD9575", "Antique fuchsia" = "#915C83", "Antique white" = "#FAEBD7", "Ao" = "#008000", "Apple green" = "#8DB600", "Apricot" = "#FBCEB1", "Aqua" = "#00FFFF", "Aquamarine" = "#7FFFD4", "Army green" = "#4B5320", "Arsenic" = "#3B444B", "Arylide yellow" = "#E9D66B", "Ash gray" = "#B2BEB5", "Asparagus" = "#87A96B", "Atomic tangerine" = "#FF9966", "Auburn" = "#A52A2A", "Aureolin" = "#FDEE00", "AuroMetalSaurus" = "#6E7F80", "Awesome" = "#FF2052", "Azure" = "#007FFF", "Azure mist" = "#F0FFFF", "Baby blue" = "#89CFF0", "Baby blue eyes" = "#A1CAF1", "Baby pink" = "#F4C2C2", "Ball Blue" = "#21ABCD", "Banana Mania" = "#FAE7B5", "Banana yellow" = "#FFE135", "Battleship gray" = "#848482", "Bazaar" = "#98777B", "Beau blue" = "#BCD4E6", "Beaver" = "#9F8170", "Beige" = "#F5F5DC", "Bisque" = "#FFE4C4", "Bistre" = "#3D2B1F", "Bittersweet" = "#FE6F5E", "Obsidian" = "#000000", "Onyx" = "#000000", "Lost Soul" = "#000000", "Midnight" = "#000000", "Rolling Blackout" = "#000000", "Sleeping Panther" = "#000000", "Void by Armani" = "#000000", "Blanched Almond" = "#FFEBCD", "Bleu de France" = "#318CE7", "Blizzard Blue" = "#ACE5EE", "Blond" = "#FAF0BE", "Blue" = "#0000FF", "Blue Bell" = "#A2A2D0", "Blue Gray" = "#6699CC", "Blue green" = "#00DDDD", "Blue violet" = "#8A2BE2", "Blush" = "#DE5D83", "Bole" = "#79443B", "Bondi blue" = "#0095B6", "Boston University Red" = "#CC0000", "Brandeis blue" = "#0070FF", "Brass" = "#B5A642", "Brick red" = "#CB4154", "Bright cerulean" = "#1DACD6", "Bright green" = "#66FF00", "Bright lavender" = "#BF94E4", "Bright maroon" = "#C32148", "Bright pink" = "#FF007F", "Bright turquoise" = "#08E8DE", "Bright ube" = "#D19FE8", "Brilliant lavender" = "#F4BBFF", "Brilliant rose" = "#FF55A3", "Brink pink" = "#FB607F", "British racing green" = "#004225", "Bronze" = "#CD7F32", "Brown" = "#964B00", "Bubble gum" = "#FFC1CC", "Bubbles" = "#E7FEFF", "Buff" = "#F0DC82", "Bulgarian rose" = "#480607", "Burgundy" = "#800020", "Burlywood" = "#DEB887", "Burnt orange" = "#CC5500", "Burnt sienna" = "#E97451", "Burnt umber" = "#8A3324", "Byzantine" = "#BD33A4", "Byzantium" = "#702963", "Cadet" = "#536872", "Cadet blue" = "#5F9EA0", "Cadet gray" = "#91A3B0", "Cadmium Green" = "#006B3C", "Cadmium Orange" = "#ED872D", "Cadmium Red" = "#E30022", "Cadmium Yellow" = "#FFF600", "Cal Poly Pomona green" = "#1E4D2B", "Cambridge Blue" = "#A3C1AD", "Camel" = "#C19A6B", "Camouflage green" = "#78866B", "Canary yellow" = "#FFEF00", "Candy apple red" = "#FF0800", "Candy pink" = "#E4717A", "Capri" = "#00BFFF", "Caput mortuum" = "#592720", "Cardinal" = "#C41E3A", "Caribbean green" = "#00CC99", "Carmine" = "#960018", "Carmine pink" = "#EB4C42", "Carmine red" = "#FF0038", "Carnation pink" = "#FFA6C9", "Carnelian" = "#B31B1B", "Carolina blue" = "#99BADD", "Carrot orange" = "#ED9121", "Ceil" = "#92A1CF", "Celadon" = "#ACE1AF", "Celestial blue" = "#4997D0", "Cerise" = "#DE3163", "Cerise pink" = "#EC3B83", "Cerulean" = "#007BA7", "Cerulean blue" = "#2A52BE", "CG Blue" = "#007AA5", "CG Red" = "#E03C31", "Chamoisee" = "#A0785A", "Champagne" = "#F7E7CE", "Charcoal" = "#36454F", "Chartreuse" = "#DFFF00", "Cherry blossom pink" = "#FFB7C5", "Chestnut" = "#CD5C5C", "Chocolate" = "#7B3F00", "Chrome yellow" = "#FFA700", "Cinereous" = "#98817B", "Cinnabar" = "#E34234", "Cinnamon" = "#D2691E", "Citrine" = "#E4D00A", "Classic rose" = "#FBCCE7", "Cobalt" = "#0047AB", "Coffee" = "#C86428", "Columbia blue" = "#9BDDFF", "Cool black" = "#002E63", "Cool gray" = "#8C92AC", "Copper" = "#B87333", "Copper rose" = "#996666", "Coquelicot" = "#FF3800", "Coral" = "#FF7F50", "Coral pink" = "#F88379", "Coral red" = "#FF4040", "Cordovan" = "#893F45", "Corn" = "#FBEC5D", "Cornflower blue" = "#6495ED", "Cornsilk" = "#FFF8DC", "Cosmic latte" = "#FFF8E7", "Cotton candy" = "#FFBCD9", "Cream" = "#FFFDD0", "Crimson" = "#DC143C", "Crimson glory" = "#BE0032", "Cyan" = "#00B7EB", "Daffodil" = "#FFFF31", "Dandelion" = "#F0E130", "Dark blue" = "#00008B", "Dark brown" = "#654321", "Dark byzantium" = "#5D3954", "Dark candy apple red" = "#A40000", "Dark cerulean" = "#08457E", "Dark champagne" = "#C2B280", "Dark chestnut" = "#986960", "Dark coral" = "#CD5B45", "Dark cyan" = "#008B8B", "Dark electric blue" = "#536878", "Dark goldenrod" = "#B8860B", "Dark gray" = "#A9A9A9", "Dark green" = "#013220", "Dark jungle green" = "#1A2421", "Dark khaki" = "#BDB76B", "Dark lava" = "#483C32", "Dark lavender" = "#734F96", "Dark magenta" = "#8B008B", "Dark midnight blue" = "#003366", "Dark olive green" = "#556B2F", "Dark orange" = "#FF8C00", "Dark orchid" = "#9932CC", "Dark pastel blue" = "#779ECB", "Dark pastel green" = "#03C03C", "Dark pastel purple" = "#966FD6", "Dark pastel red" = "#C23B22", "Dark pink" = "#E75480", "Dark powder blue" = "#003399", "Dark raspberry" = "#872657", "Dark red" = "#8B0000", "Dark salmon" = "#E9967A", "Dark scarlet" = "#560319", "Dark sea green" = "#8FBC8F", "Dark sienna" = "#3C1414", "Dark slate blue" = "#483D8B", "Dark slate gray" = "#2F4F4F", "Dark spring green" = "#177245", "Dark tan" = "#918151", "Dark tangerine" = "#FFA812", "Dark terra cotta" = "#CC4E5C", "Dark turquoise" = "#00CED1", "Dark violet" = "#9400D3", "Dartmouth green" = "#00693E", "Davy's gray" = "#555555", "Debian red" = "#D70A53", "Deep carmine" = "#A9203E", "Deep carmine pink" = "#EF3038", "Deep carrot orange" = "#E9692C", "Deep cerise" = "#DA3287", "Deep champagne" = "#FAD6A5", "Deep chestnut" = "#B94E48", "Deep fuchsia" = "#C154C1", "Deep jungle green" = "#004B49", "Deep lilac" = "#9955BB", "Deep magenta" = "#CC00CC", "Deep peach" = "#FFCBA4", "Deep pink" = "#FF1493", "Deep saffron" = "#FF9933", "Denim" = "#1560BD", "Desert sand" = "#EDC9AF", "Dim gray" = "#696969", "Dodger blue" = "#1E90FF", "Dogwood rose" = "#D71868", "Dollar bill" = "#85BB65", "Drab" = "#967117", "Duke blue" = "#00009C", "Earth yellow" = "#E1A95F", "Eggplant" = "#614051", "Eggshell" = "#F0EAD6", "Egyptian blue" = "#1034A6", "Electric blue" = "#7DF9FF", "Electric crimson" = "#FF003F", "Electric green" = "#00FE00", "Electric indigo" = "#6F00FF", "Electric lime" = "#CCFF00", "Electric purple" = "#BF00FF", "Electric ultramarine" = "#3F00FF", "Electric violet" = "#8F00FF", "Electric yellow" = "#FFFE00", "Emerald" = "#50C878", "Eton blue" = "#96C8A2", "Falu red" = "#801818", "Fandango" = "#B53389", "Fashion fuchsia" = "#F400A1", "Fawn" = "#E5AA70", "Feldgrau" = "#4D5D53", "Fern green" = "#4F7942", "Ferrari Red" = "#FF2800", "Field drab" = "#6C541E", "Firebrick" = "#B22222", "Fire engine red" = "#CE2029", "Flame" = "#E25822", "Flamingo pink" = "#FC8EAC", "Flavescent" = "#F7E98E", "Flax" = "#EEDC82", "Floral white" = "#FFFAF0", "Folly" = "#FF004F", "Forest green" = "#014421", "French beige" = "#A67B5B", "French blue" = "#0072BB", "French lilac" = "#86608E", "French rose" = "#F64A8A", "Fuchsia" = "#FF00FF", "Fuchsia pink" = "#FF77FF", "Fulvous" = "#E48400", "Fuzzy Wuzzy" = "#CC6666", "Gainsboro" = "#DCDCDC", "Gamboge" = "#E49B0F", "Ghost white" = "#F8F8FF", "Ginger" = "#B06500", "Glaucous" = "#6082B6", "Gold" = "#D4AF37", "Golden brown" = "#996515", "Golden poppy" = "#FCC200", "Goldenrod" = "#DAA520", "Golden yellow" = "#FFDF00", "Granny Smith Apple" = "#A8E4A0", "Gray" = "#808080", "Gray asparagus" = "#465945", "Green" = "#00FF00", "Green yellow" = "#ADFF2F", "Grullo" = "#A99A86", "Guppie green" = "#00FF7F", "Halaya ube" = "#663854", "Han blue" = "#446CCF", "Han purple" = "#5218FA", "Harlequin" = "#3FFF00", "Harvard crimson" = "#C90016", "Harvest Gold" = "#DA9100", "Heliotrope" = "#DF73FF", "Honeydew" = "#F0FFF0", "Hooker's green" = "#007000", "Hot magenta" = "#FF1DCE", "Hot pink" = "#FF69B4", "Hunter green" = "#355E3B", "Iceberg" = "#71A6D2", "Icterine" = "#FCF75E", "Inchworm" = "#B2EC5D", "India green" = "#138808", "Indian yellow" = "#E3A857", "Indigo" = "#00416A", "International Klein Blue" = "#002FA7", "International orange" = "#FF4F00", "Iris" = "#5A4FCF", "Isabelline" = "#F4F0EC", "Islamic green" = "#009000", "Ivory" = "#FFFFF0", "Jade" = "#00A86B", "Jasmine" = "#F8DE7E", "Jasper" = "#D73B3E", "Jazzberry jam" = "#A50B5E", "Jonquil" = "#FADA5E", "June bud" = "#BDDA57", "Jungle green" = "#29AB87", "Kelly green" = "#4CBB17", "Khaki" = "#C3B091", "KU Crimson" = "#E8000D", "Languid lavender" = "#D6CADD", "Lapis lazuli" = "#26619C", "La Salle Green" = "#087830", "Laser Lemon" = "#FEFE22", "Lava" = "#CF1020", "Lavender" = "#B57EDC", "Lavender blue" = "#CCCCFF", "Lavender blush" = "#FFF0F5", "Lavender gray" = "#C4C3D0", "Lavender indigo" = "#9457EB", "Lavender magenta" = "#EE82EE", "Lavender mist" = "#E6E6FA", "Lavender pink" = "#FBAED2", "Lavender purple" = "#967BB6", "Lavender rose" = "#FBA0E3", "Lawn green" = "#7CFC00", "Lemon" = "#FFF700", "Lemon chiffon" = "#FFFACD", "Light apricot" = "#FDD5B1", "Light blue" = "#ADD8E6", "Light brown" = "#B5651D", "Light carmine pink" = "#E66771", "Light coral" = "#F08080", "Light cornflower blue" = "#93CCEA", "Light Crimson" = "#F56991", "Light cyan" = "#E0FFFF", "Light fuchsia pink" = "#F984EF", "Light goldenrod yellow" = "#FAFAD2", "Light gray" = "#D3D3D3", "Light green" = "#90EE90", "Light khaki" = "#F0E68C", "Light mauve" = "#DCD0FF", "Light pastel purple" = "#B19CD9", "Light pink" = "#FFB6C1", "Light salmon" = "#FFA07A", "Light salmon pink" = "#FF9999", "Light sea green" = "#20B2AA", "Light sky blue" = "#87CEFA", "Light slate gray" = "#778899", "Light taupe" = "#B38B6D", "Light Thulian pink" = "#E68FAC", "Light yellow" = "#FFFFED", "Lilac" = "#C8A2C8", "Lime" = "#BFFF00", "Lime green" = "#32CD32", "Lincoln green" = "#195905", "Linen" = "#FAF0E6", "Liver" = "#534B4F", "Lust" = "#E62020", "Magenta" = "#CA1F7B", "Magic mint" = "#AAF0D1", "Magnolia" = "#F8F4FF", "Mahogany" = "#C04000", "Majorelle Blue" = "#6050DC", "Malachite" = "#0BDA51", "Manatee" = "#979AAA", "Mango Tango" = "#FF8243", "Maroon" = "#800000", "Mauve" = "#E0B0FF", "Mauvelous" = "#EF98AA", "Mauve taupe" = "#915F6D", "Maya blue" = "#73C2FB", "Meat brown" = "#E5B73B", "Medium aquamarine" = "#66DDAA", "Medium blue" = "#0000CD", "Medium candy apple red" = "#E2062C", "Medium carmine" = "#AF4035", "Medium champagne" = "#F3E5AB", "Medium electric blue" = "#035096", "Medium jungle green" = "#1C352D", "Medium lavender magenta" = "#DDA0DD", "Medium orchid" = "#BA55D3", "Medium Persian blue" = "#0067A5", "Medium purple" = "#9370DB", "Medium red violet" = "#BB3385", "Medium sea green" = "#3CB371", "Medium slate blue" = "#7B68EE", "Medium spring bud" = "#C9DC87", "Medium spring green" = "#00FA9A", "Medium taupe" = "#674C47", "Medium teal blue" = "#0054B4", "Medium turquoise" = "#48D1CC", "Medium violet red" = "#C71585", "Melon" = "#FDBCB4", "Midnight blue" = "#191970", "Midnight green" = "#004953", "Mikado yellow" = "#FFC40C", "Mint" = "#3EB489", "Mint cream" = "#F5FFFA", "Mint green" = "#98FF98", "Misty rose" = "#FFE4E1", "Moonstone blue" = "#73A9C2", "Mordant red 19" = "#AE0C00", "Moss green" = "#ADDFAD", "Mountain Meadow" = "#30BA8F", "Mountbatten pink" = "#997A8D", "MSU Green" = "#18453B", "Mulberry" = "#C54B8C", "Mustard" = "#FFDB58", "Myrtle" = "#21421E", "Nadeshiko pink" = "#F6ADC6", "Napier green" = "#2A8000", "Navajo white" = "#FFDEAD", "Navy" = "#000080", "Neon Carrot" = "#FFA343", "Neon fuchsia" = "#FE59C2", "Neon green" = "#39FF14", "Non photo blue" = "#A4DDED", "Ocean Boat Blue" = "#0077BE", "Ochre" = "#CC7722", "Old gold" = "#CFB53B", "Old lace" = "#FDF5E6", "Old lavender" = "#796878", "Old mauve" = "#673147", "Old rose" = "#C08081", "Olive" = "#808000", "Olive Drab" = "#6B8E23", "Olive Drab 7" = "#3C341F", "Olivine" = "#9AB973", "Opera mauve" = "#B784A7", "Orange" = "#FF7F00", "Orange peel" = "#FF9F00", "Orange red" = "#FF4500", "Orchid" = "#DA70D6", "OU Crimson Red" = "#990000", "Outer Space" = "#414A4C", "Outrageous Orange" = "#FF6E4A", "Oxford Blue" = "#002147", "Pakistan green" = "#006600", "Palatinate blue" = "#273BE2", "Palatinate purple" = "#682860", "Pale blue" = "#AFEEEE", "Pale brown" = "#987654", "Pale cerulean" = "#9BC4E2", "Pale chestnut" = "#DDADAF", "Pale copper" = "#DA8A67", "Pale cornflower blue" = "#ABCDEF", "Pale gold" = "#E6BE8A", "Pale goldenrod" = "#EEE8AA", "Pale green" = "#98FB98", "Pale magenta" = "#F984E5", "Pale pink" = "#FADADD", "Pale red violet" = "#DB7093", "Pale robin egg blue" = "#96DED1", "Pale silver" = "#C9C0BB", "Pale spring bud" = "#ECEBBD", "Pale taupe" = "#BC987E", "Pansy purple" = "#78184A", "Papaya whip" = "#FFEFD5", "Pastel blue" = "#AEC6CF", "Pastel brown" = "#836953", "Pastel gray" = "#CFCFC4", "Pastel green" = "#77DD77", "Pastel magenta" = "#F49AC2", "Pastel orange" = "#FFB347", "Pastel pink" = "#FFD1DC", "Pastel purple" = "#B39EB5", "Pastel red" = "#FF6961", "Pastel violet" = "#CB99C9", "Pastel yellow" = "#FDFD96", "Patriarch" = "#800080", "Payne's gray" = "#40404F", "Peach" = "#FFE5B4", "Peach orange" = "#FFCC99", "Peach puff" = "#FFDAB9", "Peach yellow" = "#FADFAD", "Pear" = "#D1E231", "Pearl Aqua" = "#88D8C0", "Peridot" = "#E6E200", "Persian blue" = "#1C39BB", "Persian green" = "#00A693", "Persian indigo" = "#32127A", "Persian orange" = "#D99058", "Persian pink" = "#F77FBE", "Persian plum" = "#701C1C", "Persian red" = "#CC3333", "Persian rose" = "#FE28A2", "Persimmon" = "#EC5800", "Phlox" = "#DF00FF", "Phthalo blue" = "#000F89", "Phthalo green" = "#123524", "Piggy pink" = "#FDDDE6", "Pine green" = "#01796F", "Pink" = "#FFC0CB", "Pink pearl" = "#E7ACCF", "Pink Sherbet" = "#F78FA7", "Pistachio" = "#93C572", "Platinum" = "#E5E4E2", "Plum" = "#8E4585", "Portland Orange" = "#FF5A36", "Powder blue" = "#B0E0E6", "Princeton orange" = "#FF8F00", "Prussian blue" = "#003153", "Puce" = "#CC8899", "Pumpkin" = "#FF7518", "Purple" = "#9F00C5", "Purple Heart" = "#69359C", "Purple mountain majesty" = "#9678B6", "Purple pizzazz" = "#FE4EDA", "Purple taupe" = "#50404D", "Quartz" = "#51484F", "Radical Red" = "#FF355E", "Raspberry" = "#E30B5D", "Raspberry pink" = "#E25098", "Raspberry rose" = "#B3446C", "Raw umber" = "#826644", "Razzle dazzle rose" = "#FF33CC", "Razzmatazz" = "#E3256B", "Red" = "#FF0000", "Redwood" = "#AB4E52", "Regalia" = "#522D80", "Rich black" = "#004040", "Rich brilliant lavender" = "#F1A7FE", "Rich carmine" = "#D70040", "Rich electric blue" = "#0892D0", "Rich lavender" = "#A76BCF", "Rich lilac" = "#B666D2", "Rich maroon" = "#B03060", "Rifle green" = "#414833", "Robin egg blue" = "#00CCCC", "Rose bonbon" = "#F9429E", "Rose ebony" = "#674846", "Rose gold" = "#B76E79", "Rose pink" = "#FF66CC", "Rose quartz" = "#AA98A9", "Rose taupe" = "#905D5D", "Rosewood" = "#65000B", "Rosso corsa" = "#D40000", "Rosy brown" = "#BC8F8F", "Royal azure" = "#0038A8", "Royal blue" = "#002366", "Royal fuchsia" = "#CA2C92", "Royal purple" = "#7851A9", "Ruby" = "#E0115F", "Ruddy" = "#FF0028", "Ruddy brown" = "#BB6528", "Ruddy pink" = "#E18E96", "Rufous" = "#A81C07", "Russet" = "#80461B", "Rust" = "#B7410E", "Sacramento State green" = "#00563F", "Saddle brown" = "#8B4513", "Safety orange" = "#FF6700", "Saffron" = "#F4C430", "Salmon" = "#FF8C69", "Salmon pink" = "#FF91A4", "Sandstorm" = "#ECD540", "Sandy brown" = "#F4A460", "Sangria" = "#92000A", "Sap green" = "#507D2A", "Sapphire" = "#082567", "Satin sheen gold" = "#CBA135", "Scarlet" = "#FF2400", "School bus yellow" = "#FFD800", "Screamin' Green" = "#76FF7A", "Sea green" = "#2E8B57", "Seal brown" = "#321414", "Seashell" = "#FFF5EE", "Selective yellow" = "#FFBA00", "Sepia" = "#704214", "Shadow" = "#8A795D", "Shamrock green" = "#009E60", "Shocking pink" = "#FC0FC0", "Sienna" = "#882D17", "Silver" = "#C0C0C0", "Sinopia" = "#CB410B", "Skobeloff" = "#007474", "Sky blue" = "#87CEEB", "Sky magenta" = "#CF71AF", "Slate blue" = "#6A5ACD", "Slate gray" = "#708090", "Smokey topaz" = "#933D41", "Smoky black" = "#100C08", "Snow" = "#FFFAFA", "Spiro Disco Ball" = "#0FC0FC", "Splashed white" = "#FEFDFF", "Spring bud" = "#A7FC00", "Steel blue" = "#4682B4", "St. Patrick's blue" = "#23297A", "Straw" = "#E4D96F", "Sunglow" = "#FFCC33", "Tan" = "#D2B48C", "Tangelo" = "#F94D00", "Tangerine" = "#F28500", "Tangerine yellow" = "#FFCC00", "Taupe gray" = "#8B8589", "Tea green" = "#D0F0C0", "Teal" = "#008080", "Teal blue" = "#367588", "Teal green" = "#006D5B", "Tenné" = "#CD5700", "Terra cotta" = "#E2725B", "Thistle" = "#D8BFD8", "Thulian pink" = "#DE6FA1", "Tickle Me Pink" = "#FC89AC", "Tiffany Blue" = "#0ABAB5", "Tiger's eye" = "#E08D3C", "Timberwolf" = "#DBD7D2", "Titanium yellow" = "#EEE600", "Tomato" = "#FF6347", "Toolbox" = "#746CC0", "Topaz" = "#FFC87C", "Tractor red" = "#FD0E35", "Tropical rain forest" = "#00755E", "True Blue" = "#0073CF", "Tufts Blue" = "#417DC1", "Tumbleweed" = "#DEAA88", "Turkish rose" = "#B57281", "Turquoise" = "#30D5C8", "Turquoise blue" = "#00FFEF", "Turquoise green" = "#A0D6B4", "Tuscan red" = "#66424D", "Twilight lavender" = "#8A496B", "Tyrian purple" = "#66023C", "UA blue" = "#0033AA", "UA red" = "#D9004C", "Ube" = "#8878C3", "UCLA Blue" = "#536895", "UCLA Gold" = "#FFB300", "UFO Green" = "#3CD070", "Ultramarine" = "#120A8F", "Ultramarine blue" = "#4166F5", "Ultra pink" = "#FF6FFF", "Umber" = "#635147", "United Nations blue" = "#5B92E5", "University of California Gold" = "#B78727", "Unmellow Yellow" = "#FFFF66", "UP Maroon" = "#7B1113", "Upsdell red" = "#AE2029", "Urobilin" = "#E1AD21", "Utah Crimson" = "#D3003F", "Vegas gold" = "#C5B358", "Venetian red" = "#C80815", "Verdigris" = "#43B3AE", "Veronica" = "#A020F0", "Violet" = "#7F00FF", "Viridian" = "#40826D", "Vivid auburn" = "#922724", "Vivid burgundy" = "#9F1D35", "Vivid cerise" = "#DA1D81", "Vivid tangerine" = "#FFA089", "Vivid violet" = "#9F00FF", "Warm black" = "#004242", "Wenge" = "#645452", "Wheat" = "#F5DEB3", "White" = "#FFFFFF", "White smoke" = "#F5F5F5", "Wild blue yonder" = "#A2ADD0", "Wild Strawberry" = "#FF43A4", "Wild Watermelon" = "#FC6C85", "Wine" = "#722F37", "Wisteria" = "#C9A0DC", "Xanadu" = "#738678", "Yale Blue" = "#0F4D92", "Yellow" = "#FFFF00", "Yellow green" = "#9ACD32", "Yellow Orange" = "#FFEF02", "Zaffre" = "#0014A8", "Zinnwaldite brown" = "#2C1608")
651a602e0c7f Uploaded
bornea
parents:
diff changeset
7 ################################# Read in Data ####################################################
651a602e0c7f Uploaded
bornea
parents:
diff changeset
8 ## REQUIRED INPUTS ##
651a602e0c7f Uploaded
bornea
parents:
diff changeset
9 # 1) listfile (filename)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
10 listfile <- "EGFR_list.txt"
651a602e0c7f Uploaded
bornea
parents:
diff changeset
11 # 2) Prey File (filename)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
12 preyfile <- "EGFR_prey.txt"
651a602e0c7f Uploaded
bornea
parents:
diff changeset
13 # 3) crapome File (filename or FALSE)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
14 crapfile <- "EGFR_crap.txt"
651a602e0c7f Uploaded
bornea
parents:
diff changeset
15 # 4) Inter File (filename)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
16 interfile <- "inter.txt"
651a602e0c7f Uploaded
bornea
parents:
diff changeset
17 # 5) X axis ("ln(NSAF)","SpecSum", "log2(FoldChange)", "SaintScore", "logOddsScore","NSAFScore")
651a602e0c7f Uploaded
bornea
parents:
diff changeset
18 input.main.x <- "ln(NSAF)"
651a602e0c7f Uploaded
bornea
parents:
diff changeset
19 # 6) Y axis ("ln(NSAF)","SpecSum", "log2(FoldChange)", "SaintScore", "logOddsScore","NSAFScore")
651a602e0c7f Uploaded
bornea
parents:
diff changeset
20 input.main.y <- "log2(FoldChange)"
651a602e0c7f Uploaded
bornea
parents:
diff changeset
21 # 7) Bubble Size ("ln(NSAF)","SpecSum", "log2(FoldChange)", "SaintScore", "logOddsScore","NSAFScore")
651a602e0c7f Uploaded
bornea
parents:
diff changeset
22 input.main.size <- "SpecSum"
651a602e0c7f Uploaded
bornea
parents:
diff changeset
23 # 8) Coloring ("fixed" or "crapome")
651a602e0c7f Uploaded
bornea
parents:
diff changeset
24 input.main.color <- "crapome"
651a602e0c7f Uploaded
bornea
parents:
diff changeset
25 # 9) Saint Score Cutoff (0 - 1)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
26 input.SS_cutoff <- 0.8
651a602e0c7f Uploaded
bornea
parents:
diff changeset
27 # 10) Fold change Cutoff (-inf - inf)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
28 input.FC_cutoff <- 0
651a602e0c7f Uploaded
bornea
parents:
diff changeset
29 # 11) NSAF Score Cutoff (-inf - inf)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
30 input.NS_cutoff <- 0
651a602e0c7f Uploaded
bornea
parents:
diff changeset
31 # 12) Plotting Theme ("Default","b/w","minimal","classic","dark","linedraw")
651a602e0c7f Uploaded
bornea
parents:
diff changeset
32 input.plot_theme <- "Default"
651a602e0c7f Uploaded
bornea
parents:
diff changeset
33 # 13) Bubble Labels ("none",">cutoff","all")
651a602e0c7f Uploaded
bornea
parents:
diff changeset
34 input.bubble_label <- ">cutoff"
651a602e0c7f Uploaded
bornea
parents:
diff changeset
35 # 14) Label Color ("white","black")
651a602e0c7f Uploaded
bornea
parents:
diff changeset
36 input.label_color <- "black"
651a602e0c7f Uploaded
bornea
parents:
diff changeset
37 # 15) Bubble Color (colors listed above)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
38 input.bubble_color <- colors[["Alizarin crimson"]]
651a602e0c7f Uploaded
bornea
parents:
diff changeset
39 # 16) Bubble outline color ("white","black")
651a602e0c7f Uploaded
bornea
parents:
diff changeset
40 input.outline_color <- "black"
651a602e0c7f Uploaded
bornea
parents:
diff changeset
41 # 17) CRAPome Filtered Bubble Color (colors listed above)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
42 input.filt_color <- colors[["Tan"]]
651a602e0c7f Uploaded
bornea
parents:
diff changeset
43 # 18) Bubble scale ((0-100),(0-100)) # SECOND NUMBER MUST BE LARGER THAN OR EQUAL TO THE FIRST
651a602e0c7f Uploaded
bornea
parents:
diff changeset
44 input.plot_scale <- c(0,10)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
45 # 19) File Type (".pdf",".png",".tif",".svg",".eps",".jpg")
651a602e0c7f Uploaded
bornea
parents:
diff changeset
46 input.file_type <- ".png"
651a602e0c7f Uploaded
bornea
parents:
diff changeset
47
651a602e0c7f Uploaded
bornea
parents:
diff changeset
48 ################################################################################
651a602e0c7f Uploaded
bornea
parents:
diff changeset
49 # Define merge function and calculate crapome %
651a602e0c7f Uploaded
bornea
parents:
diff changeset
50 merge_files <- function(SAINT_DF, prey_DF, crapome=FALSE) {
651a602e0c7f Uploaded
bornea
parents:
diff changeset
51 SAINT <- read.table(SAINT_DF, sep='\t', header=TRUE)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
52 prey <- read.table(prey_DF, sep='\t', header=FALSE); colnames(prey) <- c("Prey", "Length", "PreyGene")
651a602e0c7f Uploaded
bornea
parents:
diff changeset
53 DF <- merge(SAINT,prey)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
54
651a602e0c7f Uploaded
bornea
parents:
diff changeset
55 if(crapome!=FALSE) {
651a602e0c7f Uploaded
bornea
parents:
diff changeset
56 crapome <- read.table(crapome, sep='\t', header=TRUE)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
57 colnames(crapome) <- c("Prey", "Symbol", "Num.of.Exp", "Ave.SC", "Max.SC")
651a602e0c7f Uploaded
bornea
parents:
diff changeset
58 DF1 <- merge(DF, crapome); as.character(DF1$Num.of.Exp); DF1$Symbol <- NULL;
651a602e0c7f Uploaded
bornea
parents:
diff changeset
59 DF1$Ave.SC <- NULL; DF1$Max.SC <- NULL #remove unnecessary columns
651a602e0c7f Uploaded
bornea
parents:
diff changeset
60 DF1$Num.of.Exp <- sub("^$", "0 / 1", DF1$Num.of.Exp ) #replace blank values with 0 / 1
651a602e0c7f Uploaded
bornea
parents:
diff changeset
61 DF <- DF1 %>% separate(Num.of.Exp, c("NumExp", "TotalExp"), " / ") #split into 2 columns
651a602e0c7f Uploaded
bornea
parents:
diff changeset
62 DF$CrapomePCT <- round(100 - (as.integer(DF$NumExp) / as.integer(DF$TotalExp) * 100), digits=2) #calculate crapome %
651a602e0c7f Uploaded
bornea
parents:
diff changeset
63
651a602e0c7f Uploaded
bornea
parents:
diff changeset
64 }
651a602e0c7f Uploaded
bornea
parents:
diff changeset
65 DF$FoldChange <- round(log2(DF$FoldChange),digits=2)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
66 colnames(DF)[(colnames(DF)=="FoldChange")] <- "log2(FoldChange)"
651a602e0c7f Uploaded
bornea
parents:
diff changeset
67
651a602e0c7f Uploaded
bornea
parents:
diff changeset
68 DF$SAF <- DF$AvgSpec / DF$Length
651a602e0c7f Uploaded
bornea
parents:
diff changeset
69 by_bait <- DF %>% group_by(Bait) %>% mutate("NSAF" = SAF/sum(SAF))
651a602e0c7f Uploaded
bornea
parents:
diff changeset
70 by_bait$SAF <- NULL
651a602e0c7f Uploaded
bornea
parents:
diff changeset
71 return(by_bait[!duplicated(by_bait),])
651a602e0c7f Uploaded
bornea
parents:
diff changeset
72 }
651a602e0c7f Uploaded
bornea
parents:
diff changeset
73 ################################################################################
651a602e0c7f Uploaded
bornea
parents:
diff changeset
74 bubblebeam <- function(main.data,main.exclude,main.x,main.y,main.size,main.color,SS_cutoff,FC_cutoff,NS_cutoff,
651a602e0c7f Uploaded
bornea
parents:
diff changeset
75 plot_theme,bubble_label,label_color,bubble_color,
651a602e0c7f Uploaded
bornea
parents:
diff changeset
76 outline_color,filt_color,plot_scale, file_type){
651a602e0c7f Uploaded
bornea
parents:
diff changeset
77 str_x=paste0(main.x)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
78 str_y=paste0(main.y)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
79 str_color=paste0(main.color)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
80 str_size=paste0(main.size)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
81 str_cutoff= paste0(SS_cutoff)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
82 str_label= bubble_label
651a602e0c7f Uploaded
bornea
parents:
diff changeset
83 scl_size = plot_scale
651a602e0c7f Uploaded
bornea
parents:
diff changeset
84 main.data2 <- main.data[!(main.data$PreyGene %in% main.exclude),]
651a602e0c7f Uploaded
bornea
parents:
diff changeset
85 main.data2 <- subset(main.data2, main.data2[(colnames(main.data2)=="log2(FoldChange)")] >= FC_cutoff)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
86 main.data2 <- subset(main.data2, main.data2[(colnames(main.data2)=="NSAFScore")] >= NS_cutoff)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
87
651a602e0c7f Uploaded
bornea
parents:
diff changeset
88 c <- subset(main.data2, SaintScore>=as.numeric(str_cutoff), select = c(str_x,str_y,"Bait","PreyGene",str_size))
651a602e0c7f Uploaded
bornea
parents:
diff changeset
89 colnames(c) <- c("x","y","Bait","PreyGene","size")
651a602e0c7f Uploaded
bornea
parents:
diff changeset
90 p <- ggplot(data=c, x=x, y=y,size=size)+ geom_point(data=c, aes(x=x, y=y,size=size), fill=bubble_color,color=outline_color,pch=21) + scale_size(range=scl_size)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
91 p <- p + labs(x=str_x, y=str_y, size=str_size) + scale_size(range=scl_size)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
92 if(length(levels(c$Bait) > 1)) {p <- p + facet_wrap(~Bait)}
651a602e0c7f Uploaded
bornea
parents:
diff changeset
93 if(str_label== 'all' & length(c$x)>=1) {set.seed=42; p <- p + ggrepel::geom_text_repel(data=c, aes(x=x,y=y,label=PreyGene),
651a602e0c7f Uploaded
bornea
parents:
diff changeset
94 segment.color="black",force=1, fontface='bold',
651a602e0c7f Uploaded
bornea
parents:
diff changeset
95 box.padding=unit(0.25,'lines'),
651a602e0c7f Uploaded
bornea
parents:
diff changeset
96 point.padding=unit(0.25,'lines'),
651a602e0c7f Uploaded
bornea
parents:
diff changeset
97 max.iter=1e4, segment.size=0.5)}
651a602e0c7f Uploaded
bornea
parents:
diff changeset
98 if(plot_theme== "classic") {p <- p + theme_classic()}
651a602e0c7f Uploaded
bornea
parents:
diff changeset
99 if(plot_theme== "b/w") {p <- p + theme_bw()}
651a602e0c7f Uploaded
bornea
parents:
diff changeset
100 if(plot_theme== "minimal") {p <- p + theme_minimal()}
651a602e0c7f Uploaded
bornea
parents:
diff changeset
101 if(plot_theme== "dark") {p <- p + theme_dark()}
651a602e0c7f Uploaded
bornea
parents:
diff changeset
102 if(plot_theme== "linedraw") {p <- p + theme_linedraw()}
651a602e0c7f Uploaded
bornea
parents:
diff changeset
103
651a602e0c7f Uploaded
bornea
parents:
diff changeset
104
651a602e0c7f Uploaded
bornea
parents:
diff changeset
105
651a602e0c7f Uploaded
bornea
parents:
diff changeset
106 if(str_color=="crapome") {
651a602e0c7f Uploaded
bornea
parents:
diff changeset
107 a <- subset(main.data2, CrapomePCT <80 & SaintScore >=as.numeric(str_cutoff), select = c(str_x,str_y,"Bait","PreyGene",str_size,"CrapomePCT"))
651a602e0c7f Uploaded
bornea
parents:
diff changeset
108 b <- subset(main.data2, CrapomePCT >=80 & SaintScore >=as.numeric(str_cutoff), select = c(str_x,str_y,"Bait","PreyGene",str_size,"CrapomePCT"))
651a602e0c7f Uploaded
bornea
parents:
diff changeset
109 colnames(a) <- c("x","y","Bait","PreyGene","size", "CrapomePCT")
651a602e0c7f Uploaded
bornea
parents:
diff changeset
110 colnames(b) <- c("x","y","Bait","PreyGene","size","CrapomePCT")
651a602e0c7f Uploaded
bornea
parents:
diff changeset
111 p <- ggplot(data=a, x=x, y=y,size=size) + geom_point(data=a,aes(x=x,y=y,size=size),fill=filt_color,pch=21,color=outline_color) +
651a602e0c7f Uploaded
bornea
parents:
diff changeset
112 scale_size(range=scl_size)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
113 if(length(levels(a$Bait) > 1)) {p <- p + facet_wrap(~Bait)}
651a602e0c7f Uploaded
bornea
parents:
diff changeset
114 if(str_label== "all" & length(a$x)>=1) {set.seed=42; p <- p + ggrepel::geom_text_repel(data=a, aes(x=x,y=y,label=PreyGene),
651a602e0c7f Uploaded
bornea
parents:
diff changeset
115 segment.color=label_color,force=1, fontface='bold',
651a602e0c7f Uploaded
bornea
parents:
diff changeset
116 box.padding=unit(0.25,'lines'),
651a602e0c7f Uploaded
bornea
parents:
diff changeset
117 point.padding=unit(0.25,'lines'),
651a602e0c7f Uploaded
bornea
parents:
diff changeset
118 color=label_color,
651a602e0c7f Uploaded
bornea
parents:
diff changeset
119 max.iter=1e4, segment.size=0.5)}
651a602e0c7f Uploaded
bornea
parents:
diff changeset
120
651a602e0c7f Uploaded
bornea
parents:
diff changeset
121 p <- p + geom_point(data=b, aes(x=x, y=y, size=size, fill=CrapomePCT),color=outline_color,pch=21) +
651a602e0c7f Uploaded
bornea
parents:
diff changeset
122 scale_fill_gradient(limits=c(80, 100), low=filt_color, high=bubble_color) +
651a602e0c7f Uploaded
bornea
parents:
diff changeset
123 labs(colour="CRAPome Probability \nof Specific Interaction (%)", x=str_x, y=str_y,size=str_size)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
124 if(str_label== '>cutoff' & length(b$x)>=1) {set.seed=42; p <- p + ggrepel::geom_text_repel(data=b, aes(x=x,y=y,label=PreyGene),
651a602e0c7f Uploaded
bornea
parents:
diff changeset
125 segment.color=label_color,force=1, fontface='bold',
651a602e0c7f Uploaded
bornea
parents:
diff changeset
126 box.padding=unit(0.25,'lines'),
651a602e0c7f Uploaded
bornea
parents:
diff changeset
127 point.padding=unit(0.25,'lines'),
651a602e0c7f Uploaded
bornea
parents:
diff changeset
128 color=label_color,
651a602e0c7f Uploaded
bornea
parents:
diff changeset
129 max.iter=1e4, segment.size=0.5)}
651a602e0c7f Uploaded
bornea
parents:
diff changeset
130 if(str_label== 'all' & length(b$x)>=1) {set.seed=42; p <- p + ggrepel::geom_text_repel(data=b, aes(x=x,y=y,label=PreyGene),
651a602e0c7f Uploaded
bornea
parents:
diff changeset
131 segment.color=label_color,force=1, fontface='bold',
651a602e0c7f Uploaded
bornea
parents:
diff changeset
132 box.padding=unit(0.25,'lines'),
651a602e0c7f Uploaded
bornea
parents:
diff changeset
133 point.padding=unit(0.25,'lines'),
651a602e0c7f Uploaded
bornea
parents:
diff changeset
134 color=label_color,
651a602e0c7f Uploaded
bornea
parents:
diff changeset
135 max.iter=1e4, segment.size=0.5)}
651a602e0c7f Uploaded
bornea
parents:
diff changeset
136 if(plot_theme== "classic") {p <- p + theme_classic()}
651a602e0c7f Uploaded
bornea
parents:
diff changeset
137 if(plot_theme== "b/w") {p <- p + theme_bw()}
651a602e0c7f Uploaded
bornea
parents:
diff changeset
138 if(plot_theme== "minimal") {p <- p + theme_minimal()}
651a602e0c7f Uploaded
bornea
parents:
diff changeset
139 if(plot_theme== "dark") {p <- p + theme_dark()}
651a602e0c7f Uploaded
bornea
parents:
diff changeset
140 if(plot_theme== "linedraw") {p <- p + theme_linedraw()}
651a602e0c7f Uploaded
bornea
parents:
diff changeset
141 }
651a602e0c7f Uploaded
bornea
parents:
diff changeset
142 p <- p + theme(axis.title.y = element_text(size=rel(1.5),face="bold"),
651a602e0c7f Uploaded
bornea
parents:
diff changeset
143 axis.title.x = element_text(size=rel(1.5),face="bold"),
651a602e0c7f Uploaded
bornea
parents:
diff changeset
144 axis.text.x = element_text(size=rel(1.5),face="bold"),
651a602e0c7f Uploaded
bornea
parents:
diff changeset
145 axis.text.y = element_text(size=rel(1.5),face="bold"),
651a602e0c7f Uploaded
bornea
parents:
diff changeset
146 strip.text.x = element_text(size=rel(1.5),face="bold"),
651a602e0c7f Uploaded
bornea
parents:
diff changeset
147 legend.text = element_text(face="bold"),
651a602e0c7f Uploaded
bornea
parents:
diff changeset
148 legend.title = element_text(face="bold"))
651a602e0c7f Uploaded
bornea
parents:
diff changeset
149 if(file_type == ".png"){png(paste("BubbleGraph",file_type,sep="")); print(p); dev.off()}
651a602e0c7f Uploaded
bornea
parents:
diff changeset
150 if(file_type == ".pdf"){pdf(paste("BubbleGraph",file_type,sep="")); print(p); dev.off()}
651a602e0c7f Uploaded
bornea
parents:
diff changeset
151 if(file_type == ".tif"){tiff(paste("BubbleGraph",file_type,sep="")); print(p); dev.off()}
651a602e0c7f Uploaded
bornea
parents:
diff changeset
152 if(file_type == ".jpg"){jpeg(paste("BubbleGraph",file_type,sep="")); print(p); dev.off()}
651a602e0c7f Uploaded
bornea
parents:
diff changeset
153 if(file_type == ".svg"){svg(paste("BubbleGraph",file_type,sep="")); print(p); dev.off()}
651a602e0c7f Uploaded
bornea
parents:
diff changeset
154 if(file_type == ".eps"){postscript(paste("BubbleGraph",file_type,sep="")); print(p); dev.off()}
651a602e0c7f Uploaded
bornea
parents:
diff changeset
155 }
651a602e0c7f Uploaded
bornea
parents:
diff changeset
156 ################################################################################
651a602e0c7f Uploaded
bornea
parents:
diff changeset
157 args <- commandArgs(trailingOnly = TRUE)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
158 working <- as.data.frame(merge_files(args[1], args[2], args[3]))
651a602e0c7f Uploaded
bornea
parents:
diff changeset
159 inter_df <- read.table(args[4], sep='\t', header=FALSE)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
160 working$temp <- strsplit(as.character(working$ctrlCounts),"[|]")
651a602e0c7f Uploaded
bornea
parents:
diff changeset
161 cnt <- 0
651a602e0c7f Uploaded
bornea
parents:
diff changeset
162 for(i in working$temp){
651a602e0c7f Uploaded
bornea
parents:
diff changeset
163 cnt <- cnt+1
651a602e0c7f Uploaded
bornea
parents:
diff changeset
164 working$ctrl_mean[cnt] <- mean(as.numeric(unlist(i)))
651a602e0c7f Uploaded
bornea
parents:
diff changeset
165 working$ctrl_number[cnt] <- length(i)}
651a602e0c7f Uploaded
bornea
parents:
diff changeset
166 working$ctrl_SAF <- working$ctrl_mean / working$Length
651a602e0c7f Uploaded
bornea
parents:
diff changeset
167 main.data <- working %>% group_by(Bait) %>% mutate("control_NSAF" = ctrl_SAF/sum(ctrl_SAF))
651a602e0c7f Uploaded
bornea
parents:
diff changeset
168 ctrl_SAF_constant <- 1/mean(main.data$ctrl_SAF)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
169 # add ctrl_SAF_constant to prevent dividing by 0
651a602e0c7f Uploaded
bornea
parents:
diff changeset
170 cnt <- 0
651a602e0c7f Uploaded
bornea
parents:
diff changeset
171 for(i in main.data$control_NSAF){
651a602e0c7f Uploaded
bornea
parents:
diff changeset
172 cnt <- cnt + 1
651a602e0c7f Uploaded
bornea
parents:
diff changeset
173 main.data$nsafScore[cnt] <- ((main.data$NSAF[cnt])+ctrl_SAF_constant)/((i/main.data$ctrl_number[cnt])+ctrl_SAF_constant)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
174 }
651a602e0c7f Uploaded
bornea
parents:
diff changeset
175 main.data$NSAF <- log(main.data$NSAF)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
176 main.data$nsafScore <- log(main.data$nsafScore)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
177 main.data <- filter(main.data, NSAF > -Inf)
651a602e0c7f Uploaded
bornea
parents:
diff changeset
178 colnames(main.data)[colnames(main.data)=="NSAF"] <- "ln(NSAF)"
651a602e0c7f Uploaded
bornea
parents:
diff changeset
179 colnames(main.data)[colnames(main.data)=="nsafScore"] <- "NSAFScore"
651a602e0c7f Uploaded
bornea
parents:
diff changeset
180 main.data$SAF <- NULL; main.data$ctrl_SAF <- NULL
651a602e0c7f Uploaded
bornea
parents:
diff changeset
181 main.data$control_NSAF <- NULL; main.data$temp <- NULL
651a602e0c7f Uploaded
bornea
parents:
diff changeset
182 main.data$ctrl_mean <- NULL
651a602e0c7f Uploaded
bornea
parents:
diff changeset
183 ################################################################################
651a602e0c7f Uploaded
bornea
parents:
diff changeset
184 bubblebeam(main.data = main.data, main.exclude = FALSE,main.x = args[5],
651a602e0c7f Uploaded
bornea
parents:
diff changeset
185 main.y = args[6],main.size = args[7],main.color = colors[[args[8]]],
651a602e0c7f Uploaded
bornea
parents:
diff changeset
186 SS_cutoff = args[8],FC_cutoff = args[9],
651a602e0c7f Uploaded
bornea
parents:
diff changeset
187 NS_cutoff = args[10], plot_theme = args[11],
651a602e0c7f Uploaded
bornea
parents:
diff changeset
188 bubble_label = args[12],label_color = args[13],
651a602e0c7f Uploaded
bornea
parents:
diff changeset
189 bubble_color = colors[[args[14]]], outline_color = args[15],
651a602e0c7f Uploaded
bornea
parents:
diff changeset
190 filt_color = colors[[args[16]]], plot_scale = c(0,10),
651a602e0c7f Uploaded
bornea
parents:
diff changeset
191 file_type = ".png")
651a602e0c7f Uploaded
bornea
parents:
diff changeset
192 ################################################################################
651a602e0c7f Uploaded
bornea
parents:
diff changeset
193