diff --git a/README.md b/README.md index c2270cf..06030b8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ islandviewer-ui =============== -Web UI for Islandviewer +Web UI for Islandviewer. diff --git a/scripts/__init__.py b/scripts/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/scripts/mauve-wrapper.sh b/scripts/mauve-wrapper.sh new file mode 100644 index 0000000..cc9bac8 --- /dev/null +++ b/scripts/mauve-wrapper.sh @@ -0,0 +1,4 @@ +#!/bin/bash +#PBS -S /bin/bash + +/progressiveMauve --output=$1.xmfa --backbone-output=$2.backbone $3 $4 \ No newline at end of file diff --git a/scripts/mauvewrap.py b/scripts/mauvewrap.py new file mode 100644 index 0000000..775ed3a --- /dev/null +++ b/scripts/mauvewrap.py @@ -0,0 +1,85 @@ +import subprocess +import time +import shutil +import os +import xml.etree.ElementTree as ET + +#This can file can be moved to lib after testing +#These paths can be moved to the settings file after testing +MAUVE_PATH = "/data/Modules/iv-backend/islandviewer_dev/utils/mauve_2.4.0/linux-x64/progressiveMauve" +MAUVE_OUTPUT_PATH = "/data/Modules/iv-backend/islandviewer/pairwise_mauve" + +#Parameters = path to 2 genebank files +#Returns None +#Creates an output file at path outputfile and backbone file at path backbonefile +def runMauve(gbk1,gbk2,outputfile=None,outputbackbonefile=None, async=False): + if outputfile is None: + outputfile = MAUVE_OUTPUT_PATH+"/"+os.path.splitext(os.path.basename(gbk1))[0]+"-"+os.path.splitext(os.path.basename(gbk2))[0] + if outputbackbonefile is None: + outputbackbonefile = MAUVE_OUTPUT_PATH+"/"+os.path.splitext(os.path.basename(gbk1))[0]+"-"+os.path.splitext(os.path.basename(gbk2))[0] + + gbk1temppath = MAUVE_OUTPUT_PATH+"/"+os.path.basename(gbk1) + gbk2temppath = MAUVE_OUTPUT_PATH+"/"+os.path.basename(gbk2) + + shutil.copyfile(gbk1,gbk1temppath) + shutil.copyfile(gbk2,gbk2temppath) + + jobFile = outputfile+".pbs" + pbsFile = open(jobFile,"w+") + pbsFile.write("#!/bin/bash") + pbsFile.write("#PBS -S /bin/bash") + pbsFile.write(MAUVE_PATH+" --output="+outputfile+".xmfa --backbone-output=" + +outputbackbonefile+".backbone "+gbk1temppath+" "+gbk2temppath) + pbsFile.close() + sp = subprocess.Popen(["qsub", jobFile], cwd=MAUVE_PATH) + + # waits for job when using torque if async = False + if not async: + completeFlag = False + while not completeFlag: + qstatOutput = subprocess.Popen(["qstat", "-x"],stdout=subprocess.PIPE, cwd=MAUVE_PATH) + output = qstatOutput.communicate()[0] + tree = ET.fromstring(output) + matchfile = os.path.basename(jobFile) + for index in range(0,len(tree)): + currentFile = tree[index][1].text + if currentFile == matchfile: + status = tree[index][4].text + if status == 'C': + completeFlag = True + else: + if status != 'R': + completeFlag = True + print "Error has occured to submitted job (cluster)" + if not completeFlag: + time.sleep(60) + +#Given the paths of 2 genebank files, returns path of backbone file if it exists or None if it doesnt +def retrieveBackboneFile(gbk1,gbk2): + backbonepath = MAUVE_OUTPUT_PATH+"/"+os.path.splitext(os.path.basename(gbk1))[0]+"-"+os.path.splitext(os.path.basename(gbk2))[0]+".backbone" + if os.path.isfile(backbonepath): + return backbonepath + else: + return None + +#Wrapper for retrieving a backbone file. If it doesnt exist, this will call runMauve to create it. +def getMauveResults(gbk1,gbk2): + if retrieveBackboneFile(gbk1,gbk2) is None: + runMauve(gbk1,gbk2) + return retrieveBackboneFile(gbk1,gbk2) + + +##################### TESTS + +def testRunMauve(): + runMauve("/vagrant/islandviewer-ui/scripts/testFiles/AE009952.gbk","/vagrant/islandviewer-ui/scripts/testFiles/BX936398.gbk") + +def testRetrieveBackboneFiles(): + print(retrieveBackboneFile("/vagrant/islandviewer-ui/scripts/testFiles/AE009952.gbk","/vagrant/islandviewer-ui/scripts/testFiles/BX936398.gbk")) + +def testList(): + #testRunMauve() + #testRetrieveBackboneFiles() + print getMauveResults("/vagrant/islandviewer-ui/scripts/testFiles/AE009952.gbk","/vagrant/islandviewer-ui/scripts/testFiles/BX936398.gbk") + +#testList() \ No newline at end of file diff --git a/static/css/islandviewer.css b/static/css/islandviewer.css index 998747e..5edff9c 100644 --- a/static/css/islandviewer.css +++ b/static/css/islandviewer.css @@ -93,6 +93,10 @@ body { padding: 10px; } +input#gene_search_input{ + width:100%; +} + .chkLabel input { float: left; margin-top:0.5em;} .chkLabel span { display: block; margin-left: 1.5em;} @@ -209,6 +213,9 @@ div.outline { color: #1F1A80; letter-spacing:0.1em; line-height:26px; + display: inline-block; + white-space: normal; + width: 500px; } .linearLabel { @@ -347,6 +354,10 @@ input[type=file] { border: 1px solid #808080; } +#outer_circular{ + white-space: nowrap; +} + /* Section for GI tables */ .gitable_fullwidth { max-width: 100%; @@ -636,4 +647,9 @@ input[type=file] { transform: rotate(360deg); } } + +.linearchart { + width: 100%; +} + /* END Spinner for loading ranking page*/ diff --git a/static/examples/pseudomonas.backbone b/static/examples/pseudomonas.backbone new file mode 100644 index 0000000..d6e1221 --- /dev/null +++ b/static/examples/pseudomonas.backbone @@ -0,0 +1,686 @@ +seq0_leftend seq0_rightend seq1_leftend seq1_rightend +1 16876 1 16877 +16880 52931 16904 52951 +52961 53387 53033 53503 +53402 53763 53545 53933 +56024 98658 53938 96575 +98662 113020 96604 110961 +113554 120396 111825 118662 +120536 120743 118744 118959 +120857 120942 119033 119122 +121302 121653 119482 119840 +121693 121855 119876 120042 +121885 153098 120073 151302 +153102 164124 151354 162372 +164156 164889 163297 164035 +164913 213088 164085 212269 +215218 238921 212274 235978 +239413 256014 235983 252584 +256066 258188 252589 254710 +258395 279723 254716 276059 +280317 282315 276149 278146 +282490 282564 278601 278679 +283495 288698 280916 286118 +291773 292838 289194 290257 +292842 322742 312993 342896 +322787 364566 342906 384705 +365493 399120 384876 418490 +399174 412660 419136 432624 +412661 453415 432644 473393 +453417 509035 473414 529037 +509306 514670 529042 534406 +514882 549769 534411 569258 +550911 551036 569322 569445 +552789 564170 569470 580854 +564173 611310 580985 628122 +611353 622524 629319 640487 +622527 664607 643338 685402 +664741 667833 685407 688498 +667864 679007 700660 711801 +679414 679618 712241 712450 +679698 699977 712458 732742 +705530 773939 738296 806743 +773942 774542 806833 807432 +779340 800926 812243 833828 +805208 821119 833861 849775 +821234 835877 849779 864410 +835918 886659 869612 920348 +886678 903044 920381 936746 +909667 918243 938800 947377 +918308 920994 950504 953189 +920998 943137 953284 975423 +943141 1019030 975450 1051343 +1019033 1037973 1051440 1070366 +1037977 1074740 1070420 1107183 +1075484 1105224 1107187 1136924 +1105366 1115516 1138712 1148861 +1115649 1115684 1148865 1148899 +1115821 1159365 1148908 1192439 +1159368 1180662 1198763 1220042 +1180667 1181686 1221937 1222956 +1183141 1189482 1222961 1229302 +1190065 1190412 1229806 1230114 +1190494 1190628 1230166 1230318 +1190778 1191485 1230462 1231172 +1191654 1204104 1231202 1243650 +1204412 1204494 1244658 1244737 +1207756 1263897 1244742 1300868 +1266219 1362530 1327876 1424168 +1362541 1487001 1424202 1548677 +1487005 1487307 1548783 1549083 +1487312 1572472 1549317 1634435 +1572535 1597842 1641704 1667016 +1598191 1691764 1667021 1760609 +1693623 1697779 1768455 1772623 +1698372 1752537 1773847 1828008 +1752558 1844039 1828013 1919502 +1844042 1853075 1941371 1950392 +1853200 1860697 1950420 1957917 +1860808 1924388 1962863 2026452 +1937145 1938546 2039767 2041155 +1938740 2014600 2041591 2117452 +2014662 2028917 2120708 2134963 +2031092 2232821 2135015 2336774 +2232825 2235957 2336814 2339947 +2235960 2291835 2339969 2395847 +2293834 2333864 2402723 2442760 +2333979 2334135 2442803 2442958 +2334351 2334599 2443072 2443325 +2335029 2335153 2443612 2443733 +2335189 2335320 2443784 2443914 +2335526 2335676 2444070 2444215 +2335733 2366162 2444331 2474760 +2382664 2394826 2492553 2504717 +2394874 2395624 2506648 2507397 +2395680 2425295 2507402 2537004 +2425441 2531350 2538478 2644392 +2531353 2532394 2644416 2645456 +2564194 2577530 2645510 2658827 +2612678 2629220 2661159 2677699 +2629224 2671063 2721405 2763222 +2671109 2754294 2763227 2846444 +2755391 2755851 2870241 2870697 +2759022 2775556 2872804 2889344 +2775559 2795287 2889735 2909482 +2796375 2796425 2909915 2909964 +2796553 2811625 2910054 2925126 +2812455 2812708 2925332 2925581 +2813084 2813806 2925612 2926333 +2813974 2838004 2937271 2961299 +2843475 2843731 2962193 2962445 +2851560 2851678 2963660 2963777 +2852627 2853462 2967856 2968684 +2864510 2866057 2988797 2990340 +2866207 2895230 2990577 3019609 +2895874 2896386 3020119 3020679 +2896767 2896970 3021097 3021298 +2897039 2939321 3021341 3063612 +2939373 2939434 3063616 3063675 +2945922 2951371 3063778 3069226 +2951701 2961305 3069249 3078853 +2961321 2990871 3079041 3108580 +2993748 3031776 3108585 3146639 +3031909 3059913 3146643 3174647 +3111387 3157034 3190930 3236576 +3157759 3159097 3236600 3237936 +3159679 3160376 3237941 3238638 +3161723 3162231 3238696 3239200 +3165106 3175765 3239233 3249892 +3175919 3237080 3249939 3311095 +3238415 3244738 3312131 3318458 +3244742 3250148 3319465 3324870 +3257267 3288523 3325278 3356542 +3288838 3288990 3356548 3356699 +3290876 3304635 3356706 3370464 +3304663 3339321 3370469 3405130 +3339466 3346306 3406758 3413597 +3347106 3355068 3413637 3421608 +3356306 3419552 3421612 3484857 +3419555 3446172 3485026 3511652 +3454791 3455683 3515888 3516774 +3455705 3455809 3516849 3516951 +3455840 3457283 3520878 3522320 +3457438 3478866 3522413 3543840 +3478869 3478916 3544129 3544175 +3478919 3488865 3545329 3555274 +3489013 3489158 3555279 3555423 +3489364 3489668 3555427 3555730 +3494343 3506641 3560406 3572703 +3507838 3523565 3575155 3590880 +3528481 3547848 3595797 3615176 +3547973 3763002 3616812 3831838 +3763454 3771128 3840948 3848626 +3771131 3816664 3848651 3894197 +3816668 3855454 3894235 3933006 +3855457 3894423 3933037 3972004 +3894424 3894546 3972024 3972145 +3894548 3896912 3972166 3974529 +3896915 3912859 3975629 3991575 +3999990 4008056 3991582 3999656 +4008059 4019238 3999793 4010972 +4019241 4072349 4011007 4064113 +4072350 4117010 4064133 4108790 +4117038 4136164 4108798 4127949 +3913017 3915412 4130613 4133007 +3919265 3922491 4135142 4138367 +3924176 3929956 4154761 4160541 +3929963 3956923 4160583 4187547 +3956972 3995581 4187565 4226184 +3995609 3999891 4226189 4230471 +4154316 4179122 4230484 4255292 +4179160 4210438 4255297 4286573 +4215288 4273722 4286690 4345134 +4273725 4317129 4355803 4399211 +4317200 4317261 4399469 4399530 +4317276 4317320 4399597 4399640 +4317992 4318033 4401099 4401141 +4318037 4318192 4401254 4401408 +4318239 4318342 4401445 4401547 +4318426 4319186 4401770 4402534 +4321891 4322500 4405654 4406262 +4322643 4378698 4407275 4463325 +4379326 4379974 4463622 4464284 +4380000 4380482 4464293 4464771 +4380572 4380951 4464856 4465239 +4381036 4381442 4465310 4465714 +4381775 4382437 4466336 4466994 +4382543 4383371 4467232 4468059 +4399440 4504645 4475140 4580322 +4595739 4621873 4589262 4615401 +4621876 4663234 4615424 4656779 +4663237 4756492 4656816 4750086 +4769411 4771391 4755877 4757859 +4771395 4774377 4757951 4760865 +4774480 4774656 4761002 4761174 +4774781 4774829 4761247 4761294 +4774853 4807239 4761298 4793696 +4807243 4873236 4794250 4860226 +4873267 4880221 4895128 4902081 +4880904 4898615 4902109 4919805 +4898810 4899179 4919953 4920321 +4899261 4899745 4920353 4920839 +4899849 4899941 4920956 4921047 +4900159 4900368 4921319 4921534 +4900455 4902312 4921615 4923484 +4902394 4902987 4923570 4924162 +4905622 4905805 4926798 4926981 +4905823 4909690 4926984 4930900 +4911194 4932281 4931261 4952363 +4937628 5001929 4957704 5021988 +5002044 5111756 5021993 5131708 +5111759 5194361 5131746 5214357 +5194606 5212931 5214489 5232806 +5214704 5214896 5233934 5234123 +5214950 5232199 5234178 5251434 +4504874 4507163 5251460 5253763 +4507542 4511144 5253823 5257427 +4512579 4515259 5257449 5260128 +4516227 4517050 5260165 5260993 +4517117 4520290 5261061 5264242 +4520465 4520519 5264278 5264331 +4520580 4520749 5264336 5264504 +4520990 4522441 5264827 5266272 +4523364 4523743 5266287 5266665 +4523763 4523908 5266668 5266812 +4523913 4524316 5267103 5267504 +4524319 4526347 5268085 5270119 +4526481 4527222 5270688 5271428 +4527268 4530377 5271475 5274595 +4535109 4535321 5274655 5274865 +4535351 4547104 5277616 5289365 +4547145 4551341 5289588 5293796 +4551483 4558532 5294017 5301072 +4558535 4567252 5303964 5312670 +4567367 4567398 5312786 5312816 +4567421 4567667 5328354 5328599 +4568423 4581085 5328617 5341285 +4583021 4587744 5341288 5346005 +4587857 4589179 5346092 5347413 +4593773 4595734 5355585 5357545 +5232203 5242784 5359392 5369974 +5242818 5242984 5370034 5370208 +5243211 5243368 5370399 5370555 +5243394 5244842 5370596 5372011 +5250273 5332479 5377453 5459650 +5333040 5351435 5459729 5478121 +5351463 5387420 5478128 5514057 +5400796 5422992 5514061 5536246 +5428313 5519940 5541568 5633183 +5519943 5530897 5633289 5644243 +5531056 5544085 5644248 5657275 +5553994 5554368 5657285 5657658 +5554370 5621775 5658318 5725734 +5621778 5635572 5725950 5739730 +5635605 5638082 5740526 5743002 +5638104 5673852 5743006 5778753 +5673895 5778743 5778758 5883640 +5781133 5893496 5883679 5996028 +5893500 5893627 5996911 5997037 +5893630 5893771 5998797 5998937 +5895529 5944304 5998940 6047710 +5944397 5994644 6047715 6097966 +5994648 5996981 6098008 6100344 +5999618 6097456 6100350 6198204 +6102814 6159631 6204567 6261402 +6159964 6211291 6261408 6312732 +6216643 6359410 6318085 6460857 +6359413 6359509 6461078 6461173 +6359519 6380765 6461403 6482649 +6382051 6397246 6482721 6497906 +6397250 6414044 6497950 6514740 +6421500 6444091 6515048 6537648 +52932 52960 0 0 +53764 56023 0 0 +113021 113553 0 0 +120397 120535 0 0 +120744 120856 0 0 +120943 121301 0 0 +121654 121692 0 0 +121856 121884 0 0 +164125 164155 0 0 +164890 164912 0 0 +213089 215217 0 0 +238922 239412 0 0 +256015 256065 0 0 +258189 258394 0 0 +279724 280316 0 0 +282316 282489 0 0 +282565 283494 0 0 +288699 291772 0 0 +322743 322786 0 0 +364567 365492 0 0 +399121 399173 0 0 +509036 509305 0 0 +514671 514881 0 0 +549770 550910 0 0 +551037 552788 0 0 +611311 611352 0 0 +664608 664740 0 0 +667834 667863 0 0 +679008 679413 0 0 +679619 679697 0 0 +699978 705529 0 0 +774543 779339 0 0 +800927 805207 0 0 +821120 821233 0 0 +835878 835917 0 0 +903045 909666 0 0 +918244 918307 0 0 +1074741 1075483 0 0 +1105225 1105365 0 0 +1115517 1115648 0 0 +1115685 1115820 0 0 +1181687 1183140 0 0 +1189483 1190064 0 0 +1190413 1190493 0 0 +1190629 1190777 0 0 +1191486 1191653 0 0 +1204105 1204411 0 0 +1204495 1207755 0 0 +1263898 1266218 0 0 +1572473 1572534 0 0 +1597843 1598190 0 0 +1691765 1693622 0 0 +1697780 1698371 0 0 +1752538 1752557 0 0 +1853076 1853199 0 0 +1860698 1860807 0 0 +1924389 1937144 0 0 +1938547 1938739 0 0 +2014601 2014661 0 0 +2028918 2031091 0 0 +2291836 2293833 0 0 +2333865 2333978 0 0 +2334136 2334350 0 0 +2334600 2335028 0 0 +2335154 2335188 0 0 +2335321 2335525 0 0 +2335677 2335732 0 0 +2366163 2382663 0 0 +2394827 2394873 0 0 +2395625 2395679 0 0 +2425296 2425440 0 0 +2532395 2564193 0 0 +2577531 2612677 0 0 +2671064 2671108 0 0 +2754295 2755390 0 0 +2755852 2759021 0 0 +2795288 2796374 0 0 +2796426 2796552 0 0 +2811626 2812454 0 0 +2812709 2813083 0 0 +2813807 2813973 0 0 +2838005 2843474 0 0 +2843732 2851559 0 0 +2851679 2852626 0 0 +2853463 2864509 0 0 +2866058 2866206 0 0 +2895231 2895873 0 0 +2896387 2896766 0 0 +2896971 2897038 0 0 +2939322 2939372 0 0 +2939435 2945921 0 0 +2951372 2951700 0 0 +2990872 2993747 0 0 +3031777 3031908 0 0 +3059914 3111386 0 0 +3157035 3157758 0 0 +3159098 3159678 0 0 +3160377 3161722 0 0 +3162232 3165105 0 0 +3175766 3175918 0 0 +3237081 3238414 0 0 +3250149 3257266 0 0 +3288524 3288837 0 0 +3288991 3290875 0 0 +3304636 3304662 0 0 +3339322 3339465 0 0 +3346307 3347105 0 0 +3355069 3356305 0 0 +3446173 3454790 0 0 +3455684 3455704 0 0 +3455810 3455839 0 0 +3457284 3457437 0 0 +3488866 3489012 0 0 +3489159 3489363 0 0 +3489669 3494342 0 0 +3506642 3507837 0 0 +3523566 3528480 0 0 +3547849 3547972 0 0 +3763003 3763453 0 0 +3912860 3913016 0 0 +3915413 3919264 0 0 +3922492 3924175 0 0 +3956924 3956971 0 0 +3995582 3995608 0 0 +3999892 3999989 0 0 +4117011 4117037 0 0 +4136165 4154315 0 0 +4179123 4179159 0 0 +4210439 4215287 0 0 +4317130 4317199 0 0 +4317321 4317991 0 0 +4318193 4318238 0 0 +4318343 4318425 0 0 +4319187 4321890 0 0 +4322501 4322642 0 0 +4378699 4379325 0 0 +4379975 4379999 0 0 +4380483 4380571 0 0 +4380952 4381035 0 0 +4381443 4381774 0 0 +4382438 4382542 0 0 +4383372 4399439 0 0 +4504646 4504873 0 0 +4507164 4507541 0 0 +4511145 4512578 0 0 +4515260 4516226 0 0 +4517051 4517116 0 0 +4520291 4520464 0 0 +4520520 4520579 0 0 +4520750 4520989 0 0 +4522442 4523363 0 0 +4526348 4526480 0 0 +4527223 4527267 0 0 +4530378 4535108 0 0 +4535322 4535350 0 0 +4547105 4547144 0 0 +4551342 4551482 0 0 +4567253 4567366 0 0 +4567399 4567420 0 0 +4567668 4568422 0 0 +4581086 4583020 0 0 +4587745 4587856 0 0 +4589180 4593772 0 0 +4756493 4769410 0 0 +4774378 4774479 0 0 +4774657 4774780 0 0 +4774830 4774852 0 0 +4873237 4873266 0 0 +4880222 4880903 0 0 +4898616 4898809 0 0 +4899180 4899260 0 0 +4899746 4899848 0 0 +4899942 4900158 0 0 +4900369 4900454 0 0 +4902313 4902393 0 0 +4902988 4905621 0 0 +4909691 4911193 0 0 +4932282 4937627 0 0 +5001930 5002043 0 0 +5194362 5194605 0 0 +5212932 5214703 0 0 +5214897 5214949 0 0 +5242785 5242817 0 0 +5242985 5243210 0 0 +5243369 5243393 0 0 +5244843 5250272 0 0 +5332480 5333039 0 0 +5351436 5351462 0 0 +5387421 5400795 0 0 +5422993 5428312 0 0 +5530898 5531055 0 0 +5544086 5553993 0 0 +5635573 5635604 0 0 +5638083 5638103 0 0 +5673853 5673894 0 0 +5778744 5781132 0 0 +5893772 5895528 0 0 +5944305 5944396 0 0 +5996982 5999617 0 0 +6097457 6102813 0 0 +6159632 6159963 0 0 +6211292 6216642 0 0 +6380766 6382050 0 0 +6414045 6421499 0 0 +0 0 16878 16903 +0 0 52952 53032 +0 0 53504 53544 +0 0 96576 96603 +0 0 110962 111824 +0 0 118663 118743 +0 0 118960 119032 +0 0 119123 119481 +0 0 119841 119875 +0 0 120043 120072 +0 0 151303 151353 +0 0 162373 163296 +0 0 164036 164084 +0 0 276060 276148 +0 0 278147 278600 +0 0 278680 280915 +0 0 286119 289193 +0 0 290258 312992 +0 0 384706 384875 +0 0 418491 419135 +0 0 473394 473413 +0 0 569259 569321 +0 0 569446 569469 +0 0 580855 580984 +0 0 628123 629318 +0 0 640488 643337 +0 0 688499 700659 +0 0 711802 712240 +0 0 732743 738295 +0 0 806744 806832 +0 0 807433 812242 +0 0 833829 833860 +0 0 864411 869611 +0 0 920349 920380 +0 0 936747 938799 +0 0 947378 950503 +0 0 953190 953283 +0 0 975424 975449 +0 0 1051344 1051439 +0 0 1070367 1070419 +0 0 1136925 1138711 +0 0 1192440 1198762 +0 0 1220043 1221936 +0 0 1229303 1229805 +0 0 1230115 1230165 +0 0 1230319 1230461 +0 0 1231173 1231201 +0 0 1243651 1244657 +0 0 1300869 1327875 +0 0 1424169 1424201 +0 0 1548678 1548782 +0 0 1549084 1549316 +0 0 1634436 1641703 +0 0 1760610 1768454 +0 0 1772624 1773846 +0 0 1919503 1941370 +0 0 1950393 1950419 +0 0 1957918 1962862 +0 0 2026453 2039766 +0 0 2041156 2041590 +0 0 2117453 2120707 +0 0 2134964 2135014 +0 0 2336775 2336813 +0 0 2339948 2339968 +0 0 2395848 2402722 +0 0 2442761 2442802 +0 0 2442959 2443071 +0 0 2443326 2443611 +0 0 2443734 2443783 +0 0 2443915 2444069 +0 0 2444216 2444330 +0 0 2474761 2492552 +0 0 2504718 2506647 +0 0 2537005 2538477 +0 0 2644393 2644415 +0 0 2645457 2645509 +0 0 2658828 2661158 +0 0 2677700 2721404 +0 0 2846445 2870240 +0 0 2870698 2872803 +0 0 2889345 2889734 +0 0 2909483 2909914 +0 0 2909965 2910053 +0 0 2925127 2925331 +0 0 2925582 2925611 +0 0 2926334 2937270 +0 0 2961300 2962192 +0 0 2962446 2963659 +0 0 2963778 2967855 +0 0 2968685 2988796 +0 0 2990341 2990576 +0 0 3019610 3020118 +0 0 3020680 3021096 +0 0 3021299 3021340 +0 0 3063676 3063777 +0 0 3069227 3069248 +0 0 3078854 3079040 +0 0 3174648 3190929 +0 0 3236577 3236599 +0 0 3238639 3238695 +0 0 3239201 3239232 +0 0 3249893 3249938 +0 0 3311096 3312130 +0 0 3318459 3319464 +0 0 3324871 3325277 +0 0 3405131 3406757 +0 0 3413598 3413636 +0 0 3484858 3485025 +0 0 3511653 3515887 +0 0 3516775 3516848 +0 0 3516952 3520877 +0 0 3522321 3522412 +0 0 3543841 3544128 +0 0 3544176 3545328 +0 0 3555731 3560405 +0 0 3572704 3575154 +0 0 3590881 3595796 +0 0 3615177 3616811 +0 0 3831839 3840947 +0 0 3848627 3848650 +0 0 3894198 3894234 +0 0 3933007 3933036 +0 0 3972146 3972165 +0 0 3974530 3975628 +0 0 3999657 3999792 +0 0 4010973 4011006 +0 0 4127950 4130612 +0 0 4133008 4135141 +0 0 4138368 4154760 +0 0 4160542 4160582 +0 0 4286574 4286689 +0 0 4345135 4355802 +0 0 4399212 4399468 +0 0 4399531 4399596 +0 0 4399641 4401098 +0 0 4401142 4401253 +0 0 4401409 4401444 +0 0 4401548 4401769 +0 0 4402535 4405653 +0 0 4406263 4407274 +0 0 4463326 4463621 +0 0 4464772 4464855 +0 0 4465240 4465309 +0 0 4465715 4466335 +0 0 4466995 4467231 +0 0 4468060 4475139 +0 0 4580323 4589261 +0 0 4615402 4615423 +0 0 4656780 4656815 +0 0 4750087 4755876 +0 0 4757860 4757950 +0 0 4760866 4761001 +0 0 4761175 4761246 +0 0 4793697 4794249 +0 0 4860227 4895127 +0 0 4902082 4902108 +0 0 4919806 4919952 +0 0 4920322 4920352 +0 0 4920840 4920955 +0 0 4921048 4921318 +0 0 4921535 4921614 +0 0 4923485 4923569 +0 0 4924163 4926797 +0 0 4930901 4931260 +0 0 4952364 4957703 +0 0 5131709 5131745 +0 0 5214358 5214488 +0 0 5232807 5233933 +0 0 5234124 5234177 +0 0 5251435 5251459 +0 0 5253764 5253822 +0 0 5257428 5257448 +0 0 5260129 5260164 +0 0 5260994 5261060 +0 0 5264243 5264277 +0 0 5264505 5264826 +0 0 5266813 5267102 +0 0 5267505 5268084 +0 0 5270120 5270687 +0 0 5271429 5271474 +0 0 5274596 5274654 +0 0 5274866 5277615 +0 0 5289366 5289587 +0 0 5293797 5294016 +0 0 5301073 5303963 +0 0 5312671 5312785 +0 0 5312817 5328353 +0 0 5346006 5346091 +0 0 5347414 5355584 +0 0 5357546 5359391 +0 0 5369975 5370033 +0 0 5370209 5370398 +0 0 5370556 5370595 +0 0 5372012 5377452 +0 0 5459651 5459728 +0 0 5536247 5541567 +0 0 5633184 5633288 +0 0 5657659 5658317 +0 0 5725735 5725949 +0 0 5739731 5740525 +0 0 5883641 5883678 +0 0 5996029 5996910 +0 0 5997038 5998796 +0 0 6097967 6098007 +0 0 6198205 6204566 +0 0 6312733 6318084 +0 0 6460858 6461077 +0 0 6461174 6461402 +0 0 6482650 6482720 +0 0 6497907 6497949 +0 0 6514741 6515047 diff --git a/static/js/alignervis.js b/static/js/alignervis.js new file mode 100644 index 0000000..d9217b3 --- /dev/null +++ b/static/js/alignervis.js @@ -0,0 +1,267 @@ +//Notes: seems appropriate to move Multivis.sequences to Backbone + +function MultiVis(targetNode){ + var self = this; + const SEQUENCEHEIGHT = 150; + const CONTAINERWIDTH = 1115; + // const NUMBERAXISTICKS = 5; BROKEN FOR CURRENT IMPLEMENTATION + + this.container = d3.select(targetNode); + this.backbone = new Backbone(); + this.sequences = this.backbone.getSequences(); + + this.getSequence = function(index){ + return self.sequences[index]; + }; + + this.getLargestSequenceSize = function(){ + var largestSize=0; + for (var i = 0; ilargestSize){ + largestSize = this.sequences[i].getSequenceSize(); + } + } + return largestSize; + }; + + this.containerWidth = function() { + if (CONTAINERWIDTH != null){ + return CONTAINERWIDTH; + } + else { + return this.container.node().getBoundingClientRect().width; + } + }; + + this.containerHeight = function() { + return this.sequences.length*SEQUENCEHEIGHT-100;// The -100 fixes padding issues on islandviewer site, fix this later if required; + }; + + this.updateSequenceVisualization= function(sequenceIndex, newstart, newend){ + try { + self.getSequence(sequenceIndex).updateScale(newstart, newend, CONTAINERWIDTH); + self.transition(); + }catch(e){ + //Chart may not have been initialized yet (call parseandrender?) + } + }; + + //Readjusts the graph for updated sequence domains, (improve later, currently just re-renders graph) + this.transition = function(){ + this.container.select("svg").remove(); + this.render(); + }; + + this.render = function (){ + this.container.select("svg").remove(); + var scale = d3.scale.linear().domain([0,this.getLargestSequenceSize()]).range([0,this.containerWidth()]); + + //Add the SVG + var svg = this.container.append("svg") + .attr("width",this.containerWidth()) + .attr("height",this.containerHeight()); + + //Draw Homologous Region Lines + var lines = []; + + for (var i=0; i largestBase[k]){ + largestBase[k] = Number(data[row]["seq"+k+"_rightend"]); + } + } + + //Dont Load "Matches" that do not contain a homologous region + if (data[row]["seq" + choicelist[choice][0] + "_rightend"] == 0 || data[row]["seq" + choicelist[choice][1] + "_rightend"] == 0){ + continue; + } + + backbonereference.addHomologousRegion( choicelist[choice][0], choicelist[choice][1], + data[row]["seq" + choicelist[choice][0] + "_leftend"], + data[row]["seq" + choicelist[choice][0] + "_rightend"], + data[row]["seq" + choicelist[choice][1] + "_leftend"], + data[row]["seq" + choicelist[choice][1] + "_rightend"]); + } + } + + for (var i=0; i + + + + Title + + + + + + +
+ +
+ + + \ No newline at end of file diff --git a/static/js/islandviewer.js b/static/js/islandviewer.js index fc5a2cd..b50ea57 100644 --- a/static/js/islandviewer.js +++ b/static/js/islandviewer.js @@ -9,27 +9,44 @@ function Islandviewer(aid, ext_id, genomesize, genomename, trackdata) { this.startBP = 0; this.endBP = genomesize; + this.linearplot = null; + this.comparisoncontainer = null; } +Islandviewer.prototype.addComparison = function(comparisonfunction){ + this.comparisoncontainer = comparisonfunction; + +}; + Islandviewer.prototype.addCircularPlot = function(layout) { this.circularplot = new circularTrack(layout, this.trackdata); $(layout.container).addClass('plot_' + this.ext_id.replace('.', '')); return this.circularplot; -} +}; Islandviewer.prototype.addLinearPlot = function(layout) { this.linearplot = new genomeTrack(layout, this.trackdata); + try { + if (this.comparisoncontainer != undefined) { + this.linearplot.setComparisonContainer(this.comparisoncontainer); + } + } catch (e){ + + } + + console.log(this.linearplot); return this.linearplot; +}; + +Islandviewer.prototype.setComparisonContainer = function(comparisonfunction){ + this.comparisoncontainer = comparisonfunction; + this.linearplot.setComparisonContainer(this.comparisoncontainer) } Islandviewer.prototype.onclick = function(trackname, d, plotid, skip_half_range) { -// console.log("Got a callback " + d); -// console.log(trackname); -// console.log(d); -// console.log(plotid); if(plotid == 'circularchartlinear' || plotid == 'secondchartlinear') { @@ -136,10 +153,6 @@ Islandviewer.prototype.focus = function(startbp, endbp, params) { } Islandviewer.prototype.mouseover = function(trackname, d, plotid) { -// console.log("Got a callback " + d); -// console.log(trackname); -// console.log(d); -// console.log(plotid); if(plotid == 'circularchartlinear' || plotid == 'secondchartlinear' ) { if(trackname == 'circularGenes') { diff --git a/static/js/linearbrush.js b/static/js/linearbrush.js index db905a1..6b2a1a9 100644 --- a/static/js/linearbrush.js +++ b/static/js/linearbrush.js @@ -3,7 +3,7 @@ contextWidth = 440 - contextMargin.left - contextMargin.right, contextHeight = 100 - contextMargin.top - contextMargin.bottom; function linearBrush(layout, callbackObj) { - this.layout; + this.layout = layout; this.callbackObj = callbackObj; this.brushContainer = d3.select(layout.container) @@ -50,7 +50,7 @@ function linearBrush(layout, callbackObj) { function brushUpdate(b) { var minExtent = brush.extent()[0]; var maxExtent = brush.extent()[1]; - // console.log(minExtent, maxExtent); + //console.log(minExtent, maxExtent); callbackObj.update(minExtent, maxExtent); } diff --git a/static/js/linearplot.js b/static/js/linearplot.js index 253a6af..fa40c2c 100644 --- a/static/js/linearplot.js +++ b/static/js/linearplot.js @@ -10,23 +10,25 @@ var linearTrackDefaults = { }; function genomeTrack(layout,tracks) { + console.log(layout); this.tracks = tracks; this.layout = layout; this.numTracks = this.countTracks(); + this.comparisonContainerCallback = null; if('undefined' !== typeof layout) { - // Copy over any defaults not passed in - // by the user - for(var i in linearTrackDefaults) { - if('undefined' == typeof layout[i]) { - this.layout[i] = linearTrackDefaults[i]; - } - } + // Copy over any defaults not passed in + // by the user + for(var i in linearTrackDefaults) { + if('undefined' == typeof layout[i]) { + this.layout[i] = linearTrackDefaults[i]; + } + } } if('undefined' == typeof layout.plotid) { - this.layout.plotid = layout.container.slice(1); + this.layout.plotid = layout.container.slice(1); } this.layout.containerid = layout.container.slice(1); @@ -41,14 +43,14 @@ function genomeTrack(layout,tracks) { this.itemRects = []; this.x = d3.scale.linear() - .domain([0, layout.genomesize]) - .range([0,this.layout.width_without_margins]); + .domain([0, layout.genomesize]) + .range([0,this.layout.width_without_margins]); this.x1 = d3.scale.linear() - .range([0,this.layout.width_without_margins]) + .range([0,this.layout.width_without_margins]) .domain([0, layout.genomesize]); this.y1 = d3.scale.linear() - .domain([0,this.numTracks]) - .range([0,(this.layout.height_without_axis-this.layout.bottom_margin)]); + .domain([0,this.numTracks]) + .range([0,(this.layout.height_without_axis-this.layout.bottom_margin)]); // We need x1 and y1 in the initialization's scope too // to deal with passing it in to make the lollipops @@ -77,10 +79,8 @@ function genomeTrack(layout,tracks) { .attr("id", "trackClip_" + this.layout.containerid) .append("rect") .attr("width", this.layout.width_without_margins) - // .attr("width", this.layout.width_without_margins + this.layout.right_margin) .attr("height", this.layout.height) .attr("transform", "translate(0,0)"); - // .attr("transform", "translate(" + this.layout.left_margin + ",0)"); this.drawFeatures(); @@ -993,7 +993,7 @@ genomeTrack.prototype.displayAxis = function() { } genomeTrack.prototype.update = function(startbp, endbp, params) { - // console.log(startbp, endbp); + //console.log(startbp, endbp); this.visStart = startbp; this.visEnd = endbp; @@ -1004,7 +1004,7 @@ genomeTrack.prototype.displayAxis = function() { } genomeTrack.prototype.update_finished = function(startbp, endbp, params) { - // console.log("Thank you, got: " + startbp, endbp); + //console.log("Thank you, got: " + startbp, endbp); } @@ -1047,6 +1047,7 @@ genomeTrack.prototype.dragresize = function(d) { } genomeTrack.prototype.redraw = function() { + this.comparisonRedrawer(); for(var i = 0; i < this.tracks.length; i++) { @@ -1077,8 +1078,18 @@ genomeTrack.prototype.redraw = function() { } this.axisContainer.select(".xaxislinear").call(this.xAxis); +}; -} +genomeTrack.prototype.setComparisonContainer = function(comparisoncontainerfunction){ + this.comparisonContainerCallback = comparisoncontainerfunction; +}; + +genomeTrack.prototype.comparisonRedrawer = function(){ + var sequenceid = this.layout.id; + if (this.comparisonContainerCallback != undefined){ + this.comparisonContainerCallback(sequenceid, this.visStart, this.visEnd); + } +}; genomeTrack.prototype.rescale = function() { var cfg = this.layout; diff --git a/templates/about.html b/templates/about.html index 6cc5876..c41e615 100644 --- a/templates/about.html +++ b/templates/about.html @@ -4,14 +4,17 @@ {% block sidebar %}

Definitions

-

Genomic Islands - large genomic regions (typically > 8kb), that are thought to have horizontal origins. These regions can often contain genes that are related to antibiotic resistance or virulence.

- -

Sequence Composition GI Prediction Methods - bacterial genomes tend to naturally have differences in sequence composition such as GC% and codon bias. Therefore, a region within a genome that has abnormal sequence composition could indicate that it originated from another genome. Various tools (incl. SIGI-HMM and IslandPath-DIMOB) look for regions with abnormal sequence composition.

- -

Comparative Genomic GI Prediction Methods - genomic regions that are not present within related strains suggest that the region was horizontally transferred. IslandPick is a method that automatically selects comparison genomes that are within a proper evolutionary distance and identifies regions that are unique to only a single genome.

- -

Mobility Genes - are genes related to the movement of mobile genetic elements (incl. genomic islands), such as transposases and integrases.

- +

Genomic Islands - large genomic regions (typically > 8kb), that are thought to have horizontal origins. These regions can often contain genes that are related to antibiotic resistance or virulence.

+ +

Sequence Composition GI Prediction Methods - bacterial genomes tend to naturally have differences in sequence composition such as GC% and codon bias. Therefore, a region within a genome that has abnormal sequence composition could indicate that it originated from another genome. Various tools (incl. SIGI-HMM and IslandPath-DIMOB) look for regions with abnormal sequence composition.

+ +

Comparative Genomic GI Prediction Methods - genomic regions that are not present within related strains suggest that the region was horizontally transferred. IslandPick is a method that automatically selects comparison genomes that are within a proper evolutionary distance and identifies regions that are unique to only a single genome.

+ +

Mobility Genes - are genes related to the movement of mobile genetic elements (incl. genomic islands), such as transposases and integrases.

+ +  
+ + {% include "citation.html" %} {% endblock sidebar %} {% block content %} @@ -32,7 +35,7 @@

IslandViewer

-

This web site was developed so that researchers could easily view and download genomic islands for all published sequenced bacterial and archaeal genomes that have been predicted using the the currently most accurate GI prediction methods. Users can also upload their own unpublished genomes for analysis. The source code and entire GI data sets are available for download and acknowledgment information is available for those who use our resources . Please contact us with any questions or comments. Note, this is IslandViewer 3, the older IslandViewer 2 is still available for any old analysis needs.

+

This web site was developed so that researchers could easily view and download genomic islands for all published sequenced bacterial and archaeal genomes that have been predicted using the the currently most accurate GI prediction methods. Users can also upload their own unpublished genomes for analysis. The source code and entire GI data sets are available for download and acknowledgment information is available for those who use our resources. This software and website is developed and maintained by the Brinkman lab at Simon Fraser University, Canada. Please contact us with any questions or comments. Note, this is IslandViewer 3, the older IslandViewer 2 is still available for any old analysis needs.

IslandPick

diff --git a/templates/acknowledgements.html b/templates/acknowledgements.html index 9854ae8..169a080 100644 --- a/templates/acknowledgements.html +++ b/templates/acknowledgements.html @@ -1,28 +1,34 @@ {% extends "base.html" %} {% load static %} +{% block sidebar %} +

IslandViewer software is being developed by the Brinkman lab at Simon Fraser University, Canada

+{% endblock sidebar %} + + {% block content %}

Acknowledgements

-

We would appreciate that anyone who uses IslandViewer to cite:

+

We would appreciate anyone who uses IslandViewer to cite:

Dhillon, B.K., Laird, M.R., Shay, J.A., Winsor, G.L., Lo, R., Nizam, F., Pereira, S.K., Waglechner, N., McArthur A.G., Langille, M.G.I., and Brinkman, F.S.L. (2015). "IslandViewer 3: more flexible, interactive genomic island discovery, visualization and analysis", Nucleic Acids Research, 43 (W1): W104-W108. doi: 10.1093/nar/gkv401
+ and note these earlier papers: -
- Dhillon, B.K., Chiu, T.A., Laird, M.R., Langille, M.G.I., and Brinkman, F.S.L. (2013). “IslandViewer update: improved genomic island discovery and visualization“, Nucleic Acids Research, 41(Web server issue):W129-132. PMID: 23677610 -
-
- Langille, M.G.I. and F.S.L. Brinkman (2009). “IslandViewer: an integrated interface for computational identification and visualization of genomic islands”, Bioinformatics, Jan. 16 (EPub). PMID: 19151094 -
+
+ Dhillon, B.K., Chiu, T.A., Laird, M.R., Langille, M.G.I., and Brinkman, F.S.L. (2013). “IslandViewer update: improved genomic island discovery and visualization“, Nucleic Acids Research, 41(Web server issue):W129-132. doi: 10.1093/nar/gkt394 +
+  
+ Langille, M.G.I. and Brinkman, F.S.L. (2009). “IslandViewer: an integrated interface for computational identification and visualization of genomic islands”, Bioinformatics, (2009) 25 (5): 664-665. doi: 10.1093/bioinformatics/btp030 +

In addition, depending on the resources used, we would encourage the acknowledgement of one or more of the following resources:

  • SIGI-HMM (Waack et al., 2006)
  • -
  • IslandPath-DIMOB (Langille et al., 2008)
  • +
  • IslandPath-DIMOB (Hsiao et al., 2003, Hsiao et al., 2005 and Langille et al., 2008)
  • IslandPick (Langille et al., 2008)
  • Mauve (Darling et al. 2010; Rissman et al., 2009)
  • Virulence Factor Database - VFDB - (Chen et al., 2012)
  • diff --git a/templates/circularplot.js b/templates/circularplot.js index fa14ca3..a26981e 100644 --- a/templates/circularplot.js +++ b/templates/circularplot.js @@ -8,6 +8,7 @@ var {{ varName|default:"circular" }}data = [ visible: false, showLabels: true, showTooltip: true, + showTooltip: true, //skipLinear: true, linear_skipInit: true, {% if ext_id %}ext_id: '{{ext_id}}', @@ -140,10 +141,14 @@ var {{ varName|default:"circular" }}_aid = "{{ aid }}"; {% comment %}Skip the entire code section if we're just pulling in another plot's data{% endcomment %} {% if not skip_initialize %} -var islandviewerObj = new Islandviewer('{{ aid }}', '{{ext_id}}', {{ genomesize|default:"0" }}, "{{ genomename }}", {{ plotName|default:"circular" }}data); -// {{ genomename|pprint }} +window.container = new MultiVis("#linearchartcomparisons"); +window.islandviewerObj = new Islandviewer('{{ aid }}', '{{ext_id}}', {{ genomesize|default:"0" }}, "{{ genomename }}", {{ plotName|default:"circular" }}data); +window.islandviewerObj.addComparison(window.container.updateSequenceVisualization); + update_legend(); + + var {{ plotName|default:"circular" }}layout = {genomesize: {{ genomesize }}, container: "{{ container }}", h: 500, w: 500, ExtraWidthX: 55, TranslateX: 25, ExtraWidthY: 40, TranslateY: 20, movecursor: true, dblclick: '{{ varName|default:'' }}islandviewerObj' }; var {{ varName|default:"circular" }}containerid = "{{ container }}".slice(1); @@ -153,7 +158,9 @@ var {{ plotName|default:"circular" }}TrackObj = islandviewerObj.addCircularPlot( $('#loadingimg').remove(); -var {{ plotName|default:"circular" }}Linearlayout = {genomesize: {{ genomesize }}, container: "{{ container }}linear", width: 600, height: 135, bottom_margin:0, initStart:0, initEnd: Math.min(1000, {{ genomesize }})}; +var linearcontainerwidth = 1115; + +var {{ plotName|default:"circular" }}Linearlayout = {id: 0,genomesize: {{ genomesize }}, container: "{{ container }}linear", width: linearcontainerwidth, height: 135, bottom_margin:0, initStart:0, initEnd: Math.min(1000, {{ genomesize }})}; //var {{ plotName|default:"circular" }}LinearTrack = new genomeTrack({{ plotName|default:"circular" }}Linearlayout, {{ plotName|default:"circular" }}data); var {{ plotName|default:"circular" }}LinearTrack = islandviewerObj.addLinearPlot({{ plotName|default:"circular" }}Linearlayout); @@ -172,12 +179,6 @@ $('#gene_dialog').dialog( { position: { my: "left top", at: "right top", of: "{{ } } ); -//$('#genome_selector_dialog').dialog( { position: { my: "center", at: "center", of: window }, -// height: 300, width: 600, -// title: "Select a genome", -// autoOpen: true -// } ); - function updateStrand(cb, strand) { var track = ''; @@ -215,7 +216,6 @@ function updateStrand(cb, strand) { } } -//var virulenceMappings = { 'VFDB': ['VFDB', 'Victors', 'Patric_VF'], var virulenceMappings = { 'VFDB': ['VFDB'], 'ARDB': ['ARDB', 'CARD'], 'BLAST': ['BLAST'], @@ -226,13 +226,8 @@ var virulenceMappings = { 'VFDB': ['VFDB'], function updateVirulence(cb, vir) { var vir_factor = vir; - // var vir_factors = virulenceMappings[vir]; - // for(var x = 0; x < vir_factors.length; x++) { - // vir_factor = vir_factors[x]; -// console.log(vir_factor); if(cb.checked) { - // console.log("showing: " + vir_factor); {{ plotName|default:"circular" }}TrackObj.showGlyphTrackType("{{ plotName|default:"circular" }}Virulence", vir_factor); if('undefined' !== typeof window.secondTrackObj) { window.secondTrackObj.showGlyphTrackType("{{ plotName|default:"circular" }}Virulence", vir_factor); @@ -282,7 +277,6 @@ window.onload = function() { var half_range = (item.end - item.start)/2; {{ plotName|default:"circular" }}LinearTrack.update(Math.max(0,(item.start-half_range)), Math.min({{ genomesize }}, (item.end+half_range))); -// {{ plotName|default:"circular" }}LinearTrack.update(2840000,2905000); {{ plotName|default:"circular" }}TrackObj.moveBrushbyBP(Math.max(0,(item.start-half_range)), Math.min({{ genomesize }}, (item.end+half_range))); @@ -294,16 +288,13 @@ window.onload = function() { } } - $("#second_genome_select").chosen({width: "525px"}); + $("#second_genome_select").chosen({width: "100%"}); initialize_gene_search(); if('undefined' !== typeof reloadStr) { - // console.log(reloadStr); reload(reloadStr); } - // reload(); -// load_second(); {% if contig_controls %} $('#contigcontrols').show(); @@ -318,7 +309,7 @@ function show_gene_search() { return; } - $('#show_gene_search').html("Hide search"); + $('#show_gene_search').html("Hide Search"); $('#gene_search_dialog').slideToggle('fast'); $("#gene_search_input").focus(); @@ -421,7 +412,6 @@ function serialize() { if('undefined' !== typeof window.secondislandviewerObj) { params['s'] = window.secondislandviewerObj.serialize(); - // params['s']['id'] = window.secondislandviewerObj.aid; } if($('#gene_dialog').dialog( "isOpen" ) === false) { @@ -430,7 +420,6 @@ function serialize() { params['d'] = {v: true}; var o = $('#gene_dialog').dialog( "open" ).offset(); - // params['d']['p'] = $('#gene_dialog').dialog('option', 'position'); params['d']['t'] = o.top; params['d']['l'] = o.left; @@ -440,10 +429,6 @@ function serialize() { uri = encodeURIComponent(JSON.stringify(params)); - // decoded = decodeURIComponent(uri); - - // console.log(decoded); - url = insertParam('load', uri); console.log(url); @@ -477,7 +462,6 @@ function insertParam(key, value) if(i<0) {kvp[kvp.length] = [key,value].join('=');} //this will reload the page, it's likely better to store this until finished - // document.location.search = kvp.join('&'); return document.location.href + '?' + kvp.join('&'); } @@ -489,7 +473,6 @@ function reload(paramsStr) { } catch(err) { alert("Error decoding url."); } - // console.log(params); if('undefined' !== typeof params['m']) { islandviewerObj.reload(params['m']); @@ -516,8 +499,8 @@ function reload(paramsStr) { } if('undefined' !== typeof params['s'] && 'undefined' !== typeof params['s']['id']) { - obj = load_second(params['s']['id'], params['s']); - // obj.reload(params['s']); + obj = load_second(params['s']['id'], params['s']); + // islandviewerObj.addComparison(window.container.updateSequenceVisualization); } } @@ -567,6 +550,10 @@ function show_genome_dialog() { }); } +function load_second_helper(aidParam, reloadParams){ + $("#linearchartcomparisons").toggle(); + var secondplot = load_second(aidParam,reloadParams); +} function load_second(aidParam, reloadParams) { aid = $("#second_genome_select").val(); @@ -575,8 +562,6 @@ function load_second(aidParam, reloadParams) { aid = aidParam; } -// console.log("loading " + aid); - if($('#genome_selector_dialog').is(":visible")) { $('#genome_selector_dialog').slideToggle(); } @@ -588,20 +573,22 @@ function load_second(aidParam, reloadParams) { var url = "{% url 'circularplotjs' '9999' %}".replace("9999", aid); url += "?skipinit=true&varname=second"; -// var url = "/islandviewer/plot/553?skipinit=true&varname=second"; - -// console.log(url); $("#loadingspinner").show("fast"); - $.getScript( url, function() { -// console.log("loaded"); -// console.log(second_genomesize); + + $.ajax({url:url, + type: "GET", + async: false, + cahce: false,}); window.secondislandviewerObj = new Islandviewer(aid, second_extid, second_genomesize, second_genomename, seconddata); - $('#second_genome_title').html(second_genomename); - // We can update hte legend here because it only depends on the dataset + container.backbone.parseAndRenderBackbone("getMauve/?firstgenomeextid="+islandviewerObj.ext_id+"&secondgenomeextid="+window.secondislandviewerObj.ext_id,container); + $("#linearchartcomparisons").toggle(); + + $('#second_genome_title').html(second_genomename); + // We can update the legend here because it only depends on the dataset update_legend(); // Update the tracks if any are turned off @@ -612,8 +599,11 @@ function load_second(aidParam, reloadParams) { window.secondTrackObj = secondislandviewerObj.addCircularPlot(secondlayout); $('#rightplot').draggable({ handle: ".move_rightplot" }); - var secondLinearlayout = {genomesize: second_genomesize, container: "#secondchartlinear", width: 600, height: 135, bottom_margin:0, plotid: 'circularchartlinear'}; + var secondLinearlayout = {id:1,genomesize: second_genomesize, container: "#secondchartlinear", width: linearcontainerwidth, height: 135, bottom_margin:0, plotid: 'circularchartlinear'}; // var secondLinearTrack = new genomeTrack(secondLinearlayout, seconddata); + + secondislandviewerObj.addComparison(window.container.updateSequenceVisualization); + window.secondLinearTrack = secondislandviewerObj.addLinearPlot(secondLinearlayout); secondTrackObj.attachBrush(secondLinearTrack); @@ -626,7 +616,9 @@ function load_second(aidParam, reloadParams) { for(var i=0; i < seconddata.length; i++) { if(seconddata[i].trackName == "{{ plotName|default:"circular" }}Integrated") { if(seconddata[i].items.length > 0) { - item = seconddata[i].items[0]; + item = seconddata[i].items[0];// console.log("loaded"); +// console.log(second_genomesize); + } var half_range = (item.end - item.start)/2; @@ -662,18 +654,19 @@ function load_second(aidParam, reloadParams) { $('#linearname').html({{ varName|default:"circular" }}_genomename); $('#secondlinearname').html(second_genomename); }); - +/* }).done(function() { if('undefined' !== typeof reloadParams) { window.secondislandviewerObj.reload(reloadParams); - } + }// console.log("loaded"); +// console.log(second_genomesize); +*/ $("#loadingspinner").hide("fast"); - }); // end getScript() - +// }); // end getScript()*/ return window.secondislandviewerObj; } @@ -721,7 +714,6 @@ function update_legend() { methods = secondmethods; } -//console.log(methods); // Now update the legend var allmethods = ['circularIntegrated', 'circularIslandpick', 'circularSigi', 'circularDimob', 'PAG', 'VFDB', 'ARDB', 'CARD', 'RGI', 'Victors', 'PATRIC_VF', 'BLAST']; // First disable all checkboxes and say nothing is run @@ -762,7 +754,7 @@ function feature_tour() { } intro.onexit(function() { if(dialog_was_open === false) { - $('#gene_dialog').dialog( "close" ); + $('#gene_dialog').dialog( "close timestamp on the file will change. When Apache sees the file has been updated, it will restart your Django application for you.") } hide_download(); // $('#download_dialog').addClass("hidden"); diff --git a/templates/citation.html b/templates/citation.html new file mode 100644 index 0000000..d246887 --- /dev/null +++ b/templates/citation.html @@ -0,0 +1,2 @@ + +
    If you use IslandViewer for your research, please cite the most recent publication. Thank You!
    Dhillon, B.K. et al. 2015.
    "IslandViewer 3: more flexible, interactive genomic island discovery, visualization and analysis"
    Nucleic Acids Research, 43 (W1): W104-W108.
    doi: 10.1093/nar/gkv401
    diff --git a/templates/download.html b/templates/download.html index eb9fdfb..fcf475e 100644 --- a/templates/download.html +++ b/templates/download.html @@ -2,7 +2,7 @@ {% load static %} {% block sidebar %} -

    We would appreciate researchers acknowledge IslandViewer and any datasets that they have used.

    +

    We would appreciate researchers acknowledge IslandViewer and any datasets that they have used.

    {% endblock sidebar %} {% block content %} @@ -27,13 +27,13 @@

    Source Code

    -

    Please note that the following three methods are integrated into IslandViewer.

    +

    Please note that the following three methods are integrated into IslandViewer.

    -

    IslandPick is currently very dependent on an in-house MySQL database of all published genomes, and is optimized for use on our computer cluster. Although it would require a significant amount of effort for a casual user to install, we still believe in open access to our software. Therefore, those researchers with sophisticated bioinformatics backgrounds are welcome to view and use our source code, which is available under a GPL license here.

    +

    IslandPick is currently very dependent on an in-house MySQL database of all published genomes, and is optimized for use on our computer cluster. Although it would require a significant amount of effort for a casual user to install, we still believe in open access to our software. Therefore, those researchers with sophisticated bioinformatics backgrounds are welcome to view and use our source code, which is available under a GPL license here.

    IslandPath-DIMOB source code is available under a GPL license here. This code has been tested only on linux and requires that Perl, BioPerl, and HMMER be installed on the user's computer.

    -

    SIGI-HMM is available for download here.

    +

    SIGI-HMM is available for download here.

    We would encourage users to contact us with any special requests or concerns.

    diff --git a/templates/faq.html b/templates/faq.html index 65a8111..dd35afe 100644 --- a/templates/faq.html +++ b/templates/faq.html @@ -2,7 +2,9 @@ {% load static %} {% block sidebar %} -

    If you need further assistance, please feel free to email us at islandpick-mail@sfu.ca with your enquiries. Thank you.

    +

    If you need further assistance, please feel free to email us at islandpick-mail@sfu.ca with your enquiries. Thank you.

    +  
    + {% include "citation.html" %} {% endblock sidebar %} {% block content %} diff --git a/templates/islandpick_select_genomes.html b/templates/islandpick_select_genomes.html index 0dd4819..7da3869 100644 --- a/templates/islandpick_select_genomes.html +++ b/templates/islandpick_select_genomes.html @@ -242,13 +242,13 @@ {% endblock %} {% block sidebar %} -

    Depending on the genomes selected for comparison, IslandPick will predict genomic islands of varying insertion ages.

    +

    Depending on the genomes selected for comparison, IslandPick will predict genomic islands of varying insertion ages.

    -

    If you don't see a genome, try changing the genome distance range.

    +

    If you don't see a genome, try changing the genome distance range.

    IslandPick Selection Parameters

    -

    Changing the IslandPick paremeters will change the genomes that are picked for comparison.

    +

    Changing the IslandPick paremeters will change the genomes that are picked for comparison.

    +

    Once you are satisfied with the genome selection please select your minimum island size and click "Run IslandPick".

    +

    Minimum Genomic Island Size

    - {% if nouploads %}

    We're sorry, custom analysis are currently disabled due to maintenance, please check back later.{% if message %}

    {{ message }}{% endif %}

    {% else %} + {% if nouploads %}

    We're sorry, custom analysis are currently disabled due to maintenance, please check back later.{% if message %}

    {{ message }}{% endif %}

    {% else %}

    {% endif %} diff --git a/templates/resources.html b/templates/resources.html index be9e68c..b673777 100644 --- a/templates/resources.html +++ b/templates/resources.html @@ -2,9 +2,9 @@ {% load static %} {% block sidebar %} -

    Please note that we have listed only those computational tools that refer to genomic island predictions as opposed to methods associated with horizontal gene transfer. In addition, we only list resources with websites or freely available software.

    +

    Please note that we have listed only those computational tools that refer to genomic island predictions as opposed to methods associated with horizontal gene transfer. In addition, we only list resources with websites or freely available software.

    -

    If you think a resource should be included in this list please contact us.

    +

    If you think a resource should be included in this list please contact us.

    {% endblock sidebar %} {% block content %} @@ -25,8 +25,8 @@

    Downloadable Software - tools that once installed locally, can be used to make predictions of genomic islands

    diff --git a/templates/results.html b/templates/results.html index 2a73787..beafd64 100644 --- a/templates/results.html +++ b/templates/results.html @@ -30,7 +30,7 @@ {% else %}  
    - + The analysis is not yet complete, please check back to this page in a while, or you will be notified by email when the analysis is complete if you elected to enter an email address.
    @@ -39,7 +39,7 @@  
    Legend:
    -  
    +  
         Pending
         Running
         Complete
    @@ -54,7 +54,7 @@ {% include "noanalysis.html" %} {% else %} {% if status == "Complete" %} - + @@ -65,21 +65,18 @@
    -
    -
    +
    +
    {{ genomename }}
    {% if ref_genome %}Aligned against reference genome {{ ref_genome }}
    {% endif %} -
     
    {% if default_analysis == False %}Note: This analysis was run using non-default parameters. See here for more details.
    {% endif %} @@ -93,14 +90,21 @@
    -
    - -
    -
    -
    - -
    -
    +
    +
    + +
    +
    + +
    + +
    + +
    + +
    +
    +
    diff --git a/templates/resultssidebar.html b/templates/resultssidebar.html index a37c2ce..fda2a48 100644 --- a/templates/resultssidebar.html +++ b/templates/resultssidebar.html @@ -1,5 +1,5 @@ {% load virulencefactors %} - +

    Predicted genomic islands and virulence/resistance gene annotations (when available) are coloured within the images based on the legend. Individual items for display can be selected below.

    {% if ref_genome %}Use caution when interpreting GI predictions for incomplete genomes. Gaps are indicated as grey bars in the circular plot, and any unaligned contigs are displayed at the end of the genome plot (indicated in grey on the circular alignment plot) and should be evaluated accordingly.{% endif %}
    @@ -29,7 +29,20 @@

     

    Toolbox - +
    +
    Search for gene:
    + +
    +
    +
    Visualize two genomes + +
    @@ -41,3 +54,7 @@
  • Artemis (with GenBank file) can be used to conduct further analysis of GIs. Artemis can be easily run using the web start version.
  • Mauve (using GenBank file) can be used to produce whole genome alignments and view conserved regions surronding GIs.
  • +

     

    + {% include "citation.html" %} + diff --git a/templates/selectgenome.html b/templates/selectgenome.html index 77e69de..91d36fd 100644 --- a/templates/selectgenome.html +++ b/templates/selectgenome.html @@ -1,45 +1,45 @@ {% extends "base.html" %} -{% load static %} +{% load static %} {% block headextras %} - - - - - + + + + + {% endblock %} {% block sidebar %} - -Please select a genome from the list. -Use the search box to bring matching genomes to the top of the list. - + {% include "citation.html" %} {% endblock %} {% block content %} -
    -IslandViewer

    -

    IslandViewer is a computational tool that integrates three different genomic island prediction methods: IslandPick, IslandPath-DIMOB, and SIGI-HMM. More Information. See our FAQs

    -

    -   Example, Example (incomplete genome) +
    + IslandViewer
    +  
    +

    IslandViewer is a computational tool that integrates three different genomic island prediction methods: IslandPick, IslandPath-DIMOB, and SIGI-HMM. More Information. See our FAQs

    +
    +  
    +    Example, Example (incomplete genome) +
     
     
    +News
     
    -

    News:

    +

    2016/01/21 - Small changes have been made to IslandViewer for improved clarity and better acknowledgement of past work. If you haven't already, check out the latest IslandViewer paper published last summer. Much more on improved visualization and genomic island predictions to come soon.

    +

    2015/12/08 - Service was disrupted to IslandViewer and the SFU emergency power supply on Tuesday, December 8 while planned repairs took place. We apologize for the inconvenience.

    2015/04/20 - Islandviewer 3 is now out of beta, however if you still need to access older analysis using IslandViewer 2 we will keep it available here for the next few months.

    -

    2015/03/03 - IslandViewer 3 has officially been released and is available here. IslandViewer 3 includes a new interactive genome visualization tool, IslandPlot, and expanded virulence factor, antimicrobial resistance gene, and pathogen-associated gene annotations, as well as homologs of these genes in closely related genomes. Notably, incomplete genomes are accepted as input in IslandViewer 3, though we strongly urge users to use complete genomes whenever possible. The old IslandViewer website will still be available for users to download results for any previously analyized custom genomes, but will eventually be replaced by IslandViewer 3. If you have any questions, comments, or issues with IslandViewer 3, please contact us.

    +

    2015/03/03 - IslandViewer 3 has officially been released and is available here. IslandViewer 3 includes a new interactive genome visualization tool, IslandPlot, and expanded virulence factor, antimicrobial resistance gene, and pathogen-associated gene annotations, as well as homologs of these genes in closely related genomes. Notably, incomplete genomes are accepted as input in IslandViewer 3, though we strongly urge users to use complete genomes whenever possible. The old IslandViewer website will still be available for users to download results for any previously analyized custom genomes, but will eventually be replaced by IslandViewer 3. If you have any questions, comments, or issues with IslandViewer 3, please contact us.

    2015/01/01 - Interactive IslandPlot visualizations are now available for circular and linear genomes views. In addition to this, more curated virulence and resistance gene annotations have been incorporated, as well as homologs of these genes as determined using the Resistance Gene Identifier (RGI) and a custom approach for virulence factors. An updated pathogen-associated genes analysis has also been complete for all available genomes.

    @@ -54,23 +54,23 @@  
    - -
    + +
    {% endblock content %} diff --git a/templates/upload.html b/templates/upload.html index 5313c57..9ab2ee2 100644 --- a/templates/upload.html +++ b/templates/upload.html @@ -331,7 +331,13 @@ document.getElementById('submitted').style.display = ''; } - + +

    Note for incomplete genomes

    +
    +

    Incomplete genomes are now accepted as input due to popular demand. However, whole genome analysis is still preferred to reduce false predictions and missing GIs. Please use at your own risk. We suggest to minimize the number of contigs before performing GI analysis and carefully evaluate all results from such custom jobs. Contigs will be ordered against a user-selected reference genome using the Mauve contig orderer (Rissman et al., 2009). Please note that annotation of the contigs is still required.

    +
    +  
    +

    Hints for a successful analysis

    Check and see if your genome file contains protein sequences for all CDSs AND the complete nucleotide sequence. A valid genome file should have full protein sequence data (under "\translation" tag within "CDS" primary tag) and nucleotide sequence data under ORIGIN or blank header in GENBANK or EMBL format, respectively. For example:

    @@ -367,6 +373,7 @@

    +

     

     

     

    diff --git a/templates/uploadsidebar.html b/templates/uploadsidebar.html index 670808a..0b453d1 100644 --- a/templates/uploadsidebar.html +++ b/templates/uploadsidebar.html @@ -1,6 +1,8 @@ - +

    We only accept user genomes that are formatted in EMBL or GENBANK format.

    -

    Note:Incomplete genomes are now accepted as input due to popular demand. However, whole genome analysis is still preferred to reduce false predictions and missing GIs. Please use at your own risk. We suggest to minimize the number of contigs before performing GI analysis and carefully evaluate all results from such custom jobs. Contigs will be ordered against a user-selected reference genome using the Mauve contig orderer (Rissman et al., 2009). Please note that annotation of the contigs is still required.

    For published genomes please see pre-computed results.

    Uploaded genomes and GI predictions will not be visible to other users of IslandViewer and will be available for at least 1 month.

    +
    +{% include "citation.html" %} + diff --git a/webui/models.py b/webui/models.py index 4db2192..22f014d 100644 --- a/webui/models.py +++ b/webui/models.py @@ -3,7 +3,7 @@ from django.db import models from django.conf import settings import pprint -from Bio.Phylo.TreeConstruction import _DistanceMatrix, DistanceTreeConstructor +#from Bio.Phylo.TreeConstruction import _DistanceMatrix, DistanceTreeConstructor from Bio import Phylo import StringIO import json diff --git a/webui/urls.py b/webui/urls.py index b9277da..0a6f96f 100644 --- a/webui/urls.py +++ b/webui/urls.py @@ -24,6 +24,7 @@ url(r'^resources/$', views.resources, name='resources'), url(r'^contactus/$', views.contactus, name='contactus'), url(r'^faq/$', views.faq, name='faq'), + url(r'^getMauve/$', views.getMauveFile,name='mauve'), url(r'^islandpick/$', views.islandpick, name='islandpick'), url(r'acknowledgements', views.acknowledgements, name='acknowledgements'), url(r'^plot/(?P\d+)/$', views.circularplotjs, name='circularplotjs'), diff --git a/webui/views.py b/webui/views.py index ff069cb..76c1b48 100644 --- a/webui/views.py +++ b/webui/views.py @@ -23,10 +23,11 @@ from collections import OrderedDict from webui.models import VIRULENCE_FACTORS, VIRULENCE_FACTOR_CATEGORIES from django.db import connection +from scripts import mauvewrap +import glob def index(request): return render(request, 'index.html') -# return HttpResponse("Hello, world. You're at the poll index.") def showgenomes(request): context = {} @@ -92,10 +93,10 @@ def results(request, aid): context['ref_genome'] = ref_genome.name elif(analysis.atype == Analysis.MICROBEDB): -# gpv_id = Replicon.objects.using('microbedb').filter(rep_accnum=analysis.ext_id)[0].gpv_id -# context['genomename'] = Genomeproject.objects.using('microbedb').get(pk=gpv_id).org_name +# gpv_id = Replicon.objects.using('microbedb').filter(rep_accnum=analysis.ext_id)[0].gpv_id +# context['genomename'] = Genomeproject.objects.using('microbedb').get(pk=gpv_id).org_name context['genomename'] = NameCache.objects.get(cid=analysis.ext_id).name -# context['genomename'] = 'Something from Microbedb' +# context['genomename'] = 'Something from Microbedb' # Fetch the virulence factors # island_genes = Genes.objects.filter(ext_id=analysis.ext_id).order_by('start').all() @@ -1241,7 +1242,30 @@ def fetchislandsfasta(request): response['Content-Disposition'] = "attachment; filename=\"gi_{0}.txt\"".format(filename) response.write(fasta) return response - + +def getMauveFile(request): + firstgenomeextid = request.GET.get('firstgenomeextid') + secondgenomeextid = request.GET.get('secondgenomeextid') + + firstgenomeextid = firstgenomeextid.split('.')[0] + secondgenomeextid = secondgenomeextid.split('.')[0] + + firstReplicon = Replicon.objects.using('microbedb').filter(rep_accnum__contains=firstgenomeextid)[0] + secondReplicon = Replicon.objects.using('microbedb').filter(rep_accnum__contains=secondgenomeextid)[0] + + firstGenomeProject = Genomeproject.objects.using('microbedb').get(gpv_id__exact=firstReplicon.gpv_id) + secondGenomeProject = Genomeproject.objects.using('microbedb').get(gpv_id__exact=secondReplicon.gpv_id) + + firstGbk = glob.glob(firstGenomeProject.gpv_directory+"/*"+".gbk")[0] + secondGbk = glob.glob(secondGenomeProject.gpv_directory+"/*"+".gbk")[0] + + mauveOutputPath = mauvewrap.getMauveResults(firstGbk,secondGbk) + + with open(mauveOutputPath,'r') as f: + data = f.read() + + return HttpResponse(data) + def about(request): return render(request, "about.html")