├── README.md ├── mitodata.txt ├── solarplot.R └── solarplot.png /README.md: -------------------------------------------------------------------------------- 1 | # Mitochondrial Solar Plot 2 | 3 | **_This repo is no longer maintained_**. 4 | 5 | Clone the repo, enter the directory, source the script: 6 | 7 | ```bash 8 | git clone git@github.com:stephenturner/solarplot.git 9 | cd solarplot 10 | R CMD BATCH solarplot.R 11 | ``` 12 | 13 | ![solarplot](./solarplot.png) 14 | -------------------------------------------------------------------------------- /mitodata.txt: -------------------------------------------------------------------------------- 1 | "chr" "snp" "bp" "allele" "pheno" "p" 2 | 26 "mt921" 923 "G" "phenotype1" 0.88295310176909 3 | 26 "mt1018" 1020 "G" "phenotype1" 0.737971659051254 4 | 26 "mt1243" 1245 "G" "phenotype1" 0.110431938199326 5 | 26 "mt1719" 1721 "A" "phenotype1" 0.148461561417207 6 | 26 "mt1736" 1738 "G" "phenotype1" 0.60737046902068 7 | 26 "mt1738" 1740 "G" "phenotype1" 0.0570069588720798 8 | 26 "mt1811" 1813 "G" "phenotype1" 0.962807935196906 9 | 26 "mt1888" 1890 "A" "phenotype1" 0.0549892615526915 10 | 26 "mt2332" 2334 "A" "phenotype1" 0.102628964930773 11 | 26 "mt2352" 2354 "G" "phenotype1" 0.474789079511538 12 | 26 "mt2416" 2418 "G" "phenotype1" 0.0252267671748996 13 | 26 "mt2706" 2708 "A" "phenotype1" 0.10056950384751 14 | 26 "mt2758" 2760 "A" "phenotype1" 0.292931332951412 15 | 26 "mt2768" 2770 "G" "phenotype1" 0.955438479781151 16 | 26 "mt2789" 2791 "A" "phenotype1" 0.0469046528451145 17 | 26 "mt2885" 2887 "G" "phenotype1" 0.776299522956833 18 | 26 "mt3308" 3309 "G" "phenotype1" 0.0377595038153231 19 | 26 "mt3348" 3349 "G" "phenotype1" 0.963185384171084 20 | 26 "mt3394" 3395 "G" "phenotype1" 0.461620967136696 21 | 26 "mt3450" 3451 "A" "phenotype1" 0.153282625367865 22 | 26 "mt3480" 3481 "G" "phenotype1" 0.381662657950073 23 | 26 "mt3516" 3517 "A" "phenotype1" 0.187027012463659 24 | 26 "mt3594" 3595 "G" "phenotype1" 0.856968131614849 25 | 26 "mt3693" 3694 "A" "phenotype1" 0.980523474747315 26 | 26 "mt3796" 3797 "T" "phenotype1" 0.934609989402816 27 | 26 "mt3843" 3844 "G" "phenotype1" 0.797869293484837 28 | 26 "mt3915" 3916 "A" "phenotype1" 0.818853916600347 29 | 26 "mt3918" 3919 "A" "phenotype1" 0.582248182268813 30 | 26 "mt4104" 4105 "A" "phenotype1" 0.583856887184083 31 | 26 "mt4312" 4313 "A" "phenotype1" 0.0342333272565156 32 | 26 "mt4336" 4337 "G" "phenotype1" 0.462779911700636 33 | 26 "mt4580" 4581 "A" "phenotype1" 0.151598364347592 34 | 26 "mt4715" 4716 "G" "phenotype1" 0.71830621198751 35 | 26 "mt4977" 4978 "G" "phenotype1" 0.806445827940479 36 | 26 "mt5237" 5238 "A" "phenotype1" 0.454479611478746 37 | 26 "mt5393" 5394 "G" "phenotype1" 0.418969450518489 38 | 26 "mt6719" 6720 "G" "phenotype1" 0.509673137450591 39 | 26 "mt7867" 7868 "A" "phenotype1" 0.0535320022609085 40 | 26 "mt8206" 8207 "A" "phenotype1" 0.612800895702094 41 | 26 "mt8869" 8870 "G" "phenotype1" 0.976012365426868 42 | 26 "mt9055" 9056 "A" "phenotype1" 0.0658258581534028 43 | 26 "mt9072" 9073 "G" "phenotype1" 0.144495503278449 44 | 26 "mt9150" 9151 "G" "phenotype1" 0.742797573329881 45 | 26 "mt9540" 9541 "A" "phenotype1" 0.0979389629792422 46 | 26 "mt9554" 9555 "A" "phenotype1" 0.233125444035977 47 | 26 "mt9698" 9699 "G" "phenotype1" 0.880598581163213 48 | 26 "mt9755" 9756 "A" "phenotype1" 0.929050857434049 49 | 26 "mt9818" 9819 "A" "phenotype1" 0.209129263646901 50 | 26 "mt9899" 9900 "G" "phenotype1" 0.84941475559026 51 | 26 "mt9950" 9951 "G" "phenotype1" 0.555139500647783 52 | 26 "mt10034" 10035 "G" "phenotype1" 0.0445235085207969 53 | 26 "mt10086" 10087 "G" "phenotype1" 0.917317104060203 54 | 26 "mt10115" 10116 "G" "phenotype1" 0.109923265641555 55 | 26 "mt10238" 10239 "G" "phenotype1" 0.809327773516998 56 | 26 "mt10321" 10322 "G" "phenotype1" 0.921316622523591 57 | 26 "mt10373" 10374 "A" "phenotype1" 0.464532673824579 58 | 26 "mt10463" 10464 "G" "phenotype1" 0.260680821258575 59 | 26 "mt10550" 10551 "G" "phenotype1" 0.804277646588162 60 | 26 "mt10664" 10665 "A" "phenotype1" 0.995109555777162 61 | 26 "mt10819" 10820 "G" "phenotype1" 0.422772513935342 62 | 26 "mt10915" 10916 "G" "phenotype1" 0.408898487687111 63 | 26 "mt11177" 11178 "A" "phenotype1" 0.475003296975046 64 | 26 "mt11299" 11300 "G" "phenotype1" 0.266201792517677 65 | 26 "mt11377" 11378 "A" "phenotype1" 0.562291242880747 66 | 26 "mt11485" 11486 "G" "phenotype1" 0.918704203795642 67 | 26 "mt11641" 11642 "G" "phenotype1" 0.33495462150313 68 | 26 "mt11674" 11675 "A" "phenotype1" 0.409698427189142 69 | 26 "mt11812" 11813 "G" "phenotype1" 0.078650186304003 70 | 26 "mt11899" 11900 "G" "phenotype1" 0.825654593296349 71 | 26 "mt11914" 11915 "A" "phenotype1" 0.322417019866407 72 | 26 "mt11969" 11970 "A" "phenotype1" 0.812364299315959 73 | 26 "mt12007" 12008 "A" "phenotype1" 0.44926675176248 74 | 26 "mt12236" 12237 "A" "phenotype1" 0.105699765030295 75 | 26 "mt12308" 12309 "G" "phenotype1" 0.444160343380645 76 | 26 "mt12372" 12373 "A" "phenotype1" 0.809867043979466 77 | 26 "mt12414" 12415 "G" "phenotype1" 0.536304834997281 78 | 26 "mt12519" 12520 "G" "phenotype1" 0.149502496467903 79 | 26 "mt12612" 12613 "G" "phenotype1" 0.986837054369971 80 | 26 "mt12633" 12634 "A" "phenotype1" 0.499490405665711 81 | 26 "mt12693" 12694 "G" "phenotype1" 0.11656403192319 82 | 26 "mt12705" 12706 "G" "phenotype1" 0.418473030207679 83 | 26 "mt12720" 12721 "G" "phenotype1" 0.921096567530185 84 | 26 "mt12810" 12811 "G" "phenotype1" 0.50224564387463 85 | 26 "mt13020" 13021 "G" "phenotype1" 0.700897898525 86 | 26 "mt13105" 13106 "G" "phenotype1" 0.273432929301634 87 | 26 "mt13263" 13264 "G" "phenotype1" 0.277129370952025 88 | 26 "mt13485" 13486 "G" "phenotype1" 0.581967074424028 89 | 26 "mt13590" 13591 "A" "phenotype1" 0.544296225067228 90 | 26 "mt13650" 13651 "G" "phenotype1" 0.718235171865672 91 | 26 "mt13708" 13709 "A" "phenotype1" 0.158853731350973 92 | 26 "mt13803" 13804 "G" "phenotype1" 0.398464815923944 93 | 26 "mt13880" 13881 "A" "phenotype1" 0.129402458900586 94 | 26 "mt13886" 13887 "G" "phenotype1" 0.400931783718988 95 | 26 "mt13928" 13929 "C" "phenotype1" 0.645718855317682 96 | 26 "mt13934" 13935 "A" "phenotype1" 0.383584920084104 97 | 26 "mt13966" 13967 "G" "phenotype1" 0.113841589074582 98 | 26 "mt14000" 14001 "T" "phenotype1" 0.0756697647739202 99 | 26 "mt14088" 14089 "G" "phenotype1" 0.929680249653757 100 | 26 "mt14148" 14149 "G" "phenotype1" 0.324227138888091 101 | 26 "mt14152" 14153 "G" "phenotype1" 0.920476879458874 102 | 26 "mt14167" 14168 "A" "phenotype1" 0.474475514143705 103 | 26 "mt14284" 14285 "A" "phenotype1" 0.199417046969756 104 | 26 "mt14318" 14319 "G" "phenotype1" 0.301189860561863 105 | 26 "mt14766" 14767 "G" "phenotype1" 0.997338028857484 106 | 26 "mt14769" 14770 "G" "phenotype1" 0.0643500555306673 107 | 26 "mt14783" 14784 "G" "phenotype1" 0.730718650622293 108 | 26 "mt14905" 14906 "A" "phenotype1" 0.992445683572441 109 | 26 "mt14911" 14912 "A" "phenotype1" 0.0873700524680316 110 | 26 "mt15043" 15044 "A" "phenotype1" 0.592292188666761 111 | 26 "mt15110" 15111 "A" "phenotype1" 0.788109246874228 112 | 26 "mt15136" 15137 "A" "phenotype1" 0.113357014721259 113 | 26 "mt15204" 15205 "G" "phenotype1" 0.782853100216016 114 | 26 "mt15217" 15218 "A" "phenotype1" 0.732928654877469 115 | 26 "mt15244" 15245 "G" "phenotype1" 0.239180900622159 116 | 26 "mt15301" 15302 "G" "phenotype1" 0.630228108959273 117 | 26 "mt15311" 15312 "G" "phenotype1" 0.995186869055033 118 | 26 "mt15431" 15432 "A" "phenotype1" 0.253940709400922 119 | 26 "mt15452" 15453 "A" "phenotype1" 0.700004273094237 120 | 26 "mt15535" 15536 "A" "phenotype1" 0.0246563882101327 121 | 26 "mt15607" 15608 "G" "phenotype1" 0.275018695974723 122 | 26 "mt15670" 15671 "G" "phenotype1" 0.511239496059716 123 | 26 "mt15824" 15825 "G" "phenotype1" 0.112848917720839 124 | 26 "mt15833" 15834 "A" "phenotype1" 0.467263540718704 125 | 26 "mt15904" 15905 "A" "phenotype1" 0.236813149880618 126 | 26 "mt15924" 15925 "G" "phenotype1" 0.543854988180101 127 | 26 "mt15928" 15929 "A" "phenotype1" 0.756317559629679 128 | 26 "mt15942" 15943 "G" "phenotype1" 0.126427292590961 129 | 26 "mt16189" 16190 "G" "phenotype1" 0.271659175632522 130 | 26 "mt921" 923 "G" "phenotype1" 0.222950706025586 131 | 26 "mt1018" 1020 "G" "phenotype1" 0.649693735875189 132 | 26 "mt1243" 1245 "G" "phenotype1" 0.779733064118773 133 | 26 "mt1719" 1721 "A" "phenotype1" 0.28578876121901 134 | 26 "mt1736" 1738 "G" "phenotype1" 0.314813253004104 135 | 26 "mt1738" 1740 "G" "phenotype1" 0.539796088589355 136 | 26 "mt1811" 1813 "G" "phenotype1" 0.640093217603862 137 | 26 "mt1888" 1890 "A" "phenotype1" 0.367091512773186 138 | 26 "mt2332" 2334 "A" "phenotype1" 0.924682110548019 139 | 26 "mt2352" 2354 "G" "phenotype1" 0.25240093935281 140 | 26 "mt2416" 2418 "G" "phenotype1" 0.500287808012217 141 | 26 "mt2706" 2708 "A" "phenotype1" 0.00714820553548634 142 | 26 "mt2758" 2760 "A" "phenotype1" 0.624081132933497 143 | 26 "mt2768" 2770 "G" "phenotype1" 0.452864329796284 144 | 26 "mt2789" 2791 "A" "phenotype1" 0.727360661840066 145 | 26 "mt2885" 2887 "G" "phenotype1" 0.0421881538350135 146 | 26 "mt3308" 3309 "G" "phenotype1" 0.272186141926795 147 | 26 "mt3348" 3349 "G" "phenotype1" 0.088794267270714 148 | 26 "mt3394" 3395 "G" "phenotype1" 0.0521766652818769 149 | 26 "mt3450" 3451 "A" "phenotype1" 0.28842714917846 150 | 26 "mt3480" 3481 "G" "phenotype1" 0.916380968876183 151 | 26 "mt3516" 3517 "A" "phenotype1" 0.60536776506342 152 | 26 "mt3594" 3595 "G" "phenotype1" 0.206733596744016 153 | 26 "mt3693" 3694 "A" "phenotype1" 0.29732440575026 154 | 26 "mt3796" 3797 "T" "phenotype1" 0.332703369902447 155 | 26 "mt3843" 3844 "G" "phenotype1" 0.432593098375946 156 | 26 "mt3915" 3916 "A" "phenotype1" 0.457163413753733 157 | 26 "mt3918" 3919 "A" "phenotype1" 0.19298259075731 158 | 26 "mt4104" 4105 "A" "phenotype1" 0.386110869701952 159 | 26 "mt4312" 4313 "A" "phenotype1" 0.0617549265734851 160 | 26 "mt4336" 4337 "G" "phenotype1" 0.987392927287146 161 | 26 "mt4580" 4581 "A" "phenotype1" 0.12407282856293 162 | 26 "mt4715" 4716 "G" "phenotype1" 0.612544228089973 163 | 26 "mt4977" 4978 "G" "phenotype1" 0.958456421503797 164 | 26 "mt5237" 5238 "A" "phenotype1" 0.109164489200339 165 | 26 "mt5393" 5394 "G" "phenotype1" 0.171496499562636 166 | 26 "mt6719" 6720 "G" "phenotype1" 0.346961984643713 167 | 26 "mt7867" 7868 "A" "phenotype1" 0.311698103090748 168 | 26 "mt8206" 8207 "A" "phenotype1" 0.79358562710695 169 | 26 "mt8869" 8870 "G" "phenotype1" 0.353092007339001 170 | 26 "mt9055" 9056 "A" "phenotype1" 0.87156966375187 171 | 26 "mt9072" 9073 "G" "phenotype1" 0.64736992539838 172 | 26 "mt9150" 9151 "G" "phenotype1" 0.935588225489482 173 | 26 "mt9540" 9541 "A" "phenotype1" 0.989944728091359 174 | 26 "mt9554" 9555 "A" "phenotype1" 0.368216525763273 175 | 26 "mt9698" 9699 "G" "phenotype1" 0.910015700617805 176 | 26 "mt9755" 9756 "A" "phenotype1" 0.64251656155102 177 | 26 "mt9818" 9819 "A" "phenotype1" 0.863836656790227 178 | 26 "mt9899" 9900 "G" "phenotype1" 0.342816977528855 179 | 26 "mt9950" 9951 "G" "phenotype1" 0.776433932129294 180 | 26 "mt10034" 10035 "G" "phenotype1" 0.57240623771213 181 | 26 "mt10086" 10087 "G" "phenotype1" 0.717361273709685 182 | 26 "mt10115" 10116 "G" "phenotype1" 0.327365631936118 183 | 26 "mt10238" 10239 "G" "phenotype1" 0.91579616907984 184 | 26 "mt10321" 10322 "G" "phenotype1" 0.834897554945201 185 | 26 "mt10373" 10374 "A" "phenotype1" 0.716962191276252 186 | 26 "mt10463" 10464 "G" "phenotype1" 0.802587191341445 187 | 26 "mt10550" 10551 "G" "phenotype1" 0.0902568178717047 188 | 26 "mt10664" 10665 "A" "phenotype1" 0.704527996946126 189 | 26 "mt10819" 10820 "G" "phenotype1" 0.453378234291449 190 | 26 "mt10915" 10916 "G" "phenotype1" 0.227842788212001 191 | 26 "mt11177" 11178 "A" "phenotype1" 0.0844439645297825 192 | 26 "mt11299" 11300 "G" "phenotype1" 0.0377921944018453 193 | 26 "mt11377" 11378 "A" "phenotype1" 0.886180608533323 194 | 26 "mt11485" 11486 "G" "phenotype1" 0.433896053116769 195 | 26 "mt11641" 11642 "G" "phenotype1" 0.857276649214327 196 | 26 "mt11674" 11675 "A" "phenotype1" 0.75804718839936 197 | 26 "mt11812" 11813 "G" "phenotype1" 0.300224106758833 198 | 26 "mt11899" 11900 "G" "phenotype1" 0.0274184278678149 199 | 26 "mt11914" 11915 "A" "phenotype1" 0.105395410209894 200 | 26 "mt11969" 11970 "A" "phenotype1" 0.835483062779531 201 | 26 "mt12007" 12008 "A" "phenotype1" 0.373906877590343 202 | 26 "mt12236" 12237 "A" "phenotype1" 0.916703286580741 203 | 26 "mt12308" 12309 "G" "phenotype1" 0.113228852627799 204 | 26 "mt12372" 12373 "A" "phenotype1" 0.0636130608618259 205 | 26 "mt12414" 12415 "G" "phenotype1" 0.525681397411972 206 | 26 "mt12519" 12520 "G" "phenotype1" 0.252313866978511 207 | 26 "mt12612" 12613 "G" "phenotype1" 0.828956966521218 208 | 26 "mt12633" 12634 "A" "phenotype1" 0.223817168036476 209 | 26 "mt12693" 12694 "G" "phenotype1" 0.802033136133105 210 | 26 "mt12705" 12706 "G" "phenotype1" 0.627356577897444 211 | 26 "mt12720" 12721 "G" "phenotype1" 0.605848596664146 212 | 26 "mt12810" 12811 "G" "phenotype1" 0.039088707184419 213 | 26 "mt13020" 13021 "G" "phenotype1" 0.581528878305107 214 | 26 "mt13105" 13106 "G" "phenotype1" 0.162592664128169 215 | 26 "mt13263" 13264 "G" "phenotype1" 0.0213626862969249 216 | 26 "mt13485" 13486 "G" "phenotype1" 0.984338057460263 217 | 26 "mt13590" 13591 "A" "phenotype1" 0.742437420180067 218 | 26 "mt13650" 13651 "G" "phenotype1" 0.301316493423656 219 | 26 "mt13708" 13709 "A" "phenotype1" 0.86844261479564 220 | 26 "mt13803" 13804 "G" "phenotype1" 0.1834957676474 221 | 26 "mt13880" 13881 "A" "phenotype1" 0.734569062711671 222 | 26 "mt13886" 13887 "G" "phenotype1" 0.69774095271714 223 | 26 "mt13928" 13929 "C" "phenotype1" 0.0122555219568312 224 | 26 "mt13934" 13935 "A" "phenotype1" 0.282568011200055 225 | 26 "mt13966" 13967 "G" "phenotype1" 0.0211079339496791 226 | 26 "mt14000" 14001 "T" "phenotype1" 0.707567076664418 227 | 26 "mt14088" 14089 "G" "phenotype1" 0.524246586486697 228 | 26 "mt14148" 14149 "G" "phenotype1" 0.0767063258681446 229 | 26 "mt14152" 14153 "G" "phenotype1" 0.224812208442017 230 | 26 "mt14167" 14168 "A" "phenotype1" 0.212928660213947 231 | 26 "mt14284" 14285 "A" "phenotype1" 0.562084878794849 232 | 26 "mt14318" 14319 "G" "phenotype1" 0.879595900420099 233 | 26 "mt14766" 14767 "G" "phenotype1" 0.565857532666996 234 | 26 "mt14769" 14770 "G" "phenotype1" 0.0108059886842966 235 | 26 "mt14783" 14784 "G" "phenotype1" 0.230784004786983 236 | 26 "mt14905" 14906 "A" "phenotype1" 0.232377195730805 237 | 26 "mt14911" 14912 "A" "phenotype1" 0.613956715213135 238 | 26 "mt15043" 15044 "A" "phenotype1" 0.8622357158456 239 | 26 "mt15110" 15111 "A" "phenotype1" 0.789204630302265 240 | 26 "mt15136" 15137 "A" "phenotype1" 0.377849801676348 241 | 26 "mt15204" 15205 "G" "phenotype1" 0.212080254219472 242 | 26 "mt15217" 15218 "A" "phenotype1" 0.689059119205922 243 | 26 "mt15244" 15245 "G" "phenotype1" 0.375847134739161 244 | 26 "mt15301" 15302 "G" "phenotype1" 0.838160263141617 245 | 26 "mt15311" 15312 "G" "phenotype1" 0.900412262417376 246 | 26 "mt15431" 15432 "A" "phenotype1" 0.857210043119267 247 | 26 "mt15452" 15453 "A" "phenotype1" 0.73739680624567 248 | 26 "mt15535" 15536 "A" "phenotype1" 0.378221812192351 249 | 26 "mt15607" 15608 "G" "phenotype1" 0.394969948334619 250 | 26 "mt15670" 15671 "G" "phenotype1" 0.284184142481536 251 | 26 "mt15824" 15825 "G" "phenotype1" 0.765912670176476 252 | 26 "mt15833" 15834 "A" "phenotype1" 0.899167035706341 253 | 26 "mt15904" 15905 "A" "phenotype1" 0.743554510176182 254 | 26 "mt15924" 15925 "G" "phenotype1" 0.897927987622097 255 | 26 "mt15928" 15929 "A" "phenotype1" 0.940972850658 256 | 26 "mt15942" 15943 "G" "phenotype1" 0.66589302639477 257 | 26 "mt16189" 16190 "G" "phenotype1" 0.832719107856974 258 | -------------------------------------------------------------------------------- /solarplot.R: -------------------------------------------------------------------------------- 1 | # Mito solar plots for Mito PheWAS 2 | 3 | # See also: https://github.com/hadley/ggplot2/wiki 4 | 5 | # Import text file into R Studio with columns (at least): bp, pheno, p 6 | 7 | # Load ggplot2 8 | library(ggplot2) 9 | 10 | # plink output files merged and pheno label added to specify results for cholesterol and diabetes 11 | mitodata <- read.table(file="mitodata.txt", header=T) 12 | 13 | # Sets gene names for bp ranges 14 | addgenelabel <- function(bp,gene) { gene <- ifelse(bp < 577,gene <- "Control-Region", ifelse(bp < 648,gene <- "tRNA", ifelse(bp < 1602,gene <- "rRNA", ifelse(bp < 1671,gene <- "tRNA", ifelse(bp < 3230,gene <- "rRNA", ifelse(bp < 3305,gene <- "tRNA", ifelse(bp < 3307,gene <- "Non-Coding", ifelse(bp < 4263,gene<- "ND1", ifelse(bp < 4332,gene <- "tRNA", ifelse(bp < 4401,gene <- "tRNA", ifelse(bp < 4402,gene <- "Non-Coding", ifelse(bp < 4470,gene <- "tRNA", ifelse(bp < 5512,gene <- "ND2", ifelse(bp < 5580,gene <- "tRNA", ifelse(bp < 5587,gene <- "Non-Coding", ifelse(bp < 5656,gene <- "tRNA", ifelse(bp < 5657,gene <- "Non-Coding", ifelse(bp < 5730,gene <- "tRNA", ifelse(bp < 5826,gene <- "tRNA", ifelse(bp < 5892,gene <- "tRNA", ifelse(bp < 5904,gene <- "Non-Coding", ifelse(bp < 7446,gene <- "CO1", ifelse(bp < 7515,gene <- "tRNA", ifelse(bp < 7518,gene <- "Non-Coding", ifelse(bp < 7586,gene <- "tRNA", ifelse(bp < 8270,gene <- "CO2", ifelse(bp < 8295,gene <- "Non-Coding", ifelse(bp < 8365,gene <- "tRNA", ifelse(bp < 8366,gene <- "Non-Coding", ifelse(bp < 8573,gene <- "ATP8", ifelse(bp < 9208,gene <- "ATP6", ifelse(bp < 9991,gene <- "CO3", ifelse(bp < 10059,gene <- "tRNA", ifelse(bp < 10405,gene <- "ND3", ifelse(bp < 10470,gene <- "tRNA", ifelse(bp < 10767,gene <- "ND4L", ifelse(bp < 12138,gene <- "ND4", ifelse(bp < 12207,gene <- "tRNA", ifelse(bp < 12266,gene <- "tRNA", ifelse(bp < 12337,gene <- "tRNA", ifelse(bp < 14149,gene <- "ND5", ifelse(bp < 14674,gene <- "ND6", ifelse(bp < 14743,gene <- "tRNA", ifelse(bp < 14747,gene <- "Non-Coding", ifelse(bp < 15888,gene <- "CYB", ifelse(bp < 15954,gene <- "tRNA", ifelse(bp < 15956,gene <- "Non-Coding", ifelse(bp < 16024,gene <- "tRNA", ifelse(bp < 17000,gene <- "Control-Region") ))))))))))))))))))) ))))))))))))))))))) ))))))))) ) } 15 | 16 | # Add gene names to each SNP 17 | mitodata$gene <- addgenelabel(mitodata$bp,mitodata$gene) 18 | 19 | # Display internal structure of mitodata 20 | str(mitodata) 21 | 22 | # Creates and stores negative log p as a new variable 23 | mitodata$neglogp <- -1*log10(mitodata$p) 24 | 25 | # Adds a significance threshold line at negative log of 0.05 26 | mitodata$neglogpline <- -1*log10(0.05) 27 | 28 | # Adds -3 label to y axis 29 | mitodata$extraline <- -3 30 | 31 | # Set colors for each gene 32 | colours <- c("Control-Region" <- "lightblue4", "tRNA" <- "magenta4", "rRNA" <- "mediumaquamarine", "Non-Coding" <- "sienna4", "ND1" <- "magenta", "ND2" <- "mediumblue", "CO1" <- "olivedrab", "CO2" <- "orange2", "ATP8" <- "orchid4", "ATP6" <- "red3", "CO3" <- "royalblue2", "ND3" <- "palegreen4", "ND4L" <- "grey0", "ND4" <- "pink4", "ND5" <- "yellow4", "ND6" <- "steelblue4", "CYB" <- "tan","red") 33 | 34 | # Create gene boundaries and lines 35 | visibleboundaries <- c(1,576,1601,3229,4262,5511,7445,8269,9207,9990,10404,10766,12137,14148,14673,15887) 36 | 37 | bdries <- data.frame(x = visibleboundaries,y=-.5) 38 | 39 | bdries$gene <- addgenelabel(bdries$x,bdries$gene) 40 | 41 | lines <- data.frame(x = seq(0,16567,by=1),y = 0) 42 | 43 | lines$gene <- addgenelabel(lines$x,lines$gene) 44 | 45 | # Plot everything and GO 46 | ggplot(mitodata, aes(x = bp,y = neglogp,color = gene)) + 47 | geom_point()+ coord_polar(direction = -1) + 48 | geom_line(aes(x,1.30,color = "red"),data = lines) + 49 | #facet_grid(.~pheno) + 50 | geom_line(aes(y=extraline)) + 51 | geom_point(aes(x,y,color = gene),data=lines) + 52 | scale_colour_manual(values = colours,"Genes",breaks = c("Control-Region","tRNA","rRNA","Non-Coding","ND1","ND2","CO1","CO2","ATP8","ATP6","CO3","ND3","ND4L","ND4","ND5","ND6","CYB"), 53 | labels = c("Control Region","tRNA","rRNA","Non-Coding","ND1","ND2","CO1","CO2","ATP8","ATP6","CO3","ND3","ND4L","ND4","ND5","ND6","CYB"))+ 54 | xlab("Mitochondrial Base-Pair Location") + 55 | ylab("-log(p-value)") + 56 | ggtitle("Negative Log P-value of Mitochondrial Hits") + 57 | layer(geom="text",mapping =aes(x,y,label = x),data = bdries,size=2.5) 58 | 59 | ggsave("solarplot.png", w=6, h=6, dpi=110) 60 | -------------------------------------------------------------------------------- /solarplot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stephenturner/solarplot/1763a7e7e55b9d715b02334f0a379002d50f0f58/solarplot.png --------------------------------------------------------------------------------