From a0a1d8b70e02871328fb044c7ae190f805b0a04e Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Fri, 21 Jun 2013 20:58:12 +0000 Subject: Fixed bug where cursor was still being used in query --- wqflask/base/data_set.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'wqflask') diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index 07fe9cd9..1668940c 100755 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -779,14 +779,14 @@ class MrnaAssayDataSet(DataSet): #Max LRS and its Locus location if this_trait.lrs and this_trait.locus: - self.cursor.execute(""" + query = """ select Geno.Chr, Geno.Mb from Geno, Species - where Species.Name = '%s' and - Geno.Name = '%s' and + where Species.Name = '{}' and + Geno.Name = '{}' and Geno.SpeciesId = Species.Id - """ % (species, this_trait.locus)) - result = self.cursor.fetchone() - + """.format(species, this_trait.locus) + result = g.db.execute(query).fetchone() + if result: #if result[0] and result[1]: # lrs_chr = result[0] -- cgit v1.2.3 From 5b05c3322c1ea25a30bec0048847e5265a036d15 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 21 Jun 2013 21:00:34 +0000 Subject: Working on getting logins working again --- wqflask/wqflask/static/new/javascript/login.coffee | 2 +- wqflask/wqflask/static/new/javascript/login.js | 2 +- wqflask/wqflask/templates/base.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/static/new/javascript/login.coffee b/wqflask/wqflask/static/new/javascript/login.coffee index c49353d5..95e2b5c7 100644 --- a/wqflask/wqflask/static/new/javascript/login.coffee +++ b/wqflask/wqflask/static/new/javascript/login.coffee @@ -39,4 +39,4 @@ $ -> ) - $("form").on("submit", submit_form) + $("#colorbox form").on("submit", submit_form) diff --git a/wqflask/wqflask/static/new/javascript/login.js b/wqflask/wqflask/static/new/javascript/login.js index 6c6120ec..d51a0ac8 100644 --- a/wqflask/wqflask/static/new/javascript/login.js +++ b/wqflask/wqflask/static/new/javascript/login.js @@ -38,7 +38,7 @@ success: form_success }); }; - return $("form").on("submit", submit_form); + return $("#colorbox form").on("submit", submit_form); }); }).call(this); diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html index 741c5425..bdb1c362 100644 --- a/wqflask/wqflask/templates/base.html +++ b/wqflask/wqflask/templates/base.html @@ -180,7 +180,7 @@ - + {% block js %} {% endblock %} -- cgit v1.2.3 From a9960c6e0b99e3641d309d22af9f1be77d738c3f Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 21 Jun 2013 21:33:01 +0000 Subject: Added a thank you for siging in message Fixed issues where homepage was reloaded in modal after siging in --- wqflask/cfg/default_settings.py | 2 ++ wqflask/wqflask/static/new/javascript/login.coffee | 4 ++-- wqflask/wqflask/static/new/javascript/login.js | 3 ++- wqflask/wqflask/templates/security/thank_you.html | 6 ++++++ wqflask/wqflask/views.py | 10 ++++++++-- 5 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 wqflask/wqflask/templates/security/thank_you.html (limited to 'wqflask') diff --git a/wqflask/cfg/default_settings.py b/wqflask/cfg/default_settings.py index 96f7f1a5..e638a9c0 100644 --- a/wqflask/cfg/default_settings.py +++ b/wqflask/cfg/default_settings.py @@ -13,3 +13,5 @@ SECURITY_REGISTERABLE = True SECURITY_RECOVERABLE = True SECURITY_EMAIL_SENDER = "no-reply@genenetwork.org" + +SECURITY_POST_LOGIN_VIEW = "/thank_you" diff --git a/wqflask/wqflask/static/new/javascript/login.coffee b/wqflask/wqflask/static/new/javascript/login.coffee index 95e2b5c7..15dafd9a 100644 --- a/wqflask/wqflask/static/new/javascript/login.coffee +++ b/wqflask/wqflask/static/new/javascript/login.coffee @@ -13,8 +13,8 @@ $ -> - - $(document).on("click", ".modalize", modalize) + $(document).one("click", ".modalize", modalize) + console.log("Modalized click!!!") form_success = (data) -> $.colorbox( diff --git a/wqflask/wqflask/static/new/javascript/login.js b/wqflask/wqflask/static/new/javascript/login.js index d51a0ac8..ce301353 100644 --- a/wqflask/wqflask/static/new/javascript/login.js +++ b/wqflask/wqflask/static/new/javascript/login.js @@ -14,7 +14,8 @@ } }); }; - $(document).on("click", ".modalize", modalize); + $(document).one("click", ".modalize", modalize); + console.log("Modalized click!!!"); form_success = function(data) { return $.colorbox({ open: true, diff --git a/wqflask/wqflask/templates/security/thank_you.html b/wqflask/wqflask/templates/security/thank_you.html new file mode 100644 index 00000000..f2e2db68 --- /dev/null +++ b/wqflask/wqflask/templates/security/thank_you.html @@ -0,0 +1,6 @@ +{% from "security/_macros.html" import render_only_errors %} +{% include "security/_messages.html" %} + +
+

Thank you for signing in!

+
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index b9aa3acf..90be7a71 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -87,7 +87,7 @@ def search_page(): print("key is:", pf(key)) with Bench("Loading cache"): result = Redis.get(key) - + if result: print("Cache hit!!!") with Bench("Loading results"): @@ -97,7 +97,7 @@ def search_page(): print("request.args is", request.args) the_search = search_results.SearchResultPage(request.args) result = the_search.__dict__ - + print("result: ", pf(result)) Redis.set(key, pickle.dumps(result)) Redis.expire(key, 60*60) @@ -249,11 +249,17 @@ def sharing_info_page(): return template_vars +# Take this out or secure it before going into production @app.route("/get_temp_data") def get_temp_data(): temp_uuid = request.args['key'] return flask.jsonify(temp_data.TempData(temp_uuid).get_all()) + +@app.route("/thank_you") +def thank_you(): + return render_template("security/thank_you.html") + @app.route("/manage/users") def manage_users(): template_vars = user_manager.UsersManager() -- cgit v1.2.3 From d703c6e456334187a279c04e9b4cf6a8e5099785 Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Tue, 25 Jun 2013 23:09:09 +0000 Subject: Added DataSets class to dataset.py that will be used to create list of confidential datasets --- wqflask/base/data_set.py | 35 ++++++++++++++++++++++-- wqflask/wqflask/correlation/show_corr_results.py | 7 +++++ wqflask/wqflask/views.py | 3 ++ 3 files changed, 43 insertions(+), 2 deletions(-) (limited to 'wqflask') diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index 1668940c..f301cc05 100755 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -167,8 +167,8 @@ class DatasetGroup(object): self.incparentsf1 = False self.allsamples = None - - + + def get_markers(self): #print("self.species is:", self.species) if self.species == "human": @@ -222,6 +222,37 @@ class DatasetGroup(object): self.samplelist = list(genotype.prgy) +class DataSets(object): + """Builds a list of DataSets""" + + def __init__(self): + self.datasets = list() + + type_dict = {'phenotype': 'PublishFreeze', + 'mrna_assay': 'ProbeSetFreeze', + 'genotype': 'GenoFreeze'} + + for dataset_type in type_dict: + query = "SELECT Name FROM {}".format(type_dict[dataset_type]) + for result in g.db.execute(query).fetchall(): + #The query at the beginning of this function isn't necessary here, but still would + #rather just reuse it + create_dataset(result.Name) + + + #query = """SELECT Name FROM ProbeSetFreeze + # UNION + # SELECT Name From PublishFreeze + # UNION + # SELECT Name From GenoFreeze""" + # + #for result in g.db.execute(query).fetchall(): + # dataset = DataSet(result.Name) + # self.datasets.append(dataset) + +#ds = DataSets() +#print("[orange] ds:", ds.datasets) + class DataSet(object): """ DataSet class defines a dataset in webqtl, can be either Microarray, diff --git a/wqflask/wqflask/correlation/show_corr_results.py b/wqflask/wqflask/correlation/show_corr_results.py index 1410ae0c..3b47e970 100644 --- a/wqflask/wqflask/correlation/show_corr_results.py +++ b/wqflask/wqflask/correlation/show_corr_results.py @@ -203,6 +203,13 @@ class CorrelationResults(object): # mb = trait_object.mb # ) + + + trait_list = self.getTissueCorrelationByList( primary_trait_symbol = self.this_trait.symbol, + corr_results = self.correlation_results, + TissueProbeSetFreezeId = 1, + method=1) + #XZ, 09/18/2008: get all information about the user selected database. #target_db_name = fd.corr_dataset #self.target_db_name = start_vars['corr_dataset'] diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index b9aa3acf..fcb34d31 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -27,6 +27,7 @@ from flask import render_template, request, make_response, Response, Flask, g, c from wqflask import search_results from base.data_set import DataSet # Used by YAML in marker_regression +from base.data_set import DataSets from wqflask.show_trait import show_trait from wqflask.show_trait import export_trait_data from wqflask.marker_regression import marker_regression @@ -53,6 +54,8 @@ def connect_db(): @app.route("/") def index_page(): print("Sending index_page") + ds = DataSets() + print("[orange] ds:", ds.datasets) return render_template("index_page.html") @app.route("/data_sharing") -- cgit v1.2.3 From 6fbbfe5e8bcc3b57c4177687bbf67bf041da3cba Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Wed, 26 Jun 2013 21:35:07 +0000 Subject: Got code that creates DataSets object running Fixed one genofile that had extra quotation marks in the comments that caused an error Defaults mb_graph_interval to 1 for species without chromosome lengths in megabases --- web/genotypes/B6D2F2-PSU.geno | 8 +++--- wqflask/base/data_set.py | 55 +++++++++++++++++++++------------------ wqflask/base/species.py | 10 +++++-- wqflask/wqflask/search_results.py | 2 -- wqflask/wqflask/views.py | 3 ++- 5 files changed, 43 insertions(+), 35 deletions(-) (limited to 'wqflask') diff --git a/web/genotypes/B6D2F2-PSU.geno b/web/genotypes/B6D2F2-PSU.geno index 2c8876a0..a0c1728f 100755 --- a/web/genotypes/B6D2F2-PSU.geno +++ b/web/genotypes/B6D2F2-PSU.geno @@ -1,5 +1,5 @@ -"#This is B6D2F2-PSU genotype file, it should be tab-delimited" -"#the first three/four columns should be ""Chr, Locus, cM, [Mb]"" (case sensitive)" +#This is B6D2F2-PSU genotype file, it should be tab-delimited +#the first three/four columns should be ""Chr, Locus, cM, [Mb]"" (case sensitive) #please save as Unix format text file. #comment line always start with a '#' #type riset or intercross @@ -8,9 +8,9 @@ #abbreviation of maternal or paternal parents @mat:B @pat:D -"#heterozygous , optional, default is ""H""" +#heterozygous , optional, default is ""H"" @het:H -"#Unknown , optional, default is ""U""" +#Unknown , optional, default is ""U"" @unk:U Chr Locus cM Mb PSU0001 PSU0004 PSU0007 PSU0022 PSU0024 PSU0042 PSU0044 PSU0045 PSU0046 PSU0048 PSU0049 PSU0050 PSU0052 PSU0053 PSU0054 PSU0055 PSU0056 PSU0057 PSU0058 PSU0059 PSU0060 PSU0061 PSU0062 PSU0063 PSU0066 PSU0067 PSU0068 PSU0069 PSU0070 PSU0071 PSU0072 PSU0074 PSU0077 PSU0079 PSU0080 PSU0082 PSU0083 PSU0084 PSU0085 PSU0086 PSU0087 PSU0089 PSU0090 PSU0091 PSU0092 PSU0093 PSU0094 PSU0095 PSU0096 PSU0097 PSU0098 PSU0099 PSU0100 PSU0102 PSU0103 PSU0104 PSU0107 PSU0108 PSU0109 PSU0110 PSU0112 PSU0113 PSU0114 PSU0116 PSU0117 PSU0118 PSU0119 PSU0122 PSU0124 PSU0126 PSU0128 PSU0130 PSU0131 PSU0132 PSU0133 PSU0134 PSU0135 PSU0136 PSU0137 PSU0138 PSU0139 PSU0140 PSU0141 PSU0142 PSU0143 PSU0146 PSU0147 PSU0148 PSU0152 PSU0153 PSU0155 PSU0158 PSU0159 PSU0163 PSU0164 PSU0165 PSU0166 PSU0167 PSU0168 PSU0169 PSU0170 PSU0172 PSU0173 PSU0174 PSU0175 PSU0177 PSU0178 PSU0179 PSU0180 PSU0182 PSU0183 PSU0187 PSU0188 PSU0190 PSU0191 PSU0193 PSU0194 PSU0196 PSU0197 PSU0198 PSU0199 PSU0205 PSU0206 PSU0207 PSU0208 PSU0209 PSU0210 PSU0211 PSU0212 PSU0213 PSU0214 PSU0216 PSU0218 PSU0219 PSU0220 PSU0222 PSU0223 PSU0225 PSU0226 PSU0227 PSU0229 PSU0230 PSU0231 PSU0234 PSU0235 PSU0236 PSU0238 PSU0239 PSU0241 PSU0242 PSU0243 PSU0244 PSU0246 PSU0247 PSU0248 PSU0250 PSU0251 PSU0255 PSU0257 PSU0258 PSU0260 PSU0261 PSU0262 PSU0263 PSU0264 PSU0271 PSU0272 PSU0273 PSU0274 PSU0275 PSU0276 PSU0278 PSU0280 PSU0282 PSU0283 PSU0285 PSU0286 PSU0287 PSU0288 PSU0289 PSU0291 PSU0292 PSU0293 PSU0295 PSU0296 PSU0299 PSU0300 PSU0301 PSU0302 PSU0304 PSU0305 PSU0306 PSU0308 PSU0309 PSU0310 PSU0311 PSU0312 PSU0313 PSU0314 PSU0315 PSU0316 PSU0317 PSU0318 PSU0319 PSU0320 PSU0321 PSU0323 PSU0325 PSU0326 PSU0327 PSU0328 PSU0329 PSU0330 PSU0331 PSU0334 PSU0336 PSU0337 PSU0338 PSU0339 PSU0340 PSU0341 PSU0342 PSU0343 PSU0344 PSU0346 PSU0349 PSU0351 PSU0352 PSU0353 PSU0355 PSU0356 PSU0357 PSU0358 PSU0359 PSU0360 PSU0361 PSU0362 PSU0363 PSU0366 PSU0367 PSU0369 PSU0370 PSU0371 PSU0372 PSU0373 PSU0374 PSU0375 PSU0376 PSU0378 PSU0379 PSU0381 PSU0382 PSU0383 PSU0384 PSU0385 PSU0388 PSU0390 PSU0391 PSU0392 PSU0393 PSU0395 PSU0397 PSU0399 PSU0400 PSU0401 PSU0403 PSU0405 PSU0406 PSU0408 PSU0410 PSU0412 PSU0413 PSU0414 PSU0416 PSU0417 PSU0418 PSU0420 PSU0421 PSU0423 PSU0425 PSU0426 PSU0430 PSU0431 PSU0434 PSU0435 PSU0437 PSU0438 PSU0441 PSU0445 PSU0449 PSU0450 PSU0451 PSU0452 PSU0454 PSU0455 PSU0458 PSU0461 PSU0462 PSU0464 PSU0466 PSU0468 PSU0470 PSU0472 PSU0478 PSU0479 PSU0480 PSU0482 PSU0483 PSU0487 PSU0488 PSU0490 PSU0492 PSU0493 PSU0494 PSU0495 PSU0499 PSU0501 PSU0502 PSU0503 PSU0504 PSU0505 PSU0506 PSU0508 PSU0511 PSU0513 PSU0514 PSU0517 PSU0519 PSU0521 PSU0522 PSU0523 PSU0524 PSU0527 PSU0529 PSU0531 PSU0533 PSU0535 PSU0536 PSU0537 PSU0540 PSU0542 PSU0543 PSU0545 PSU0546 PSU0549 PSU0551 PSU0553 PSU0554 PSU0557 PSU0561 PSU0562 PSU0565 PSU0566 PSU0568 PSU0569 PSU0570 PSU0571 PSU0575 PSU0576 PSU0586 PSU0593 PSU0597 PSU0598 PSU0603 PSU0604 PSU0606 PSU0609 PSU0610 PSU0612 PSU0616 PSU0617 PSU0620 PSU0621 PSU0623 PSU0624 PSU0626 PSU0629 PSU0630 PSU0631 PSU0632 PSU0634 PSU0637 PSU0639 PSU0641 PSU0642 PSU0643 PSU0645 PSU0646 PSU0647 PSU0648 PSU0649 PSU0650 PSU0651 PSU0652 PSU0654 PSU0655 PSU0659 PSU0661 PSU0662 PSU0663 PSU0665 PSU0667 PSU0668 PSU0669 PSU0671 PSU0672 PSU0673 PSU0674 PSU0675 PSU0677 PSU0680 PSU0682 PSU0683 PSU0684 PSU0686 PSU0687 PSU0689 PSU0690 PSU0691 PSU0696 PSU0697 PSU0699 PSU0701 PSU0702 PSU0704 PSU0705 PSU0706 PSU0709 PSU0710 PSU0712 PSU0714 PSU0716 PSU0717 PSU0718 PSU0719 PSU0720 PSU0721 PSU0724 PSU0725 PSU0727 PSU0728 PSU0729 PSU0730 PSU0731 PSU0733 PSU0734 PSU0736 PSU0737 PSU0738 PSU0741 PSU0742 PSU0743 PSU0744 PSU0745 PSU0749 PSU0750 PSU0751 PSU0753 PSU0756 PSU0757 PSU0758 PSU0759 PSU0760 PSU0763 PSU0764 PSU0765 PSU0766 PSU0767 PSU0769 PSU0770 PSU0771 PSU0772 PSU0773 PSU0776 PSU0780 PSU0781 PSU0782 PSU0783 PSU0784 PSU0787 PSU0788 PSU0789 PSU0790 PSU0791 PSU0792 PSU0794 PSU0798 PSU0799 PSU0804 PSU0806 PSU0807 PSU0808 PSU0810 PSU0811 PSU0813 PSU0814 PSU0815 PSU0816 PSU0818 PSU0821 PSU0822 PSU0824 PSU0825 PSU0828 PSU0830 PSU0831 PSU0833 PSU0834 PSU0837 PSU0840 PSU0843 PSU0844 PSU0847 PSU0849 PSU0851 PSU0853 PSU0855 PSU0856 PSU0858 PSU0860 PSU0862 PSU0863 PSU0864 PSU1060 PSU1095 PSU1372 PSU1373 PSU1374 PSU1381 PSU1392 PSU1399 PSU1414 PSU1421 PSU1422 PSU1430 PSU1432 PSU1470 PSU1473 PSU1490 PSU1526 PSU1540 PSU1549 PSU1553 PSU1556 PSU1561 PSU1564 PSU1576 PSU1591 PSU1609 PSU1613 PSU1625 PSU1626 PSU1630 PSU1638 PSU1639 1 rs13475697 0.01 3.385827 U H H H H B D B H B H H D H H H H H H H H B H H H H D H D B B D H H B H D H B H H H B B B D B H H D H D B H H H B H B B B B B B H H B D D H H D D H D D H H B D D B B D B B D B B H B B H D B H H H D H D B D B D H H D B D D H H H D B H B H D H D H D B D D D H H D H B B H H B H B H B D H D D D D H D H H H D B D H D H H D B D B B B D H H B D H H H H D H D H D H D H D D B H D B H D H D D H H H H H D D B H H D B H H H H D H H H D H B D D D H H H H B D H H H D H B B B D B H H H H B H H B H B D D D D H D H D H D B H H H B B B B B H U B H H B D H D H D H H B B B H H H H H D B H H H B H D H D B B D B H H B D H H H B B H H H D H B H B D H B H D B H B H H H B H B H D D B H D B H H D H H D D H H H H B B H D H D H H D D B D D H H D D H H B H H H H B H H D H D H B H D D H H D D B H H H H H H D B D H H B H B H H H H H D H B B D H H D D D B B H H B H H B H B B H B D H H H B B H D B B B D D B D H H B H D D H H H B H H D B D H B H D D B H H D H D H B H H H H H D H B D B H H H D H H B H H B D H D D B H D H D B H H H D H D H D D H B B D B H D B H D H H B B H H H H B H D H H B D B D H D D H B D H B H H H D D H D H diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index f301cc05..e4bdb5c3 100755 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -46,17 +46,18 @@ from pprint import pformat as pf # Used by create_database to instantiate objects DS_NAME_MAP = {} -def create_dataset(dataset_name): +def create_dataset(dataset_name, dataset_type = None): #print("dataset_name:", dataset_name) - query = """ - SELECT DBType.Name - FROM DBList, DBType - WHERE DBList.Name = '{}' and - DBType.Id = DBList.DBTypeId - """.format(escape(dataset_name)) - #print("query is: ", pf(query)) - dataset_type = g.db.execute(query).fetchone().Name + if not dataset_type: + query = """ + SELECT DBType.Name + FROM DBList, DBType + WHERE DBList.Name = '{}' and + DBType.Id = DBList.DBTypeId + """.format(escape(dataset_name)) + #print("query is: ", pf(query)) + dataset_type = g.db.execute(query).fetchone().Name #dataset_type = cursor.fetchone()[0] #print("[blubber] dataset_type:", pf(dataset_type)) @@ -228,16 +229,17 @@ class DataSets(object): def __init__(self): self.datasets = list() - type_dict = {'phenotype': 'PublishFreeze', - 'mrna_assay': 'ProbeSetFreeze', - 'genotype': 'GenoFreeze'} + type_dict = {'Publish': 'PublishFreeze', + 'ProbeSet': 'ProbeSetFreeze', + 'Geno': 'GenoFreeze'} for dataset_type in type_dict: query = "SELECT Name FROM {}".format(type_dict[dataset_type]) for result in g.db.execute(query).fetchall(): #The query at the beginning of this function isn't necessary here, but still would #rather just reuse it - create_dataset(result.Name) + print("type: {}\tname: {}".format(dataset_type, result.Name)) + create_dataset(result.Name, dataset_type) #query = """SELECT Name FROM ProbeSetFreeze @@ -265,6 +267,8 @@ class DataSet(object): assert name, "Need a name" self.name = name self.id = None + self.shortname = None + self.fullname = None self.type = None self.setup() @@ -324,7 +328,7 @@ class DataSet(object): self.name, self.name, self.name)) - #print("query_args are:", query_args) + print("query_args are:", query_args) #print(""" # SELECT Id, Name, FullName, ShortName @@ -332,17 +336,17 @@ class DataSet(object): # WHERE public > %s AND # (Name = '%s' OR FullName = '%s' OR ShortName = '%s') # """ % (query_args)) - - self.id, self.name, self.fullname, self.shortname = g.db.execute(""" - SELECT Id, Name, FullName, ShortName - FROM %s - WHERE public > %s AND - (Name = '%s' OR FullName = '%s' OR ShortName = '%s') - """ % (query_args)).fetchone() - - #self.cursor.execute(query) - #self.id, self.name, self.fullname, self.shortname = self.cursor.fetchone() + try: + self.id, self.name, self.fullname, self.shortname = g.db.execute(""" + SELECT Id, Name, FullName, ShortName + FROM %s + WHERE public > %s AND + (Name = '%s' OR FullName = '%s' OR ShortName = '%s') + """ % (query_args)).fetchone() + except TypeError: + print("Dataset {} is not yet available in GeneNetwork.".format(self.name)) + pass class PhenotypeDataSet(DataSet): DS_NAME_MAP['Publish'] = 'PhenotypeDataSet' @@ -971,6 +975,5 @@ def geno_mrna_confidentiality(ob): authorized_users) = result.fetchall()[0] if confidential: - # Allow confidential data later - NoConfindetialDataForYouTodaySorry + return True diff --git a/wqflask/base/species.py b/wqflask/base/species.py index 191f4535..ebc2bfed 100644 --- a/wqflask/base/species.py +++ b/wqflask/base/species.py @@ -56,6 +56,7 @@ class Chromosomes(object): InbredSet.Name = %s Order by OrderId """, self.dataset.group.name).fetchall() + print("group: ", self.dataset.group.name) print("bike:", results) for item in results: @@ -68,9 +69,14 @@ class Chromosomes(object): def set_mb_graph_interval(self): """Empirical megabase interval""" + if self.chromosomes: + self.mb_graph_interval = self.get_genome_mb_length()/(len(self.chromosomes)*12) + else: + self.mb_graph_interval = 1 + #if self.chromosomes: - assert self.chromosomes, "Have to add some code back in apparently to set it to 1" - self.mb_graph_interval = self.get_genome_mb_length()/(len(self.chromosomes)*12) + #assert self.chromosomes, "Have to add some code back in apparently to set it to 1" + #self.mb_graph_interval = self.get_genome_mb_length()/(len(self.chromosomes)*12) #else: #self.mb_graph_interval = 1 diff --git a/wqflask/wqflask/search_results.py b/wqflask/wqflask/search_results.py index f76af374..504a67ce 100644 --- a/wqflask/wqflask/search_results.py +++ b/wqflask/wqflask/search_results.py @@ -162,8 +162,6 @@ class SearchResultPage(object): import redis Redis = redis.Redis() - - #def get_group_species_tree(self): # self.species_groups = collections.default_dict(list) # for key in self.results: diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index fcb34d31..e48506ab 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -54,7 +54,8 @@ def connect_db(): @app.route("/") def index_page(): print("Sending index_page") - ds = DataSets() + with Bench("Creating DataSets object"): + ds = DataSets() print("[orange] ds:", ds.datasets) return render_template("index_page.html") -- cgit v1.2.3 From 9718fc35ac90640f9ff1324af077c99fe43c4900 Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Wed, 26 Jun 2013 21:48:44 +0000 Subject: Moved code creating DataSets object to a function in dataset.py Added caching to creating DataSets object --- wqflask/base/data_set.py | 17 +++++++++++++++++ wqflask/wqflask/views.py | 17 +++++++++++++---- 2 files changed, 30 insertions(+), 4 deletions(-) (limited to 'wqflask') diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index e4bdb5c3..803cbc4f 100755 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -27,8 +27,12 @@ import string import collections import json +import cPickle as pickle import itertools +from redis import Redis +Redis = Redis() + from flask import Flask, g import reaper @@ -70,6 +74,19 @@ def create_dataset(dataset_name, dataset_type = None): dataset_class = globals()[dataset_ob] return dataset_class(dataset_name) +def create_datasets_list(): + key = "all_datasets" + result = Redis.get(key) + if result: + print("Cache hit!!!") + result = pickle.loads(result) + else: + with Bench("Creating DataSets object"): + ds = DataSets() + Redis.set(key, pickle.dumps(result)) + Redis.expire(key, 2*60) + + def create_in_clause(items): """Create an in clause for mysql""" in_clause = ', '.join("'{}'".format(x) for x in mescape(*items)) diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index e48506ab..603ff49b 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -27,7 +27,7 @@ from flask import render_template, request, make_response, Response, Flask, g, c from wqflask import search_results from base.data_set import DataSet # Used by YAML in marker_regression -from base.data_set import DataSets +from base.data_set import create_datasets_list from wqflask.show_trait import show_trait from wqflask.show_trait import export_trait_data from wqflask.marker_regression import marker_regression @@ -54,9 +54,18 @@ def connect_db(): @app.route("/") def index_page(): print("Sending index_page") - with Bench("Creating DataSets object"): - ds = DataSets() - print("[orange] ds:", ds.datasets) + create_datasets_list() + #key = "all_datasets" + #result = Redis.get(key) + #if result: + # print("Cache hit!!!") + # result = pickle.loads(result) + #else: + # with Bench("Creating DataSets object"): + # ds = DataSets() + # Redis.set(key, pickle.dumps(result)) + # Redis.expire(key, 2*60) + #print("[orange] ds:", ds.datasets) return render_template("index_page.html") @app.route("/data_sharing") -- cgit v1.2.3 From c751c6e4e50fdb35ea1108975e21735a665b48df Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 26 Jun 2013 21:50:01 +0000 Subject: More signin changes --- wqflask/wqflask/static/new/javascript/thank_you.coffee | 4 ++++ wqflask/wqflask/static/new/javascript/thank_you.js | 10 ++++++++++ wqflask/wqflask/templates/base.html | 4 ++-- wqflask/wqflask/templates/security/thank_you.html | 2 ++ 4 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 wqflask/wqflask/static/new/javascript/thank_you.coffee create mode 100644 wqflask/wqflask/static/new/javascript/thank_you.js (limited to 'wqflask') diff --git a/wqflask/wqflask/static/new/javascript/thank_you.coffee b/wqflask/wqflask/static/new/javascript/thank_you.coffee new file mode 100644 index 00000000..975f85c6 --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/thank_you.coffee @@ -0,0 +1,4 @@ +$ -> + console.log("Starting transform") + $('#login_out').text('Sign out').attr('href', '/logout').removeClass('modalize') + console.log("Transformed to sign out I hope") diff --git a/wqflask/wqflask/static/new/javascript/thank_you.js b/wqflask/wqflask/static/new/javascript/thank_you.js new file mode 100644 index 00000000..2871dd2d --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/thank_you.js @@ -0,0 +1,10 @@ +// Generated by CoffeeScript 1.4.0 +(function() { + + $(function() { + console.log("Starting transform"); + $('#login_out').text('Sign out').attr('href', '/logout').removeClass('modalize'); + return console.log("Transformed to sign out I hope"); + }); + +}).call(this); diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html index bdb1c362..cbed5859 100644 --- a/wqflask/wqflask/templates/base.html +++ b/wqflask/wqflask/templates/base.html @@ -70,9 +70,9 @@
  • {% if g.identity.name=="anon" %} - Sign in + Sign in {% else %} - Sign out + Sign out {% endif %}
  • diff --git a/wqflask/wqflask/templates/security/thank_you.html b/wqflask/wqflask/templates/security/thank_you.html index f2e2db68..dd6c7297 100644 --- a/wqflask/wqflask/templates/security/thank_you.html +++ b/wqflask/wqflask/templates/security/thank_you.html @@ -4,3 +4,5 @@

    Thank you for signing in!

    + + -- cgit v1.2.3 From 62bd1bb6ad9f9f1c991127387154b5e0ca271fae Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Thu, 27 Jun 2013 23:03:14 +0000 Subject: Created a group manager page where user administrators can create groups of datasets to give/add read privileges to --- wqflask/base/data_set.py | 50 ++++++++++++---------- wqflask/wqflask/correlation/show_corr_results.py | 8 ++-- wqflask/wqflask/templates/admin/group_manager.html | 49 +++++++++++++++++++++ wqflask/wqflask/user_manager.py | 16 +++++++ wqflask/wqflask/views.py | 13 ++++-- 5 files changed, 106 insertions(+), 30 deletions(-) create mode 100644 wqflask/wqflask/templates/admin/group_manager.html (limited to 'wqflask') diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index 803cbc4f..03b24230 100755 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -77,14 +77,31 @@ def create_dataset(dataset_name, dataset_type = None): def create_datasets_list(): key = "all_datasets" result = Redis.get(key) + if result: print("Cache hit!!!") - result = pickle.loads(result) + datasets = pickle.loads(result) + else: + datasets = list() with Bench("Creating DataSets object"): - ds = DataSets() - Redis.set(key, pickle.dumps(result)) - Redis.expire(key, 2*60) + type_dict = {'Publish': 'PublishFreeze', + 'ProbeSet': 'ProbeSetFreeze', + 'Geno': 'GenoFreeze'} + + for dataset_type in type_dict: + query = "SELECT Name FROM {}".format(type_dict[dataset_type]) + for result in g.db.execute(query).fetchall(): + #The query at the beginning of this function isn't necessary here, but still would + #rather just reuse it + print("type: {}\tname: {}".format(dataset_type, result.Name)) + dataset = create_dataset(result.Name, dataset_type) + datasets.append(dataset) + + Redis.set(key, pickle.dumps(datasets, pickle.HIGHEST_PROTOCOL)) + Redis.expire(key, 60*60) + + return datasets def create_in_clause(items): @@ -240,24 +257,13 @@ class DatasetGroup(object): self.samplelist = list(genotype.prgy) -class DataSets(object): - """Builds a list of DataSets""" - - def __init__(self): - self.datasets = list() - - type_dict = {'Publish': 'PublishFreeze', - 'ProbeSet': 'ProbeSetFreeze', - 'Geno': 'GenoFreeze'} - - for dataset_type in type_dict: - query = "SELECT Name FROM {}".format(type_dict[dataset_type]) - for result in g.db.execute(query).fetchall(): - #The query at the beginning of this function isn't necessary here, but still would - #rather just reuse it - print("type: {}\tname: {}".format(dataset_type, result.Name)) - create_dataset(result.Name, dataset_type) - +#class DataSets(object): +# """Builds a list of DataSets""" +# +# def __init__(self): +# self.datasets = list() +# + #query = """SELECT Name FROM ProbeSetFreeze # UNION diff --git a/wqflask/wqflask/correlation/show_corr_results.py b/wqflask/wqflask/correlation/show_corr_results.py index 3b47e970..f69fe551 100644 --- a/wqflask/wqflask/correlation/show_corr_results.py +++ b/wqflask/wqflask/correlation/show_corr_results.py @@ -205,10 +205,10 @@ class CorrelationResults(object): - trait_list = self.getTissueCorrelationByList( primary_trait_symbol = self.this_trait.symbol, - corr_results = self.correlation_results, - TissueProbeSetFreezeId = 1, - method=1) + #trait_list = self.getTissueCorrelationByList( primary_trait_symbol = self.this_trait.symbol, + # corr_results = self.correlation_results, + # TissueProbeSetFreezeId = 1, + # method=1) #XZ, 09/18/2008: get all information about the user selected database. #target_db_name = fd.corr_dataset diff --git a/wqflask/wqflask/templates/admin/group_manager.html b/wqflask/wqflask/templates/admin/group_manager.html new file mode 100644 index 00000000..6b7809d3 --- /dev/null +++ b/wqflask/wqflask/templates/admin/group_manager.html @@ -0,0 +1,49 @@ +{% extends "base.html" %} +{% block title %}Group Manager{% endblock %} +{% block content %} + +
    +
    +

    Group Manager

    +
    +
    + +
    + +
    +
    + Group Name: +
    + + +
    +
    + + + + + + + + + + + + {% for dataset in datasets %} + + + + + + + + {% endfor %} +
    ReadTypeIDNameFull Name
    {{ dataset.type }}{{ dataset.id }}{{ dataset.name }}{{ dataset.fullname }}
    +
    +
    + + + +{% endblock %} \ No newline at end of file diff --git a/wqflask/wqflask/user_manager.py b/wqflask/wqflask/user_manager.py index b8ebc71f..9e666bbd 100644 --- a/wqflask/wqflask/user_manager.py +++ b/wqflask/wqflask/user_manager.py @@ -13,6 +13,8 @@ from flask import Flask, g from pprint import pformat as pf +from base.data_set import create_datasets_list + #from app import db print("globals are:", globals()) @@ -32,6 +34,20 @@ class UserManager(object): #print("user is:", user) self.user = model.User.query.get(self.user_id) print("user is:", self.user) + datasets = create_datasets_list() + for dataset in datasets: + if not dataset.check_confidentiality(): + continue + print("\n Name:", dataset.name) + print(" Type:", dataset.type) + print(" ID:", dataset.id) + print(" Confidential:", dataset.check_confidentiality()) + #print(" ---> self.datasets:", self.datasets) + + +class GroupsManager(object): + def __init__(self, kw): + self.datasets = create_datasets_list() class RolesManager(object): diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index bd56f7a9..813075b8 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -54,7 +54,7 @@ def connect_db(): @app.route("/") def index_page(): print("Sending index_page") - create_datasets_list() + #create_datasets_list() #key = "all_datasets" #result = Redis.get(key) #if result: @@ -63,7 +63,7 @@ def index_page(): #else: # with Bench("Creating DataSets object"): # ds = DataSets() - # Redis.set(key, pickle.dumps(result)) + # Redis.set(key, pickle.dumps(result, pickle.HIGHEST_PROTOCOL)) # Redis.expire(key, 2*60) #print("[orange] ds:", ds.datasets) return render_template("index_page.html") @@ -112,7 +112,7 @@ def search_page(): result = the_search.__dict__ print("result: ", pf(result)) - Redis.set(key, pickle.dumps(result)) + Redis.set(key, pickle.dumps(result, pickle.HIGHEST_PROTOCOL)) Redis.expire(key, 60*60) if result['quick']: @@ -232,7 +232,7 @@ def marker_regression_page(): # print(" ---**--- {}: {}".format(type(template_vars.__dict__[item]), item)) #causeerror - Redis.set(key, pickle.dumps(result)) + Redis.set(key, pickle.dumps(result, pickle.HIGHEST_PROTOCOL)) Redis.expire(key, 60*60) with Bench("Rendering template"): @@ -283,6 +283,11 @@ def manage_user(): template_vars = user_manager.UserManager(request.args) return render_template("admin/ind_user_manager.html", **template_vars.__dict__) +@app.route("/manage/groups") +def manage_groups(): + template_vars = user_manager.GroupsManager(request.args) + return render_template("admin/group_manager.html", **template_vars.__dict__) + def json_default_handler(obj): '''Based on http://stackoverflow.com/a/2680060/1175849''' -- cgit v1.2.3 From 253df1a5adb060df3202de5b80a5065a3614e368 Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Wed, 3 Jul 2013 20:42:44 +0000 Subject: Made the table in the group manager sortable, etc --- wqflask/wqflask/templates/admin/group_manager.html | 36 +++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/templates/admin/group_manager.html b/wqflask/wqflask/templates/admin/group_manager.html index 6b7809d3..df3eda33 100644 --- a/wqflask/wqflask/templates/admin/group_manager.html +++ b/wqflask/wqflask/templates/admin/group_manager.html @@ -21,7 +21,7 @@ - +
    @@ -46,4 +46,38 @@ +{% endblock %} + +{% block js %} + + + + + + + {% endblock %} \ No newline at end of file -- cgit v1.2.3 From d27e52855d1aa442cebce7901815a673cf34f8b8 Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Wed, 3 Jul 2013 23:03:49 +0000 Subject: Updated notes and created requirements.txt file --- misc/gn_installation_notes.txt | 38 ++++++++++++++++- misc/notes.txt | 11 ++++- misc/requirements.txt | 53 ++++++++++++++++++++++++ wqflask/wqflask/correlation/show_corr_results.py | 2 - 4 files changed, 100 insertions(+), 4 deletions(-) create mode 100644 misc/requirements.txt (limited to 'wqflask') diff --git a/misc/gn_installation_notes.txt b/misc/gn_installation_notes.txt index bad21226..565cf9f5 100644 --- a/misc/gn_installation_notes.txt +++ b/misc/gn_installation_notes.txt @@ -1,6 +1,37 @@ +UFW - default firewall confirguation tool for Ubuntu; eases iptables firewall configuration + +Enable UFW: +sudo ufw enable +Check status of UFW: +sudo ufw status verbose + +Limit ssh: +sudo ufw limit ssh + +Enable http, https: +sudo ufw allow http +sudo ufw allow https + +=========================================== + +http://evilrouters.net/2011/02/18/using-etckeeper-with-git-on-ubuntu/ + +Install etckeeper: +sudo apt-get install etckeeper + +Edit /etc/etckeeper/etckeeper.conf to comment out VCS="bzr" and comment in VCS="git" + +Initialize repository: +sudo etckeeper init + +Do initial commit: +sudo etckeeper commit "Initial commit." + +=========================================== + Get git: -sudo apt-get install git-core +sudo apt-get install git =========================================== @@ -16,6 +47,11 @@ git pull origin flask(or whatever the branch is) Search for package with a specified file that can be installed with apt-get apt-file search _______ +============================================ + +Install pip: +sudo apt-get install python-pip + Install from requirements.txt: pip install -r gene/wqflask/requirements.txt -t ve27 diff --git a/misc/notes.txt b/misc/notes.txt index 92ed267b..9da6c4ea 100644 --- a/misc/notes.txt +++ b/misc/notes.txt @@ -92,6 +92,15 @@ python runserver.py =========================================== +UFW - default firewall confirguation tool for Ubuntu; eases iptables firewall configuration + +Enable UFW: +sudo ufw enable +Check status of UFW: +sudo ufw status verbose + +=========================================== + Update user password: use mysql; UPDATE user SET password=PASSWORD('whatever') WHERE user='webqtl'; @@ -117,7 +126,7 @@ pylint --help Start screen session: -If "no option -R": +If "no option -R" or running for first time: byobu-select-backend 2. screen diff --git a/misc/requirements.txt b/misc/requirements.txt new file mode 100644 index 00000000..bd4e3c2f --- /dev/null +++ b/misc/requirements.txt @@ -0,0 +1,53 @@ +Cheetah==2.4.4 +GnuPGInterface==0.3.2 +Jinja2==2.6 +Landscape-Client==12.05 +M2Crypto==0.21.1 +MarkupSafe==0.15 +PAM==0.4.2 +PyYAML==3.10 +Reaper==1.0 +Twisted-Core==11.1.0 +Twisted-Names==11.1.0 +Twisted-Web==11.1.0 +apache-libcloud==0.12.3 +apt-xapian-index==0.44 +argparse==1.2.1 +boto==2.2.2 +chardet==2.0.1 +cloud-init==0.6.3 +command-not-found==0.2.44 +configobj==4.7.2 +## FIXME: could not find svn URL in dependency_links for this package: +distribute==0.6.24dev-r0 +euca2ools==2.0.0 +httplib2==0.7.2 +keyring==0.9.2 +language-selector==0.1 +launchpadlib==1.9.12 +lazr.restfulclient==0.12.0 +lazr.uri==1.0.3 +msgpack-python==0.1.10 +numarray==1.5.2 +oauth==1.0.1 +paramiko==1.7.7.1 +pyOpenSSL==0.12 +pycrypto==2.4.1 +pycurl==7.19.0 +pylibacl==0.5.0 +pyserial==2.5 +python-apt==0.8.3ubuntu7.1 +python-debian==0.1.21ubuntu1 +pyxattr==0.5.0 +pyzmq==13.0.0 +rdiff-backup==1.2.8 +redis==2.7.2 +salt-cloud==0.8.0 +simplejson==2.3.2 +ufw==0.31.1-1 +unattended-upgrades==0.1 +virtualenv==1.8.4 +wadllib==1.3.0 +wsgiref==0.1.2 +yolk==0.4.3 +zope.interface==3.6.1 diff --git a/wqflask/wqflask/correlation/show_corr_results.py b/wqflask/wqflask/correlation/show_corr_results.py index f69fe551..4a0937bb 100644 --- a/wqflask/wqflask/correlation/show_corr_results.py +++ b/wqflask/wqflask/correlation/show_corr_results.py @@ -203,8 +203,6 @@ class CorrelationResults(object): # mb = trait_object.mb # ) - - #trait_list = self.getTissueCorrelationByList( primary_trait_symbol = self.this_trait.symbol, # corr_results = self.correlation_results, # TissueProbeSetFreezeId = 1, -- cgit v1.2.3 From c0b7da4b4c2bd98353eb980402075318010a79a3 Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Tue, 9 Jul 2013 17:07:13 -0500 Subject: Committing installation notes before editing them more --- misc/gn_installation_notes.txt | 24 ++++++++++++++++++------ misc/requirements.txt | 4 ++-- wqflask/requirements.txt | 17 ----------------- 3 files changed, 20 insertions(+), 25 deletions(-) delete mode 100644 wqflask/requirements.txt (limited to 'wqflask') diff --git a/misc/gn_installation_notes.txt b/misc/gn_installation_notes.txt index 2607f2b5..e31273b1 100644 --- a/misc/gn_installation_notes.txt +++ b/misc/gn_installation_notes.txt @@ -52,8 +52,23 @@ apt-file search _______ Install pip: sudo apt-get install python-pip -Install from requirements.txt: -pip install -r gene/wqflask/requirements.txt -t ve27 +REMEMBER TO SOURCE VE BEFORE INSTALLING + +Comment out in requirements.txt: +Reaper +numarray + +Install from requirements.txt (after activating virtualenv): +pip install -r gene/misc/requirements.txt + +When it hits error with install MySQL-Python, install libmysqlclient-dev: +sudo apt-get install libmysqlclient-dev + +When hits error with numpy install python-dev: +sudo apt-get install python-dev + +When hits error with scipy: +sudo apt-get install libatlas-base-dev gfortran g++ ============================================ @@ -116,10 +131,7 @@ Installing QTL Reaper wget http://downloads.sourceforge.net/project/qtlreaper/qtlreaper/1.1.1/qtlreaper-1.1.1.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fqtlreaper%2Ffiles%2Flatest%2Fdownload&ts=1358975786&use_mirror=iweb mv -v qtlreaper-1.1.1.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fqtlreaper%2Ffiles%2Flatest%2Fdownload&ts=1358975786&use_mirror=iweb qtlreaper-1.1.1.tar.gz tar xvf qtlreaper-1.1.1.tar.gz (to unzip) -python setup.py build -sudo mkdir /home/zas1024/ve27/include/python2.7/Reaper -sudo chown /home/zas1024/ve27/include/python2.7/Reaper (or whereever the directory is; the problem -involved the fact that doing "sudo python setup.py install" doesn't install within the virtualenv) +mkdir /home/zas1024/ve27/include/python2.7/Reaper python setup.py install =========================================== diff --git a/misc/requirements.txt b/misc/requirements.txt index 0e892c05..ec02a2c2 100644 --- a/misc/requirements.txt +++ b/misc/requirements.txt @@ -9,7 +9,7 @@ Flask-WTF==0.8.3 Jinja2==2.6 MySQL-python==1.2.4 PyYAML==3.10 -Reaper==1.0 +#Reaper==1.0 Reindent==0.1.1 SQLAlchemy==0.8.0 WTForms==1.0.3 @@ -21,7 +21,7 @@ itsdangerous==0.17 logging-tree==1.2 logilab-astng==0.24.3 logilab-common==0.59.1 -numarray==1.5.2 +#numarray==1.5.2 numpy==1.7.0 passlib==1.6.1 pp==1.6.3 diff --git a/wqflask/requirements.txt b/wqflask/requirements.txt deleted file mode 100644 index 4449c0e7..00000000 --- a/wqflask/requirements.txt +++ /dev/null @@ -1,17 +0,0 @@ -Flask==0.9 -Jinja2==2.6 -#MySQL-python==1.2.3 -Piddle==0.1-dev -PyYAML==3.10 -SQLAlchemy==0.7.9 -Werkzeug==0.8.3 -logging-tree==1.1 -nose==1.2.1 -numpy==1.6.2 -pp==1.6.3 -requests==0.13.3 -rpy2==2.3.1 -scipy==0.11.0 -simplejson==2.6.2 -wsgiref==0.1.2 -yolk==0.4.3 -- cgit v1.2.3 From d56f54d23b9f1621049e4cf62049e17e21b88201 Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Wed, 10 Jul 2013 15:34:31 -0500 Subject: Updated gn_installation_notes --- misc/gn_installation_notes.txt | 112 ++++++++++++++++----------- wqflask/other_config/nginx_conf/penguin.conf | 42 ++++++++++ wqflask/other_config/wqflask-nginx.conf | 83 -------------------- 3 files changed, 109 insertions(+), 128 deletions(-) create mode 100644 wqflask/other_config/nginx_conf/penguin.conf delete mode 100644 wqflask/other_config/wqflask-nginx.conf (limited to 'wqflask') diff --git a/misc/gn_installation_notes.txt b/misc/gn_installation_notes.txt index e31273b1..11bda48c 100644 --- a/misc/gn_installation_notes.txt +++ b/misc/gn_installation_notes.txt @@ -47,30 +47,6 @@ git pull origin flask(or whatever the branch is) Search for package with a specified file that can be installed with apt-get apt-file search _______ -============================================ - -Install pip: -sudo apt-get install python-pip - -REMEMBER TO SOURCE VE BEFORE INSTALLING - -Comment out in requirements.txt: -Reaper -numarray - -Install from requirements.txt (after activating virtualenv): -pip install -r gene/misc/requirements.txt - -When it hits error with install MySQL-Python, install libmysqlclient-dev: -sudo apt-get install libmysqlclient-dev - -When hits error with numpy install python-dev: -sudo apt-get install python-dev - -When hits error with scipy: -sudo apt-get install libatlas-base-dev gfortran g++ - - ============================================ Create trash directory: @@ -85,19 +61,6 @@ dpkg -l | less =========================================== -Using Yolk - -Install Yolk: -pip install yolk - -Check packages installed in this virtual environment: -yolk -l - -Checks packages that have updates available: -yolk -U - -=========================================== - Installing virtualenv: sudo pip install virtualenv @@ -109,20 +72,31 @@ source ~/ve27/bin/activate =========================================== -Installing yaml +Install libmysqlclient-dev (Mysql-Python dependency) +sudo apt-get install libmysqlclient-dev -Install libyaml-dev: -sudo apt-get install libyaml-dev +Install python-dev (numpy dependency) +sudo apt-get install python-dev -Install yaml: -pip install pyyaml +Install scipy dependencies: +sudo apt-get install libatlas-base-dev gfortran g++ =========================================== -Install MySQL Client +Install pip: +sudo apt-get install python-pip -To fix error "mysql_config not found" while installing packages with pip: -sudo apt-get install libmysqlclient-dev +REMEMBER TO SOURCE VE BEFORE INSTALLING + +Comment out in requirements.txt: +Reaper +numarray + +Before installing from requirements.txt, install numpy separately: +pip install numpy==1.7.0 (or whatever version we're using) + +Install from requirements.txt (after activating virtualenv): +pip install -r gene/misc/requirements.txt =========================================== @@ -145,6 +119,54 @@ sudo python setup.py install =========================================== +Installing nginx + +sudo -s +nginx=stable # use nginx=development for latest development version +echo "deb http://ppa.launchpad.net/nginx/$nginx/ubuntu lucid main" > /etc/apt/sources.list.d/nginx-$nginx-lucid.list +apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C300EE8C +apt-get update +apt-get install nginx + +Create configuration file in ~/gene/wqflask/other_config/nginx_conf/ (modeled off of the others) +Create symbolic link to config file in /etc/nginx/sites-enabled/: +ln -s dir_to_link_to linking_dir + +Run nginx: +sudo /usr/sbin/nginx + +============================================ + +Using Yolk + +Install Yolk: +pip install yolk + +Check packages installed in this virtual environment: +yolk -l + +Checks packages that have updates available: +yolk -U + +=========================================== + +Installing yaml + +Install libyaml-dev: +sudo apt-get install libyaml-dev + +Install yaml: +pip install pyyaml + +=========================================== + +Install MySQL Client + +To fix error "mysql_config not found" while installing packages with pip: +sudo apt-get install libmysqlclient-dev + +=========================================== + Installing R sudo apt-get install r-base-dev diff --git a/wqflask/other_config/nginx_conf/penguin.conf b/wqflask/other_config/nginx_conf/penguin.conf new file mode 100644 index 00000000..822556d3 --- /dev/null +++ b/wqflask/other_config/nginx_conf/penguin.conf @@ -0,0 +1,42 @@ +server { + # Modeled after http://flask.pocoo.org/docs/deploying/wsgi-standalone/ + listen 80; + + server_name penguin.uthsc.edu; + + access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log; + + location ^~ /css/ { + root /gene/wqflask/wqflask/static/; + } + + location ^~ /javascript/ { + root /gene/wqflask/wqflask/static/; + } + +# location ^~ /image/ { +# root /gene/wqflask/wqflask/static/; +# } + + location ^~ /images/ { + root /gene/wqflask/wqflask/static/; + } + + ### New - added by Sam + #location ^~ /static/ { + # root /gene/wqflask/wqflask/static/; + #} + + location / { + proxy_pass http://127.0.0.1:5000/; + proxy_redirect off; + + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_read_timeout 40m; + } +} + diff --git a/wqflask/other_config/wqflask-nginx.conf b/wqflask/other_config/wqflask-nginx.conf deleted file mode 100644 index 4e6fd0d9..00000000 --- a/wqflask/other_config/wqflask-nginx.conf +++ /dev/null @@ -1,83 +0,0 @@ -server { - # Modeled after http://flask.pocoo.org/docs/deploying/wsgi-standalone/ - listen 80; - - server_name gn2python.genenetwork.org; - - access_log /var/log/nginx/access.log; - error_log /var/log/nginx/error.log; - - location ^~ /css/ { - root /gene/wqflask/wqflask/static/; - } - - location ^~ /javascript/ { - root /gene/wqflask/wqflask/static/; - } - -# location ^~ /image/ { -# root /gene/wqflask/wqflask/static/; -# } - - location ^~ /images/ { - root /gene/wqflask/wqflask/static/; - } - - ### New - added by Sam - #location ^~ /static/ { - # root /gene/wqflask/wqflask/static/; - #} - - location / { - proxy_pass http://127.0.0.1:5000/; - proxy_redirect off; - - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - - proxy_read_timeout 40m; - } -} - -server { - # Modeled after http://flask.pocoo.org/docs/deploying/wsgi-standalone/ - listen 80; - - server_name gn2python_lei.genenetwork.org; - - access_log /var/log/nginx/lei_access.log; - error_log /var/log/nginx/lei_error.log; - - location ^~ /css/ { - root /gene/wqflask/wqflask/static/; - } - - location ^~ /javascript/ { - root /gene/wqflask/wqflask/static/; - } - -# location ^~ /image/ { -# root /gene/wqflask/wqflask/static/; -# } - - location ^~ /images/ { - root /gene/wqflask/wqflask/static/; - } - - ### New - added by Sam - #location ^~ /static/ { - # root /gene/wqflask/wqflask/static/; - #} - - location / { - proxy_pass http://127.0.0.1:5001/; - proxy_redirect off; - - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - - proxy_read_timeout 40m; - } -} -- cgit v1.2.3 From 99e1151d5603b1bbf52141166d72e6e32203bb62 Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Tue, 16 Jul 2013 23:24:57 +0000 Subject: Wrote code that can get a dataset's type for every single GN dataset; previously we could not view traits in datasets that were not in the DBType table in the database --- misc/gn_installation_notes.txt | 148 +++- wqflask/base/data_set.py | 90 +- wqflask/base/trait.py | 12 +- wqflask/wqflask/correlation/correlationFunction.py | 923 --------------------- .../wqflask/correlation/correlation_function.py | 923 +++++++++++++++++++++ wqflask/wqflask/correlation/show_corr_results.py | 130 +-- wqflask/wqflask/search_results.py | 8 +- 7 files changed, 1198 insertions(+), 1036 deletions(-) delete mode 100644 wqflask/wqflask/correlation/correlationFunction.py create mode 100644 wqflask/wqflask/correlation/correlation_function.py (limited to 'wqflask') diff --git a/misc/gn_installation_notes.txt b/misc/gn_installation_notes.txt index 2607f2b5..7545a5b8 100644 --- a/misc/gn_installation_notes.txt +++ b/misc/gn_installation_notes.txt @@ -47,15 +47,6 @@ git pull origin flask(or whatever the branch is) Search for package with a specified file that can be installed with apt-get apt-file search _______ -============================================ - -Install pip: -sudo apt-get install python-pip - -Install from requirements.txt: -pip install -r gene/wqflask/requirements.txt -t ve27 - - ============================================ Create trash directory: @@ -70,19 +61,6 @@ dpkg -l | less =========================================== -Using Yolk - -Install Yolk: -pip install yolk - -Check packages installed in this virtual environment: -yolk -l - -Checks packages that have updates available: -yolk -U - -=========================================== - Installing virtualenv: sudo pip install virtualenv @@ -94,20 +72,31 @@ source ~/ve27/bin/activate =========================================== -Installing yaml +Install libmysqlclient-dev (Mysql-Python dependency) +sudo apt-get install libmysqlclient-dev -Install libyaml-dev: -sudo apt-get install libyaml-dev +Install python-dev (numpy dependency) +sudo apt-get install python-dev -Install yaml: -pip install pyyaml +Install scipy dependencies: +sudo apt-get install libatlas-base-dev gfortran g++ =========================================== -Install MySQL Client +Install pip: +sudo apt-get install python-pip -To fix error "mysql_config not found" while installing packages with pip: -sudo apt-get install libmysqlclient-dev +REMEMBER TO SOURCE VE BEFORE INSTALLING + +Comment out in requirements.txt: +Reaper +numarray + +Before installing from requirements.txt, install numpy separately: +pip install numpy==1.7.0 (or whatever version we're using) + +Install from requirements.txt (after activating virtualenv): +pip install -r gene/misc/requirements.txt =========================================== @@ -116,10 +105,7 @@ Installing QTL Reaper wget http://downloads.sourceforge.net/project/qtlreaper/qtlreaper/1.1.1/qtlreaper-1.1.1.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fqtlreaper%2Ffiles%2Flatest%2Fdownload&ts=1358975786&use_mirror=iweb mv -v qtlreaper-1.1.1.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fqtlreaper%2Ffiles%2Flatest%2Fdownload&ts=1358975786&use_mirror=iweb qtlreaper-1.1.1.tar.gz tar xvf qtlreaper-1.1.1.tar.gz (to unzip) -python setup.py build -sudo mkdir /home/zas1024/ve27/include/python2.7/Reaper -sudo chown /home/zas1024/ve27/include/python2.7/Reaper (or whereever the directory is; the problem -involved the fact that doing "sudo python setup.py install" doesn't install within the virtualenv) +mkdir /home/zas1024/ve27/include/python2.7/Reaper python setup.py install =========================================== @@ -133,6 +119,98 @@ sudo python setup.py install =========================================== +Installing nginx + +sudo -s +nginx=stable # use nginx=development for latest development version +echo "deb http://ppa.launchpad.net/nginx/$nginx/ubuntu lucid main" > /etc/apt/sources.list.d/nginx-$nginx-lucid.list +apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C300EE8C +apt-get update +apt-get install nginx + +Create configuration file in ~/gene/wqflask/other_config/nginx_conf/ (modeled off of the others) +Create symbolic link to config file in /etc/nginx/sites-enabled/: +ln -s dir_to_link_to linking_dir + +Run nginx: +sudo /usr/sbin/nginx + +============================================ + +Copy over zach_settings.py to /home/zas1024 directory (or whatever is home directory) + +export WQFLASK_SETTINGS=~/gene/wqflask/cfg/zach_settings.py (or wherever file is located) + +============================================ + +Install MySQL Server + +sudo apt-get install mysql-server + +mkdir /mnt/big +fdisk /dev/sdb +m: for help +n: new partion +... +w: write to table and exit + +Start MySQL server: +service mysql start + +Stop MySQL server: +service mysql stop + +Change root password: +mysql> UPDATE mysql.user SET Password=PASSWORD('your password') WHERE User='root'; + +Setup accounts in MySQL (first need to delete anonymous/non-root accounts): +#; use mysql; +#; select * from user; +#; delete from user where Host!="localhost"; +#; delete from user where User!="root"; +#; update user set Password = Password('yourpassword') where User='root'; +#; GRANT ALL ON *.* TO 'yourusername'@'%' IDENTIFIED BY 'yourpassword'; +#; select * from user; + +============================================ + +Check RSA key: +ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key + +03:2c:d7:01:01:f0:31:3a:c8:df:e4:98:62:2c:59:d2 root@penguin (RSA) + +============================================ + +Using Yolk + +Install Yolk: +pip install yolk + +Check packages installed in this virtual environment: +yolk -l + +Checks packages that have updates available: +yolk -U + +=========================================== + +Installing yaml + +Install libyaml-dev: +sudo apt-get install libyaml-dev + +Install yaml: +pip install pyyaml + +=========================================== + +Install MySQL Client + +To fix error "mysql_config not found" while installing packages with pip: +sudo apt-get install libmysqlclient-dev + +=========================================== + Installing R sudo apt-get install r-base-dev @@ -173,7 +251,7 @@ Start up virtual environment: source ~/ve27/bin/activate To set WQFLASK_SETTINGS environment variable: -export WQFLASK_SETTINGS=~/gene/wqflask/cfg/zach_settings.py (or wherever file is located) +export WQFLASK_SETTINGS=~/zach_settings.py (or wherever file is located) To change screen environment variable (if man not working or to get color, for example): export TERM=screen diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index 03b24230..30221503 100755 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -48,32 +48,67 @@ from MySQLdb import escape_string as escape from pprint import pformat as pf # Used by create_database to instantiate objects +# Each subclass will add to this DS_NAME_MAP = {} def create_dataset(dataset_name, dataset_type = None): - #print("dataset_name:", dataset_name) - + + print("dataset_type:", dataset_type) if not dataset_type: - query = """ - SELECT DBType.Name - FROM DBList, DBType - WHERE DBList.Name = '{}' and - DBType.Id = DBList.DBTypeId - """.format(escape(dataset_name)) - #print("query is: ", pf(query)) - dataset_type = g.db.execute(query).fetchone().Name + dataset_type = Dataset_Getter(dataset_name) + #dataset_type = get_dataset_type_from_json(dataset_name) - #dataset_type = cursor.fetchone()[0] - #print("[blubber] dataset_type:", pf(dataset_type)) + print("dataset_type is:", dataset_type) + #query = """ + # SELECT DBType.Name + # FROM DBList, DBType + # WHERE DBList.Name = '{}' and + # DBType.Id = DBList.DBTypeId + # """.format(escape(dataset_name)) + #dataset_type = g.db.execute(query).fetchone().Name - dataset_ob = DS_NAME_MAP[dataset_type] - #dataset_class = getattr(data_set, dataset_ob) - #print("dataset_ob:", dataset_ob) - #print("DS_NAME_MAP:", pf(DS_NAME_MAP)) + dataset_ob = DS_NAME_MAP[dataset_type] dataset_class = globals()[dataset_ob] return dataset_class(dataset_name) + +#def get_dataset_type_from_json(dataset_name): + +class Dataset_Types(object): + + def __init__(self): + self.datasets = {} + file_name = "wqflask/static/new/javascript/dataset_menu_structure.json" + with open(file_name, 'r') as fh: + data = json.load(fh) + + print("*" * 70) + for species in data['datasets']: + for group in data['datasets'][species]: + for dataset_type in data['datasets'][species][group]: + for dataset in data['datasets'][species][group][dataset_type]: + print("dataset is:", dataset) + + short_dataset_name = dataset[0] + if dataset_type == "Phenotypes": + new_type = "Publish" + elif dataset_type == "Genotypes": + new_type = "Geno" + else: + new_type = "ProbeSet" + self.datasets[short_dataset_name] = new_type + + def __call__(self, name): + return self.datasets[name] + +# Do the intensive work at startup one time only +Dataset_Getter = Dataset_Types() + +# +#print("Running at startup:", get_dataset_type_from_json("HBTRC-MLPFC_0611")) + + def create_datasets_list(): key = "all_datasets" result = Redis.get(key) @@ -212,7 +247,7 @@ class DatasetGroup(object): marker_class = Markers self.markers = marker_class(self.name) - + def get_f1_parent_strains(self): try: @@ -225,7 +260,7 @@ class DatasetGroup(object): self.f1list = [f1, f12] if maternal and paternal: self.parlist = [maternal, paternal] - + def read_genotype_file(self): '''Read genotype from .geno file instead of database''' #if self.group == 'BXD300': @@ -375,6 +410,9 @@ class PhenotypeDataSet(DataSet): DS_NAME_MAP['Publish'] = 'PhenotypeDataSet' def setup(self): + + print("IS A PHENOTYPEDATASET") + # Fields in the database table self.search_fields = ['Phenotype.Post_publication_description', 'Phenotype.Pre_publication_description', @@ -445,14 +483,24 @@ class PhenotypeDataSet(DataSet): def get_trait_info(self, trait_list, species = ''): for this_trait in trait_list: if not this_trait.haveinfo: - this_trait.retrieveInfo(QTL=1) + this_trait.retrieve_info(get_qtl_info=True) description = this_trait.post_publication_description + + #If the dataset is confidential and the user has access to confidential + #phenotype traits, then display the pre-publication description instead + #of the post-publication description if this_trait.confidential: continue # for now - if not webqtlUtil.hasAccessToConfidentialPhenotypeTrait(privilege=self.privilege, userName=self.userName, authorized_users=this_trait.authorized_users): + + if not webqtlUtil.hasAccessToConfidentialPhenotypeTrait( + privilege=self.privilege, + userName=self.userName, + authorized_users=this_trait.authorized_users): + description = this_trait.pre_publication_description - this_trait.description_display = unicode(description, "utf8") + + this_trait.description_display = description if not this_trait.year.isdigit(): this_trait.pubmed_text = "N/A" diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index db76ddea..6648047c 100755 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -320,7 +320,11 @@ class GeneralTrait(object): #XZ: assign SQL query result to trait attributes. for i, field in enumerate(self.dataset.display_fields): print(" mike: {} -> {} - {}".format(field, type(trait_info[i]), trait_info[i])) - setattr(self, field, trait_info[i]) + holder = trait_info[i] + if isinstance(trait_info[i], basestring): + print("is basestring") + holder = unicode(trait_info[i], "utf8") + setattr(self, field, holder) if self.dataset.type == 'Publish': self.confidential = 0 @@ -329,9 +333,9 @@ class GeneralTrait(object): self.homologeneid = None - print("self.geneid is:", self.geneid) - print(" type:", type(self.geneid)) - print("self.dataset.group.name is:", self.dataset.group.name) + #print("self.geneid is:", self.geneid) + #print(" type:", type(self.geneid)) + #print("self.dataset.group.name is:", self.dataset.group.name) if self.dataset.type == 'ProbeSet' and self.dataset.group and self.geneid: #XZ, 05/26/2010: From time to time, this query get error message because some geneid values in database are not number. #XZ: So I have to test if geneid is number before execute the query. diff --git a/wqflask/wqflask/correlation/correlationFunction.py b/wqflask/wqflask/correlation/correlationFunction.py deleted file mode 100644 index 7d4b58a9..00000000 --- a/wqflask/wqflask/correlation/correlationFunction.py +++ /dev/null @@ -1,923 +0,0 @@ -# Copyright (C) University of Tennessee Health Science Center, Memphis, TN. -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU Affero General Public License -# as published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the GNU Affero General Public License for more details. -# -# This program is available from Source Forge: at GeneNetwork Project -# (sourceforge.net/projects/genenetwork/). -# -# Contact Drs. Robert W. Williams and Xiaodong Zhou (2010) -# at rwilliams@uthsc.edu and xzhou15@uthsc.edu -# -# -# -# This module is used by GeneNetwork project (www.genenetwork.org) -# -# Created by GeneNetwork Core Team 2010/08/10 -# -# Last updated by NL 2011/03/23 - - -import math -#import rpy2.robjects -import pp -import string - -from utility import webqtlUtil -from base.trait import GeneralTrait -from dbFunction import webqtlDatabaseFunction - - - -#XZ: The input 'controls' is String. It contains the full name of control traits. -#XZ: The input variable 'strainlst' is List. It contains the strain names of primary trait. -#XZ: The returned tcstrains is the list of list [[],[]...]. So are tcvals and tcvars. The last returned parameter is list of numbers. -#XZ, 03/29/2010: For each returned control trait, there is no None value in it. -def controlStrains(controls, strainlst): - - controls = controls.split(',') - - cvals = {} - for oneTraitName in controls: - oneTrait = webqtlTrait(fullname=oneTraitName, cursor=webqtlDatabaseFunction.getCursor() ) - oneTrait.retrieveData() - cvals[oneTraitName] = oneTrait.data - - tcstrains = [] - tcvals = [] - tcvars = [] - - for oneTraitName in controls: - strains = [] - vals = [] - vars = [] - - for _strain in strainlst: - if cvals[oneTraitName].has_key(_strain): - _val = cvals[oneTraitName][_strain].val - if _val != None: - strains.append(_strain) - vals.append(_val) - vars.append(None) - - tcstrains.append(strains) - tcvals.append(vals) - tcvars.append(vars) - - return tcstrains, tcvals, tcvars, [len(x) for x in tcstrains] - - - -#XZ, 03/29/2010: After execution of functon "controlStrains" and "fixStrains", primary trait and control traits have the same strains and in the same order. There is no 'None' value in them. -def fixStrains(_strains,_controlstrains,_vals,_controlvals,_vars,_controlvars): - """Corrects strains, vals, and vars so that all contrain only those strains common - to the reference trait and all control traits.""" - - def dictify(strains,vals,vars): - subdict = {} - for i in xrange(len(strains)): - subdict[strains[i]] = (vals[i],vars[i]) - return subdict - - #XZ: The 'dicts' is a list of dictionary. The first element is the dictionary of reference trait. The rest elements are for control traits. - dicts = [] - dicts.append(dictify(_strains,_vals,_vars)) - - nCstrains = len(_controlstrains) - for i in xrange(nCstrains): - dicts.append(dictify(_controlstrains[i],_controlvals[i],_controlvars[i])) - - _newstrains = [] - _vals = [] - _vars = [] - _controlvals = [[] for x in xrange(nCstrains)] - _controlvars = [[] for x in xrange(nCstrains)] - - for strain in _strains: - inall = True - for d in dicts: - if strain not in d: - inall = False - break - if inall: - _newstrains.append(strain) - _vals.append(dicts[0][strain][0]) - _vars.append(dicts[0][strain][1]) - for i in xrange(nCstrains): - _controlvals[i].append(dicts[i+1][strain][0]) - _controlvars[i].append(dicts[i+1][strain][1]) - - return _newstrains, _vals, _controlvals, _vars, _controlvars - - -#XZ, 6/15/2010: If there is no identical control traits, the returned list is empty. -#else, the returned list has two elements of control trait name. -def findIdenticalControlTraits ( controlVals, controlNames ): - nameOfIdenticalTraits = [] - - controlTraitNumber = len(controlVals) - - if controlTraitNumber > 1: - - #XZ: reset the precision of values and convert to string type - for oneTraitVal in controlVals: - for oneStrainVal in oneTraitVal: - oneStrainVal = '%.3f' % oneStrainVal - - for i, oneTraitVal in enumerate( controlVals ): - for j in range(i+1, controlTraitNumber): - if oneTraitVal == controlVals[j]: - nameOfIdenticalTraits.append(controlNames[i]) - nameOfIdenticalTraits.append(controlNames[j]) - - return nameOfIdenticalTraits - -#XZ, 6/15/2010: If there is no identical control traits, the returned list is empty. -#else, the returned list has two elements of control trait name. -#primaryVal is of list type. It contains value of primary trait. -#primaryName is of string type. -#controlVals is of list type. Each element is list too. Each element contain value of one control trait. -#controlNames is of list type. -def findIdenticalTraits (primaryVal, primaryName, controlVals, controlNames ): - nameOfIdenticalTraits = [] - - #XZ: reset the precision of values and convert to string type - for oneStrainVal in primaryVal: - oneStrainVal = '%.3f' % oneStrainVal - - for oneTraitVal in controlVals: - for oneStrainVal in oneTraitVal: - oneStrainVal = '%.3f' % oneStrainVal - - controlTraitNumber = len(controlVals) - - if controlTraitNumber > 1: - for i, oneTraitVal in enumerate( controlVals ): - for j in range(i+1, controlTraitNumber): - if oneTraitVal == controlVals[j]: - nameOfIdenticalTraits.append(controlNames[i]) - nameOfIdenticalTraits.append(controlNames[j]) - break - - if len(nameOfIdenticalTraits) == 0: - for i, oneTraitVal in enumerate( controlVals ): - if primaryVal == oneTraitVal: - nameOfIdenticalTraits.append(primaryName) - nameOfIdenticalTraits.append(controlNames[i]) - break - - return nameOfIdenticalTraits - - - -#XZ, 03/29/2010: The strains in primaryVal, controlVals, targetVals must be of the same number and in same order. -#XZ: No value in primaryVal and controlVals could be None. - -def determinePartialsByR (primaryVal, controlVals, targetVals, targetNames, method='p'): - - def compute_partial ( primaryVal, controlVals, targetVals, targetNames, method ): - - rpy2.robjects.r(""" -pcor.test <- function(x,y,z,use="mat",method="p",na.rm=T){ - # The partial correlation coefficient between x and y given z - # - # pcor.test is free and comes with ABSOLUTELY NO WARRANTY. - # - # x and y should be vectors - # - # z can be either a vector or a matrix - # - # use: There are two methods to calculate the partial correlation coefficient. - # One is by using variance-covariance matrix ("mat") and the other is by using recursive formula ("rec"). - # Default is "mat". - # - # method: There are three ways to calculate the correlation coefficient, - # which are Pearson's ("p"), Spearman's ("s"), and Kendall's ("k") methods. - # The last two methods which are Spearman's and Kendall's coefficient are based on the non-parametric analysis. - # Default is "p". - # - # na.rm: If na.rm is T, then all the missing samples are deleted from the whole dataset, which is (x,y,z). - # If not, the missing samples will be removed just when the correlation coefficient is calculated. - # However, the number of samples for the p-value is the number of samples after removing - # all the missing samples from the whole dataset. - # Default is "T". - - x <- c(x) - y <- c(y) - z <- as.data.frame(z) - - if(use == "mat"){ - p.use <- "Var-Cov matrix" - pcor = pcor.mat(x,y,z,method=method,na.rm=na.rm) - }else if(use == "rec"){ - p.use <- "Recursive formula" - pcor = pcor.rec(x,y,z,method=method,na.rm=na.rm) - }else{ - stop("use should be either rec or mat!\n") - } - - # print the method - if(gregexpr("p",method)[[1]][1] == 1){ - p.method <- "Pearson" - }else if(gregexpr("s",method)[[1]][1] == 1){ - p.method <- "Spearman" - }else if(gregexpr("k",method)[[1]][1] == 1){ - p.method <- "Kendall" - }else{ - stop("method should be pearson or spearman or kendall!\n") - } - - # sample number - n <- dim(na.omit(data.frame(x,y,z)))[1] - - # given variables' number - gn <- dim(z)[2] - - # p-value - if(p.method == "Kendall"){ - statistic <- pcor/sqrt(2*(2*(n-gn)+5)/(9*(n-gn)*(n-1-gn))) - p.value <- 2*pnorm(-abs(statistic)) - - }else{ - statistic <- pcor*sqrt((n-2-gn)/(1-pcor^2)) - p.value <- 2*pnorm(-abs(statistic)) - } - - data.frame(estimate=pcor,p.value=p.value,statistic=statistic,n=n,gn=gn,Method=p.method,Use=p.use) -} - -# By using var-cov matrix -pcor.mat <- function(x,y,z,method="p",na.rm=T){ - - x <- c(x) - y <- c(y) - z <- as.data.frame(z) - - if(dim(z)[2] == 0){ - stop("There should be given data\n") - } - - data <- data.frame(x,y,z) - - if(na.rm == T){ - data = na.omit(data) - } - - xdata <- na.omit(data.frame(data[,c(1,2)])) - Sxx <- cov(xdata,xdata,m=method) - - xzdata <- na.omit(data) - xdata <- data.frame(xzdata[,c(1,2)]) - zdata <- data.frame(xzdata[,-c(1,2)]) - Sxz <- cov(xdata,zdata,m=method) - - zdata <- na.omit(data.frame(data[,-c(1,2)])) - Szz <- cov(zdata,zdata,m=method) - - # is Szz positive definite? - zz.ev <- eigen(Szz)$values - if(min(zz.ev)[1]<0){ - stop("\'Szz\' is not positive definite!\n") - } - - # partial correlation - Sxx.z <- Sxx - Sxz %*% solve(Szz) %*% t(Sxz) - - rxx.z <- cov2cor(Sxx.z)[1,2] - - rxx.z -} - -# By using recursive formula -pcor.rec <- function(x,y,z,method="p",na.rm=T){ - # - - x <- c(x) - y <- c(y) - z <- as.data.frame(z) - - if(dim(z)[2] == 0){ - stop("There should be given data\n") - } - - data <- data.frame(x,y,z) - - if(na.rm == T){ - data = na.omit(data) - } - - # recursive formula - if(dim(z)[2] == 1){ - tdata <- na.omit(data.frame(data[,1],data[,2])) - rxy <- cor(tdata[,1],tdata[,2],m=method) - - tdata <- na.omit(data.frame(data[,1],data[,-c(1,2)])) - rxz <- cor(tdata[,1],tdata[,2],m=method) - - tdata <- na.omit(data.frame(data[,2],data[,-c(1,2)])) - ryz <- cor(tdata[,1],tdata[,2],m=method) - - rxy.z <- (rxy - rxz*ryz)/( sqrt(1-rxz^2)*sqrt(1-ryz^2) ) - - return(rxy.z) - }else{ - x <- c(data[,1]) - y <- c(data[,2]) - z0 <- c(data[,3]) - zc <- as.data.frame(data[,-c(1,2,3)]) - - rxy.zc <- pcor.rec(x,y,zc,method=method,na.rm=na.rm) - rxz0.zc <- pcor.rec(x,z0,zc,method=method,na.rm=na.rm) - ryz0.zc <- pcor.rec(y,z0,zc,method=method,na.rm=na.rm) - - rxy.z <- (rxy.zc - rxz0.zc*ryz0.zc)/( sqrt(1-rxz0.zc^2)*sqrt(1-ryz0.zc^2) ) - return(rxy.z) - } -} -""") - - R_pcorr_function = rpy2.robjects.r['pcor.test'] - R_corr_test = rpy2.robjects.r['cor.test'] - - primary = rpy2.robjects.FloatVector(range(len(primaryVal))) - for i in range(len(primaryVal)): - primary[i] = primaryVal[i] - - control = rpy2.robjects.r.matrix(rpy2.robjects.FloatVector( range(len(controlVals)*len(controlVals[0])) ), ncol=len(controlVals)) - for i in range(len(controlVals)): - for j in range(len(controlVals[0])): - control[i*len(controlVals[0]) + j] = controlVals[i][j] - - allcorrelations = [] - - for targetIndex, oneTargetVals in enumerate(targetVals): - - this_primary = None - this_control = None - this_target = None - - if None in oneTargetVals: - - goodIndex = [] - for i in range(len(oneTargetVals)): - if oneTargetVals[i] != None: - goodIndex.append(i) - - this_primary = rpy2.robjects.FloatVector(range(len(goodIndex))) - for i in range(len(goodIndex)): - this_primary[i] = primaryVal[goodIndex[i]] - - this_control = rpy2.robjects.r.matrix(rpy2.robjects.FloatVector( range(len(controlVals)*len(goodIndex)) ), ncol=len(controlVals)) - for i in range(len(controlVals)): - for j in range(len(goodIndex)): - this_control[i*len(goodIndex) + j] = controlVals[i][goodIndex[j]] - - this_target = rpy2.robjects.FloatVector(range(len(goodIndex))) - for i in range(len(goodIndex)): - this_target[i] = oneTargetVals[goodIndex[i]] - - else: - this_primary = primary - this_control = control - this_target = rpy2.robjects.FloatVector(range(len(oneTargetVals))) - for i in range(len(oneTargetVals)): - this_target[i] = oneTargetVals[i] - - one_name = targetNames[targetIndex] - one_N = len(this_primary) - - #calculate partial correlation - one_pc_coefficient = 'NA' - one_pc_p = 1 - - try: - if method == 's': - result = R_pcorr_function(this_primary, this_target, this_control, method='s') - else: - result = R_pcorr_function(this_primary, this_target, this_control) - - #XZ: In very few cases, the returned coefficient is nan. - #XZ: One way to detect nan is to compare the number to itself. NaN is always != NaN - if result[0][0] == result[0][0]: - one_pc_coefficient = result[0][0] - #XZ: when the coefficient value is 1 (primary trait and target trait are the same), - #XZ: occationally, the returned p value is nan instead of 0. - if result[1][0] == result[1][0]: - one_pc_p = result[1][0] - elif abs(one_pc_coefficient - 1) < 0.0000001: - one_pc_p = 0 - except: - pass - - #calculate zero order correlation - one_corr_coefficient = 0 - one_corr_p = 1 - - try: - if method == 's': - R_result = R_corr_test(this_primary, this_target, method='spearman') - else: - R_result = R_corr_test(this_primary, this_target) - - one_corr_coefficient = R_result[3][0] - one_corr_p = R_result[2][0] - except: - pass - - traitinfo = [ one_name, one_N, one_pc_coefficient, one_pc_p, one_corr_coefficient, one_corr_p ] - - allcorrelations.append(traitinfo) - - return allcorrelations - #End of function compute_partial - - - allcorrelations = [] - - target_trait_number = len(targetVals) - - if target_trait_number < 1000: - allcorrelations = compute_partial ( primaryVal, controlVals, targetVals, targetNames, method ) - else: - step = 1000 - job_number = math.ceil( float(target_trait_number)/step ) - - job_targetVals_lists = [] - job_targetNames_lists = [] - - for job_index in range( int(job_number) ): - starti = job_index*step - endi = min((job_index+1)*step, target_trait_number) - - one_job_targetVals_list = [] - one_job_targetNames_list = [] - - for i in range( starti, endi ): - one_job_targetVals_list.append( targetVals[i] ) - one_job_targetNames_list.append( targetNames[i] ) - - job_targetVals_lists.append( one_job_targetVals_list ) - job_targetNames_lists.append( one_job_targetNames_list ) - - ppservers = () - # Creates jobserver with automatically detected number of workers - job_server = pp.Server(ppservers=ppservers) - - jobs = [] - results = [] - - for i, one_job_targetVals_list in enumerate( job_targetVals_lists ): - one_job_targetNames_list = job_targetNames_lists[i] - #pay attention to modules from outside - jobs.append( job_server.submit(func=compute_partial, args=( primaryVal, controlVals, one_job_targetVals_list, one_job_targetNames_list, method), depfuncs=(), modules=("rpy2.robjects",)) ) - - for one_job in jobs: - one_result = one_job() - results.append( one_result ) - - for one_result in results: - for one_traitinfo in one_result: - allcorrelations.append( one_traitinfo ) - - return allcorrelations - - - -#XZ, April 30, 2010: The input primaryTrait and targetTrait are instance of webqtlTrait -#XZ: The primaryTrait and targetTrait should have executed retrieveData function -def calZeroOrderCorr (primaryTrait, targetTrait, method='pearson'): - - #primaryTrait.retrieveData() - - #there is no None value in primary_val - primary_strain, primary_val, primary_var = primaryTrait.exportInformative() - - #targetTrait.retrieveData() - - #there might be None value in target_val - target_val = targetTrait.exportData(primary_strain, type="val") - - R_primary = rpy2.robjects.FloatVector(range(len(primary_val))) - for i in range(len(primary_val)): - R_primary[i] = primary_val[i] - - N = len(target_val) - - if None in target_val: - goodIndex = [] - for i in range(len(target_val)): - if target_val[i] != None: - goodIndex.append(i) - - N = len(goodIndex) - - R_primary = rpy2.robjects.FloatVector(range(len(goodIndex))) - for i in range(len(goodIndex)): - R_primary[i] = primary_val[goodIndex[i]] - - R_target = rpy2.robjects.FloatVector(range(len(goodIndex))) - for i in range(len(goodIndex)): - R_target[i] = target_val[goodIndex[i]] - - else: - R_target = rpy2.robjects.FloatVector(range(len(target_val))) - for i in range(len(target_val)): - R_target[i] = target_val[i] - - R_corr_test = rpy2.robjects.r['cor.test'] - - if method == 'spearman': - R_result = R_corr_test(R_primary, R_target, method='spearman') - else: - R_result = R_corr_test(R_primary, R_target) - - corr_result = [] - corr_result.append( R_result[3][0] ) - corr_result.append( N ) - corr_result.append( R_result[2][0] ) - - return corr_result - -##################################################################################### -#Input: primaryValue(list): one list of expression values of one probeSet, -# targetValue(list): one list of expression values of one probeSet, -# method(string): indicate correlation method ('pearson' or 'spearman') -#Output: corr_result(list): first item is Correlation Value, second item is tissue number, -# third item is PValue -#Function: get correlation value,Tissue quantity ,p value result by using R; -#Note : This function is special case since both primaryValue and targetValue are from -#the same dataset. So the length of these two parameters is the same. They are pairs. -#Also, in the datatable TissueProbeSetData, all Tissue values are loaded based on -#the same tissue order -##################################################################################### - -def calZeroOrderCorrForTiss (primaryValue=[], targetValue=[], method='pearson'): - - R_primary = rpy2.robjects.FloatVector(range(len(primaryValue))) - N = len(primaryValue) - for i in range(len(primaryValue)): - R_primary[i] = primaryValue[i] - - R_target = rpy2.robjects.FloatVector(range(len(targetValue))) - for i in range(len(targetValue)): - R_target[i]=targetValue[i] - - R_corr_test = rpy2.robjects.r['cor.test'] - if method =='spearman': - R_result = R_corr_test(R_primary, R_target, method='spearman') - else: - R_result = R_corr_test(R_primary, R_target) - - corr_result =[] - corr_result.append( R_result[3][0]) - corr_result.append( N ) - corr_result.append( R_result[2][0]) - - return corr_result - - - - -def batchCalTissueCorr(primaryTraitValue=[], SymbolValueDict={}, method='pearson'): - - def cal_tissue_corr(primaryTraitValue, oneSymbolValueDict, method ): - - oneSymbolCorrDict = {} - oneSymbolPvalueDict = {} - - R_corr_test = rpy2.robjects.r['cor.test'] - - R_primary = rpy2.robjects.FloatVector(range(len(primaryTraitValue))) - - for i in range(len(primaryTraitValue)): - R_primary[i] = primaryTraitValue[i] - - for (oneTraitSymbol, oneTraitValue) in oneSymbolValueDict.iteritems(): - R_target = rpy2.robjects.FloatVector(range(len(oneTraitValue))) - for i in range(len(oneTraitValue)): - R_target[i] = oneTraitValue[i] - - if method =='spearman': - R_result = R_corr_test(R_primary, R_target, method='spearman') - else: - R_result = R_corr_test(R_primary, R_target) - - oneSymbolCorrDict[oneTraitSymbol] = R_result[3][0] - oneSymbolPvalueDict[oneTraitSymbol] = R_result[2][0] - - return(oneSymbolCorrDict, oneSymbolPvalueDict) - - - - symbolCorrDict = {} - symbolPvalueDict = {} - - items_number = len(SymbolValueDict) - - if items_number <= 1000: - symbolCorrDict, symbolPvalueDict = cal_tissue_corr(primaryTraitValue, SymbolValueDict, method) - else: - items_list = SymbolValueDict.items() - - step = 1000 - job_number = math.ceil( float(items_number)/step ) - - job_oneSymbolValueDict_list = [] - - for job_index in range( int(job_number) ): - starti = job_index*step - endi = min((job_index+1)*step, items_number) - - oneSymbolValueDict = {} - - for i in range( starti, endi ): - one_item = items_list[i] - one_symbol = one_item[0] - one_value = one_item[1] - oneSymbolValueDict[one_symbol] = one_value - - job_oneSymbolValueDict_list.append( oneSymbolValueDict ) - - - ppservers = () - # Creates jobserver with automatically detected number of workers - job_server = pp.Server(ppservers=ppservers) - - jobs = [] - results = [] - - for i, oneSymbolValueDict in enumerate( job_oneSymbolValueDict_list ): - - #pay attention to modules from outside - jobs.append( job_server.submit(func=cal_tissue_corr, args=(primaryTraitValue, oneSymbolValueDict, method), depfuncs=(), modules=("rpy2.robjects",)) ) - - for one_job in jobs: - one_result = one_job() - results.append( one_result ) - - for one_result in results: - oneSymbolCorrDict, oneSymbolPvalueDict = one_result - symbolCorrDict.update( oneSymbolCorrDict ) - symbolPvalueDict.update( oneSymbolPvalueDict ) - - return (symbolCorrDict, symbolPvalueDict) - -########################################################################### -#Input: cursor, GeneNameLst (list), TissueProbeSetFreezeId -#output: geneIdDict,dataIdDict,ChrDict,MbDict,descDict,pTargetDescDict (Dict) -#function: get multi dicts for short and long label functions, and for getSymbolValuePairDict and -# getGeneSymbolTissueValueDict to build dict to get CorrPvArray -#Note: If there are multiple probesets for one gene, select the one with highest mean. -########################################################################### -def getTissueProbeSetXRefInfo(cursor=None,GeneNameLst=[],TissueProbeSetFreezeId=0): - Symbols ="" - symbolList =[] - geneIdDict ={} - dataIdDict = {} - ChrDict = {} - MbDict = {} - descDict = {} - pTargetDescDict = {} - - count = len(GeneNameLst) - - # Added by NL 01/06/2011 - # Note that:inner join is necessary in this query to get distinct record in one symbol group with highest mean value - # Duo to the limit size of TissueProbeSetFreezeId table in DB, performance of inner join is acceptable. - if count==0: - query=''' - select t.Symbol,t.GeneId, t.DataId,t.Chr, t.Mb,t.description,t.Probe_Target_Description - from ( - select Symbol, max(Mean) as maxmean - from TissueProbeSetXRef - where TissueProbeSetFreezeId=%s and Symbol!='' and Symbol Is Not Null group by Symbol) - as x inner join TissueProbeSetXRef as t on t.Symbol = x.Symbol and t.Mean = x.maxmean; - '''%TissueProbeSetFreezeId - - else: - for i, item in enumerate(GeneNameLst): - - if i == count-1: - Symbols += "'%s'" %item - else: - Symbols += "'%s'," %item - - Symbols = "("+ Symbols+")" - query=''' - select t.Symbol,t.GeneId, t.DataId,t.Chr, t.Mb,t.description,t.Probe_Target_Description - from ( - select Symbol, max(Mean) as maxmean - from TissueProbeSetXRef - where TissueProbeSetFreezeId=%s and Symbol in %s group by Symbol) - as x inner join TissueProbeSetXRef as t on t.Symbol = x.Symbol and t.Mean = x.maxmean; - '''% (TissueProbeSetFreezeId,Symbols) - - try: - - cursor.execute(query) - results =cursor.fetchall() - resultCount = len(results) - # Key in all dicts is the lower-cased symbol - for i, item in enumerate(results): - symbol = item[0] - symbolList.append(symbol) - - key =symbol.lower() - geneIdDict[key]=item[1] - dataIdDict[key]=item[2] - ChrDict[key]=item[3] - MbDict[key]=item[4] - descDict[key]=item[5] - pTargetDescDict[key]=item[6] - - except: - symbolList = None - geneIdDict=None - dataIdDict=None - ChrDict=None - MbDict=None - descDict=None - pTargetDescDict=None - - return symbolList,geneIdDict,dataIdDict,ChrDict,MbDict,descDict,pTargetDescDict - -########################################################################### -#Input: cursor, symbolList (list), dataIdDict(Dict) -#output: symbolValuepairDict (dictionary):one dictionary of Symbol and Value Pair, -# key is symbol, value is one list of expression values of one probeSet; -#function: get one dictionary whose key is gene symbol and value is tissue expression data (list type). -#Attention! All keys are lower case! -########################################################################### -def getSymbolValuePairDict(cursor=None,symbolList=None,dataIdDict={}): - symbolList = map(string.lower, symbolList) - symbolValuepairDict={} - valueList=[] - - for key in symbolList: - if dataIdDict.has_key(key): - DataId = dataIdDict[key] - - valueQuery = "select value from TissueProbeSetData where Id=%s" % DataId - try : - cursor.execute(valueQuery) - valueResults = cursor.fetchall() - for item in valueResults: - item =item[0] - valueList.append(item) - symbolValuepairDict[key] = valueList - valueList=[] - except: - symbolValuepairDict[key] = None - - return symbolValuepairDict - - -######################################################################################################## -#input: cursor, symbolList (list), dataIdDict(Dict): key is symbol -#output: SymbolValuePairDict(dictionary):one dictionary of Symbol and Value Pair. -# key is symbol, value is one list of expression values of one probeSet. -#function: wrapper function for getSymbolValuePairDict function -# build gene symbol list if necessary, cut it into small lists if necessary, -# then call getSymbolValuePairDict function and merge the results. -######################################################################################################## - -def getGeneSymbolTissueValueDict(cursor=None,symbolList=None,dataIdDict={}): - limitNum=1000 - count = len(symbolList) - - SymbolValuePairDict = {} - - if count !=0 and count <=limitNum: - SymbolValuePairDict = getSymbolValuePairDict(cursor=cursor,symbolList=symbolList,dataIdDict=dataIdDict) - - elif count >limitNum: - SymbolValuePairDict={} - n = count/limitNum - start =0 - stop =0 - - for i in range(n): - stop =limitNum*(i+1) - gList1 = symbolList[start:stop] - PairDict1 = getSymbolValuePairDict(cursor=cursor,symbolList=gList1,dataIdDict=dataIdDict) - start =limitNum*(i+1) - - SymbolValuePairDict.update(PairDict1) - - if stop < count: - stop = count - gList2 = symbolList[start:stop] - PairDict2 = getSymbolValuePairDict(cursor=cursor,symbolList=gList2,dataIdDict=dataIdDict) - SymbolValuePairDict.update(PairDict2) - - return SymbolValuePairDict - -######################################################################################################## -#input: cursor, GeneNameLst (list), TissueProbeSetFreezeId(int) -#output: SymbolValuePairDict(dictionary):one dictionary of Symbol and Value Pair. -# key is symbol, value is one list of expression values of one probeSet. -#function: wrapper function of getGeneSymbolTissueValueDict function -# for CorrelationPage.py -######################################################################################################## - -def getGeneSymbolTissueValueDictForTrait(cursor=None,GeneNameLst=[],TissueProbeSetFreezeId=0): - SymbolValuePairDict={} - symbolList,geneIdDict,dataIdDict,ChrDict,MbDict,descDict,pTargetDescDict = getTissueProbeSetXRefInfo(cursor=cursor,GeneNameLst=GeneNameLst,TissueProbeSetFreezeId=TissueProbeSetFreezeId) - if symbolList: - SymbolValuePairDict = getGeneSymbolTissueValueDict(cursor=cursor,symbolList=symbolList,dataIdDict=dataIdDict) - return SymbolValuePairDict - -######################################################################################################## -#Input: cursor(cursor): MySQL connnection cursor; -# priGeneSymbolList(list): one list of gene symbol; -# symbolValuepairDict(dictionary): one dictionary of Symbol and Value Pair, -# key is symbol, value is one list of expression values of one probeSet; -#Output: corrArray(array): array of Correlation Value, -# pvArray(array): array of PValue; -#Function: build corrArray, pvArray for display by calling calculation function:calZeroOrderCorrForTiss -######################################################################################################## - -def getCorrPvArray(cursor=None,priGeneSymbolList=[],symbolValuepairDict={}): - # setting initial value for corrArray, pvArray equal to 0 - Num = len(priGeneSymbolList) - - corrArray = [([0] * (Num))[:] for i in range(Num)] - pvArray = [([0] * (Num))[:] for i in range(Num)] - i = 0 - for pkey in priGeneSymbolList: - j = 0 - pkey = pkey.strip().lower()# key in symbolValuepairDict is low case - if symbolValuepairDict.has_key(pkey): - priValue = symbolValuepairDict[pkey] - for tkey in priGeneSymbolList: - tkey = tkey.strip().lower()# key in symbolValuepairDict is low case - if priValue and symbolValuepairDict.has_key(tkey): - tarValue = symbolValuepairDict[tkey] - - if tarValue: - if i>j: - # corrArray stores Pearson Correlation values - # pvArray stores Pearson P-Values - pcorr_result =calZeroOrderCorrForTiss(primaryValue=priValue,targetValue=tarValue) - corrArray[i][j] =pcorr_result[0] - pvArray[i][j] =pcorr_result[2] - elif i 1: + + #XZ: reset the precision of values and convert to string type + for oneTraitVal in controlVals: + for oneStrainVal in oneTraitVal: + oneStrainVal = '%.3f' % oneStrainVal + + for i, oneTraitVal in enumerate( controlVals ): + for j in range(i+1, controlTraitNumber): + if oneTraitVal == controlVals[j]: + nameOfIdenticalTraits.append(controlNames[i]) + nameOfIdenticalTraits.append(controlNames[j]) + + return nameOfIdenticalTraits + +#XZ, 6/15/2010: If there is no identical control traits, the returned list is empty. +#else, the returned list has two elements of control trait name. +#primaryVal is of list type. It contains value of primary trait. +#primaryName is of string type. +#controlVals is of list type. Each element is list too. Each element contain value of one control trait. +#controlNames is of list type. +def findIdenticalTraits (primaryVal, primaryName, controlVals, controlNames ): + nameOfIdenticalTraits = [] + + #XZ: reset the precision of values and convert to string type + for oneStrainVal in primaryVal: + oneStrainVal = '%.3f' % oneStrainVal + + for oneTraitVal in controlVals: + for oneStrainVal in oneTraitVal: + oneStrainVal = '%.3f' % oneStrainVal + + controlTraitNumber = len(controlVals) + + if controlTraitNumber > 1: + for i, oneTraitVal in enumerate( controlVals ): + for j in range(i+1, controlTraitNumber): + if oneTraitVal == controlVals[j]: + nameOfIdenticalTraits.append(controlNames[i]) + nameOfIdenticalTraits.append(controlNames[j]) + break + + if len(nameOfIdenticalTraits) == 0: + for i, oneTraitVal in enumerate( controlVals ): + if primaryVal == oneTraitVal: + nameOfIdenticalTraits.append(primaryName) + nameOfIdenticalTraits.append(controlNames[i]) + break + + return nameOfIdenticalTraits + + + +#XZ, 03/29/2010: The strains in primaryVal, controlVals, targetVals must be of the same number and in same order. +#XZ: No value in primaryVal and controlVals could be None. + +def determinePartialsByR (primaryVal, controlVals, targetVals, targetNames, method='p'): + + def compute_partial ( primaryVal, controlVals, targetVals, targetNames, method ): + + rpy2.robjects.r(""" +pcor.test <- function(x,y,z,use="mat",method="p",na.rm=T){ + # The partial correlation coefficient between x and y given z + # + # pcor.test is free and comes with ABSOLUTELY NO WARRANTY. + # + # x and y should be vectors + # + # z can be either a vector or a matrix + # + # use: There are two methods to calculate the partial correlation coefficient. + # One is by using variance-covariance matrix ("mat") and the other is by using recursive formula ("rec"). + # Default is "mat". + # + # method: There are three ways to calculate the correlation coefficient, + # which are Pearson's ("p"), Spearman's ("s"), and Kendall's ("k") methods. + # The last two methods which are Spearman's and Kendall's coefficient are based on the non-parametric analysis. + # Default is "p". + # + # na.rm: If na.rm is T, then all the missing samples are deleted from the whole dataset, which is (x,y,z). + # If not, the missing samples will be removed just when the correlation coefficient is calculated. + # However, the number of samples for the p-value is the number of samples after removing + # all the missing samples from the whole dataset. + # Default is "T". + + x <- c(x) + y <- c(y) + z <- as.data.frame(z) + + if(use == "mat"){ + p.use <- "Var-Cov matrix" + pcor = pcor.mat(x,y,z,method=method,na.rm=na.rm) + }else if(use == "rec"){ + p.use <- "Recursive formula" + pcor = pcor.rec(x,y,z,method=method,na.rm=na.rm) + }else{ + stop("use should be either rec or mat!\n") + } + + # print the method + if(gregexpr("p",method)[[1]][1] == 1){ + p.method <- "Pearson" + }else if(gregexpr("s",method)[[1]][1] == 1){ + p.method <- "Spearman" + }else if(gregexpr("k",method)[[1]][1] == 1){ + p.method <- "Kendall" + }else{ + stop("method should be pearson or spearman or kendall!\n") + } + + # sample number + n <- dim(na.omit(data.frame(x,y,z)))[1] + + # given variables' number + gn <- dim(z)[2] + + # p-value + if(p.method == "Kendall"){ + statistic <- pcor/sqrt(2*(2*(n-gn)+5)/(9*(n-gn)*(n-1-gn))) + p.value <- 2*pnorm(-abs(statistic)) + + }else{ + statistic <- pcor*sqrt((n-2-gn)/(1-pcor^2)) + p.value <- 2*pnorm(-abs(statistic)) + } + + data.frame(estimate=pcor,p.value=p.value,statistic=statistic,n=n,gn=gn,Method=p.method,Use=p.use) +} + +# By using var-cov matrix +pcor.mat <- function(x,y,z,method="p",na.rm=T){ + + x <- c(x) + y <- c(y) + z <- as.data.frame(z) + + if(dim(z)[2] == 0){ + stop("There should be given data\n") + } + + data <- data.frame(x,y,z) + + if(na.rm == T){ + data = na.omit(data) + } + + xdata <- na.omit(data.frame(data[,c(1,2)])) + Sxx <- cov(xdata,xdata,m=method) + + xzdata <- na.omit(data) + xdata <- data.frame(xzdata[,c(1,2)]) + zdata <- data.frame(xzdata[,-c(1,2)]) + Sxz <- cov(xdata,zdata,m=method) + + zdata <- na.omit(data.frame(data[,-c(1,2)])) + Szz <- cov(zdata,zdata,m=method) + + # is Szz positive definite? + zz.ev <- eigen(Szz)$values + if(min(zz.ev)[1]<0){ + stop("\'Szz\' is not positive definite!\n") + } + + # partial correlation + Sxx.z <- Sxx - Sxz %*% solve(Szz) %*% t(Sxz) + + rxx.z <- cov2cor(Sxx.z)[1,2] + + rxx.z +} + +# By using recursive formula +pcor.rec <- function(x,y,z,method="p",na.rm=T){ + # + + x <- c(x) + y <- c(y) + z <- as.data.frame(z) + + if(dim(z)[2] == 0){ + stop("There should be given data\n") + } + + data <- data.frame(x,y,z) + + if(na.rm == T){ + data = na.omit(data) + } + + # recursive formula + if(dim(z)[2] == 1){ + tdata <- na.omit(data.frame(data[,1],data[,2])) + rxy <- cor(tdata[,1],tdata[,2],m=method) + + tdata <- na.omit(data.frame(data[,1],data[,-c(1,2)])) + rxz <- cor(tdata[,1],tdata[,2],m=method) + + tdata <- na.omit(data.frame(data[,2],data[,-c(1,2)])) + ryz <- cor(tdata[,1],tdata[,2],m=method) + + rxy.z <- (rxy - rxz*ryz)/( sqrt(1-rxz^2)*sqrt(1-ryz^2) ) + + return(rxy.z) + }else{ + x <- c(data[,1]) + y <- c(data[,2]) + z0 <- c(data[,3]) + zc <- as.data.frame(data[,-c(1,2,3)]) + + rxy.zc <- pcor.rec(x,y,zc,method=method,na.rm=na.rm) + rxz0.zc <- pcor.rec(x,z0,zc,method=method,na.rm=na.rm) + ryz0.zc <- pcor.rec(y,z0,zc,method=method,na.rm=na.rm) + + rxy.z <- (rxy.zc - rxz0.zc*ryz0.zc)/( sqrt(1-rxz0.zc^2)*sqrt(1-ryz0.zc^2) ) + return(rxy.z) + } +} +""") + + R_pcorr_function = rpy2.robjects.r['pcor.test'] + R_corr_test = rpy2.robjects.r['cor.test'] + + primary = rpy2.robjects.FloatVector(range(len(primaryVal))) + for i in range(len(primaryVal)): + primary[i] = primaryVal[i] + + control = rpy2.robjects.r.matrix(rpy2.robjects.FloatVector( range(len(controlVals)*len(controlVals[0])) ), ncol=len(controlVals)) + for i in range(len(controlVals)): + for j in range(len(controlVals[0])): + control[i*len(controlVals[0]) + j] = controlVals[i][j] + + allcorrelations = [] + + for targetIndex, oneTargetVals in enumerate(targetVals): + + this_primary = None + this_control = None + this_target = None + + if None in oneTargetVals: + + goodIndex = [] + for i in range(len(oneTargetVals)): + if oneTargetVals[i] != None: + goodIndex.append(i) + + this_primary = rpy2.robjects.FloatVector(range(len(goodIndex))) + for i in range(len(goodIndex)): + this_primary[i] = primaryVal[goodIndex[i]] + + this_control = rpy2.robjects.r.matrix(rpy2.robjects.FloatVector( range(len(controlVals)*len(goodIndex)) ), ncol=len(controlVals)) + for i in range(len(controlVals)): + for j in range(len(goodIndex)): + this_control[i*len(goodIndex) + j] = controlVals[i][goodIndex[j]] + + this_target = rpy2.robjects.FloatVector(range(len(goodIndex))) + for i in range(len(goodIndex)): + this_target[i] = oneTargetVals[goodIndex[i]] + + else: + this_primary = primary + this_control = control + this_target = rpy2.robjects.FloatVector(range(len(oneTargetVals))) + for i in range(len(oneTargetVals)): + this_target[i] = oneTargetVals[i] + + one_name = targetNames[targetIndex] + one_N = len(this_primary) + + #calculate partial correlation + one_pc_coefficient = 'NA' + one_pc_p = 1 + + try: + if method == 's': + result = R_pcorr_function(this_primary, this_target, this_control, method='s') + else: + result = R_pcorr_function(this_primary, this_target, this_control) + + #XZ: In very few cases, the returned coefficient is nan. + #XZ: One way to detect nan is to compare the number to itself. NaN is always != NaN + if result[0][0] == result[0][0]: + one_pc_coefficient = result[0][0] + #XZ: when the coefficient value is 1 (primary trait and target trait are the same), + #XZ: occationally, the returned p value is nan instead of 0. + if result[1][0] == result[1][0]: + one_pc_p = result[1][0] + elif abs(one_pc_coefficient - 1) < 0.0000001: + one_pc_p = 0 + except: + pass + + #calculate zero order correlation + one_corr_coefficient = 0 + one_corr_p = 1 + + try: + if method == 's': + R_result = R_corr_test(this_primary, this_target, method='spearman') + else: + R_result = R_corr_test(this_primary, this_target) + + one_corr_coefficient = R_result[3][0] + one_corr_p = R_result[2][0] + except: + pass + + traitinfo = [ one_name, one_N, one_pc_coefficient, one_pc_p, one_corr_coefficient, one_corr_p ] + + allcorrelations.append(traitinfo) + + return allcorrelations + #End of function compute_partial + + + allcorrelations = [] + + target_trait_number = len(targetVals) + + if target_trait_number < 1000: + allcorrelations = compute_partial ( primaryVal, controlVals, targetVals, targetNames, method ) + else: + step = 1000 + job_number = math.ceil( float(target_trait_number)/step ) + + job_targetVals_lists = [] + job_targetNames_lists = [] + + for job_index in range( int(job_number) ): + starti = job_index*step + endi = min((job_index+1)*step, target_trait_number) + + one_job_targetVals_list = [] + one_job_targetNames_list = [] + + for i in range( starti, endi ): + one_job_targetVals_list.append( targetVals[i] ) + one_job_targetNames_list.append( targetNames[i] ) + + job_targetVals_lists.append( one_job_targetVals_list ) + job_targetNames_lists.append( one_job_targetNames_list ) + + ppservers = () + # Creates jobserver with automatically detected number of workers + job_server = pp.Server(ppservers=ppservers) + + jobs = [] + results = [] + + for i, one_job_targetVals_list in enumerate( job_targetVals_lists ): + one_job_targetNames_list = job_targetNames_lists[i] + #pay attention to modules from outside + jobs.append( job_server.submit(func=compute_partial, args=( primaryVal, controlVals, one_job_targetVals_list, one_job_targetNames_list, method), depfuncs=(), modules=("rpy2.robjects",)) ) + + for one_job in jobs: + one_result = one_job() + results.append( one_result ) + + for one_result in results: + for one_traitinfo in one_result: + allcorrelations.append( one_traitinfo ) + + return allcorrelations + + + +#XZ, April 30, 2010: The input primaryTrait and targetTrait are instance of webqtlTrait +#XZ: The primaryTrait and targetTrait should have executed retrieveData function +def calZeroOrderCorr (primaryTrait, targetTrait, method='pearson'): + + #primaryTrait.retrieveData() + + #there is no None value in primary_val + primary_strain, primary_val, primary_var = primaryTrait.exportInformative() + + #targetTrait.retrieveData() + + #there might be None value in target_val + target_val = targetTrait.exportData(primary_strain, type="val") + + R_primary = rpy2.robjects.FloatVector(range(len(primary_val))) + for i in range(len(primary_val)): + R_primary[i] = primary_val[i] + + N = len(target_val) + + if None in target_val: + goodIndex = [] + for i in range(len(target_val)): + if target_val[i] != None: + goodIndex.append(i) + + N = len(goodIndex) + + R_primary = rpy2.robjects.FloatVector(range(len(goodIndex))) + for i in range(len(goodIndex)): + R_primary[i] = primary_val[goodIndex[i]] + + R_target = rpy2.robjects.FloatVector(range(len(goodIndex))) + for i in range(len(goodIndex)): + R_target[i] = target_val[goodIndex[i]] + + else: + R_target = rpy2.robjects.FloatVector(range(len(target_val))) + for i in range(len(target_val)): + R_target[i] = target_val[i] + + R_corr_test = rpy2.robjects.r['cor.test'] + + if method == 'spearman': + R_result = R_corr_test(R_primary, R_target, method='spearman') + else: + R_result = R_corr_test(R_primary, R_target) + + corr_result = [] + corr_result.append( R_result[3][0] ) + corr_result.append( N ) + corr_result.append( R_result[2][0] ) + + return corr_result + +##################################################################################### +#Input: primaryValue(list): one list of expression values of one probeSet, +# targetValue(list): one list of expression values of one probeSet, +# method(string): indicate correlation method ('pearson' or 'spearman') +#Output: corr_result(list): first item is Correlation Value, second item is tissue number, +# third item is PValue +#Function: get correlation value,Tissue quantity ,p value result by using R; +#Note : This function is special case since both primaryValue and targetValue are from +#the same dataset. So the length of these two parameters is the same. They are pairs. +#Also, in the datatable TissueProbeSetData, all Tissue values are loaded based on +#the same tissue order +##################################################################################### + +def calZeroOrderCorrForTiss (primaryValue=[], targetValue=[], method='pearson'): + + R_primary = rpy2.robjects.FloatVector(range(len(primaryValue))) + N = len(primaryValue) + for i in range(len(primaryValue)): + R_primary[i] = primaryValue[i] + + R_target = rpy2.robjects.FloatVector(range(len(targetValue))) + for i in range(len(targetValue)): + R_target[i]=targetValue[i] + + R_corr_test = rpy2.robjects.r['cor.test'] + if method =='spearman': + R_result = R_corr_test(R_primary, R_target, method='spearman') + else: + R_result = R_corr_test(R_primary, R_target) + + corr_result =[] + corr_result.append( R_result[3][0]) + corr_result.append( N ) + corr_result.append( R_result[2][0]) + + return corr_result + + + + +def batchCalTissueCorr(primaryTraitValue=[], SymbolValueDict={}, method='pearson'): + + def cal_tissue_corr(primaryTraitValue, oneSymbolValueDict, method ): + + oneSymbolCorrDict = {} + oneSymbolPvalueDict = {} + + R_corr_test = rpy2.robjects.r['cor.test'] + + R_primary = rpy2.robjects.FloatVector(range(len(primaryTraitValue))) + + for i in range(len(primaryTraitValue)): + R_primary[i] = primaryTraitValue[i] + + for (oneTraitSymbol, oneTraitValue) in oneSymbolValueDict.iteritems(): + R_target = rpy2.robjects.FloatVector(range(len(oneTraitValue))) + for i in range(len(oneTraitValue)): + R_target[i] = oneTraitValue[i] + + if method =='spearman': + R_result = R_corr_test(R_primary, R_target, method='spearman') + else: + R_result = R_corr_test(R_primary, R_target) + + oneSymbolCorrDict[oneTraitSymbol] = R_result[3][0] + oneSymbolPvalueDict[oneTraitSymbol] = R_result[2][0] + + return(oneSymbolCorrDict, oneSymbolPvalueDict) + + + + symbolCorrDict = {} + symbolPvalueDict = {} + + items_number = len(SymbolValueDict) + + if items_number <= 1000: + symbolCorrDict, symbolPvalueDict = cal_tissue_corr(primaryTraitValue, SymbolValueDict, method) + else: + items_list = SymbolValueDict.items() + + step = 1000 + job_number = math.ceil( float(items_number)/step ) + + job_oneSymbolValueDict_list = [] + + for job_index in range( int(job_number) ): + starti = job_index*step + endi = min((job_index+1)*step, items_number) + + oneSymbolValueDict = {} + + for i in range( starti, endi ): + one_item = items_list[i] + one_symbol = one_item[0] + one_value = one_item[1] + oneSymbolValueDict[one_symbol] = one_value + + job_oneSymbolValueDict_list.append( oneSymbolValueDict ) + + + ppservers = () + # Creates jobserver with automatically detected number of workers + job_server = pp.Server(ppservers=ppservers) + + jobs = [] + results = [] + + for i, oneSymbolValueDict in enumerate( job_oneSymbolValueDict_list ): + + #pay attention to modules from outside + jobs.append( job_server.submit(func=cal_tissue_corr, args=(primaryTraitValue, oneSymbolValueDict, method), depfuncs=(), modules=("rpy2.robjects",)) ) + + for one_job in jobs: + one_result = one_job() + results.append( one_result ) + + for one_result in results: + oneSymbolCorrDict, oneSymbolPvalueDict = one_result + symbolCorrDict.update( oneSymbolCorrDict ) + symbolPvalueDict.update( oneSymbolPvalueDict ) + + return (symbolCorrDict, symbolPvalueDict) + +########################################################################### +#Input: cursor, GeneNameLst (list), TissueProbeSetFreezeId +#output: geneIdDict,dataIdDict,ChrDict,MbDict,descDict,pTargetDescDict (Dict) +#function: get multi dicts for short and long label functions, and for getSymbolValuePairDict and +# getGeneSymbolTissueValueDict to build dict to get CorrPvArray +#Note: If there are multiple probesets for one gene, select the one with highest mean. +########################################################################### +def getTissueProbeSetXRefInfo(cursor=None,GeneNameLst=[],TissueProbeSetFreezeId=0): + Symbols ="" + symbolList =[] + geneIdDict ={} + dataIdDict = {} + ChrDict = {} + MbDict = {} + descDict = {} + pTargetDescDict = {} + + count = len(GeneNameLst) + + # Added by NL 01/06/2011 + # Note that:inner join is necessary in this query to get distinct record in one symbol group with highest mean value + # Duo to the limit size of TissueProbeSetFreezeId table in DB, performance of inner join is acceptable. + if count==0: + query=''' + select t.Symbol,t.GeneId, t.DataId,t.Chr, t.Mb,t.description,t.Probe_Target_Description + from ( + select Symbol, max(Mean) as maxmean + from TissueProbeSetXRef + where TissueProbeSetFreezeId=%s and Symbol!='' and Symbol Is Not Null group by Symbol) + as x inner join TissueProbeSetXRef as t on t.Symbol = x.Symbol and t.Mean = x.maxmean; + '''%TissueProbeSetFreezeId + + else: + for i, item in enumerate(GeneNameLst): + + if i == count-1: + Symbols += "'%s'" %item + else: + Symbols += "'%s'," %item + + Symbols = "("+ Symbols+")" + query=''' + select t.Symbol,t.GeneId, t.DataId,t.Chr, t.Mb,t.description,t.Probe_Target_Description + from ( + select Symbol, max(Mean) as maxmean + from TissueProbeSetXRef + where TissueProbeSetFreezeId=%s and Symbol in %s group by Symbol) + as x inner join TissueProbeSetXRef as t on t.Symbol = x.Symbol and t.Mean = x.maxmean; + '''% (TissueProbeSetFreezeId,Symbols) + + try: + + cursor.execute(query) + results =cursor.fetchall() + resultCount = len(results) + # Key in all dicts is the lower-cased symbol + for i, item in enumerate(results): + symbol = item[0] + symbolList.append(symbol) + + key =symbol.lower() + geneIdDict[key]=item[1] + dataIdDict[key]=item[2] + ChrDict[key]=item[3] + MbDict[key]=item[4] + descDict[key]=item[5] + pTargetDescDict[key]=item[6] + + except: + symbolList = None + geneIdDict=None + dataIdDict=None + ChrDict=None + MbDict=None + descDict=None + pTargetDescDict=None + + return symbolList,geneIdDict,dataIdDict,ChrDict,MbDict,descDict,pTargetDescDict + +########################################################################### +#Input: cursor, symbolList (list), dataIdDict(Dict) +#output: symbolValuepairDict (dictionary):one dictionary of Symbol and Value Pair, +# key is symbol, value is one list of expression values of one probeSet; +#function: get one dictionary whose key is gene symbol and value is tissue expression data (list type). +#Attention! All keys are lower case! +########################################################################### +def getSymbolValuePairDict(cursor=None,symbolList=None,dataIdDict={}): + symbolList = map(string.lower, symbolList) + symbolValuepairDict={} + valueList=[] + + for key in symbolList: + if dataIdDict.has_key(key): + DataId = dataIdDict[key] + + valueQuery = "select value from TissueProbeSetData where Id=%s" % DataId + try : + cursor.execute(valueQuery) + valueResults = cursor.fetchall() + for item in valueResults: + item =item[0] + valueList.append(item) + symbolValuepairDict[key] = valueList + valueList=[] + except: + symbolValuepairDict[key] = None + + return symbolValuepairDict + + +######################################################################################################## +#input: cursor, symbolList (list), dataIdDict(Dict): key is symbol +#output: SymbolValuePairDict(dictionary):one dictionary of Symbol and Value Pair. +# key is symbol, value is one list of expression values of one probeSet. +#function: wrapper function for getSymbolValuePairDict function +# build gene symbol list if necessary, cut it into small lists if necessary, +# then call getSymbolValuePairDict function and merge the results. +######################################################################################################## + +def getGeneSymbolTissueValueDict(cursor=None,symbolList=None,dataIdDict={}): + limitNum=1000 + count = len(symbolList) + + SymbolValuePairDict = {} + + if count !=0 and count <=limitNum: + SymbolValuePairDict = getSymbolValuePairDict(cursor=cursor,symbolList=symbolList,dataIdDict=dataIdDict) + + elif count >limitNum: + SymbolValuePairDict={} + n = count/limitNum + start =0 + stop =0 + + for i in range(n): + stop =limitNum*(i+1) + gList1 = symbolList[start:stop] + PairDict1 = getSymbolValuePairDict(cursor=cursor,symbolList=gList1,dataIdDict=dataIdDict) + start =limitNum*(i+1) + + SymbolValuePairDict.update(PairDict1) + + if stop < count: + stop = count + gList2 = symbolList[start:stop] + PairDict2 = getSymbolValuePairDict(cursor=cursor,symbolList=gList2,dataIdDict=dataIdDict) + SymbolValuePairDict.update(PairDict2) + + return SymbolValuePairDict + +######################################################################################################## +#input: cursor, GeneNameLst (list), TissueProbeSetFreezeId(int) +#output: SymbolValuePairDict(dictionary):one dictionary of Symbol and Value Pair. +# key is symbol, value is one list of expression values of one probeSet. +#function: wrapper function of getGeneSymbolTissueValueDict function +# for CorrelationPage.py +######################################################################################################## + +def getGeneSymbolTissueValueDictForTrait(cursor=None,GeneNameLst=[],TissueProbeSetFreezeId=0): + SymbolValuePairDict={} + symbolList,geneIdDict,dataIdDict,ChrDict,MbDict,descDict,pTargetDescDict = getTissueProbeSetXRefInfo(cursor=cursor,GeneNameLst=GeneNameLst,TissueProbeSetFreezeId=TissueProbeSetFreezeId) + if symbolList: + SymbolValuePairDict = getGeneSymbolTissueValueDict(cursor=cursor,symbolList=symbolList,dataIdDict=dataIdDict) + return SymbolValuePairDict + +######################################################################################################## +#Input: cursor(cursor): MySQL connnection cursor; +# priGeneSymbolList(list): one list of gene symbol; +# symbolValuepairDict(dictionary): one dictionary of Symbol and Value Pair, +# key is symbol, value is one list of expression values of one probeSet; +#Output: corrArray(array): array of Correlation Value, +# pvArray(array): array of PValue; +#Function: build corrArray, pvArray for display by calling calculation function:calZeroOrderCorrForTiss +######################################################################################################## + +def getCorrPvArray(cursor=None,priGeneSymbolList=[],symbolValuepairDict={}): + # setting initial value for corrArray, pvArray equal to 0 + Num = len(priGeneSymbolList) + + corrArray = [([0] * (Num))[:] for i in range(Num)] + pvArray = [([0] * (Num))[:] for i in range(Num)] + i = 0 + for pkey in priGeneSymbolList: + j = 0 + pkey = pkey.strip().lower()# key in symbolValuepairDict is low case + if symbolValuepairDict.has_key(pkey): + priValue = symbolValuepairDict[pkey] + for tkey in priGeneSymbolList: + tkey = tkey.strip().lower()# key in symbolValuepairDict is low case + if priValue and symbolValuepairDict.has_key(tkey): + tarValue = symbolValuepairDict[tkey] + + if tarValue: + if i>j: + # corrArray stores Pearson Correlation values + # pvArray stores Pearson P-Values + pcorr_result =calZeroOrderCorrForTiss(primaryValue=priValue,targetValue=tarValue) + corrArray[i][j] =pcorr_result[0] + pvArray[i][j] =pcorr_result[2] + elif i %s - order by Tissue.Name""", (species, group, webqtlConfig.PUBLICTHRESH)) + ProbeSetFreeze.public > 0 + order by Tissue.Name""", (species, group)) return Cursor.fetchall() @@ -140,14 +162,17 @@ def build_datasets(species, group, type_name): InbredSet.Name = %s and ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id and Tissue.Name = %s and ProbeFreeze.TissueId = Tissue.Id and ProbeFreeze.InbredSetId = - InbredSet.Id and ProbeSetFreeze.public > %s order by + InbredSet.Id and ProbeSetFreeze.public > 0 order by ProbeSetFreeze.CreateTime desc""", ( - species, group, type_name, webqtlConfig.PUBLICTHRESH)) + species, group, type_name)) return Cursor.fetchall() def main(): """Generates and outputs (as json file) the data for the main dropdown menus on the home page""" + + parse_db_uri(our_settings.DB_URI) + species = get_species() groups = get_groups(species) types = get_types(groups) @@ -182,5 +207,7 @@ def _test_it(): datasets = build_datasets("Mouse", "BXD", "Hippocampus") print("build_datasets:", pf(datasets)) -if __name__ == '__main__': +if __name__ == '__main__': + Conn = MySQLdb.Connect(**parse_db_uri(our_settings.DB_URI)) + Cursor = Conn.cursor() main() diff --git a/wqflask/maintenance/our_settings.py b/wqflask/maintenance/our_settings.py new file mode 120000 index 00000000..14efe407 --- /dev/null +++ b/wqflask/maintenance/our_settings.py @@ -0,0 +1 @@ +../../../zach_settings.py \ No newline at end of file diff --git a/wqflask/secure_server.py b/wqflask/secure_server.py index 3487f35b..2abfdb05 100644 --- a/wqflask/secure_server.py +++ b/wqflask/secure_server.py @@ -4,12 +4,10 @@ from wqflask import app from flask import Flask, render_template - # Setup mail from flask.ext.mail import Mail mail = Mail(app) - from wqflask.model import * # Create a user to test with @@ -19,7 +17,6 @@ from wqflask.model import * # user_datastore.create_user(email='matt@example.com', password='notebook') # db.session.commit() - import logging file_handler = logging.FileHandler(app.config['LOGFILE']) file_handler.setLevel(logging.DEBUG) diff --git a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json index 88bdcb11..4aae20ba 100644 --- a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json +++ b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json @@ -62,15 +62,15 @@ "QSM Genotypes" ] ], - "Leaf": [ - [ - "B1LI0809M5", - "Barley1 Leaf INOC TTKS (Aug09) MAS5" - ], + "Leaf mRNA": [ [ "B1LI0809R", "Barley1 Leaf INOC TTKS (Aug09) RMA" ], + [ + "B1LI0809M5", + "Barley1 Leaf INOC TTKS (Aug09) MAS5" + ], [ "B1MI0809M5", "Barley1 Leaf MOCK TTKS (Aug09) MAS5" @@ -88,7 +88,7 @@ ] }, "SXM": { - "Embryo": [ + "Embryo mRNA": [ [ "B139_K_1206_R", "Barley1 Embryo gcRMA SCRI (Dec06)" @@ -108,18 +108,18 @@ "SXM Genotypes" ] ], - "Leaf": [ + "Leaf mRNA": [ [ "B30_K_1206_M", "Barley1 Leaf MAS 5.0 SCRI (Dec06)" ], - [ - "B30_K_1206_R", - "Barley1 Leaf gcRMA SCRI (Dec06)" - ], [ "B30_K_1206_Rn", "Barley1 Leaf gcRMAn SCRI (Dec06)" + ], + [ + "B30_K_1206_R", + "Barley1 Leaf gcRMA SCRI (Dec06)" ] ], "Phenotypes": [ @@ -144,7 +144,7 @@ "DGRP Published Phenotypes" ] ], - "Whole Body": [ + "Whole Body mRNA": [ [ "NCSU_DrosWB_LC_RMA_0111", "NCSU Drosophila Whole Body (Jan11) RMA" @@ -164,7 +164,7 @@ "Oregon-R_x_2b3 Published Phenotypes" ] ], - "Whole Body": [ + "Whole Body mRNA": [ [ "UAB_DrosWB_LC_RMA_1009", "UAB Whole body D.m. mRNA control (Oct09) RMA" @@ -178,7 +178,7 @@ }, "human": { "AD-cases-controls": { - "Brain": [ + "Brain mRNA": [ [ "GSE5281_F_RMA_N_0709", "GSE5281 Human Brain Normal Full Liang (Jul09) RMA" @@ -210,15 +210,15 @@ ] }, "AD-cases-controls-Myers": { - "Brain": [ - [ - "GSE15222_F_N_RI_0409", - "GSE15222 Human Brain Normal Myers (Apr09) RankInv" - ], + "Brain mRNA": [ [ "GSE15222_F_A_RI_0409", "GSE15222 Human Brain Alzheimer Myers (Apr09) RankInv" ], + [ + "GSE15222_F_N_RI_0409", + "GSE15222 Human Brain Normal Myers (Apr09) RankInv" + ], [ "GSE15222_F_RI_0409", "GSE15222 Human Brain Myers (Apr09) RankInv" @@ -244,10 +244,20 @@ "CANDLE Genotypes" ] ], - "Newborn Cord Blood": [ + "Methylation": [ + [ + "CANDLE_Meth27_0313", + "CANDLE Newborn Cord ILM HumanMethylation27 (Mar13) **" + ], + [ + "CANDLE_Meth_0313", + "CANDLE Newborn Cord ILM HumanMethylation27 (Mar13) Z-Score **" + ] + ], + "Newborn Cord Blood mRNA": [ [ "CANDLE_NB_0711", - "CANDLE Newborn Cord ILMv6.3 (Jun11) QUANT **" + "CANDLE Newborn Cord ILMv6.3 (Jun11) QUANT" ] ], "Phenotypes": [ @@ -264,7 +274,7 @@ "CEPH-2004 Genotypes" ] ], - "Lymphoblast B-cell": [ + "Lymphoblast B-cell mRNA": [ [ "UT_CEPH_RankInv0909", "UTHSC CEPH B-cells Illumina (Sep09) RankInv" @@ -282,7 +292,7 @@ ] }, "HB": { - "Cerebellum": [ + "Cerebellum mRNA": [ [ "HBTRC-MLC_0611", "HBTRC-MLC Human Cerebellum Agilent (Jun11) mlratio" @@ -312,7 +322,7 @@ "HB Published Phenotypes" ] ], - "Prefrontal Cortex": [ + "Prefrontal Cortex mRNA": [ [ "HBTRC-MLPFC_0611", "HBTRC-MLC Human Prefrontal Cortex Agilent (Jun11) mlratio" @@ -330,7 +340,7 @@ "HBTRC-MLC Human Prefrontal Cortex Agilent HD (Jun11) mlratio" ] ], - "Primary Visual Cortex": [ + "Primary Visual Cortex mRNA": [ [ "HBTRC-MLVC_0611", "HBTRC-MLC Human Visual Cortex Agilent (Jun11) mlratio" @@ -356,7 +366,7 @@ "HLC Genotypes" ] ], - "Liver": [ + "Liver mRNA": [ [ "HLC_0311", "GSE9588 Human Liver Normal (Mar11) Both Sexes" @@ -377,20 +387,52 @@ ] ] }, + "HLT": { + "Genotypes": [ + [ + "HLTGeno", + "HLT Genotypes" + ] + ], + "Lung mRNA": [ + [ + "GSE23546HLT0613", + "Super Series GSE23546 Whole-Genome GXD Non-Tumorous Human Lung Tissues Affy HuRSTA array (Jun11) RMA" + ], + [ + "luCA_GSE23352HLT0613", + "UL/GSE23352 Whole-Genome GXD Non-Tumorous Human Lung Tissues Affy HuRSTA (Jun11) RMA" + ], + [ + "UBC-GSE23529HLT0613", + "UBC/GSE23529 Whole-Genome GXD Non-Tumorous Human Lung Tissues Affy HuRSTA array (Jun11) RMA" + ], + [ + "GRNG-GSE23545HLT0613", + "GRNG/GSE23545 Whole-Genome GXD Non-Tumorous Human Lung Tissues Affy HuRSTA array (Jun11) RMA" + ] + ], + "Phenotypes": [ + [ + "HLTPublish", + "HLT Published Phenotypes" + ] + ] + }, "HSB": { - "Amygdala": [ + "Amygdala mRNA": [ [ "KIN_YSM_AMY_0711", "GN330 Human Amygdala Affy Hu-Exon 1.0 ST (Jul11) Quantile" ] ], - "Cerebellar Cortex": [ + "Cerebellar Cortex mRNA": [ [ "KIN_YSM_CBC_0711", "Human Cerebellar Cortex Affy Hu-Exon 1.0 ST (Jul11) Quantile" ] ], - "Dorsolateral Prefrontal Cortex": [ + "Dorsolateral Prefrontal Cortex mRNA": [ [ "KIN_YSM_DFC_0711", "Human Dorsolateral Prefrontal Cortex Affy Hu-Exon 1.0 ST (Jul11) Quantile" @@ -402,31 +444,31 @@ "HSB Genotypes" ] ], - "Hippocampus": [ + "Hippocampus mRNA": [ [ "KIN_YSM_HIP_0711", "Human Hippocampus Affy Hu-Exon 1.0 ST (Jul11) Quantile" ] ], - "Inferior Temporal Cortex": [ + "Inferior Temporal Cortex mRNA": [ [ "KIN_YSM_ITC_0711", "Human Inferior Temporal Cortex Affy Hu-Exon 1.0 ST (Jul11) Quantile" ] ], - "Medial Prefrontal Cortex": [ + "Medial Prefrontal Cortex mRNA": [ [ "KIN_YSM_MFC_0711", "Human Medial Prefrontal Cortex Affy Hu-Exon 1.0 ST (Jul11) Quantile" ] ], - "Mediodorsal Nucleus of Thalamus": [ + "Mediodorsal Nucleus of Thalamus mRNA": [ [ "KIN_YSM_MD_0711", "Human Mediodorsal Nucleus of Thalamus Affy Hu-Exon 1.0 ST (Jul11) Quantile" ] ], - "Orbital Prefrontal Cortex": [ + "Orbital Prefrontal Cortex mRNA": [ [ "KIN_YSM_OFC_0711", "Human Orbital Prefrontal Cortex Affy Hu-Exon 1.0 ST (Jul11) Quantile" @@ -438,49 +480,49 @@ "HSB Published Phenotypes" ] ], - "Posterior Inferior Parietal Cortex": [ + "Posterior Inferior Parietal Cortex mRNA": [ [ "KIN_YSM_IPC_0711", "Human Posterior Inferior Parietal Cortex Affy Hu-Exon 1.0 ST (Jul11) Quantile" ] ], - "Posterior Superior Temporal Cortex": [ + "Posterior Superior Temporal Cortex mRNA": [ [ "KIN_YSM_STC_0711", "Human Posterior Superior Temporal Cortex Affy Hu-Exon 1.0 ST (Jul11) Quantile" ] ], - "Primary Auditory (A1) Cortex": [ + "Primary Auditory (A1) Cortex mRNA": [ [ "KIN_YSM_A1C_0711", "Human Primary Auditory (A1) Cortex Affy Hu-Exon 1.0 ST (Jul11) Quantile" ] ], - "Primary Motor (M1) Cortex": [ + "Primary Motor (M1) Cortex mRNA": [ [ "KIN_YSM_M1C_0711", "Human Primary Motor (M1) Cortex Affy Hu-Exon 1.0 ST (Jul11) Quantile" ] ], - "Primary Somatosensory (S1) Cortex": [ + "Primary Somatosensory (S1) Cortex mRNA": [ [ "KIN_YSM_S1C_0711", "Human Primary Somatosensory (S1) Cortex Affy Hu-Exon 1.0 ST (Jul11) Quantile" ] ], - "Primary Visual Cortex": [ + "Primary Visual Cortex mRNA": [ [ "KIN_YSM_V1C_0711", "Human Primary Visual Cortex Affy Hu-Exon 1.0 ST (Jul11) Quantile" ] ], - "Striatum": [ + "Striatum mRNA": [ [ "KIN_YSM_STR_0711", "Human Striatum Affy Hu-Exon 1.0 ST (Jul11) Quantile" ] ], - "Ventrolateral Prefrontal Cortex": [ + "Ventrolateral Prefrontal Cortex mRNA": [ [ "KIN_YSM_VFC_0711", "Human Ventrolateral Prefrontal Cortex Affy Hu-Exon 1.0 ST (Jul11) Quantile" @@ -490,13 +532,13 @@ }, "macaque monkey": { "Macaca-fasicularis": { - "Amygdala": [ + "Amygdala mRNA": [ [ "INIA_MacFas_AMG_RMA_0110", "INIA Macaca fasicularis Amygdala (Jan10) RMA **" ] ], - "Brain": [ + "Brain mRNA": [ [ "INIA_MacFas_brain_RMA_0110", "INIA Macaca fasicularis Brain (Jan10) RMA **" @@ -508,13 +550,13 @@ "Macaca-fasicularis Genotypes" ] ], - "Hippocampus": [ + "Hippocampus mRNA": [ [ "INIA_MacFas_Hc_RMA_0110", "INIA Macaca fasicularis Hippocampus (Jan10) RMA **" ] ], - "Nucleus Accumbens": [ + "Nucleus Accumbens mRNA": [ [ "INIA_MacFas_Ac_RMA_0110", "INIA Macaca fasicularis Nucleus Accumbens (Jan10) RMA **" @@ -526,7 +568,7 @@ "Macaca-fasicularis Published Phenotypes" ] ], - "Prefrontal Cortex": [ + "Prefrontal Cortex mRNA": [ [ "INIA_MacFas_Pf_RMA_0110", "INIA Macaca fasicularis Prefrontal Cortex (Jan10) RMA **" @@ -542,18 +584,18 @@ "AKXD Genotypes" ] ], - "Mammary Tumors": [ + "Mammary Tumors mRNA": [ [ "NCI_Agil_Mam_Tum_RMA_0409", "NCI Mammary LMT miRNA v2 (Apr09) RMA" ], - [ - "MA_M_0704_M", - "NCI Mammary mRNA M430 (July04) MAS5" - ], [ "MA_M_0704_R", "NCI Mammary mRNA M430 (July04) RMA" + ], + [ + "MA_M_0704_M", + "NCI Mammary mRNA M430 (July04) MAS5" ] ], "Phenotypes": [ @@ -564,7 +606,13 @@ ] }, "AXBXA": { - "Eye": [ + "Bone Femur mRNA": [ + [ + "UCLA_AXB/BXA_Femur_0113_RSN", + "UCLA GSE27483 AXB/BXA Bone Femur ILM Mouse WG-6 v1, v1.1 (Jan13) RSN" + ] + ], + "Eye mRNA": [ [ "Eye_AXBXA_1008_RankInv", "Eye AXBXA Illumina V6.2(Oct08) RankInv Beta" @@ -576,7 +624,13 @@ "AXBXA Genotypes" ] ], - "Liver": [ + "Heart mRNA": [ + [ + "IRCM_AXBXA_HRI0213", + "IRCM AXB/BXA Mouse Heart ILM MouseRef-8 v2.0 (Feb13) RankInv" + ] + ], + "Liver mRNA": [ [ "GSE16780AB_UCLA_ML0911", "GSE16780 UCLA Mouse AXB/BXA Liver Affy HT M430A (Sep11) RMA" @@ -596,14 +650,14 @@ "B6BTBRF2 Genotypes" ] ], - "Liver": [ - [ - "LVF2_M_0704_M", - "(B6 x BTBR)F2-ob/ob Liver mRNA M430 (Jul04) MAS5" - ], + "Liver mRNA": [ [ "LVF2_M_0704_R", "(B6 x BTBR)F2-ob/ob Liver mRNA M430 (Jul04) RMA" + ], + [ + "LVF2_M_0704_M", + "(B6 x BTBR)F2-ob/ob Liver mRNA M430 (Jul04) MAS5" ] ], "Phenotypes": [ @@ -614,7 +668,11 @@ ] }, "B6D2F2": { - "Brain": [ + "Brain mRNA": [ + [ + "BRF2_M_0805_R", + "OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) RMA" + ], [ "BRF2_M_0805_M", "OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) MAS5" @@ -623,21 +681,17 @@ "BRF2_M_0805_P", "OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) PDNN" ], - [ - "BRF2_M_0805_R", - "OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) RMA" - ], [ "BRF2_M_0304_P", "OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) PDNN" ], - [ - "BRF2_M_0304_M", - "OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) MAS5" - ], [ "BRF2_M_0304_R", "OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) RMA" + ], + [ + "BRF2_M_0304_M", + "OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) MAS5" ] ], "Genotypes": [ @@ -660,10 +714,22 @@ "B6D2F2-PSU Genotypes" ] ], - "Muscle": [ + "Muscle mRNA": [ [ "PSU-B6D2F2_0812", "PSU B6D2F2 Muscle Affy Mouse Genome 430 2.0 (Aug12) RMA **" + ], + [ + "PSU-B6D2F2_F0812", + "PSU B6D2F2 Muscle Affy Mouse Genome 430 2.0 (Aug12) RMA Females **" + ], + [ + "PSU-B6D2F2_M0812", + "PSU B6D2F2 Muscle Affy Mouse Genome 430 2.0 (Aug12) RMA Males **" + ], + [ + "PSU-B6D2F2_M2000812", + "PSU B6D2F2 Muscle Affy Mouse Genome 430 2.0 (Aug12) RMA Males Aged 200 **" ] ], "Phenotypes": [ @@ -680,7 +746,7 @@ "B6D2RI Genotypes" ] ], - "Hippocampus": [ + "Hippocampus mRNA": [ [ "UTHSC_B6D2RI_H_0912", "UTHSC B6D2RI Aged Hippocampus Affy Mouse Gene 1.0 ST (Sep12) RMA **" @@ -700,7 +766,7 @@ "BDF2-1999 Genotypes" ] ], - "Liver": [ + "Liver mRNA": [ [ "UCLA_BDF2_LIVER_1999", "UCLA BDF2 Liver (1999) mlratio" @@ -726,7 +792,11 @@ "BDF2-2005 Published Phenotypes" ] ], - "Striatum": [ + "Striatum mRNA": [ + [ + "SA_M2_0905_R", + "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) RMA" + ], [ "SA_M2_0905_M", "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) MAS5" @@ -734,37 +804,33 @@ [ "SA_M2_0905_P", "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) PDNN" - ], - [ - "SA_M2_0905_R", - "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) RMA" ] ] }, "BHF2": { - "Adipose": [ - [ - "UCLA_BHF2_ADIPOSE_FEMALE", - "UCLA BHF2 Adipose Female mlratio" - ], + "Adipose mRNA": [ [ "UCLA_BHF2_ADIPOSE_MALE", "UCLA BHF2 Adipose Male mlratio" ], + [ + "UCLA_BHF2_ADIPOSE_FEMALE", + "UCLA BHF2 Adipose Female mlratio" + ], [ "UCLA_BHF2_ADIPOSE_0605", "UCLA BHF2 Adipose (June05) mlratio" ] ], - "Brain": [ - [ - "UCLA_BHF2_BRAIN_FEMALE", - "UCLA BHF2 Brain Female mlratio" - ], + "Brain mRNA": [ [ "UCLA_BHF2_BRAIN_MALE", "UCLA BHF2 Brain Male mlratio" ], + [ + "UCLA_BHF2_BRAIN_FEMALE", + "UCLA BHF2 Brain Female mlratio" + ], [ "UCLA_BHF2_BRAIN_0605", "UCLA BHF2 Brain (June05) mlratio" @@ -776,29 +842,29 @@ "BHF2 Genotypes" ] ], - "Liver": [ - [ - "UCLA_BHF2_LIVER_FEMALE", - "UCLA BHF2 Liver Female mlratio" - ], + "Liver mRNA": [ [ "UCLA_BHF2_LIVER_MALE", "UCLA BHF2 Liver Male mlratio" ], + [ + "UCLA_BHF2_LIVER_FEMALE", + "UCLA BHF2 Liver Female mlratio" + ], [ "UCLA_BHF2_LIVER_0605", "UCLA BHF2 Liver (June05) mlratio" ] ], - "Muscle": [ - [ - "UCLA_BHF2_MUSCLE_FEMALE", - "UCLA BHF2 Muscle Female mlratio **" - ], + "Muscle mRNA": [ [ "UCLA_BHF2_MUSCLE_MALE", "UCLA BHF2 Muscle Male mlratio **" ], + [ + "UCLA_BHF2_MUSCLE_FEMALE", + "UCLA BHF2 Muscle Female mlratio **" + ], [ "UCLA_BHF2_MUSCLE_0605", "UCLA BHF2 Muscle (June05) mlratio **" @@ -812,7 +878,7 @@ ] }, "BHHBF2": { - "Adipose": [ + "Adipose mRNA": [ [ "UCLA_BHHBF2_ADIPOSE_2005", "UCLA BHHBF2 Adipose (2005) mlratio" @@ -826,7 +892,7 @@ "UCLA BHHBF2 Adipose Female Only" ] ], - "Brain": [ + "Brain mRNA": [ [ "UCLA_BHHBF2_BRAIN_2005", "UCLA BHHBF2 Brain (2005) mlratio" @@ -846,7 +912,7 @@ "BHHBF2 Genotypes" ] ], - "Liver": [ + "Liver mRNA": [ [ "UCLA_BHHBF2_LIVER_2005", "UCLA BHHBF2 Liver (2005) mlratio" @@ -860,7 +926,7 @@ "UCLA BHHBF2 Liver Female Only" ] ], - "Muscle": [ + "Muscle mRNA": [ [ "UCLA_BHHBF2_MUSCLE_2005", "UCLA BHHBF2 Muscle (2005) mlratio" @@ -882,17 +948,25 @@ ] }, "BXD": { - "Adrenal Gland": [ + "Adrenal Gland mRNA": [ [ "INIA_Adrenal_RMA_0612", "INIA Adrenal Affy MoGene 1.0ST (Jun12) RMA" ], + [ + "INIA_Adrenal_RMA_F_0612", + "INIA Adrenal Affy MoGene 1.0ST (Jun12) RMA Females" + ], + [ + "INIA_Adrenal_RMA_M_0612", + "INIA Adrenal Affy MoGene 1.0ST (Jun12) RMA Males" + ], [ "INIA_Adrenal_RMA_Ex_0612", "INIA Adrenal Affy MoGene 1.0ST (Jun12) RMA Exon Level" ] ], - "Amygdala": [ + "Amygdala mRNA": [ [ "INIA_AmgCoh_0311", "INIA Amygdala Cohort Affy MoGene 1.0 ST (Mar11) RMA" @@ -914,7 +988,25 @@ "INIA Amygdala Exon Affy MoGene 1.0 ST (Nov10) RMA" ] ], - "Brain": [ + "Bone Femur mRNA": [ + [ + "UCLA_BXD_Femur_0113_RSN", + "UCLA GSE27483 BXD Bone Femur ILM Mouse WG-6 v1, v1.1 (Jan13) RSN" + ], + [ + "UCLA_BXD-on_Femur_0113_RSN", + "UCLA GSE27483 BXD Only Bone Femur ILM Mouse WG-6 v2.0 (Jan13) RSN" + ] + ], + "Brain mRNA": [ + [ + "UTHSC_BXD_WB_RNASeq1112", + "UTHSC Mouse BXD Whole Brain RNA Sequence (Nov12) RPKM" + ], + [ + "UTHSC_BXD_WB_RNASeqEx1112", + "UTHSC Mouse BXD Whole Brain RNA Sequence Exon Level (Nov12) RPKM" + ], [ "BR_M2_1106_R", "UCHSC BXD Whole Brain M430 2.0 (Nov06) RMA" @@ -923,6 +1015,10 @@ "BR_U_1105_P", "UTHSC Brain mRNA U74Av2 (Nov05) PDNN" ], + [ + "BR_U_0805_M", + "UTHSC Brain mRNA U74Av2 (Aug05) MAS5" + ], [ "BR_U_0805_R", "UTHSC Brain mRNA U74Av2 (Aug05) RMA" @@ -931,16 +1027,12 @@ "BR_U_0805_P", "UTHSC Brain mRNA U74Av2 (Aug05) PDNN" ], - [ - "BR_U_0805_M", - "UTHSC Brain mRNA U74Av2 (Aug05) MAS5" - ], [ "CB_M_0204_P", "INIA Brain mRNA M430 (Feb04) PDNN" ] ], - "Cartilage": [ + "Cartilage mRNA": [ [ "UCLA_BXDBXH_CARTILAGE_V2", "UCLA BXD and BXH Cartilage v2" @@ -954,7 +1046,7 @@ "UCLA BXD Cartilage" ] ], - "Cerebellum": [ + "Cerebellum mRNA": [ [ "CB_M_1004_R", "SJUT Cerebellum mRNA M430 (Oct04) RMA" @@ -970,9 +1062,65 @@ [ "CB_M_1003_M", "SJUT Cerebellum mRNA M430 (Oct03) MAS5" + ], + [ + "CMMTUBCBXDCerILM0513", + "UBC/CMMT BXD Cerebellum All Ages Combined ILM Mouse WG-6 v2.0 (May13) RankInv **" + ], + [ + "CMMTUBCBXDG12CerILM0513", + "UBC/CMMT BXD E12 Cerebellum ILM Mouse WG-6 v2.0 (May13) RankInv **" + ], + [ + "CMMTUBCBXDG15CerILM0513", + "UBC/CMMT BXD E15 Cerebellum ILM Mouse WG-6 v2.0 (May13) RankInv **" + ], + [ + "CMMTUBCBXDG18CerILM0513", + "UBC/CMMT BXD E18 Cerebellum ILM Mouse WG-6 v2.0 (May13) RankInv **" + ], + [ + "CMMTUBCBXDP00CerILM0513", + "UBC/CMMT BXD P0 Cerebellum ILM Mouse WG-6 v2.0 (May13) RankInv **" + ], + [ + "CMMTUBCBXDP03CerILM0513", + "UBC/CMMT BXD P3 Cerebellum ILM Mouse WG-6 v2.0 (May13) RankInv **" + ], + [ + "CMMTUBCBXDP06CerILM0513", + "UBC/CMMT BXD P6 Cerebellum ILM Mouse WG-6 v2.0 (May13) RankInv **" + ], + [ + "CMMTUBCBXDP09CerILM0513", + "UBC/CMMT BXD P9 Cerebellum ILM Mouse WG-6 v2.0 (May13) RankInv **" + ], + [ + "GenEx_BXD_CerebEt_RMA_0213", + "GenEx BXD EtOH Cerebellum Affy M430 2.0 (Feb13) RMA Both Sexes **" + ], + [ + "GenEx_BXD_CerebEt_RMA_F_0213", + "GenEx BXD EtOH Cerebellum Affy M430 2.0 (Feb13) RMA Females **" + ], + [ + "GenEx_BXD_CerebEt_RMA_M_0213", + "GenEx BXD EtOH Cerebellum Affy M430 2.0 (Feb13) RMA Males **" + ], + [ + "GenEx_BXD_CerebSal_RMA_0213", + "GenEx BXD Sal Cerebellum Affy M430 2.0 (Feb13) RMA Both Sexes **" + ], + [ + "GenEx_BXD_CerebSal_RMA_F_0213", + "GenEx BXD Sal Cerebellum Affy M430 2.0 (Feb13) RMA Females **" + ], + [ + "GenEx_BXD_CerebSal_RMA_M_0213", + "GenEx BXD Sal Cerebellum Affy M430 2.0 (Feb13) RMA Males **" ] ], - "Eye": [ + "Eye mRNA": [ [ "Eye_M2_0908_R", "Eye M430v2 (Sep08) RMA" @@ -989,6 +1137,14 @@ "Eye_M2_0908_R_ND", "Eye M430v2 WT Gpnmb (Sep08) RMA **" ], + [ + "Eye_M2_0908_R_WT", + "Eye M430v2 WT Tyrp1 (Sep08) RMA **" + ], + [ + "DBA2J-ONH-1212", + "ONH BXD Glaucoma Affy M430 2.0 Trial (Dec12) RMA **" + ], [ "Eye_M2_0908_R_MT", "Eye M430v2 Mutant Tyrp1 (Sep08) RMA **" @@ -997,10 +1153,6 @@ "Eye_M2_0908_WTWT", "Eye M430v2 WT WT (Sep08) RMA **" ], - [ - "Eye_M2_0908_R_WT", - "Eye M430v2 WT Tyrp1 (Sep08) RMA **" - ], [ "BXD_GLA_0911", "BXD Glaucoma Affy M430 2.0 Trial (Sep11) RMA **" @@ -1012,7 +1164,7 @@ "BXD Genotypes" ] ], - "Hematopoietic Cells": [ + "Hematopoietic Cells mRNA": [ [ "UMCG_0907_HemaStem_ori", "UMCG Stem Cells ILM6v1.1 (Apr09) original" @@ -1050,7 +1202,7 @@ "GNF Stem Cells U74Av2 (Mar04) RMA" ] ], - "Hippocampus": [ + "Hippocampus mRNA": [ [ "HC_M2_0606_P", "Hippocampus Consortium M430v2 (Jun06) PDNN" @@ -1063,6 +1215,30 @@ "HC_M2_0606_R", "Hippocampus Consortium M430v2 (Jun06) RMA" ], + [ + "UT_ILM_BXD_hipp_5T_1112", + "UTHSC Hippocampus Illumina v6.1 5Trt (Nov12) RankInv" + ], + [ + "UT_ILM_BXD_hipp_NON_1112", + "UTHSC Hippocampus Illumina v6.1 NON (Nov12) RankInv" + ], + [ + "UT_ILM_BXD_hipp_NOS_1112", + "UTHSC Hippocampus Illumina v6.1 NOS (Nov12) RankInv" + ], + [ + "UT_ILM_BXD_hipp_NOE_1112", + "UTHSC Hippocampus Illumina v6.1 NOE (Nov12) RankInv" + ], + [ + "UT_ILM_BXD_hipp_RSS_1112", + "UTHSC Hippocampus Illumina v6.1 RSS (Nov12) RankInv" + ], + [ + "UT_ILM_BXD_hipp_RSE_1112", + "UTHSC Hippocampus Illumina v6.1 RSE (Nov12) RankInv" + ], [ "UMUTAffyExon_0209_RMA", "UMUTAffy Hippocampus Exon (Feb09) RMA" @@ -1096,7 +1272,7 @@ "UTHSC BXD Aged Hippocampus Affy Mouse Gene 1.0 ST (Sep12) RMA Exon Level **" ] ], - "Hypothalamus": [ + "Hypothalamus mRNA": [ [ "INIA_Hyp_RMA_1110", "INIA Hypothalamus Affy MoGene 1.0 ST (Nov10)" @@ -1114,15 +1290,15 @@ "INIA Hypothalamus Exon Affy MoGene 1.0 ST (Nov10)" ] ], - "Kidney": [ - [ - "MA_M2M_0706_R", - "Mouse kidney M430v2 Male (Aug06) RMA" - ], + "Kidney mRNA": [ [ "MA_M2F_0706_R", "Mouse kidney M430v2 Female (Aug06) RMA" ], + [ + "MA_M2M_0706_R", + "Mouse kidney M430v2 Male (Aug06) RMA" + ], [ "MA_M2_0806_R", "Mouse kidney M430v2 Sex Balanced (Aug06) RMA" @@ -1131,68 +1307,110 @@ "MA_M2_0806_P", "Mouse Kidney M430v2 Sex Balanced (Aug06) PDNN" ], - [ - "MA_M2_0706_R", - "Mouse Kidney M430v2 (Jul06) RMA" - ], [ "MA_M2_0706_P", "Mouse Kidney M430v2 (Jul06) PDNN" + ], + [ + "MA_M2_0706_R", + "Mouse Kidney M430v2 (Jul06) RMA" ] ], - "Leucocytes": [ + "Leucocytes mRNA": [ [ "Illum_BXD_PBL_1108", "UWA Illumina PBL (Nov08) RSN **" ] ], - "Liver": [ + "Liver Proteome": [ + [ + "EPFLBXDprotRPN0513", + "EPFL/LISP BXD Liver, Hepatocytes, Soluable Proteins CD+HFD (May13) RPN **" + ], + [ + "EPFLBXDprotHFDRPN0513", + "EPFL/LISP BXD Liver, Hepatocytes, Soluable Proteins HFD (May13) RPN **" + ], + [ + "EPFLBXDprotCDRPN0513", + "EPFL/LISP BXD Liver, Hepatocytes, Soluable Proteins CD (May13) RPN **" + ], + [ + "EPFLBXDprot0513", + "EPFL/LISP BXD Liver, Hepatocytes, Soluable Proteins CD+HFD (May13) **" + ], + [ + "EPFLBXDprotHFD0513", + "EPFL/LISP BXD Liver, Hepatocytes, Soluable Proteins HFD (May13) **" + ], + [ + "EPFLBXDprotCD0513", + "EPFL/LISP BXD Liver, Hepatocytes, Soluable Proteins CD (May13) **" + ] + ], + "Liver mRNA": [ [ "GSE16780_UCLA_ML0911", "GSE16780 UCLA Hybrid MDP Liver Affy HT M430A (Sep11) RMA" ], [ - "GenEx_BXD_liverEt_M5_0912", - "GenEx BXD EtOH Liver Affy M430 2.0 (Sep12) MAS5 Both Sexes **" + "EPFLMouseLiverRMA0413", + "EPFL/LISP BXD CD+HFD Liver Affy Mouse Gene 1.0 ST (Apr13) RMA **" ], [ - "GenEx_BXD_liverEt_M5F_0912", - "GenEx BXD EtOH Liver Affy M430 2.0 (Sep12) MAS5 Females **" + "EPFLMouseLiverHFDRMA0413", + "EPFL/LISP BXD HFD Liver Affy Mouse Gene 1.0 ST (Apr13) RMA **" + ], + [ + "EPFLMouseLiverCDRMA0413", + "EPFL/LISP BXD CD Liver Affy Mouse Gene 1.0 ST (Apr13) RMA **" + ], + [ + "EPFLMouseLiverBothExRMA0413", + "EPFL/LISP BXD CD+HFD Liver Affy Mouse Gene 1.0 ST (Apr13) RMA Exon Level **" + ], + [ + "GenEx_BXD_liverEt_M5_0912", + "GenEx BXD EtOH Liver Affy M430 2.0 (Sep12) MAS5 Both Sexes **" ], [ "GenEx_BXD_liverEt_M5M_0912", "GenEx BXD EtOH Liver Affy M430 2.0 (Sep12) MAS5 Males **" ], [ - "GenEx_BXD_liverSal_RMA_F_0211", - "GenEx BXD Sal Liver Affy M430 2.0 (Feb11) RMA Females **" + "GenEx_BXD_liverEt_M5F_0912", + "GenEx BXD EtOH Liver Affy M430 2.0 (Sep12) MAS5 Females **" ], [ - "GenEx_BXD_liverSal_RMA_M_0211", - "GenEx BXD Sal Liver Affy M430 2.0 (Feb11) RMA Males **" + "GenEx_BXD_liverEt_RMA_0211", + "GenEx BXD EtOH Liver Affy M430 2.0 (Feb11) RMA Both Sexes **" ], [ - "GenEx_BXD_liverSal_RMA_0211", - "GenEx BXD Sal Liver Affy M430 2.0 (Feb11) RMA Both Sexes **" + "GenEx_BXD_liverEt_RMA_M_0211", + "GenEx BXD EtOH Liver Affy M430 2.0 (Feb11) RMA Males **" ], [ "GenEx_BXD_liverEt_RMA_F_0211", "GenEx BXD EtOH Liver Affy M430 2.0 (Feb11) RMA Females **" ], [ - "GenEx_BXD_liverEt_RMA_M_0211", - "GenEx BXD EtOH Liver Affy M430 2.0 (Feb11) RMA Males **" + "GenEx_BXD_liverSal_RMA_0211", + "GenEx BXD Sal Liver Affy M430 2.0 (Feb11) RMA Both Sexes **" ], [ - "GenEx_BXD_liverEt_RMA_0211", - "GenEx BXD EtOH Liver Affy M430 2.0 (Feb11) RMA Both Sexes **" + "GenEx_BXD_liverSal_RMA_M_0211", + "GenEx BXD Sal Liver Affy M430 2.0 (Feb11) RMA Males **" + ], + [ + "GenEx_BXD_liverSal_RMA_F_0211", + "GenEx BXD Sal Liver Affy M430 2.0 (Feb11) RMA Females **" ], [ "SUH_Liv_RMA_0611", "SUH BXD Liver Affy Mouse Gene 1.0 ST (Jun11) RMA **" ] ], - "Lung": [ + "Lung mRNA": [ [ "HZI_0408_R", "HZI Lung M430v2 (Apr08) RMA" @@ -1201,18 +1419,34 @@ "HZI_0408_M", "HZI Lung M430v2 (Apr08) MAS5" ], + [ + "HZI_LTCF_0313", + "HZI Lung Time Course Flu PR8M (Mar13) Schughart **" + ], [ "HZI_PR8M_Q_0612", "HZI PR8M-Infected Lungs Agilent4x44 (Apr12) Quantile Females **" ] ], - "Midbrain": [ + "Midbrain mRNA": [ [ "VUBXDMouseMidBrainQ0512", "VU BXD Midbrain Agilent SurePrint G3 Mouse GE (May12) Quantile **" ] ], - "Muscle": [ + "Muscle mRNA": [ + [ + "EPFLMouseMuscleRMA_Ex1112", + "EPFL/LISP BXD CD+HFD Muscle Affy Mouse Gene 1.0 ST (Nov12) RMA Exon Level **" + ], + [ + "EPFLMouseMuscleHFDRMAEx1112", + "EPFL/LISP BXD HFD Muscle Affy Mouse Gene 1.0 ST (Nov12) RMA Exon Level **" + ], + [ + "EPFLMouseMuscleCDRMAEx1112", + "EPFL/LISP BXD CD Muscle Affy Mouse Gene 1.0 ST (Nov12) RMA Exon Level **" + ], [ "EPFLMouseMuscleRMA1211", "EPFL/LISP BXD CD+HFD Muscle Affy Mouse Gene 1.0 ST (Dec11) RMA **" @@ -1226,15 +1460,15 @@ "EPFL/LISP BXD CD Muscle Affy Mouse Gene 1.0 ST (Dec11) RMA **" ] ], - "Neocortex": [ - [ - "DevNeocortex_ILM6.2P3RInv_1111", - "BIDMC/UTHSC Dev Neocortex P3 ILMv6.2 (Nov11) RankInv" - ], + "Neocortex mRNA": [ [ "DevNeocortex_ILM6.2P14RInv_1111", "BIDMC/UTHSC Dev Neocortex P14 ILMv6.2 (Nov11) RankInv" ], + [ + "DevNeocortex_ILM6.2P3RInv_1111", + "BIDMC/UTHSC Dev Neocortex P3 ILMv6.2 (Nov11) RankInv" + ], [ "HQFNeoc_1210v2_RankInv", "HQF BXD Neocortex ILM6v1.1 (Dec10v2) RankInv" @@ -1247,20 +1481,32 @@ "HQFNeoc_0208_RankInv", "HQF BXD Neocortex ILM6v1.1 (Feb08) RankInv" ], - [ - "DevNeocortex_ILM6.2P14RInv_1110", - "BIDMC/UTHSC Dev Neocortex P14 ILMv6.2 (Nov10) RankInv" - ], [ "DevNeocortex_ILM6.2P3RInv_1110", "BIDMC/UTHSC Dev Neocortex P3 ILMv6.2 (Nov10) RankInv" + ], + [ + "DevNeocortex_ILM6.2P14RInv_1110", + "BIDMC/UTHSC Dev Neocortex P14 ILMv6.2 (Nov10) RankInv" ] ], - "Nucleus Accumbens": [ + "Nucleus Accumbens mRNA": [ [ "VCUSalo_1007_R", "VCU BXD NA Sal M430 2.0 (Oct07) RMA" ], + [ + "VCU_NAc_AvE_0113_Ss", + "VCU BXD NAc EtOH vs CIE Air M430 2.0 (Jan13) Sscore **" + ], + [ + "VCU_NAc_Et_0113_R", + "VCU BXD NAc CIE EtOH M430 2.0 (Jan13) RMA **" + ], + [ + "VCU_NAc_Air_0113_R", + "VCU BXD NAc CIE Air M430 2.0 (Jan13) RMA **" + ], [ "VCUEtOH_1007_R", "VCU BXD NA EtOH M430 2.0 (Oct07) RMA **" @@ -1276,49 +1522,57 @@ "BXD Published Phenotypes" ] ], - "Pituitary Gland": [ + "Pituitary Gland mRNA": [ [ "INIA_PG_RMA_0612", "INIA Pituitary Affy MoGene 1.0ST (Jun12) RMA" ], + [ + "INIA_Pituitary_RMA_F_0612", + "INIA Pituitary Affy MoGene 1.0ST (Jun12) RMA Females" + ], + [ + "INIA_Pituitary_RMA_M_0612", + "INIA Pituitary Affy MoGene 1.0ST (Jun12) RMA Males" + ], [ "INIA_PG_RMA_Ex_0612", "INIA Pituitary Affy MoGene 1.0ST (Jun12) RMA Exon Level" ] ], - "Popliteal Lymph Node": [ + "Popliteal Lymph Node mRNA": [ [ "STJ_PLN_0912", "St Jude BXD Popliteal Lymph Node Affy HT MG-430 PM (Sep12) RMA **" ] ], - "Prefrontal Cortex": [ + "Prefrontal Cortex mRNA": [ [ "VCUSal_1206_R", "VCU BXD PFC Sal M430 2.0 (Dec06) RMA" ], - [ - "VCUSal_1006_R", - "VCU BXD PFC Et vs Sal M430 2.0 (Dec06) Sscore" - ], [ "VCUEtOH_1206_R", "VCU BXD PFC EtOH M430 2.0 (Dec06) RMA" ], [ - "VCU_PF_Air_0111_R", - "VCU BXD PFC CIE Air M430 2.0 (Jan11) RMA **" + "VCUSal_1006_R", + "VCU BXD PFC Et vs Sal M430 2.0 (Dec06) Sscore" + ], + [ + "VCU_PF_AvE_0111_Ss", + "VCU BXD PFC EtOH vs CIE Air M430 2.0 (Jan11) Sscore **" ], [ "VCU_PF_Et_0111_R", "VCU BXD PFC CIE EtOH M430 2.0 (Jan11) RMA **" ], [ - "VCU_PF_AvE_0111_Ss", - "VCU BXD PFC EtOH vs CIE Air M430 2.0 (Jan11) Sscore **" + "VCU_PF_Air_0111_R", + "VCU BXD PFC CIE Air M430 2.0 (Jan11) RMA **" ] ], - "Retina": [ + "Retina mRNA": [ [ "G2NEI_ILM_Retina_BXD_RI0410", "Normal HEI Retina (April 2010) RankInv" @@ -1331,6 +1585,14 @@ "ONCRetILM6_0412", "ONC HEI Retina (April 2012) RankInv" ], + [ + "ONCRetMoGene2_0413", + "DoD TATRC Retina Affy MoGene 2.0 ST (Apr13) RMA **" + ], + [ + "ONCRetExMoGene2_0413", + "DoD TATRC Retina Affy MoGene 2.0 ST (Apr13) RMA Exon Level **" + ], [ "B6D2ONCILM_0412", "B6D2 ONC Retina (April 2012) RankInv **" @@ -1344,7 +1606,7 @@ "G2 HEI ONC Retina Illumina V6.2 (Sep11) RankInv **" ] ], - "Spleen": [ + "Spleen mRNA": [ [ "UTHSC_SPL_RMA_1210", "UTHSC Affy MoGene 1.0 ST Spleen (Dec10) RMA" @@ -1357,6 +1619,10 @@ "UTHSC_SPL_RMA_1210F", "UTHSC Affy MoGene 1.0 ST Spleen (Dec10) RMA Females" ], + [ + "UTHSC_SPL_RMAEx_1210", + "UTHSC Affy MoGene 1.0 ST Spleen (Dec10) RMA Exon Level" + ], [ "UTHSC_SPL_RMA_1010", "UTHSC Affy MoGene 1.0 ST Spleen (Oct10) RMA" @@ -1374,14 +1640,14 @@ "UWA Illumina Spleen (Nov08) RSN **" ] ], - "Striatum": [ + "Striatum mRNA": [ [ - "DevStriatum_ILM6.2P14RInv_1111", - "BIDMC/UTHSC Dev Striatum P14 ILMv6.2 (Nov11) RankInv **" + "Striatum_Exon_1212", + "HQF Striatum Affy Mouse Exon 1.0ST Gene Level (Dec09) RMA" ], [ - "DevStriatum_ILM6.2P3RInv_1111", - "BIDMC/UTHSC Dev Striatum P3 ILMv6.2 (Nov11) RankInv **" + "Striatum_Exon_0209", + "HQF Striatum Affy Mouse Exon 1.0ST Exon Level (Dec09) RMA" ], [ "UTHSC_Striatum_RankInv_1210", @@ -1416,8 +1682,12 @@ "HBP Rosen Striatum M430V2 (Apr05) RMA Orig" ], [ - "Striatum_Exon_0209", - "HQF Striatum Exon (Feb09) RMA" + "DevStriatum_ILM6.2P3RInv_1111", + "BIDMC/UTHSC Dev Striatum P3 ILMv6.2 (Nov11) RankInv **" + ], + [ + "DevStriatum_ILM6.2P14RInv_1111", + "BIDMC/UTHSC Dev Striatum P14 ILMv6.2 (Nov11) RankInv **" ], [ "DevStriatum_ILM6.2P14RInv_1110", @@ -1428,25 +1698,29 @@ "BIDMC/UTHSC Dev Striatum P3 ILMv6.2 (Nov10) RankInv **" ] ], - "T Cell (helper)": [ + "T Cell (helper) mRNA": [ [ "RTHC_0211_R", "HZI Thelp M430v2 (Feb11) RMA" ] ], - "T Cell (regulatory)": [ + "T Cell (regulatory) mRNA": [ [ "RTC_1106_R", "HZI Treg M430v2 (Feb11) RMA" ] ], - "Thymus": [ + "Thymus mRNA": [ [ "Illum_BXD_Thy_1108", "UWA Illumina Thymus (Nov08) RSN **" ] ], - "Ventral Tegmental Area": [ + "Ventral Tegmental Area mRNA": [ + [ + "VCUEtOH_0609_R", + "VCU BXD VTA EtOH M430 2.0 (Jun09) RMA **" + ], [ "VCUSal_0609_R", "VCU BXD VTA Sal M430 2.0 (Jun09) RMA **" @@ -1454,15 +1728,17 @@ [ "VCUEtvsSal_0609_R", "VCU BXD VTA Et vs Sal M430 2.0 (Jun09) Sscore **" - ], - [ - "VCUEtOH_0609_R", - "VCU BXD VTA EtOH M430 2.0 (Jun09) RMA **" ] ] }, "BXH": { - "Cartilage": [ + "Bone Femur mRNA": [ + [ + "UCLA_BXH_Femur_0113_RSN", + "UCLA GSE27483 BXH Bone Femur ILM Mouse WG-6 v1, v1.1 (Jan13) RSN" + ] + ], + "Cartilage mRNA": [ [ "UCLA_BXHBXD_CARTILAGE_V2", "UCLA BXH and BXD Cartilage v2" @@ -1482,7 +1758,7 @@ "BXH Genotypes" ] ], - "Liver": [ + "Liver mRNA": [ [ "GSE16780BXH_UCLA_ML0911", "GSE16780 UCLA Mouse BXH Liver Affy HT M430A (Sep11) RMA" @@ -1495,8 +1771,22 @@ ] ] }, + "C57BL-6JxC57BL-6NJF2": { + "Genotypes": [ + [ + "C57BL-6JxC57BL-6NJF2Geno", + "C57BL-6JxC57BL-6NJF2 Genotypes" + ] + ], + "Phenotypes": [ + [ + "C57BL-6JxC57BL-6NJF2Publish", + "C57BL-6JxC57BL-6NJF2 Published Phenotypes" + ] + ] + }, "CTB6F2": { - "Adipose": [ + "Adipose mRNA": [ [ "UCLA_CTB6B6CTF2_ADIPOSE_2005", "UCLA CTB6/B6CTF2 Adipose (2005) mlratio" @@ -1510,7 +1800,7 @@ "UCLA CTB6B6CTF2 Adipose Male mlratio **" ] ], - "Brain": [ + "Brain mRNA": [ [ "UCLA_CTB6B6CTF2_BRAIN_2005", "UCLA CTB6/B6CTF2 Brain (2005) mlratio" @@ -1530,7 +1820,7 @@ "CTB6F2 Genotypes" ] ], - "Liver": [ + "Liver mRNA": [ [ "UCLA_CTB6B6CTF2_LIVER_2005", "UCLA CTB6/B6CTF2 Liver (2005) mlratio" @@ -1544,7 +1834,7 @@ "UCLA CTB6B6CTF2 Liver Male mlratio **" ] ], - "Muscle": [ + "Muscle mRNA": [ [ "UCLA_CTB6B6CTF2_MUSCLE_2005", "UCLA CTB6/B6CTF2 Muscle (2005) mlratio" @@ -1572,14 +1862,14 @@ "CXB Genotypes" ] ], - "Hippocampus": [ - [ - "HC_M2CB_1205_P", - "Hippocampus Consortium M430v2 CXB (Dec05) PDNN" - ], + "Hippocampus mRNA": [ [ "HC_M2CB_1205_R", "Hippocampus Consortium M430v2 CXB (Dec05) RMA" + ], + [ + "HC_M2CB_1205_P", + "Hippocampus Consortium M430v2 CXB (Dec05) PDNN" ] ], "Phenotypes": [ @@ -1588,7 +1878,7 @@ "CXB Published Phenotypes" ] ], - "Spleen": [ + "Spleen mRNA": [ [ "STSPL_1107_R", "Stuart Spleen M430v2 (Nov07) RMA" @@ -1602,19 +1892,19 @@ "HS Genotypes" ] ], - "Hippocampus": [ + "Hippocampus mRNA": [ [ "OXUKHS_ILMHipp_RI0510", "OX UK HS ILM6v1.1 Hippocampus (May 2010) RankInv" ] ], - "Liver": [ + "Liver mRNA": [ [ "OXUKHS_ILMLiver_RI0510", "OX UK HS ILM6v1.1 Liver (May 2010) RankInv" ] ], - "Lung": [ + "Lung mRNA": [ [ "OXUKHS_ILMLung_RI0510", "OX UK HS ILM6v1.1 Lung (May 2010) RankInv" @@ -1640,7 +1930,7 @@ "HS-CC Published Phenotypes" ] ], - "Striatum": [ + "Striatum mRNA": [ [ "OHSU_HS-CC_ILMStr_0211", "OHSU HS-CC Striatum ILM6v1 (Feb11) RankInv" @@ -1654,7 +1944,7 @@ "LXS Genotypes" ] ], - "Hippocampus": [ + "Hippocampus mRNA": [ [ "Illum_LXS_Hipp_loess0807", "Hippocampus Illumina (Aug07) LOESS" @@ -1683,6 +1973,14 @@ "Hipp_Illumina_RankInv_0507", "Hippocampus Illumina (May07) RankInv" ], + [ + "Illum_LXS_Hipp_NOS_1008", + "Hippocampus Illumina NOS (Oct08) RankInv beta" + ], + [ + "Illum_LXS_Hipp_NON_1008", + "Hippocampus Illumina NON (Oct08) RankInv beta" + ], [ "Illum_LXS_Hipp_RSE_1008", "Hippocampus Illumina RSE (Oct08) RankInv beta" @@ -1694,14 +1992,6 @@ [ "Illum_LXS_Hipp_RSS_1008", "Hippocampus Illumina RSS (Oct08) RankInv beta" - ], - [ - "Illum_LXS_Hipp_NOS_1008", - "Hippocampus Illumina NOS (Oct08) RankInv beta" - ], - [ - "Illum_LXS_Hipp_NON_1008", - "Hippocampus Illumina NON (Oct08) RankInv beta" ] ], "Phenotypes": [ @@ -1710,7 +2000,11 @@ "LXS Published Phenotypes" ] ], - "Prefrontal Cortex": [ + "Prefrontal Cortex mRNA": [ + [ + "VCUEtOH_0806_R", + "VCU LXS PFC EtOH M430A 2.0 (Aug06) RMA **" + ], [ "VCUSal_0806_R", "VCU LXS PFC Sal M430A 2.0 (Aug06) RMA" @@ -1718,31 +2012,39 @@ [ "VCUEt_vs_Sal_0806_R", "VCU LXS PFC Et vs Sal M430A 2.0 (Aug06) Sscore **" - ], - [ - "VCUEtOH_0806_R", - "VCU LXS PFC EtOH M430A 2.0 (Aug06) RMA **" ] ] }, "MDP": { + "Bone Femur mRNA": [ + [ + "UCLA_MDP_Femur_0113_RSN", + "UCLA GSE27483 MDP Bone Femur ILM Mouse WG-6 v1, v1.1 (Jan13) RSN" + ] + ], + "Dorsal Root Ganglia mRNA": [ + [ + "TSRI-DRG-AffyMOE430_0113-MDP", + "TSRI DRG Affy Mouse Genome 430 2.0 (Jan13) RMA MDP **" + ] + ], "Genotypes": [ [ "MDPGeno", "MDP Genotypes" ] ], - "Hippocampus": [ - [ - "HC_M2_0606_MDP", - "Hippocampus Consortium M430v2 (Jun06) RMA MDP" - ], + "Hippocampus mRNA": [ [ "UMUTAffyExon_0209_RMA_MDP", "UMUTAffy Hippocampus Exon (Feb09) RMA MDP" + ], + [ + "HC_M2_0606_MDP", + "Hippocampus Consortium M430v2 (Jun06) RMA MDP" ] ], - "Liver": [ + "Liver mRNA": [ [ "GSE16780MDP_UCLA_ML0911", "GSE16780 UCLA Mouse MDP Liver Affy HT M430A (Sep11) RMA" @@ -1758,6 +2060,10 @@ [ "JAX_CSB_L_6C_0711", "JAX Liver 6C Affy M430 2.0 (Jul11) MDP" + ], + [ + "JAX_liver_agil_MDP-0113", + "Harrill-Rusyn MDP Liver Acetaminophen Tox Study (G4121A, 2009)" ] ], "Phenotypes": [ @@ -1774,7 +2080,7 @@ "NZBXFVB-N2 Genotypes" ] ], - "Mammary Tumors": [ + "Mammary Tumors mRNA": [ [ "NCI_Mam_Tum_RMA_0409", "NCI Mammary M430v2 (Apr09) RMA" @@ -1786,11 +2092,63 @@ "NZBXFVB-N2 Published Phenotypes" ] ] + }, + "SOTNOT-OHSU": { + "Genotypes": [ + [ + "SOTNOT-OHSUGeno", + "SOTNOT-OHSU Genotypes" + ] + ], + "Phenotypes": [ + [ + "SOTNOT-OHSUPublish", + "SOTNOT-OHSU Published Phenotypes" + ] + ] + }, + "Scripps-2013": { + "Anterior Cingulate Cortex mRNA": [ + [ + "ScrBXDACC4G0513", + "Scripps BXD ACC 4 Groups Affy Mouse Gene 1.0 ST (May13) RMA Gene Level **" + ], + [ + "ScrBXDACC4GEx0513", + "Scripps BXD ACC 4 Groups Affy Mouse Gene 1.0 ST (May13) RMA Exon Level **" + ] + ], + "Genotypes": [ + [ + "Scripps-2013Geno", + "Scripps-2013 Genotypes" + ] + ], + "Phenotypes": [ + [ + "Scripps-2013Publish", + "Scripps-2013 Published Phenotypes" + ] + ] } }, "rat": { + "HSNIH": { + "Genotypes": [ + [ + "HSNIHGeno", + "HSNIH Genotypes" + ] + ], + "Phenotypes": [ + [ + "HSNIHPublish", + "HSNIH Published Phenotypes" + ] + ] + }, "HXBBXH": { - "Adrenal Gland": [ + "Adrenal Gland mRNA": [ [ "HXB_Adrenal_1208", "MDC/CAS/UCL Adrenal 230A (Dec08) RMA" @@ -1802,19 +2160,19 @@ "HXBBXH Genotypes" ] ], - "Heart": [ + "Heart mRNA": [ [ "HXB_Heart_1208", "MDC/CAS/UCL Heart 230_V2 (Dec08) RMA" ] ], - "Hippocampus": [ + "Hippocampus mRNA": [ [ "UT_HippRatEx_RMA_0709", "UT Hippocampus Affy RaEx 1.0 Exon (Jul09) RMA" ] ], - "Kidney": [ + "Kidney mRNA": [ [ "KI_2A_0405_M", "MDC/CAS/ICL Kidney 230A (Apr05) MAS5" @@ -1828,13 +2186,13 @@ "MDC/CAS/ICL Kidney 230A (Apr05) RMA" ] ], - "Liver": [ + "Liver mRNA": [ [ "HXB_Liver_1208", "MDC/CAS/UCL Liver 230v2 (Dec08) RMA" ] ], - "Peritoneal Fat": [ + "Peritoneal Fat mRNA": [ [ "FT_2A_0805_M", "MDC/CAS/ICL Peritoneal Fat 230A (Aug05) MAS5" @@ -1852,7 +2210,7 @@ ] }, "SRxSHRSPF2": { - "Eye": [ + "Eye mRNA": [ [ "UIOWA_Eye_RMA_0906", "UIOWA Eye mRNA RAE230v2 (Sep06) RMA" @@ -1971,6 +2329,10 @@ "HLC", "Human Liver Cohort (Merck)" ], + [ + "HLT", + "Human Lung Transcriptome (Rosetta/Merck)" + ], [ "HSB", "Human Brain Transcriptome (Yale/Kavli)" @@ -2031,6 +2393,10 @@ "BXH", "BXH" ], + [ + "C57BL-6JxC57BL-6NJF2", + "C57BL/6JxC57BL/6NJ F2 Cross" + ], [ "CTB6F2", "CastB6/B6Cast F2 UCLA" @@ -2058,9 +2424,21 @@ [ "NZBXFVB-N2", "NZB/FVB N2 NCI" + ], + [ + "Scripps-2013", + "Scripps C57BL/6J" + ], + [ + "SOTNOT-OHSU", + "SOTNOT-OHSU" ] ], "rat": [ + [ + "HSNIH", + "NIH Heterogeneous Stock" + ], [ "HXBBXH", "HXB/BXH" @@ -2177,8 +2555,8 @@ "Genotypes" ], [ - "Leaf", - "Leaf mRNA" + "Leaf mRNA", + "Leaf mRNA mRNA" ] ], "SXM": [ @@ -2191,12 +2569,12 @@ "Genotypes" ], [ - "Embryo", - "Embryo mRNA" + "Embryo mRNA", + "Embryo mRNA mRNA" ], [ - "Leaf", - "Leaf mRNA" + "Leaf mRNA", + "Leaf mRNA mRNA" ] ] }, @@ -2211,8 +2589,8 @@ "Genotypes" ], [ - "Whole Body", - "Whole Body mRNA" + "Whole Body mRNA", + "Whole Body mRNA mRNA" ] ], "Oregon-R_x_2b3": [ @@ -2225,8 +2603,8 @@ "Genotypes" ], [ - "Whole Body", - "Whole Body mRNA" + "Whole Body mRNA", + "Whole Body mRNA mRNA" ] ] }, @@ -2241,8 +2619,8 @@ "Genotypes" ], [ - "Brain", - "Brain mRNA" + "Brain mRNA", + "Brain mRNA mRNA" ] ], "AD-cases-controls-Myers": [ @@ -2255,8 +2633,8 @@ "Genotypes" ], [ - "Brain", - "Brain mRNA" + "Brain mRNA", + "Brain mRNA mRNA" ] ], "CANDLE": [ @@ -2269,8 +2647,12 @@ "Genotypes" ], [ - "Newborn Cord Blood", - "Newborn Cord Blood mRNA" + "Methylation", + "Methylation mRNA" + ], + [ + "Newborn Cord Blood mRNA", + "Newborn Cord Blood mRNA mRNA" ] ], "CEPH-2004": [ @@ -2283,8 +2665,8 @@ "Genotypes" ], [ - "Lymphoblast B-cell", - "Lymphoblast B-cell mRNA" + "Lymphoblast B-cell mRNA", + "Lymphoblast B-cell mRNA mRNA" ] ], "HB": [ @@ -2297,16 +2679,16 @@ "Genotypes" ], [ - "Cerebellum", - "Cerebellum mRNA" + "Cerebellum mRNA", + "Cerebellum mRNA mRNA" ], [ - "Prefrontal Cortex", - "Prefrontal Cortex mRNA" + "Prefrontal Cortex mRNA", + "Prefrontal Cortex mRNA mRNA" ], [ - "Primary Visual Cortex", - "Primary Visual Cortex mRNA" + "Primary Visual Cortex mRNA", + "Primary Visual Cortex mRNA mRNA" ] ], "HLC": [ @@ -2319,8 +2701,22 @@ "Genotypes" ], [ - "Liver", - "Liver mRNA" + "Liver mRNA", + "Liver mRNA mRNA" + ] + ], + "HLT": [ + [ + "Phenotypes", + "Phenotypes" + ], + [ + "Genotypes", + "Genotypes" + ], + [ + "Lung mRNA", + "Lung mRNA mRNA" ] ], "HSB": [ @@ -2333,68 +2729,68 @@ "Genotypes" ], [ - "Amygdala", - "Amygdala mRNA" + "Amygdala mRNA", + "Amygdala mRNA mRNA" ], [ - "Cerebellar Cortex", - "Cerebellar Cortex mRNA" + "Cerebellar Cortex mRNA", + "Cerebellar Cortex mRNA mRNA" ], [ - "Dorsolateral Prefrontal Cortex", - "Dorsolateral Prefrontal Cortex mRNA" + "Dorsolateral Prefrontal Cortex mRNA", + "Dorsolateral Prefrontal Cortex mRNA mRNA" ], [ - "Hippocampus", - "Hippocampus mRNA" + "Hippocampus mRNA", + "Hippocampus mRNA mRNA" ], [ - "Inferior Temporal Cortex", - "Inferior Temporal Cortex mRNA" + "Inferior Temporal Cortex mRNA", + "Inferior Temporal Cortex mRNA mRNA" ], [ - "Medial Prefrontal Cortex", - "Medial Prefrontal Cortex mRNA" + "Medial Prefrontal Cortex mRNA", + "Medial Prefrontal Cortex mRNA mRNA" ], [ - "Mediodorsal Nucleus of Thalamus", - "Mediodorsal Nucleus of Thalamus mRNA" + "Mediodorsal Nucleus of Thalamus mRNA", + "Mediodorsal Nucleus of Thalamus mRNA mRNA" ], [ - "Orbital Prefrontal Cortex", - "Orbital Prefrontal Cortex mRNA" + "Orbital Prefrontal Cortex mRNA", + "Orbital Prefrontal Cortex mRNA mRNA" ], [ - "Posterior Inferior Parietal Cortex", - "Posterior Inferior Parietal Cortex mRNA" + "Posterior Inferior Parietal Cortex mRNA", + "Posterior Inferior Parietal Cortex mRNA mRNA" ], [ - "Posterior Superior Temporal Cortex", - "Posterior Superior Temporal Cortex mRNA" + "Posterior Superior Temporal Cortex mRNA", + "Posterior Superior Temporal Cortex mRNA mRNA" ], [ - "Primary Auditory (A1) Cortex", - "Primary Auditory (A1) Cortex mRNA" + "Primary Auditory (A1) Cortex mRNA", + "Primary Auditory (A1) Cortex mRNA mRNA" ], [ - "Primary Motor (M1) Cortex", - "Primary Motor (M1) Cortex mRNA" + "Primary Motor (M1) Cortex mRNA", + "Primary Motor (M1) Cortex mRNA mRNA" ], [ - "Primary Somatosensory (S1) Cortex", - "Primary Somatosensory (S1) Cortex mRNA" + "Primary Somatosensory (S1) Cortex mRNA", + "Primary Somatosensory (S1) Cortex mRNA mRNA" ], [ - "Primary Visual Cortex", - "Primary Visual Cortex mRNA" + "Primary Visual Cortex mRNA", + "Primary Visual Cortex mRNA mRNA" ], [ - "Striatum", - "Striatum mRNA" + "Striatum mRNA", + "Striatum mRNA mRNA" ], [ - "Ventrolateral Prefrontal Cortex", - "Ventrolateral Prefrontal Cortex mRNA" + "Ventrolateral Prefrontal Cortex mRNA", + "Ventrolateral Prefrontal Cortex mRNA mRNA" ] ] }, @@ -2409,24 +2805,24 @@ "Genotypes" ], [ - "Amygdala", - "Amygdala mRNA" + "Amygdala mRNA", + "Amygdala mRNA mRNA" ], [ - "Brain", - "Brain mRNA" + "Brain mRNA", + "Brain mRNA mRNA" ], [ - "Hippocampus", - "Hippocampus mRNA" + "Hippocampus mRNA", + "Hippocampus mRNA mRNA" ], [ - "Nucleus Accumbens", - "Nucleus Accumbens mRNA" + "Nucleus Accumbens mRNA", + "Nucleus Accumbens mRNA mRNA" ], [ - "Prefrontal Cortex", - "Prefrontal Cortex mRNA" + "Prefrontal Cortex mRNA", + "Prefrontal Cortex mRNA mRNA" ] ] }, @@ -2441,8 +2837,8 @@ "Genotypes" ], [ - "Mammary Tumors", - "Mammary Tumors mRNA" + "Mammary Tumors mRNA", + "Mammary Tumors mRNA mRNA" ] ], "AXBXA": [ @@ -2455,12 +2851,20 @@ "Genotypes" ], [ - "Eye", - "Eye mRNA" + "Bone Femur mRNA", + "Bone Femur mRNA mRNA" + ], + [ + "Eye mRNA", + "Eye mRNA mRNA" + ], + [ + "Heart mRNA", + "Heart mRNA mRNA" ], [ - "Liver", - "Liver mRNA" + "Liver mRNA", + "Liver mRNA mRNA" ] ], "B6BTBRF2": [ @@ -2473,8 +2877,8 @@ "Genotypes" ], [ - "Liver", - "Liver mRNA" + "Liver mRNA", + "Liver mRNA mRNA" ] ], "B6D2F2": [ @@ -2487,8 +2891,8 @@ "Genotypes" ], [ - "Brain", - "Brain mRNA" + "Brain mRNA", + "Brain mRNA mRNA" ] ], "B6D2F2-PSU": [ @@ -2501,8 +2905,8 @@ "Genotypes" ], [ - "Muscle", - "Muscle mRNA" + "Muscle mRNA", + "Muscle mRNA mRNA" ] ], "B6D2RI": [ @@ -2515,8 +2919,8 @@ "Genotypes" ], [ - "Hippocampus", - "Hippocampus mRNA" + "Hippocampus mRNA", + "Hippocampus mRNA mRNA" ] ], "BDF2-1999": [ @@ -2529,8 +2933,8 @@ "Genotypes" ], [ - "Liver", - "Liver mRNA" + "Liver mRNA", + "Liver mRNA mRNA" ] ], "BDF2-2005": [ @@ -2543,8 +2947,8 @@ "Genotypes" ], [ - "Striatum", - "Striatum mRNA" + "Striatum mRNA", + "Striatum mRNA mRNA" ] ], "BHF2": [ @@ -2557,20 +2961,20 @@ "Genotypes" ], [ - "Adipose", - "Adipose mRNA" + "Adipose mRNA", + "Adipose mRNA mRNA" ], [ - "Brain", - "Brain mRNA" + "Brain mRNA", + "Brain mRNA mRNA" ], [ - "Liver", - "Liver mRNA" + "Liver mRNA", + "Liver mRNA mRNA" ], [ - "Muscle", - "Muscle mRNA" + "Muscle mRNA", + "Muscle mRNA mRNA" ] ], "BHHBF2": [ @@ -2583,20 +2987,20 @@ "Genotypes" ], [ - "Adipose", - "Adipose mRNA" + "Adipose mRNA", + "Adipose mRNA mRNA" ], [ - "Brain", - "Brain mRNA" + "Brain mRNA", + "Brain mRNA mRNA" ], [ - "Liver", - "Liver mRNA" + "Liver mRNA", + "Liver mRNA mRNA" ], [ - "Muscle", - "Muscle mRNA" + "Muscle mRNA", + "Muscle mRNA mRNA" ] ], "BXD": [ @@ -2609,112 +3013,120 @@ "Genotypes" ], [ - "Adrenal Gland", - "Adrenal Gland mRNA" + "Adrenal Gland mRNA", + "Adrenal Gland mRNA mRNA" + ], + [ + "Amygdala mRNA", + "Amygdala mRNA mRNA" + ], + [ + "Bone Femur mRNA", + "Bone Femur mRNA mRNA" ], [ - "Amygdala", - "Amygdala mRNA" + "Brain mRNA", + "Brain mRNA mRNA" ], [ - "Brain", - "Brain mRNA" + "Cartilage mRNA", + "Cartilage mRNA mRNA" ], [ - "Cartilage", - "Cartilage mRNA" + "Cerebellum mRNA", + "Cerebellum mRNA mRNA" ], [ - "Cerebellum", - "Cerebellum mRNA" + "Eye mRNA", + "Eye mRNA mRNA" ], [ - "Eye", - "Eye mRNA" + "Hematopoietic Cells mRNA", + "Hematopoietic Cells mRNA mRNA" ], [ - "Hematopoietic Cells", - "Hematopoietic Cells mRNA" + "Hippocampus mRNA", + "Hippocampus mRNA mRNA" ], [ - "Hippocampus", - "Hippocampus mRNA" + "Hypothalamus mRNA", + "Hypothalamus mRNA mRNA" ], [ - "Hypothalamus", - "Hypothalamus mRNA" + "Kidney mRNA", + "Kidney mRNA mRNA" ], [ - "Kidney", - "Kidney mRNA" + "Leucocytes mRNA", + "Leucocytes mRNA mRNA" ], [ - "Leucocytes", - "Leucocytes mRNA" + "Liver mRNA", + "Liver mRNA mRNA" ], [ - "Liver", - "Liver mRNA" + "Liver Proteome", + "Liver Proteome mRNA" ], [ - "Lung", - "Lung mRNA" + "Lung mRNA", + "Lung mRNA mRNA" ], [ - "Midbrain", - "Midbrain mRNA" + "Midbrain mRNA", + "Midbrain mRNA mRNA" ], [ - "Muscle", - "Muscle mRNA" + "Muscle mRNA", + "Muscle mRNA mRNA" ], [ - "Neocortex", - "Neocortex mRNA" + "Neocortex mRNA", + "Neocortex mRNA mRNA" ], [ - "Nucleus Accumbens", - "Nucleus Accumbens mRNA" + "Nucleus Accumbens mRNA", + "Nucleus Accumbens mRNA mRNA" ], [ - "Pituitary Gland", - "Pituitary Gland mRNA" + "Pituitary Gland mRNA", + "Pituitary Gland mRNA mRNA" ], [ - "Popliteal Lymph Node", - "Popliteal Lymph Node mRNA" + "Popliteal Lymph Node mRNA", + "Popliteal Lymph Node mRNA mRNA" ], [ - "Prefrontal Cortex", - "Prefrontal Cortex mRNA" + "Prefrontal Cortex mRNA", + "Prefrontal Cortex mRNA mRNA" ], [ - "Retina", - "Retina mRNA" + "Retina mRNA", + "Retina mRNA mRNA" ], [ - "Spleen", - "Spleen mRNA" + "Spleen mRNA", + "Spleen mRNA mRNA" ], [ - "Striatum", - "Striatum mRNA" + "Striatum mRNA", + "Striatum mRNA mRNA" ], [ - "T Cell (helper)", - "T Cell (helper) mRNA" + "T Cell (helper) mRNA", + "T Cell (helper) mRNA mRNA" ], [ - "T Cell (regulatory)", - "T Cell (regulatory) mRNA" + "T Cell (regulatory) mRNA", + "T Cell (regulatory) mRNA mRNA" ], [ - "Thymus", - "Thymus mRNA" + "Thymus mRNA", + "Thymus mRNA mRNA" ], [ - "Ventral Tegmental Area", - "Ventral Tegmental Area mRNA" + "Ventral Tegmental Area mRNA", + "Ventral Tegmental Area mRNA mRNA" ] ], "BXH": [ @@ -2727,12 +3139,26 @@ "Genotypes" ], [ - "Cartilage", - "Cartilage mRNA" + "Bone Femur mRNA", + "Bone Femur mRNA mRNA" + ], + [ + "Cartilage mRNA", + "Cartilage mRNA mRNA" + ], + [ + "Liver mRNA", + "Liver mRNA mRNA" + ] + ], + "C57BL-6JxC57BL-6NJF2": [ + [ + "Phenotypes", + "Phenotypes" ], [ - "Liver", - "Liver mRNA" + "Genotypes", + "Genotypes" ] ], "CTB6F2": [ @@ -2745,20 +3171,20 @@ "Genotypes" ], [ - "Adipose", - "Adipose mRNA" + "Adipose mRNA", + "Adipose mRNA mRNA" ], [ - "Brain", - "Brain mRNA" + "Brain mRNA", + "Brain mRNA mRNA" ], [ - "Liver", - "Liver mRNA" + "Liver mRNA", + "Liver mRNA mRNA" ], [ - "Muscle", - "Muscle mRNA" + "Muscle mRNA", + "Muscle mRNA mRNA" ] ], "CXB": [ @@ -2771,12 +3197,12 @@ "Genotypes" ], [ - "Hippocampus", - "Hippocampus mRNA" + "Hippocampus mRNA", + "Hippocampus mRNA mRNA" ], [ - "Spleen", - "Spleen mRNA" + "Spleen mRNA", + "Spleen mRNA mRNA" ] ], "HS": [ @@ -2789,16 +3215,16 @@ "Genotypes" ], [ - "Hippocampus", - "Hippocampus mRNA" + "Hippocampus mRNA", + "Hippocampus mRNA mRNA" ], [ - "Liver", - "Liver mRNA" + "Liver mRNA", + "Liver mRNA mRNA" ], [ - "Lung", - "Lung mRNA" + "Lung mRNA", + "Lung mRNA mRNA" ] ], "HS-CC": [ @@ -2811,8 +3237,8 @@ "Genotypes" ], [ - "Striatum", - "Striatum mRNA" + "Striatum mRNA", + "Striatum mRNA mRNA" ] ], "LXS": [ @@ -2825,12 +3251,12 @@ "Genotypes" ], [ - "Hippocampus", - "Hippocampus mRNA" + "Hippocampus mRNA", + "Hippocampus mRNA mRNA" ], [ - "Prefrontal Cortex", - "Prefrontal Cortex mRNA" + "Prefrontal Cortex mRNA", + "Prefrontal Cortex mRNA mRNA" ] ], "MDP": [ @@ -2843,12 +3269,20 @@ "Genotypes" ], [ - "Hippocampus", - "Hippocampus mRNA" + "Bone Femur mRNA", + "Bone Femur mRNA mRNA" + ], + [ + "Dorsal Root Ganglia mRNA", + "Dorsal Root Ganglia mRNA mRNA" ], [ - "Liver", - "Liver mRNA" + "Hippocampus mRNA", + "Hippocampus mRNA mRNA" + ], + [ + "Liver mRNA", + "Liver mRNA mRNA" ] ], "NZBXFVB-N2": [ @@ -2861,12 +3295,46 @@ "Genotypes" ], [ - "Mammary Tumors", - "Mammary Tumors mRNA" + "Mammary Tumors mRNA", + "Mammary Tumors mRNA mRNA" + ] + ], + "SOTNOT-OHSU": [ + [ + "Phenotypes", + "Phenotypes" + ], + [ + "Genotypes", + "Genotypes" + ] + ], + "Scripps-2013": [ + [ + "Phenotypes", + "Phenotypes" + ], + [ + "Genotypes", + "Genotypes" + ], + [ + "Anterior Cingulate Cortex mRNA", + "Anterior Cingulate Cortex mRNA mRNA" ] ] }, "rat": { + "HSNIH": [ + [ + "Phenotypes", + "Phenotypes" + ], + [ + "Genotypes", + "Genotypes" + ] + ], "HXBBXH": [ [ "Phenotypes", @@ -2877,28 +3345,28 @@ "Genotypes" ], [ - "Adrenal Gland", - "Adrenal Gland mRNA" + "Adrenal Gland mRNA", + "Adrenal Gland mRNA mRNA" ], [ - "Heart", - "Heart mRNA" + "Heart mRNA", + "Heart mRNA mRNA" ], [ - "Hippocampus", - "Hippocampus mRNA" + "Hippocampus mRNA", + "Hippocampus mRNA mRNA" ], [ - "Kidney", - "Kidney mRNA" + "Kidney mRNA", + "Kidney mRNA mRNA" ], [ - "Liver", - "Liver mRNA" + "Liver mRNA", + "Liver mRNA mRNA" ], [ - "Peritoneal Fat", - "Peritoneal Fat mRNA" + "Peritoneal Fat mRNA", + "Peritoneal Fat mRNA mRNA" ] ], "SRxSHRSPF2": [ @@ -2911,8 +3379,8 @@ "Genotypes" ], [ - "Eye", - "Eye mRNA" + "Eye mRNA", + "Eye mRNA mRNA" ] ] }, -- cgit v1.2.3 From 0fcadee805a6d4a2007e57a69ab130eb9b1c1a3c Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Thu, 18 Jul 2013 17:39:10 -0500 Subject: Added Amelie's rat data genotypes Got human mapping mostly working Fixed dataset dropdown menus --- misc/notes.txt | 5 + web/genotypes/HSNIH.geno.gz | Bin 0 -> 63400027 bytes wqflask/base/trait.py | 3 +- wqflask/base/webqtlConfig.py | 4 +- wqflask/maintenance/gen_select_dataset.py | 15 +- wqflask/wqflask/correlation/show_corr_results.py | 2 - wqflask/wqflask/my_pylmm/pyLMM/lmm.py | 4 +- .../new/javascript/dataset_menu_structure.json | 248 ++++++++++----------- 8 files changed, 136 insertions(+), 145 deletions(-) create mode 100755 web/genotypes/HSNIH.geno.gz (limited to 'wqflask') diff --git a/misc/notes.txt b/misc/notes.txt index 9da6c4ea..d9bd6e41 100644 --- a/misc/notes.txt +++ b/misc/notes.txt @@ -245,6 +245,11 @@ To iterate through dictionary items: for X, Y in MyDictionary.items(): =========================================== +Change import path from command line +export PYTHONPATH=~/gene/wqflask (or whatever) + +=========================================== + Create symbolic link: ln -s dir_to_link_to linking_dir diff --git a/web/genotypes/HSNIH.geno.gz b/web/genotypes/HSNIH.geno.gz new file mode 100755 index 00000000..96584768 Binary files /dev/null and b/web/genotypes/HSNIH.geno.gz differ diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index 6648047c..a1e6b0d3 100755 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -319,10 +319,9 @@ class GeneralTrait(object): #XZ: assign SQL query result to trait attributes. for i, field in enumerate(self.dataset.display_fields): - print(" mike: {} -> {} - {}".format(field, type(trait_info[i]), trait_info[i])) + #print(" mike: {} -> {} - {}".format(field, type(trait_info[i]), trait_info[i])) holder = trait_info[i] if isinstance(trait_info[i], basestring): - print("is basestring") holder = unicode(trait_info[i], "utf8") setattr(self, field, holder) diff --git a/wqflask/base/webqtlConfig.py b/wqflask/base/webqtlConfig.py index 716986db..d4511212 100755 --- a/wqflask/base/webqtlConfig.py +++ b/wqflask/base/webqtlConfig.py @@ -53,8 +53,8 @@ GNROOT = "/home/zas1024/gene/" # Will remove this and dependent items later SECUREDIR = GNROOT + 'secure/' COMMON_LIB = GNROOT + 'support/admin' HTMLPATH = GNROOT + 'web/' -PYLMM_PATH = '/home/zas1024/' -SNP_PATH = '/mnt/xvdf1/snps/' +PYLMM_PATH = '/home/zas1024/plink/' +SNP_PATH = '/home/zas1024/snps/' IMGDIR = HTMLPATH +'image/' IMAGESPATH = HTMLPATH + 'images/' UPLOADPATH = IMAGESPATH + 'upload/' diff --git a/wqflask/maintenance/gen_select_dataset.py b/wqflask/maintenance/gen_select_dataset.py index d653fd2d..8cb94f20 100644 --- a/wqflask/maintenance/gen_select_dataset.py +++ b/wqflask/maintenance/gen_select_dataset.py @@ -47,6 +47,15 @@ import urlparse from pprint import pformat as pf +#Engine = sa.create_engine(our_settings.SQLALCHEMY_DATABASE_URI) + +# build MySql database connection + +#conn = Engine.connect() + + + + def parse_db_uri(db_uri): """Converts a database URI to the db name, host name, user name, and password""" @@ -106,7 +115,7 @@ def build_types(species, group): (all types except phenotype/genotype are tissues) """ - Cursor.execute("""select distinct Tissue.Name, concat(Tissue.Name, ' mRNA') + Cursor.execute("""select distinct Tissue.Name, Tissue.Name from ProbeFreeze, ProbeSetFreeze, InbredSet, Tissue, Species where Species.Name = %s and Species.Id = InbredSet.SpeciesId and InbredSet.Name = %s and @@ -161,13 +170,9 @@ def build_datasets(species, group, type_name): def main(): """Generates and outputs (as json file) the data for the main dropdown menus on the home page""" -<<<<<<< HEAD parse_db_uri(our_settings.DB_URI) -======= - ->>>>>>> 1a3a456eb7635337a966913f2e2e75c8a89bb92e species = get_species() groups = get_groups(species) types = get_types(groups) diff --git a/wqflask/wqflask/correlation/show_corr_results.py b/wqflask/wqflask/correlation/show_corr_results.py index 422fa8af..07d70897 100644 --- a/wqflask/wqflask/correlation/show_corr_results.py +++ b/wqflask/wqflask/correlation/show_corr_results.py @@ -140,8 +140,6 @@ class CorrelationResults(object): this_trait_vals, target_vals, num_overlap = corr_result_helpers.normalize_values( this_trait_vals, target_vals) - print("num_overlap:", num_overlap) - if self.corr_method == 'pearson': sample_r, sample_p = scipy.stats.pearsonr(this_trait_vals, target_vals) else: diff --git a/wqflask/wqflask/my_pylmm/pyLMM/lmm.py b/wqflask/wqflask/my_pylmm/pyLMM/lmm.py index 5bfc3a01..38a49f12 100644 --- a/wqflask/wqflask/my_pylmm/pyLMM/lmm.py +++ b/wqflask/wqflask/my_pylmm/pyLMM/lmm.py @@ -138,8 +138,8 @@ def run_human(pheno_vector, #print("***** Added to {} queue *****".format(key)) for snp, this_id in plink_input: #with Bench("part before association"): - if count > 2000: - break + #if count > 2000: + # break count += 1 percent_complete = (float(count) / total_snps) * 100 diff --git a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json index a4de53bd..49c44fbd 100644 --- a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json +++ b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json @@ -793,10 +793,6 @@ ] ], "Striatum mRNA": [ - [ - "SA_M2_0905_R", - "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) RMA" - ], [ "SA_M2_0905_R", "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) RMA" @@ -1051,10 +1047,6 @@ ] ], "Cerebellum mRNA": [ - [ - "CB_M_1004_M", - "SJUT Cerebellum mRNA M430 (Oct04) MAS5" - ], [ "CB_M_1004_R", "SJUT Cerebellum mRNA M430 (Oct04) RMA" @@ -1063,6 +1055,10 @@ "CB_M_1004_P", "SJUT Cerebellum mRNA M430 (Oct04) PDNN" ], + [ + "CB_M_1004_M", + "SJUT Cerebellum mRNA M430 (Oct04) MAS5" + ], [ "CB_M_1003_M", "SJUT Cerebellum mRNA M430 (Oct03) MAS5" @@ -1551,10 +1547,6 @@ ] ], "Prefrontal Cortex mRNA": [ - [ - "VCUEtOH_1206_R", - "VCU BXD PFC EtOH M430 2.0 (Dec06) RMA" - ], [ "VCUSal_1206_R", "VCU BXD PFC Sal M430 2.0 (Dec06) RMA" @@ -1725,10 +1717,6 @@ ] ], "Ventral Tegmental Area mRNA": [ - [ - "VCUEtOH_0609_R", - "VCU BXD VTA EtOH M430 2.0 (Jun09) RMA **" - ], [ "VCUEtOH_0609_R", "VCU BXD VTA EtOH M430 2.0 (Jun09) RMA **" @@ -2013,10 +2001,6 @@ ] ], "Prefrontal Cortex mRNA": [ - [ - "VCUEtOH_0806_R", - "VCU LXS PFC EtOH M430A 2.0 (Aug06) RMA **" - ], [ "VCUEtOH_0806_R", "VCU LXS PFC EtOH M430A 2.0 (Aug06) RMA **" @@ -2572,7 +2556,7 @@ ], [ "Leaf mRNA", - "Leaf mRNA mRNA" + "Leaf mRNA" ] ], "SXM": [ @@ -2586,11 +2570,11 @@ ], [ "Embryo mRNA", - "Embryo mRNA mRNA" + "Embryo mRNA" ], [ "Leaf mRNA", - "Leaf mRNA mRNA" + "Leaf mRNA" ] ] }, @@ -2606,7 +2590,7 @@ ], [ "Whole Body mRNA", - "Whole Body mRNA mRNA" + "Whole Body mRNA" ] ], "Oregon-R_x_2b3": [ @@ -2620,7 +2604,7 @@ ], [ "Whole Body mRNA", - "Whole Body mRNA mRNA" + "Whole Body mRNA" ] ] }, @@ -2636,7 +2620,7 @@ ], [ "Brain mRNA", - "Brain mRNA mRNA" + "Brain mRNA" ] ], "AD-cases-controls-Myers": [ @@ -2650,7 +2634,7 @@ ], [ "Brain mRNA", - "Brain mRNA mRNA" + "Brain mRNA" ] ], "CANDLE": [ @@ -2664,11 +2648,11 @@ ], [ "Methylation", - "Methylation mRNA" + "Methylation" ], [ "Newborn Cord Blood mRNA", - "Newborn Cord Blood mRNA mRNA" + "Newborn Cord Blood mRNA" ] ], "CEPH-2004": [ @@ -2682,7 +2666,7 @@ ], [ "Lymphoblast B-cell mRNA", - "Lymphoblast B-cell mRNA mRNA" + "Lymphoblast B-cell mRNA" ] ], "HB": [ @@ -2696,15 +2680,15 @@ ], [ "Cerebellum mRNA", - "Cerebellum mRNA mRNA" + "Cerebellum mRNA" ], [ "Prefrontal Cortex mRNA", - "Prefrontal Cortex mRNA mRNA" + "Prefrontal Cortex mRNA" ], [ "Primary Visual Cortex mRNA", - "Primary Visual Cortex mRNA mRNA" + "Primary Visual Cortex mRNA" ] ], "HLC": [ @@ -2718,7 +2702,7 @@ ], [ "Liver mRNA", - "Liver mRNA mRNA" + "Liver mRNA" ] ], "HLT": [ @@ -2732,7 +2716,7 @@ ], [ "Lung mRNA", - "Lung mRNA mRNA" + "Lung mRNA" ] ], "HSB": [ @@ -2746,67 +2730,67 @@ ], [ "Amygdala mRNA", - "Amygdala mRNA mRNA" + "Amygdala mRNA" ], [ "Cerebellar Cortex mRNA", - "Cerebellar Cortex mRNA mRNA" + "Cerebellar Cortex mRNA" ], [ "Dorsolateral Prefrontal Cortex mRNA", - "Dorsolateral Prefrontal Cortex mRNA mRNA" + "Dorsolateral Prefrontal Cortex mRNA" ], [ "Hippocampus mRNA", - "Hippocampus mRNA mRNA" + "Hippocampus mRNA" ], [ "Inferior Temporal Cortex mRNA", - "Inferior Temporal Cortex mRNA mRNA" + "Inferior Temporal Cortex mRNA" ], [ "Medial Prefrontal Cortex mRNA", - "Medial Prefrontal Cortex mRNA mRNA" + "Medial Prefrontal Cortex mRNA" ], [ "Mediodorsal Nucleus of Thalamus mRNA", - "Mediodorsal Nucleus of Thalamus mRNA mRNA" + "Mediodorsal Nucleus of Thalamus mRNA" ], [ "Orbital Prefrontal Cortex mRNA", - "Orbital Prefrontal Cortex mRNA mRNA" + "Orbital Prefrontal Cortex mRNA" ], [ "Posterior Inferior Parietal Cortex mRNA", - "Posterior Inferior Parietal Cortex mRNA mRNA" + "Posterior Inferior Parietal Cortex mRNA" ], [ "Posterior Superior Temporal Cortex mRNA", - "Posterior Superior Temporal Cortex mRNA mRNA" + "Posterior Superior Temporal Cortex mRNA" ], [ "Primary Auditory (A1) Cortex mRNA", - "Primary Auditory (A1) Cortex mRNA mRNA" + "Primary Auditory (A1) Cortex mRNA" ], [ "Primary Motor (M1) Cortex mRNA", - "Primary Motor (M1) Cortex mRNA mRNA" + "Primary Motor (M1) Cortex mRNA" ], [ "Primary Somatosensory (S1) Cortex mRNA", - "Primary Somatosensory (S1) Cortex mRNA mRNA" + "Primary Somatosensory (S1) Cortex mRNA" ], [ "Primary Visual Cortex mRNA", - "Primary Visual Cortex mRNA mRNA" + "Primary Visual Cortex mRNA" ], [ "Striatum mRNA", - "Striatum mRNA mRNA" + "Striatum mRNA" ], [ "Ventrolateral Prefrontal Cortex mRNA", - "Ventrolateral Prefrontal Cortex mRNA mRNA" + "Ventrolateral Prefrontal Cortex mRNA" ] ] }, @@ -2822,23 +2806,23 @@ ], [ "Amygdala mRNA", - "Amygdala mRNA mRNA" + "Amygdala mRNA" ], [ "Brain mRNA", - "Brain mRNA mRNA" + "Brain mRNA" ], [ "Hippocampus mRNA", - "Hippocampus mRNA mRNA" + "Hippocampus mRNA" ], [ "Nucleus Accumbens mRNA", - "Nucleus Accumbens mRNA mRNA" + "Nucleus Accumbens mRNA" ], [ "Prefrontal Cortex mRNA", - "Prefrontal Cortex mRNA mRNA" + "Prefrontal Cortex mRNA" ] ] }, @@ -2854,7 +2838,7 @@ ], [ "Mammary Tumors mRNA", - "Mammary Tumors mRNA mRNA" + "Mammary Tumors mRNA" ] ], "AXBXA": [ @@ -2868,19 +2852,19 @@ ], [ "Bone Femur mRNA", - "Bone Femur mRNA mRNA" + "Bone Femur mRNA" ], [ "Eye mRNA", - "Eye mRNA mRNA" + "Eye mRNA" ], [ "Heart mRNA", - "Heart mRNA mRNA" + "Heart mRNA" ], [ "Liver mRNA", - "Liver mRNA mRNA" + "Liver mRNA" ] ], "B6BTBRF2": [ @@ -2894,7 +2878,7 @@ ], [ "Liver mRNA", - "Liver mRNA mRNA" + "Liver mRNA" ] ], "B6D2F2": [ @@ -2908,7 +2892,7 @@ ], [ "Brain mRNA", - "Brain mRNA mRNA" + "Brain mRNA" ] ], "B6D2F2-PSU": [ @@ -2922,7 +2906,7 @@ ], [ "Muscle mRNA", - "Muscle mRNA mRNA" + "Muscle mRNA" ] ], "B6D2RI": [ @@ -2936,7 +2920,7 @@ ], [ "Hippocampus mRNA", - "Hippocampus mRNA mRNA" + "Hippocampus mRNA" ] ], "BDF2-1999": [ @@ -2950,7 +2934,7 @@ ], [ "Liver mRNA", - "Liver mRNA mRNA" + "Liver mRNA" ] ], "BDF2-2005": [ @@ -2964,7 +2948,7 @@ ], [ "Striatum mRNA", - "Striatum mRNA mRNA" + "Striatum mRNA" ] ], "BHF2": [ @@ -2978,19 +2962,19 @@ ], [ "Adipose mRNA", - "Adipose mRNA mRNA" + "Adipose mRNA" ], [ "Brain mRNA", - "Brain mRNA mRNA" + "Brain mRNA" ], [ "Liver mRNA", - "Liver mRNA mRNA" + "Liver mRNA" ], [ "Muscle mRNA", - "Muscle mRNA mRNA" + "Muscle mRNA" ] ], "BHHBF2": [ @@ -3004,19 +2988,19 @@ ], [ "Adipose mRNA", - "Adipose mRNA mRNA" + "Adipose mRNA" ], [ "Brain mRNA", - "Brain mRNA mRNA" + "Brain mRNA" ], [ "Liver mRNA", - "Liver mRNA mRNA" + "Liver mRNA" ], [ "Muscle mRNA", - "Muscle mRNA mRNA" + "Muscle mRNA" ] ], "BXD": [ @@ -3030,119 +3014,119 @@ ], [ "Adrenal Gland mRNA", - "Adrenal Gland mRNA mRNA" + "Adrenal Gland mRNA" ], [ "Amygdala mRNA", - "Amygdala mRNA mRNA" + "Amygdala mRNA" ], [ "Bone Femur mRNA", - "Bone Femur mRNA mRNA" + "Bone Femur mRNA" ], [ "Brain mRNA", - "Brain mRNA mRNA" + "Brain mRNA" ], [ "Cartilage mRNA", - "Cartilage mRNA mRNA" + "Cartilage mRNA" ], [ "Cerebellum mRNA", - "Cerebellum mRNA mRNA" + "Cerebellum mRNA" ], [ "Eye mRNA", - "Eye mRNA mRNA" + "Eye mRNA" ], [ "Hematopoietic Cells mRNA", - "Hematopoietic Cells mRNA mRNA" + "Hematopoietic Cells mRNA" ], [ "Hippocampus mRNA", - "Hippocampus mRNA mRNA" + "Hippocampus mRNA" ], [ "Hypothalamus mRNA", - "Hypothalamus mRNA mRNA" + "Hypothalamus mRNA" ], [ "Kidney mRNA", - "Kidney mRNA mRNA" + "Kidney mRNA" ], [ "Leucocytes mRNA", - "Leucocytes mRNA mRNA" + "Leucocytes mRNA" ], [ "Liver mRNA", - "Liver mRNA mRNA" + "Liver mRNA" ], [ "Liver Proteome", - "Liver Proteome mRNA" + "Liver Proteome" ], [ "Lung mRNA", - "Lung mRNA mRNA" + "Lung mRNA" ], [ "Midbrain mRNA", - "Midbrain mRNA mRNA" + "Midbrain mRNA" ], [ "Muscle mRNA", - "Muscle mRNA mRNA" + "Muscle mRNA" ], [ "Neocortex mRNA", - "Neocortex mRNA mRNA" + "Neocortex mRNA" ], [ "Nucleus Accumbens mRNA", - "Nucleus Accumbens mRNA mRNA" + "Nucleus Accumbens mRNA" ], [ "Pituitary Gland mRNA", - "Pituitary Gland mRNA mRNA" + "Pituitary Gland mRNA" ], [ "Popliteal Lymph Node mRNA", - "Popliteal Lymph Node mRNA mRNA" + "Popliteal Lymph Node mRNA" ], [ "Prefrontal Cortex mRNA", - "Prefrontal Cortex mRNA mRNA" + "Prefrontal Cortex mRNA" ], [ "Retina mRNA", - "Retina mRNA mRNA" + "Retina mRNA" ], [ "Spleen mRNA", - "Spleen mRNA mRNA" + "Spleen mRNA" ], [ "Striatum mRNA", - "Striatum mRNA mRNA" + "Striatum mRNA" ], [ "T Cell (helper) mRNA", - "T Cell (helper) mRNA mRNA" + "T Cell (helper) mRNA" ], [ "T Cell (regulatory) mRNA", - "T Cell (regulatory) mRNA mRNA" + "T Cell (regulatory) mRNA" ], [ "Thymus mRNA", - "Thymus mRNA mRNA" + "Thymus mRNA" ], [ "Ventral Tegmental Area mRNA", - "Ventral Tegmental Area mRNA mRNA" + "Ventral Tegmental Area mRNA" ] ], "BXH": [ @@ -3156,15 +3140,15 @@ ], [ "Bone Femur mRNA", - "Bone Femur mRNA mRNA" + "Bone Femur mRNA" ], [ "Cartilage mRNA", - "Cartilage mRNA mRNA" + "Cartilage mRNA" ], [ "Liver mRNA", - "Liver mRNA mRNA" + "Liver mRNA" ] ], "C57BL-6JxC57BL-6NJF2": [ @@ -3188,19 +3172,19 @@ ], [ "Adipose mRNA", - "Adipose mRNA mRNA" + "Adipose mRNA" ], [ "Brain mRNA", - "Brain mRNA mRNA" + "Brain mRNA" ], [ "Liver mRNA", - "Liver mRNA mRNA" + "Liver mRNA" ], [ "Muscle mRNA", - "Muscle mRNA mRNA" + "Muscle mRNA" ] ], "CXB": [ @@ -3214,11 +3198,11 @@ ], [ "Hippocampus mRNA", - "Hippocampus mRNA mRNA" + "Hippocampus mRNA" ], [ "Spleen mRNA", - "Spleen mRNA mRNA" + "Spleen mRNA" ] ], "HS": [ @@ -3232,15 +3216,15 @@ ], [ "Hippocampus mRNA", - "Hippocampus mRNA mRNA" + "Hippocampus mRNA" ], [ "Liver mRNA", - "Liver mRNA mRNA" + "Liver mRNA" ], [ "Lung mRNA", - "Lung mRNA mRNA" + "Lung mRNA" ] ], "HS-CC": [ @@ -3254,7 +3238,7 @@ ], [ "Striatum mRNA", - "Striatum mRNA mRNA" + "Striatum mRNA" ] ], "LXS": [ @@ -3268,11 +3252,11 @@ ], [ "Hippocampus mRNA", - "Hippocampus mRNA mRNA" + "Hippocampus mRNA" ], [ "Prefrontal Cortex mRNA", - "Prefrontal Cortex mRNA mRNA" + "Prefrontal Cortex mRNA" ] ], "MDP": [ @@ -3286,19 +3270,19 @@ ], [ "Bone Femur mRNA", - "Bone Femur mRNA mRNA" + "Bone Femur mRNA" ], [ "Dorsal Root Ganglia mRNA", - "Dorsal Root Ganglia mRNA mRNA" + "Dorsal Root Ganglia mRNA" ], [ "Hippocampus mRNA", - "Hippocampus mRNA mRNA" + "Hippocampus mRNA" ], [ "Liver mRNA", - "Liver mRNA mRNA" + "Liver mRNA" ] ], "NZBXFVB-N2": [ @@ -3312,7 +3296,7 @@ ], [ "Mammary Tumors mRNA", - "Mammary Tumors mRNA mRNA" + "Mammary Tumors mRNA" ] ], "SOTNOT-OHSU": [ @@ -3336,7 +3320,7 @@ ], [ "Anterior Cingulate Cortex mRNA", - "Anterior Cingulate Cortex mRNA mRNA" + "Anterior Cingulate Cortex mRNA" ] ] }, @@ -3362,27 +3346,27 @@ ], [ "Adrenal Gland mRNA", - "Adrenal Gland mRNA mRNA" + "Adrenal Gland mRNA" ], [ "Heart mRNA", - "Heart mRNA mRNA" + "Heart mRNA" ], [ "Hippocampus mRNA", - "Hippocampus mRNA mRNA" + "Hippocampus mRNA" ], [ "Kidney mRNA", - "Kidney mRNA mRNA" + "Kidney mRNA" ], [ "Liver mRNA", - "Liver mRNA mRNA" + "Liver mRNA" ], [ "Peritoneal Fat mRNA", - "Peritoneal Fat mRNA mRNA" + "Peritoneal Fat mRNA" ] ], "SRxSHRSPF2": [ @@ -3396,7 +3380,7 @@ ], [ "Eye mRNA", - "Eye mRNA mRNA" + "Eye mRNA" ] ] }, -- cgit v1.2.3 From 6aaefdaae3a9fb068278d9b94d8cdf25d4f8d852 Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Fri, 19 Jul 2013 16:13:47 -0500 Subject: Created file gen_group_samplelists that iterates through all genofiles and builds each groups' samplelist --- web/genotypes/HSNIH.geno.gz | Bin wqflask/base/data_set.py | 50 ++++- wqflask/base/webqtlConfig.py | 8 +- wqflask/maintenance/gen_select_dataset.py | 4 +- wqflask/maintenance/get_group_samplelists.py | 43 ++++ .../new/javascript/dataset_menu_structure.json | 224 ++++++++++----------- 6 files changed, 206 insertions(+), 123 deletions(-) mode change 100755 => 100644 web/genotypes/HSNIH.geno.gz create mode 100644 wqflask/maintenance/get_group_samplelists.py (limited to 'wqflask') diff --git a/web/genotypes/HSNIH.geno.gz b/web/genotypes/HSNIH.geno.gz old mode 100755 new mode 100644 diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index 30221503..cf219fda 100755 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -16,8 +16,6 @@ # Contact Drs. Robert W. Williams and Xiaodong Zhou (2010) # at rwilliams@uthsc.edu and xzhou15@uthsc.edu # -#we -# # This module is used by GeneNetwork project (www.genenetwork.org) from __future__ import absolute_import, print_function, division @@ -27,6 +25,7 @@ import string import collections import json +import gzip import cPickle as pickle import itertools @@ -52,8 +51,6 @@ from pprint import pformat as pf DS_NAME_MAP = {} def create_dataset(dataset_name, dataset_type = None): - - print("dataset_type:", dataset_type) if not dataset_type: dataset_type = Dataset_Getter(dataset_name) #dataset_type = get_dataset_type_from_json(dataset_name) @@ -129,7 +126,7 @@ def create_datasets_list(): for result in g.db.execute(query).fetchall(): #The query at the beginning of this function isn't necessary here, but still would #rather just reuse it - print("type: {}\tname: {}".format(dataset_type, result.Name)) + #print("type: {}\tname: {}".format(dataset_type, result.Name)) dataset = create_dataset(result.Name, dataset_type) datasets.append(dataset) @@ -261,6 +258,36 @@ class DatasetGroup(object): if maternal and paternal: self.parlist = [maternal, paternal] + def get_sample_list(self): + genofilename = str(os.path.join(webqtlConfig.GENODIR, self.name + '.geno')) + genofile = open(genofilename, "r") + for line in genofile: + line = line.strip() + if line.startswith(("#", "@")): + continue + headline = line + break + headers = headline.split("\t") + if headers[3] == "Mb": + self.samplelist = headers[4:] + else: + self.samplelist = headers[3:] + + #if genotype_1.type == "group" and self.parlist: + # genotype_2 = genotype_1.add(Mat=self.parlist[0], Pat=self.parlist[1]) #, F1=_f1) + #else: + # genotype_2 = genotype_1 + + #determine default genotype object + #if self.incparentsf1 and genotype_1.type != "intercross": + # genotype = genotype_2 + #else: + # self.incparentsf1 = 0 + # genotype = genotype_1 + + #self.samplelist = list(genotype.prgy) + + def read_genotype_file(self): '''Read genotype from .geno file instead of database''' #if self.group == 'BXD300': @@ -275,7 +302,18 @@ class DatasetGroup(object): # reaper barfs on unicode filenames, so here we ensure it's a string full_filename = str(os.path.join(webqtlConfig.GENODIR, self.name + '.geno')) - genotype_1.read(full_filename) + if os.path.isfile(full_filename): + print("Reading file: ", full_filename) + genotype_1.read(full_filename) + print("File read") + else: + try: + full_filename = str(os.path.join(webqtlConfig.TMPDIR, self.name + '.geno')) + #print("Reading file") + genotype_1.read(full_filename) + #print("File read") + except IOError: + print("File doesn't exist!") if genotype_1.type == "group" and self.parlist: genotype_2 = genotype_1.add(Mat=self.parlist[0], Pat=self.parlist[1]) #, F1=_f1) diff --git a/wqflask/base/webqtlConfig.py b/wqflask/base/webqtlConfig.py index d4511212..67a9c63f 100755 --- a/wqflask/base/webqtlConfig.py +++ b/wqflask/base/webqtlConfig.py @@ -35,7 +35,7 @@ NCBI_LOCUSID = "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=gene&cmd=Retrie UCSC_REFSEQ = "http://genome.cse.ucsc.edu/cgi-bin/hgGene?db=%s&hgg_gene=%s&hgg_chrom=chr%s&hgg_start=%s&hgg_end=%s" GENBANK_ID = "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=Nucleotide&cmd=search&doptcmdl=DocSum&term=%s" OMIM_ID = "http://www.ncbi.nlm.nih.gov/omim/%s" -UNIGEN_ID = "http://www.ncbi.nlm.nih.gov/UniGene/clust.cgi?ORG=%s&CID=%s" +UNIGEN_ID = "http://www.ncbi.nlm.nih.gov/UniGene/clust.cgi?ORG=%s&CID=%s"; HOMOLOGENE_ID = "http://www.ncbi.nlm.nih.gov/sites/entrez?Db=homologene&Cmd=DetailsSearch&Term=%s" PUBMEDLINK_URL = "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids=%s&dopt=Abstract" UCSC_POS = "http://genome.ucsc.edu/cgi-bin/hgTracks?clade=mammal&org=%s&db=%s&position=chr%s:%s-%s&pix=800&Submit=submit" @@ -53,12 +53,12 @@ GNROOT = "/home/zas1024/gene/" # Will remove this and dependent items later SECUREDIR = GNROOT + 'secure/' COMMON_LIB = GNROOT + 'support/admin' HTMLPATH = GNROOT + 'web/' -PYLMM_PATH = '/home/zas1024/plink/' -SNP_PATH = '/home/zas1024/snps/' +PYLMM_PATH = '/home/zas1024/' +SNP_PATH = '/mnt/xvdf1/snps/' IMGDIR = HTMLPATH +'image/' IMAGESPATH = HTMLPATH + 'images/' UPLOADPATH = IMAGESPATH + 'upload/' -TMPDIR = HTMLPATH + 'tmp/' +TMPDIR = '/tmp/' GENODIR = HTMLPATH + 'genotypes/' NEWGENODIR = HTMLPATH + 'new_genotypes/' GENO_ARCHIVE_DIR = GENODIR + 'archive/' diff --git a/wqflask/maintenance/gen_select_dataset.py b/wqflask/maintenance/gen_select_dataset.py index 8cb94f20..d4e47327 100644 --- a/wqflask/maintenance/gen_select_dataset.py +++ b/wqflask/maintenance/gen_select_dataset.py @@ -115,7 +115,7 @@ def build_types(species, group): (all types except phenotype/genotype are tissues) """ - Cursor.execute("""select distinct Tissue.Name, Tissue.Name + Cursor.execute("""select distinct Tissue.Name, concat(Tissue.Name, ' mRNA') from ProbeFreeze, ProbeSetFreeze, InbredSet, Tissue, Species where Species.Name = %s and Species.Id = InbredSet.SpeciesId and InbredSet.Name = %s and @@ -192,6 +192,8 @@ def main(): datasets=datasets, ) + print("data:", data) + output_file = """../wqflask/static/new/javascript/dataset_menu_structure.json""" with open(output_file, 'w') as fh: diff --git a/wqflask/maintenance/get_group_samplelists.py b/wqflask/maintenance/get_group_samplelists.py new file mode 100644 index 00000000..2434038e --- /dev/null +++ b/wqflask/maintenance/get_group_samplelists.py @@ -0,0 +1,43 @@ +from __future__ import absolute_import, print_function, division + +import os +import glob +import gzip + +from base import webqtlConfig + + +def get_sample_list_dir(geno_dir="/home/zas1024/gene/web/genotypes/"): + os.chdir(geno_dir) + + for group_file in glob.glob("*"): + if group_file.lower().endswith(('.geno', '.geno.gz')): + #group_name = genofilename.split('.')[0] + sample_list = get_sample_list(group_file) + print("\n\n{}\n\n".format(sample_list)) + + +def get_sample_list(group_file): + print(group_file) + genofilename = str(os.path.join(webqtlConfig.GENODIR, group_file)) + if genofilename.lower().endswith('.geno.gz'): + genofile = gzip.open(genofilename) + else: + genofile = open(genofilename) + for line in genofile: + line = line.strip() + if not line: + continue + if line.startswith(("#", "@")): + continue + headline = line + break + headers = headline.split("\t") + if headers[3] == "Mb": + samplelist = headers[4:] + else: + samplelist = headers[3:] + return samplelist + +if __name__ == '__main__': + get_sample_list_dir() diff --git a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json index 49c44fbd..4aae20ba 100644 --- a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json +++ b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json @@ -2556,7 +2556,7 @@ ], [ "Leaf mRNA", - "Leaf mRNA" + "Leaf mRNA mRNA" ] ], "SXM": [ @@ -2570,11 +2570,11 @@ ], [ "Embryo mRNA", - "Embryo mRNA" + "Embryo mRNA mRNA" ], [ "Leaf mRNA", - "Leaf mRNA" + "Leaf mRNA mRNA" ] ] }, @@ -2590,7 +2590,7 @@ ], [ "Whole Body mRNA", - "Whole Body mRNA" + "Whole Body mRNA mRNA" ] ], "Oregon-R_x_2b3": [ @@ -2604,7 +2604,7 @@ ], [ "Whole Body mRNA", - "Whole Body mRNA" + "Whole Body mRNA mRNA" ] ] }, @@ -2620,7 +2620,7 @@ ], [ "Brain mRNA", - "Brain mRNA" + "Brain mRNA mRNA" ] ], "AD-cases-controls-Myers": [ @@ -2634,7 +2634,7 @@ ], [ "Brain mRNA", - "Brain mRNA" + "Brain mRNA mRNA" ] ], "CANDLE": [ @@ -2648,11 +2648,11 @@ ], [ "Methylation", - "Methylation" + "Methylation mRNA" ], [ "Newborn Cord Blood mRNA", - "Newborn Cord Blood mRNA" + "Newborn Cord Blood mRNA mRNA" ] ], "CEPH-2004": [ @@ -2666,7 +2666,7 @@ ], [ "Lymphoblast B-cell mRNA", - "Lymphoblast B-cell mRNA" + "Lymphoblast B-cell mRNA mRNA" ] ], "HB": [ @@ -2680,15 +2680,15 @@ ], [ "Cerebellum mRNA", - "Cerebellum mRNA" + "Cerebellum mRNA mRNA" ], [ "Prefrontal Cortex mRNA", - "Prefrontal Cortex mRNA" + "Prefrontal Cortex mRNA mRNA" ], [ "Primary Visual Cortex mRNA", - "Primary Visual Cortex mRNA" + "Primary Visual Cortex mRNA mRNA" ] ], "HLC": [ @@ -2702,7 +2702,7 @@ ], [ "Liver mRNA", - "Liver mRNA" + "Liver mRNA mRNA" ] ], "HLT": [ @@ -2716,7 +2716,7 @@ ], [ "Lung mRNA", - "Lung mRNA" + "Lung mRNA mRNA" ] ], "HSB": [ @@ -2730,67 +2730,67 @@ ], [ "Amygdala mRNA", - "Amygdala mRNA" + "Amygdala mRNA mRNA" ], [ "Cerebellar Cortex mRNA", - "Cerebellar Cortex mRNA" + "Cerebellar Cortex mRNA mRNA" ], [ "Dorsolateral Prefrontal Cortex mRNA", - "Dorsolateral Prefrontal Cortex mRNA" + "Dorsolateral Prefrontal Cortex mRNA mRNA" ], [ "Hippocampus mRNA", - "Hippocampus mRNA" + "Hippocampus mRNA mRNA" ], [ "Inferior Temporal Cortex mRNA", - "Inferior Temporal Cortex mRNA" + "Inferior Temporal Cortex mRNA mRNA" ], [ "Medial Prefrontal Cortex mRNA", - "Medial Prefrontal Cortex mRNA" + "Medial Prefrontal Cortex mRNA mRNA" ], [ "Mediodorsal Nucleus of Thalamus mRNA", - "Mediodorsal Nucleus of Thalamus mRNA" + "Mediodorsal Nucleus of Thalamus mRNA mRNA" ], [ "Orbital Prefrontal Cortex mRNA", - "Orbital Prefrontal Cortex mRNA" + "Orbital Prefrontal Cortex mRNA mRNA" ], [ "Posterior Inferior Parietal Cortex mRNA", - "Posterior Inferior Parietal Cortex mRNA" + "Posterior Inferior Parietal Cortex mRNA mRNA" ], [ "Posterior Superior Temporal Cortex mRNA", - "Posterior Superior Temporal Cortex mRNA" + "Posterior Superior Temporal Cortex mRNA mRNA" ], [ "Primary Auditory (A1) Cortex mRNA", - "Primary Auditory (A1) Cortex mRNA" + "Primary Auditory (A1) Cortex mRNA mRNA" ], [ "Primary Motor (M1) Cortex mRNA", - "Primary Motor (M1) Cortex mRNA" + "Primary Motor (M1) Cortex mRNA mRNA" ], [ "Primary Somatosensory (S1) Cortex mRNA", - "Primary Somatosensory (S1) Cortex mRNA" + "Primary Somatosensory (S1) Cortex mRNA mRNA" ], [ "Primary Visual Cortex mRNA", - "Primary Visual Cortex mRNA" + "Primary Visual Cortex mRNA mRNA" ], [ "Striatum mRNA", - "Striatum mRNA" + "Striatum mRNA mRNA" ], [ "Ventrolateral Prefrontal Cortex mRNA", - "Ventrolateral Prefrontal Cortex mRNA" + "Ventrolateral Prefrontal Cortex mRNA mRNA" ] ] }, @@ -2806,23 +2806,23 @@ ], [ "Amygdala mRNA", - "Amygdala mRNA" + "Amygdala mRNA mRNA" ], [ "Brain mRNA", - "Brain mRNA" + "Brain mRNA mRNA" ], [ "Hippocampus mRNA", - "Hippocampus mRNA" + "Hippocampus mRNA mRNA" ], [ "Nucleus Accumbens mRNA", - "Nucleus Accumbens mRNA" + "Nucleus Accumbens mRNA mRNA" ], [ "Prefrontal Cortex mRNA", - "Prefrontal Cortex mRNA" + "Prefrontal Cortex mRNA mRNA" ] ] }, @@ -2838,7 +2838,7 @@ ], [ "Mammary Tumors mRNA", - "Mammary Tumors mRNA" + "Mammary Tumors mRNA mRNA" ] ], "AXBXA": [ @@ -2852,19 +2852,19 @@ ], [ "Bone Femur mRNA", - "Bone Femur mRNA" + "Bone Femur mRNA mRNA" ], [ "Eye mRNA", - "Eye mRNA" + "Eye mRNA mRNA" ], [ "Heart mRNA", - "Heart mRNA" + "Heart mRNA mRNA" ], [ "Liver mRNA", - "Liver mRNA" + "Liver mRNA mRNA" ] ], "B6BTBRF2": [ @@ -2878,7 +2878,7 @@ ], [ "Liver mRNA", - "Liver mRNA" + "Liver mRNA mRNA" ] ], "B6D2F2": [ @@ -2892,7 +2892,7 @@ ], [ "Brain mRNA", - "Brain mRNA" + "Brain mRNA mRNA" ] ], "B6D2F2-PSU": [ @@ -2906,7 +2906,7 @@ ], [ "Muscle mRNA", - "Muscle mRNA" + "Muscle mRNA mRNA" ] ], "B6D2RI": [ @@ -2920,7 +2920,7 @@ ], [ "Hippocampus mRNA", - "Hippocampus mRNA" + "Hippocampus mRNA mRNA" ] ], "BDF2-1999": [ @@ -2934,7 +2934,7 @@ ], [ "Liver mRNA", - "Liver mRNA" + "Liver mRNA mRNA" ] ], "BDF2-2005": [ @@ -2948,7 +2948,7 @@ ], [ "Striatum mRNA", - "Striatum mRNA" + "Striatum mRNA mRNA" ] ], "BHF2": [ @@ -2962,19 +2962,19 @@ ], [ "Adipose mRNA", - "Adipose mRNA" + "Adipose mRNA mRNA" ], [ "Brain mRNA", - "Brain mRNA" + "Brain mRNA mRNA" ], [ "Liver mRNA", - "Liver mRNA" + "Liver mRNA mRNA" ], [ "Muscle mRNA", - "Muscle mRNA" + "Muscle mRNA mRNA" ] ], "BHHBF2": [ @@ -2988,19 +2988,19 @@ ], [ "Adipose mRNA", - "Adipose mRNA" + "Adipose mRNA mRNA" ], [ "Brain mRNA", - "Brain mRNA" + "Brain mRNA mRNA" ], [ "Liver mRNA", - "Liver mRNA" + "Liver mRNA mRNA" ], [ "Muscle mRNA", - "Muscle mRNA" + "Muscle mRNA mRNA" ] ], "BXD": [ @@ -3014,119 +3014,119 @@ ], [ "Adrenal Gland mRNA", - "Adrenal Gland mRNA" + "Adrenal Gland mRNA mRNA" ], [ "Amygdala mRNA", - "Amygdala mRNA" + "Amygdala mRNA mRNA" ], [ "Bone Femur mRNA", - "Bone Femur mRNA" + "Bone Femur mRNA mRNA" ], [ "Brain mRNA", - "Brain mRNA" + "Brain mRNA mRNA" ], [ "Cartilage mRNA", - "Cartilage mRNA" + "Cartilage mRNA mRNA" ], [ "Cerebellum mRNA", - "Cerebellum mRNA" + "Cerebellum mRNA mRNA" ], [ "Eye mRNA", - "Eye mRNA" + "Eye mRNA mRNA" ], [ "Hematopoietic Cells mRNA", - "Hematopoietic Cells mRNA" + "Hematopoietic Cells mRNA mRNA" ], [ "Hippocampus mRNA", - "Hippocampus mRNA" + "Hippocampus mRNA mRNA" ], [ "Hypothalamus mRNA", - "Hypothalamus mRNA" + "Hypothalamus mRNA mRNA" ], [ "Kidney mRNA", - "Kidney mRNA" + "Kidney mRNA mRNA" ], [ "Leucocytes mRNA", - "Leucocytes mRNA" + "Leucocytes mRNA mRNA" ], [ "Liver mRNA", - "Liver mRNA" + "Liver mRNA mRNA" ], [ "Liver Proteome", - "Liver Proteome" + "Liver Proteome mRNA" ], [ "Lung mRNA", - "Lung mRNA" + "Lung mRNA mRNA" ], [ "Midbrain mRNA", - "Midbrain mRNA" + "Midbrain mRNA mRNA" ], [ "Muscle mRNA", - "Muscle mRNA" + "Muscle mRNA mRNA" ], [ "Neocortex mRNA", - "Neocortex mRNA" + "Neocortex mRNA mRNA" ], [ "Nucleus Accumbens mRNA", - "Nucleus Accumbens mRNA" + "Nucleus Accumbens mRNA mRNA" ], [ "Pituitary Gland mRNA", - "Pituitary Gland mRNA" + "Pituitary Gland mRNA mRNA" ], [ "Popliteal Lymph Node mRNA", - "Popliteal Lymph Node mRNA" + "Popliteal Lymph Node mRNA mRNA" ], [ "Prefrontal Cortex mRNA", - "Prefrontal Cortex mRNA" + "Prefrontal Cortex mRNA mRNA" ], [ "Retina mRNA", - "Retina mRNA" + "Retina mRNA mRNA" ], [ "Spleen mRNA", - "Spleen mRNA" + "Spleen mRNA mRNA" ], [ "Striatum mRNA", - "Striatum mRNA" + "Striatum mRNA mRNA" ], [ "T Cell (helper) mRNA", - "T Cell (helper) mRNA" + "T Cell (helper) mRNA mRNA" ], [ "T Cell (regulatory) mRNA", - "T Cell (regulatory) mRNA" + "T Cell (regulatory) mRNA mRNA" ], [ "Thymus mRNA", - "Thymus mRNA" + "Thymus mRNA mRNA" ], [ "Ventral Tegmental Area mRNA", - "Ventral Tegmental Area mRNA" + "Ventral Tegmental Area mRNA mRNA" ] ], "BXH": [ @@ -3140,15 +3140,15 @@ ], [ "Bone Femur mRNA", - "Bone Femur mRNA" + "Bone Femur mRNA mRNA" ], [ "Cartilage mRNA", - "Cartilage mRNA" + "Cartilage mRNA mRNA" ], [ "Liver mRNA", - "Liver mRNA" + "Liver mRNA mRNA" ] ], "C57BL-6JxC57BL-6NJF2": [ @@ -3172,19 +3172,19 @@ ], [ "Adipose mRNA", - "Adipose mRNA" + "Adipose mRNA mRNA" ], [ "Brain mRNA", - "Brain mRNA" + "Brain mRNA mRNA" ], [ "Liver mRNA", - "Liver mRNA" + "Liver mRNA mRNA" ], [ "Muscle mRNA", - "Muscle mRNA" + "Muscle mRNA mRNA" ] ], "CXB": [ @@ -3198,11 +3198,11 @@ ], [ "Hippocampus mRNA", - "Hippocampus mRNA" + "Hippocampus mRNA mRNA" ], [ "Spleen mRNA", - "Spleen mRNA" + "Spleen mRNA mRNA" ] ], "HS": [ @@ -3216,15 +3216,15 @@ ], [ "Hippocampus mRNA", - "Hippocampus mRNA" + "Hippocampus mRNA mRNA" ], [ "Liver mRNA", - "Liver mRNA" + "Liver mRNA mRNA" ], [ "Lung mRNA", - "Lung mRNA" + "Lung mRNA mRNA" ] ], "HS-CC": [ @@ -3238,7 +3238,7 @@ ], [ "Striatum mRNA", - "Striatum mRNA" + "Striatum mRNA mRNA" ] ], "LXS": [ @@ -3252,11 +3252,11 @@ ], [ "Hippocampus mRNA", - "Hippocampus mRNA" + "Hippocampus mRNA mRNA" ], [ "Prefrontal Cortex mRNA", - "Prefrontal Cortex mRNA" + "Prefrontal Cortex mRNA mRNA" ] ], "MDP": [ @@ -3270,19 +3270,19 @@ ], [ "Bone Femur mRNA", - "Bone Femur mRNA" + "Bone Femur mRNA mRNA" ], [ "Dorsal Root Ganglia mRNA", - "Dorsal Root Ganglia mRNA" + "Dorsal Root Ganglia mRNA mRNA" ], [ "Hippocampus mRNA", - "Hippocampus mRNA" + "Hippocampus mRNA mRNA" ], [ "Liver mRNA", - "Liver mRNA" + "Liver mRNA mRNA" ] ], "NZBXFVB-N2": [ @@ -3296,7 +3296,7 @@ ], [ "Mammary Tumors mRNA", - "Mammary Tumors mRNA" + "Mammary Tumors mRNA mRNA" ] ], "SOTNOT-OHSU": [ @@ -3320,7 +3320,7 @@ ], [ "Anterior Cingulate Cortex mRNA", - "Anterior Cingulate Cortex mRNA" + "Anterior Cingulate Cortex mRNA mRNA" ] ] }, @@ -3346,27 +3346,27 @@ ], [ "Adrenal Gland mRNA", - "Adrenal Gland mRNA" + "Adrenal Gland mRNA mRNA" ], [ "Heart mRNA", - "Heart mRNA" + "Heart mRNA mRNA" ], [ "Hippocampus mRNA", - "Hippocampus mRNA" + "Hippocampus mRNA mRNA" ], [ "Kidney mRNA", - "Kidney mRNA" + "Kidney mRNA mRNA" ], [ "Liver mRNA", - "Liver mRNA" + "Liver mRNA mRNA" ], [ "Peritoneal Fat mRNA", - "Peritoneal Fat mRNA" + "Peritoneal Fat mRNA mRNA" ] ], "SRxSHRSPF2": [ @@ -3380,7 +3380,7 @@ ], [ "Eye mRNA", - "Eye mRNA" + "Eye mRNA mRNA" ] ] }, -- cgit v1.2.3 From 82f493650909e2351035e26e9dc82b16498beb48 Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Fri, 19 Jul 2013 17:34:52 -0500 Subject: Finished integrating code that reads sample list from geno files withouot using reaper and caches results so it doesn't need to read the file every single time someone loads a page --- wqflask/base/data_set.py | 48 ++++++++++++---------------- wqflask/maintenance/__init__.py | 0 wqflask/maintenance/get_group_samplelists.py | 26 +++++++-------- wqflask/utility/helper_functions.py | 5 ++- wqflask/wqflask/show_trait/show_trait.py | 2 +- wqflask/wqflask/views.py | 2 +- 6 files changed, 38 insertions(+), 45 deletions(-) create mode 100644 wqflask/maintenance/__init__.py (limited to 'wqflask') diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index cf219fda..d5aae31d 100755 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -43,6 +43,8 @@ from utility import webqtlUtil from utility.benchmark import Bench from wqflask.my_pylmm.pyLMM import chunks +from maintenance import get_group_samplelists + from MySQLdb import escape_string as escape from pprint import pformat as pf @@ -258,35 +260,25 @@ class DatasetGroup(object): if maternal and paternal: self.parlist = [maternal, paternal] - def get_sample_list(self): - genofilename = str(os.path.join(webqtlConfig.GENODIR, self.name + '.geno')) - genofile = open(genofilename, "r") - for line in genofile: - line = line.strip() - if line.startswith(("#", "@")): - continue - headline = line - break - headers = headline.split("\t") - if headers[3] == "Mb": - self.samplelist = headers[4:] - else: - self.samplelist = headers[3:] - - #if genotype_1.type == "group" and self.parlist: - # genotype_2 = genotype_1.add(Mat=self.parlist[0], Pat=self.parlist[1]) #, F1=_f1) - #else: - # genotype_2 = genotype_1 - #determine default genotype object - #if self.incparentsf1 and genotype_1.type != "intercross": - # genotype = genotype_2 - #else: - # self.incparentsf1 = 0 - # genotype = genotype_1 + def get_samplelist(self): + key = "samplelist:v4:" + self.name + print("key is:", key) + with Bench("Loading cache"): + result = Redis.get(key) - #self.samplelist = list(genotype.prgy) - + if result: + print("Sample List Cache hit!!!") + print("Before unjsonifying {}: {}".format(type(result), result)) + self.samplelist = json.loads(result) + print(" type: ", type(self.samplelist)) + print(" self.samplelist: ", self.samplelist) + else: + print("Cache not hit") + self.samplelist = get_group_samplelists.get_samplelist(self.name + ".geno") + print("after get_samplelist") + Redis.set(key, json.dumps(self.samplelist)) + Redis.expire(key, 60*5) def read_genotype_file(self): '''Read genotype from .geno file instead of database''' @@ -374,7 +366,7 @@ class DataSet(object): self.retrieve_other_names() self.group = DatasetGroup(self) # sets self.group and self.group_id and gets genotype - self.group.read_genotype_file() + self.group.get_samplelist() self.species = species.TheSpecies(self) diff --git a/wqflask/maintenance/__init__.py b/wqflask/maintenance/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/wqflask/maintenance/get_group_samplelists.py b/wqflask/maintenance/get_group_samplelists.py index 2434038e..99e22904 100644 --- a/wqflask/maintenance/get_group_samplelists.py +++ b/wqflask/maintenance/get_group_samplelists.py @@ -7,37 +7,35 @@ import gzip from base import webqtlConfig -def get_sample_list_dir(geno_dir="/home/zas1024/gene/web/genotypes/"): +def process_genofiles(geno_dir=webqtlConfig.GENODIR): os.chdir(geno_dir) - - for group_file in glob.glob("*"): - if group_file.lower().endswith(('.geno', '.geno.gz')): + for geno_file in glob.glob("*"): + if geno_file.lower().endswith(('.geno', '.geno.gz')): #group_name = genofilename.split('.')[0] - sample_list = get_sample_list(group_file) - print("\n\n{}\n\n".format(sample_list)) + sample_list = get_samplelist(geno_file) -def get_sample_list(group_file): - print(group_file) - genofilename = str(os.path.join(webqtlConfig.GENODIR, group_file)) - if genofilename.lower().endswith('.geno.gz'): +def get_samplelist(geno_file): + genofilename = os.path.join(webqtlConfig.GENODIR, geno_file) + if os.path.isfile(genofilename + '.gz'): + genofilename += '.gz' genofile = gzip.open(genofilename) else: genofile = open(genofilename) + for line in genofile: line = line.strip() if not line: continue if line.startswith(("#", "@")): continue - headline = line break - headers = headline.split("\t") + + headers = line.split() + if headers[3] == "Mb": samplelist = headers[4:] else: samplelist = headers[3:] return samplelist -if __name__ == '__main__': - get_sample_list_dir() diff --git a/wqflask/utility/helper_functions.py b/wqflask/utility/helper_functions.py index d76a32ce..44f5321e 100644 --- a/wqflask/utility/helper_functions.py +++ b/wqflask/utility/helper_functions.py @@ -8,11 +8,14 @@ from base.species import TheSpecies def get_species_dataset_trait(self, start_vars): #assert type(read_genotype) == type(bool()), "Expecting boolean value for read_genotype" self.dataset = data_set.create_dataset(start_vars['dataset']) + print("After creating dataset") self.species = TheSpecies(dataset=self.dataset) + print("After creating species") self.this_trait = GeneralTrait(dataset=self.dataset, name=start_vars['trait_id'], cellid=None) + print("After creating trait") #if read_genotype: - self.dataset.group.read_genotype_file() + #self.dataset.group.read_genotype_file() #self.genotype = self.dataset.group.genotype diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py index 60e42afb..7397c776 100755 --- a/wqflask/wqflask/show_trait/show_trait.py +++ b/wqflask/wqflask/show_trait/show_trait.py @@ -41,7 +41,7 @@ class ShowTrait(object): helper_functions.get_species_dataset_trait(self, kw) - self.dataset.group.read_genotype_file() + #self.dataset.group.read_genotype_file() # Todo: Add back in the ones we actually need from below, as we discover we need them hddn = OrderedDict() diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 813075b8..bd8f5c86 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -96,7 +96,7 @@ def search_page(): else: return render_template("data_sharing.html", **template_vars.__dict__) else: - key = "search_results:v2:" + json.dumps(request.args, sort_keys=True) + key = "search_results:v3:" + json.dumps(request.args, sort_keys=True) print("key is:", pf(key)) with Bench("Loading cache"): result = Redis.get(key) -- cgit v1.2.3 From 930d8b0cf0c7bf88fee1de95852dfe883418a494 Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Tue, 23 Jul 2013 17:12:29 -0500 Subject: Fixed a couple issues with he quick_search_table.py script Added notes on using percona to optimise mysql to gn_installation_notes.txt Started moving "get_trait_data" to DataSet since it is the same regardless of the particular DataSet subclass (PhenotypeDataSet, MrnaAssayDataSet, etc) --- misc/gn_installation_notes.txt | 8 ++ misc/notes.txt | 15 +++ wqflask/base/data_set.py | 202 ++++++++++++++++++++---------- wqflask/maintenance/quick_search_table.py | 62 ++++----- wqflask/wqflask/my_pylmm/pyLMM/lmm.py | 3 + 5 files changed, 194 insertions(+), 96 deletions(-) (limited to 'wqflask') diff --git a/misc/gn_installation_notes.txt b/misc/gn_installation_notes.txt index fb38844f..91fe1781 100644 --- a/misc/gn_installation_notes.txt +++ b/misc/gn_installation_notes.txt @@ -172,6 +172,14 @@ Setup accounts in MySQL (first need to delete anonymous/non-root accounts): #; GRANT ALL ON *.* TO 'yourusername'@'%' IDENTIFIED BY 'yourpassword'; #; select * from user; +Use Percona to optimise my.cfg file: +https://tools.percona.com/wizard + +To check # CPUs: +grep -c processor /proc/cpuinfo + +To check memory, can use htop + ============================================ Check RSA key: diff --git a/misc/notes.txt b/misc/notes.txt index d9bd6e41..9e61e527 100644 --- a/misc/notes.txt +++ b/misc/notes.txt @@ -269,6 +269,21 @@ grep -ir (search string) (directory) =========================================== +Change owner/group: + +chown zas1024 somefile (change owner of somefile to zas1024) +chown zas1024: somefile (change owner and group of somefile to zas1024) +sudo chown root: somefile (change owner/group of somefile to root) + +Change permissions: + +chmod g-wr (remove write/read privileges for group) +chmod g+w (add write privileges for group) +chmod u+rwx (add read, write, and execute privileges for user) +etc. + +=========================================== + MySQL Things - Create fulltext (MATCH AGAINST syntax) index: diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index d5aae31d..188a94a2 100755 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -435,6 +435,74 @@ class DataSet(object): except TypeError: print("Dataset {} is not yet available in GeneNetwork.".format(self.name)) pass + + def get_trait_data(self): + self.samplelist = self.group.samplelist + self.group.parlist + self.group.f1list + query = """ + SELECT Strain.Name, Strain.Id FROM Strain, Species + WHERE Strain.Name IN {} + and Strain.SpeciesId=Species.Id + and Species.name = '{}' + """.format(create_in_clause(self.samplelist), *mescape(self.group.species)) + results = dict(g.db.execute(query).fetchall()) + sample_ids = [results[item] for item in self.samplelist] + + # MySQL limits the number of tables that can be used in a join to 61, + # so we break the sample ids into smaller chunks + # Postgres doesn't have that limit, so we can get rid of this after we transition + chunk_size = 50 + number_chunks = int(math.ceil(len(sample_ids) / chunk_size)) + trait_sample_data = [] + for sample_ids_step in chunks.divide_into_chunks(sample_ids, number_chunks): + + #XZ, 09/24/2008: build one temporary table that only contains the records associated with the input GeneId + #tempTable = None + #if GeneId and db.type == "ProbeSet": + # if method == "3": + # tempTable = self.getTempLiteratureTable(species=species, + # input_species_geneid=GeneId, + # returnNumber=returnNumber) + # + # if method == "4" or method == "5": + # tempTable = self.getTempTissueCorrTable(primaryTraitSymbol=GeneSymbol, + # TissueProbeSetFreezeId=tissueProbeSetFreezeId, + # method=method, + # returnNumber=returnNumber) + + temp = ['T%s.value' % item for item in sample_ids_step] + query = "SELECT {}.Name,".format(escape(self.type)) + data_start_pos = 1 + query += string.join(temp, ', ') + query += ' FROM ({}, {}XRef, {}Freeze) '.format(*mescape(self.type, + self.type, + self.type)) + + for item in sample_ids_step: + query += """ + left join {}Data as T{} on T{}.Id = {}XRef.DataId + and T{}.StrainId={}\n + """.format(*mescape(self.type, item, item, self.type, item, item)) + + query += """ + WHERE {}XRef.{}FreezeId = {}Freeze.Id + and {}Freeze.Name = '{}' + and {}.Id = {}XRef.{}Id + order by {}.Id + """.format(*mescape(self.type, self.type, self.type, self.type, + self.name, self.type, self.type, self.type, self.type)) + results = g.db.execute(query).fetchall() + trait_sample_data.append(results) + + trait_count = len(trait_sample_data[0]) + self.trait_data = collections.defaultdict(list) + + # put all of the separate data together into a dictionary where the keys are + # trait names and values are lists of sample values + for trait_counter in range(trait_count): + trait_name = trait_sample_data[0][trait_counter][0] + for chunk_counter in range(int(number_chunks)): + self.trait_data[trait_name] += ( + trait_sample_data[chunk_counter][trait_counter][data_start_pos:]) class PhenotypeDataSet(DataSet): DS_NAME_MAP['Publish'] = 'PhenotypeDataSet' @@ -768,73 +836,73 @@ class MrnaAssayDataSet(DataSet): #print("After retrieve_sample_data") return trait_data - def get_trait_data(self): - self.samplelist = self.group.samplelist + self.group.parlist + self.group.f1list - query = """ - SELECT Strain.Name, Strain.Id FROM Strain, Species - WHERE Strain.Name IN {} - and Strain.SpeciesId=Species.Id - and Species.name = '{}' - """.format(create_in_clause(self.samplelist), *mescape(self.group.species)) - results = dict(g.db.execute(query).fetchall()) - sample_ids = [results[item] for item in self.samplelist] - - # MySQL limits the number of tables that can be used in a join to 61, - # so we break the sample ids into smaller chunks - # Postgres doesn't have that limit, so we can get rid of this after we transition - chunk_size = 50 - number_chunks = int(math.ceil(len(sample_ids) / chunk_size)) - trait_sample_data = [] - for sample_ids_step in chunks.divide_into_chunks(sample_ids, number_chunks): - - #XZ, 09/24/2008: build one temporary table that only contains the records associated with the input GeneId - #tempTable = None - #if GeneId and db.type == "ProbeSet": - # if method == "3": - # tempTable = self.getTempLiteratureTable(species=species, - # input_species_geneid=GeneId, - # returnNumber=returnNumber) - # - # if method == "4" or method == "5": - # tempTable = self.getTempTissueCorrTable(primaryTraitSymbol=GeneSymbol, - # TissueProbeSetFreezeId=tissueProbeSetFreezeId, - # method=method, - # returnNumber=returnNumber) - - temp = ['T%s.value' % item for item in sample_ids_step] - query = "SELECT {}.Name,".format(escape(self.type)) - data_start_pos = 1 - query += string.join(temp, ', ') - query += ' FROM ({}, {}XRef, {}Freeze) '.format(*mescape(self.type, - self.type, - self.type)) - - for item in sample_ids_step: - query += """ - left join {}Data as T{} on T{}.Id = {}XRef.DataId - and T{}.StrainId={}\n - """.format(*mescape(self.type, item, item, self.type, item, item)) - - query += """ - WHERE {}XRef.{}FreezeId = {}Freeze.Id - and {}Freeze.Name = '{}' - and {}.Id = {}XRef.{}Id - order by {}.Id - """.format(*mescape(self.type, self.type, self.type, self.type, - self.name, self.type, self.type, self.type, self.type)) - results = g.db.execute(query).fetchall() - trait_sample_data.append(results) - - trait_count = len(trait_sample_data[0]) - self.trait_data = collections.defaultdict(list) - - # put all of the separate data together into a dictionary where the keys are - # trait names and values are lists of sample values - for trait_counter in range(trait_count): - trait_name = trait_sample_data[0][trait_counter][0] - for chunk_counter in range(int(number_chunks)): - self.trait_data[trait_name] += ( - trait_sample_data[chunk_counter][trait_counter][data_start_pos:]) + #def get_trait_data(self): + # self.samplelist = self.group.samplelist + self.group.parlist + self.group.f1list + # query = """ + # SELECT Strain.Name, Strain.Id FROM Strain, Species + # WHERE Strain.Name IN {} + # and Strain.SpeciesId=Species.Id + # and Species.name = '{}' + # """.format(create_in_clause(self.samplelist), *mescape(self.group.species)) + # results = dict(g.db.execute(query).fetchall()) + # sample_ids = [results[item] for item in self.samplelist] + # + # # MySQL limits the number of tables that can be used in a join to 61, + # # so we break the sample ids into smaller chunks + # # Postgres doesn't have that limit, so we can get rid of this after we transition + # chunk_size = 50 + # number_chunks = int(math.ceil(len(sample_ids) / chunk_size)) + # trait_sample_data = [] + # for sample_ids_step in chunks.divide_into_chunks(sample_ids, number_chunks): + # + # #XZ, 09/24/2008: build one temporary table that only contains the records associated with the input GeneId + # #tempTable = None + # #if GeneId and db.type == "ProbeSet": + # # if method == "3": + # # tempTable = self.getTempLiteratureTable(species=species, + # # input_species_geneid=GeneId, + # # returnNumber=returnNumber) + # # + # # if method == "4" or method == "5": + # # tempTable = self.getTempTissueCorrTable(primaryTraitSymbol=GeneSymbol, + # # TissueProbeSetFreezeId=tissueProbeSetFreezeId, + # # method=method, + # # returnNumber=returnNumber) + # + # temp = ['T%s.value' % item for item in sample_ids_step] + # query = "SELECT {}.Name,".format(escape(self.type)) + # data_start_pos = 1 + # query += string.join(temp, ', ') + # query += ' FROM ({}, {}XRef, {}Freeze) '.format(*mescape(self.type, + # self.type, + # self.type)) + # + # for item in sample_ids_step: + # query += """ + # left join {}Data as T{} on T{}.Id = {}XRef.DataId + # and T{}.StrainId={}\n + # """.format(*mescape(self.type, item, item, self.type, item, item)) + # + # query += """ + # WHERE {}XRef.{}FreezeId = {}Freeze.Id + # and {}Freeze.Name = '{}' + # and {}.Id = {}XRef.{}Id + # order by {}.Id + # """.format(*mescape(self.type, self.type, self.type, self.type, + # self.name, self.type, self.type, self.type, self.type)) + # results = g.db.execute(query).fetchall() + # trait_sample_data.append(results) + # + # trait_count = len(trait_sample_data[0]) + # self.trait_data = collections.defaultdict(list) + # + # # put all of the separate data together into a dictionary where the keys are + # # trait names and values are lists of sample values + # for trait_counter in range(trait_count): + # trait_name = trait_sample_data[0][trait_counter][0] + # for chunk_counter in range(int(number_chunks)): + # self.trait_data[trait_name] += ( + # trait_sample_data[chunk_counter][trait_counter][data_start_pos:]) def get_trait_info(self, trait_list=None, species=''): diff --git a/wqflask/maintenance/quick_search_table.py b/wqflask/maintenance/quick_search_table.py index b07e7656..9cd792ef 100644 --- a/wqflask/maintenance/quick_search_table.py +++ b/wqflask/maintenance/quick_search_table.py @@ -71,9 +71,10 @@ class PublishXRef(Base): values['the_key'] = json.dumps([pub_row.Id, pub_row.InbredSetId]) values['terms'] = cls.get_unique_terms(pub_row.Id, pub_row.InbredSetId) print("terms is:", values['terms']) - values['result_fields'] = cls.get_result_fields(pub_row.Id, pub_row.InbredSetId) - ins = QuickSearch.insert().values(**values) - conn.execute(ins) + if values['terms']: + values['result_fields'] = cls.get_result_fields(pub_row.Id, pub_row.InbredSetId) + ins = QuickSearch.insert().values(**values) + conn.execute(ins) counter += 1 print("Done:", counter) @@ -100,28 +101,30 @@ class PublishXRef(Base): inbredset_id=inbredset_id).all() unique = set() - for item in results[0]: - #print("locals:", locals()) - if not item: - continue - for token in item.split(): - if token.startswith(('(','[')): - token = token[1:] - if token.endswith((')', ']')): - token = token[:-1] - if token.endswith(';'): - token = token[:-1] - if len(token) > 2: - try: - # This hopefully ensures that the token is utf-8 - token = token.encode('utf-8') - print(" ->", token) - except UnicodeDecodeError: - print("\n-- UDE \n") - # Can't get it into utf-8, we won't use it - continue - - unique.add(token) + print("results: ", results) + if len(results): + for item in results[0]: + #print("locals:", locals()) + if not item: + continue + for token in item.split(): + if token.startswith(('(','[')): + token = token[1:] + if token.endswith((')', ']')): + token = token[:-1] + if token.endswith(';'): + token = token[:-1] + if len(token) > 2: + try: + # This hopefully ensures that the token is utf-8 + token = token.encode('utf-8') + print(" ->", token) + except UnicodeDecodeError: + print("\n-- UDE \n") + # Can't get it into utf-8, we won't use it + continue + + unique.add(token) #print("\nUnique terms are: {}\n".format(unique)) return " ".join(unique) @@ -467,8 +470,8 @@ QuickSearch = sa.Table("QuickSearch", Metadata, mysql_engine = 'MyISAM', ) -#QuickSearch.drop(Engine, checkfirst=True) -#Metadata.create_all(Engine) +QuickSearch.drop(Engine, checkfirst=True) +Metadata.create_all(Engine) def row2dict(row): @@ -495,9 +498,10 @@ def main(): Add all items from the ProbeSetXRef, GenoXRef, and PublishXRef tables to the QuickSearch tables. """ + + GenoXRef.run() + PublishXRef.run() ProbeSetXRef.run() - #GenoXRef.run() - #PublishXRef.run() if __name__ == "__main__": main() \ No newline at end of file diff --git a/wqflask/wqflask/my_pylmm/pyLMM/lmm.py b/wqflask/wqflask/my_pylmm/pyLMM/lmm.py index 38a49f12..446683a4 100644 --- a/wqflask/wqflask/my_pylmm/pyLMM/lmm.py +++ b/wqflask/wqflask/my_pylmm/pyLMM/lmm.py @@ -237,6 +237,9 @@ def run(pheno_vector, with Bench("Calculate Kinship"): kinship_matrix = calculate_kinship(genotype_matrix, temp_data) + print("kinship_matrix: ", pf(kinship_matrix)) + print("kinship_matrix.shape: ", pf(kinship_matrix.shape)) + with Bench("Create LMM object"): lmm_ob = LMM(pheno_vector, kinship_matrix) -- cgit v1.2.3 From 7eb7c55b3d0effdfcd359f12447f99568407f086 Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Tue, 30 Jul 2013 17:07:16 -0500 Subject: Just added some print statements to debug an issue with LMM code Also added some to notes --- misc/gn_installation_notes.txt | 5 +++++ wqflask/base/data_set.py | 1 - wqflask/wqflask/my_pylmm/pyLMM/lmm.py | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) (limited to 'wqflask') diff --git a/misc/gn_installation_notes.txt b/misc/gn_installation_notes.txt index 91fe1781..6329586f 100644 --- a/misc/gn_installation_notes.txt +++ b/misc/gn_installation_notes.txt @@ -320,4 +320,9 @@ Run web server: Run server: python runserver.py +=========================================== + +To do full upgrade (as opposed to apt-get upgrade) +sudo aptitude full-upgrade + =========================================== \ No newline at end of file diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index 188a94a2..ffc77299 100755 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -400,7 +400,6 @@ class DataSet(object): # return self._group - def retrieve_other_names(self): """ If the data set name parameter is not found in the 'Name' field of the data set table, diff --git a/wqflask/wqflask/my_pylmm/pyLMM/lmm.py b/wqflask/wqflask/my_pylmm/pyLMM/lmm.py index 446683a4..bca90486 100644 --- a/wqflask/wqflask/my_pylmm/pyLMM/lmm.py +++ b/wqflask/wqflask/my_pylmm/pyLMM/lmm.py @@ -462,6 +462,7 @@ class LMM: x = True - np.isnan(Y) #pdb.set_trace() if not x.sum() == len(Y): + print("Removing %d missing values from Y\n" % ((True - x).sum())) if self.verbose: sys.stderr.write("Removing %d missing values from Y\n" % ((True - x).sum())) Y = Y[x] K = K[x,:][:,x] -- cgit v1.2.3 From cf42e71c07efc772c15956b75db374f0f2849cac Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Fri, 2 Aug 2013 17:55:39 -0500 Subject: Fixed a bug related to groups with genofiles (not sure if it makes sense for them not to have genofiles yet) --- wqflask/base/data_set.py | 6 ++++-- wqflask/maintenance/get_group_samplelists.py | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'wqflask') diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index ffc77299..58f08ae7 100755 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -260,7 +260,6 @@ class DatasetGroup(object): if maternal and paternal: self.parlist = [maternal, paternal] - def get_samplelist(self): key = "samplelist:v4:" + self.name print("key is:", key) @@ -275,7 +274,10 @@ class DatasetGroup(object): print(" self.samplelist: ", self.samplelist) else: print("Cache not hit") - self.samplelist = get_group_samplelists.get_samplelist(self.name + ".geno") + try: + self.samplelist = get_group_samplelists.get_samplelist(self.name + ".geno") + except IOError: + self.samplelist = None print("after get_samplelist") Redis.set(key, json.dumps(self.samplelist)) Redis.expire(key, 60*5) diff --git a/wqflask/maintenance/get_group_samplelists.py b/wqflask/maintenance/get_group_samplelists.py index 99e22904..c9ec3872 100644 --- a/wqflask/maintenance/get_group_samplelists.py +++ b/wqflask/maintenance/get_group_samplelists.py @@ -8,6 +8,8 @@ from base import webqtlConfig def process_genofiles(geno_dir=webqtlConfig.GENODIR): + print("Yabba") + #sys.exit("Dabba") os.chdir(geno_dir) for geno_file in glob.glob("*"): if geno_file.lower().endswith(('.geno', '.geno.gz')): -- cgit v1.2.3 From 8993b25262b7fc565c1be3548660a66afd4c3530 Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Wed, 7 Aug 2013 18:39:09 -0500 Subject: Fixed things with the dataset dropdowns and mRNA datasets Improved the templates for a couple pages related to changing user password, etc --- misc/notes.txt | 4 + wqflask/base/data_set.py | 36 +- wqflask/base/trait.py | 4 +- wqflask/base/webqtlConfig.py | 4 +- wqflask/maintenance/gen_select_dataset.py | 39 +- wqflask/wqflask/do_search.py | 4 +- wqflask/wqflask/my_pylmm/pyLMM/lmm.py | 10 +- .../new/javascript/dataset_menu_structure.json | 440 +-- .../static/new/javascript/dataset_select_menu.js | 2 +- wqflask/wqflask/static/new/javascript/login.js | 2 +- .../static/new/javascript/marker_regression.coffee | 3 +- .../static/new/javascript/marker_regression.js | 11 +- .../static/new/javascript/marker_regression_old.js | 226 ++ .../static/new/javascript/node_modules/.bin/cake | 1 + .../static/new/javascript/node_modules/.bin/coffee | 1 + .../node_modules/coffee-script/.npmignore | 11 + .../javascript/node_modules/coffee-script/CNAME | 1 + .../node_modules/coffee-script/CONTRIBUTING.md | 9 + .../javascript/node_modules/coffee-script/LICENSE | 22 + .../javascript/node_modules/coffee-script/README | 51 + .../javascript/node_modules/coffee-script/Rakefile | 79 + .../javascript/node_modules/coffee-script/bin/cake | 7 + .../node_modules/coffee-script/bin/coffee | 7 + .../node_modules/coffee-script/extras/jsl.conf | 44 + .../coffee-script/lib/coffee-script/browser.js | 101 + .../coffee-script/lib/coffee-script/cake.js | 113 + .../lib/coffee-script/coffee-script.js | 218 ++ .../coffee-script/lib/coffee-script/command.js | 506 ++++ .../coffee-script/lib/coffee-script/grammar.js | 623 ++++ .../coffee-script/lib/coffee-script/helpers.js | 150 + .../coffee-script/lib/coffee-script/index.js | 11 + .../coffee-script/lib/coffee-script/lexer.js | 905 ++++++ .../coffee-script/lib/coffee-script/nodes.js | 3088 ++++++++++++++++++++ .../coffee-script/lib/coffee-script/optparse.js | 138 + .../coffee-script/lib/coffee-script/parser.js | 608 ++++ .../coffee-script/lib/coffee-script/repl.js | 104 + .../coffee-script/lib/coffee-script/rewriter.js | 478 +++ .../coffee-script/lib/coffee-script/scope.js | 147 + .../coffee-script/lib/coffee-script/sourcemap.js | 237 ++ .../node_modules/coffee-script/package.json | 57 + .../wqflask/static/new/javascript/show_trait.js | 2 +- .../new/javascript/show_trait_mapping_tools.js | 2 +- wqflask/wqflask/static/new/javascript/stats.js | 2 +- wqflask/wqflask/static/new/javascript/thank_you.js | 2 +- .../wqflask/static/new/javascript/validation.js | 4 +- .../wqflask/templates/security/reset_password.html | 7 +- .../templates/security/send_confirmation.html | 5 + wqflask/wqflask/templates/security/thank_you.html | 2 +- wqflask/wqflask/views.py | 4 +- 49 files changed, 8266 insertions(+), 266 deletions(-) create mode 100644 wqflask/wqflask/static/new/javascript/marker_regression_old.js create mode 120000 wqflask/wqflask/static/new/javascript/node_modules/.bin/cake create mode 120000 wqflask/wqflask/static/new/javascript/node_modules/.bin/coffee create mode 100644 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/.npmignore create mode 100644 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/CNAME create mode 100644 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/CONTRIBUTING.md create mode 100644 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/LICENSE create mode 100644 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/README create mode 100644 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/Rakefile create mode 100755 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/bin/cake create mode 100755 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/bin/coffee create mode 100644 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/extras/jsl.conf create mode 100644 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/browser.js create mode 100644 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/cake.js create mode 100644 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/coffee-script.js create mode 100644 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/command.js create mode 100644 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/grammar.js create mode 100644 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/helpers.js create mode 100644 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/index.js create mode 100644 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/lexer.js create mode 100644 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/nodes.js create mode 100644 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/optparse.js create mode 100755 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/parser.js create mode 100644 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/repl.js create mode 100644 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/rewriter.js create mode 100644 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/scope.js create mode 100644 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/sourcemap.js create mode 100644 wqflask/wqflask/static/new/javascript/node_modules/coffee-script/package.json (limited to 'wqflask') diff --git a/misc/notes.txt b/misc/notes.txt index 9e61e527..ede8176b 100644 --- a/misc/notes.txt +++ b/misc/notes.txt @@ -288,3 +288,7 @@ MySQL Things - Create fulltext (MATCH AGAINST syntax) index: CREATE FULLTEXT INDEX __________ ON Table (Column); + +If <4 character searches not working: +Add ft_min_word_len = 2 (to make te minimum characters 2) to config file +Rebuild relevant tables with fulltext indexes with "REPAIR TABLE _______ QUICK" diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index 58f08ae7..017c6052 100755 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -436,7 +436,7 @@ class DataSet(object): except TypeError: print("Dataset {} is not yet available in GeneNetwork.".format(self.name)) pass - + def get_trait_data(self): self.samplelist = self.group.samplelist + self.group.parlist + self.group.f1list query = """ @@ -470,11 +470,18 @@ class DataSet(object): # method=method, # returnNumber=returnNumber) + if self.type == "Publish": + dataset_type = "Phenotype" + else: + dataset_type = self.type temp = ['T%s.value' % item for item in sample_ids_step] - query = "SELECT {}.Name,".format(escape(self.type)) + if self.type == "Publish": + query = "SELECT {}XRef.Id,".format(escape(self.type)) + else: + query = "SELECT {}.Name,".format(escape(dataset_type)) data_start_pos = 1 query += string.join(temp, ', ') - query += ' FROM ({}, {}XRef, {}Freeze) '.format(*mescape(self.type, + query += ' FROM ({}, {}XRef, {}Freeze) '.format(*mescape(dataset_type, self.type, self.type)) @@ -484,13 +491,22 @@ class DataSet(object): and T{}.StrainId={}\n """.format(*mescape(self.type, item, item, self.type, item, item)) - query += """ - WHERE {}XRef.{}FreezeId = {}Freeze.Id - and {}Freeze.Name = '{}' - and {}.Id = {}XRef.{}Id - order by {}.Id - """.format(*mescape(self.type, self.type, self.type, self.type, - self.name, self.type, self.type, self.type, self.type)) + if self.type == "Publish": + query += """ + WHERE {}XRef.InbredSetId = {}Freeze.InbredSetId + and {}Freeze.Name = '{}' + and {}.Id = {}XRef.PhenotypeId + order by {}.Id + """.format(*mescape(self.type, self.type, self.type, self.name, + dataset_type, self.type, dataset_type )) + else: + query += """ + WHERE {}XRef.{}FreezeId = {}Freeze.Id + and {}Freeze.Name = '{}' + and {}.Id = {}XRef.{}Id + order by {}.Id + """.format(*mescape(self.type, self.type, self.type, self.type, + self.name, dataset_type, self.type, self.type, dataset_type)) results = g.db.execute(query).fetchall() trait_sample_data.append(results) diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index a1e6b0d3..c893c887 100755 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -322,7 +322,7 @@ class GeneralTrait(object): #print(" mike: {} -> {} - {}".format(field, type(trait_info[i]), trait_info[i])) holder = trait_info[i] if isinstance(trait_info[i], basestring): - holder = unicode(trait_info[i], "utf8") + holder = unicode(trait_info[i], "utf8", "ignore") setattr(self, field, holder) if self.dataset.type == 'Publish': @@ -603,4 +603,4 @@ class GeneralTrait(object): else: ZValue = 0.5*log((1.0+self.correlation)/(1.0-self.correlation)) ZValue = ZValue*sqrt(self.overlap-3) - self.p_value = 2.0*(1.0 - reaper.normp(abs(ZValue))) + self.p_value = 2.0*(1.0 - reaper.normp(abs(ZValue))) \ No newline at end of file diff --git a/wqflask/base/webqtlConfig.py b/wqflask/base/webqtlConfig.py index 67a9c63f..23d32233 100755 --- a/wqflask/base/webqtlConfig.py +++ b/wqflask/base/webqtlConfig.py @@ -53,8 +53,8 @@ GNROOT = "/home/zas1024/gene/" # Will remove this and dependent items later SECUREDIR = GNROOT + 'secure/' COMMON_LIB = GNROOT + 'support/admin' HTMLPATH = GNROOT + 'web/' -PYLMM_PATH = '/home/zas1024/' -SNP_PATH = '/mnt/xvdf1/snps/' +PYLMM_PATH = '/home/zas1024/plink/' +SNP_PATH = '/home/zas1024/snps/' IMGDIR = HTMLPATH +'image/' IMAGESPATH = HTMLPATH + 'images/' UPLOADPATH = IMAGESPATH + 'upload/' diff --git a/wqflask/maintenance/gen_select_dataset.py b/wqflask/maintenance/gen_select_dataset.py index d4e47327..ad560659 100644 --- a/wqflask/maintenance/gen_select_dataset.py +++ b/wqflask/maintenance/gen_select_dataset.py @@ -99,12 +99,14 @@ def get_groups(species): def get_types(groups): """Build types list""" types = {} + print("Groups: ", pf(groups)) for species, group_dict in groups.iteritems(): types[species] = {} for group_name, _group_full_name in group_dict: # make group an alias to shorten the code types[species][group_name] = [("Phenotypes", "Phenotypes"), ("Genotypes", "Genotypes")] types[species][group_name] += build_types(species, group_name) + return types @@ -115,7 +117,17 @@ def build_types(species, group): (all types except phenotype/genotype are tissues) """ - Cursor.execute("""select distinct Tissue.Name, concat(Tissue.Name, ' mRNA') + + print("""select distinct Tissue.Name + from ProbeFreeze, ProbeSetFreeze, InbredSet, Tissue, Species + where Species.Name = '{}' and Species.Id = InbredSet.SpeciesId and + InbredSet.Name = '{}' and + ProbeFreeze.TissueId = Tissue.Id and + ProbeFreeze.InbredSetId = InbredSet.Id and + ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id and + ProbeSetFreeze.public > 0 + order by Tissue.Name""".format(species, group)) + Cursor.execute("""select distinct Tissue.Name from ProbeFreeze, ProbeSetFreeze, InbredSet, Tissue, Species where Species.Name = %s and Species.Id = InbredSet.SpeciesId and InbredSet.Name = %s and @@ -124,8 +136,13 @@ def build_types(species, group): ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id and ProbeSetFreeze.public > 0 order by Tissue.Name""", (species, group)) - return Cursor.fetchall() - + + results = [] + for result in Cursor.fetchall(): + if len(result): + results.append((result[0], result[0])) + + return results def get_datasets(types): """Build datasets list""" @@ -133,9 +150,10 @@ def get_datasets(types): for species, group_dict in types.iteritems(): datasets[species] = {} for group, type_list in group_dict.iteritems(): + print("type_list: ", type_list) datasets[species][group] = {} - for type_name, _type_full_name in type_list: - datasets[species][group][type_name] = build_datasets(species, group, type_name) + for type_name in type_list: + datasets[species][group][type_name[0]] = build_datasets(species, group, type_name[0]) return datasets @@ -156,6 +174,14 @@ def build_datasets(species, group, type_name): if dataset_value: return [(dataset_value, dataset_text)] else: + print("""select ProbeSetFreeze.Name, ProbeSetFreeze.FullName from + ProbeSetFreeze, ProbeFreeze, InbredSet, Tissue, Species where + Species.Name = '{}' and Species.Id = InbredSet.SpeciesId and + InbredSet.Name = '{}' and + ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id and Tissue.Name = '{}' + and ProbeFreeze.TissueId = Tissue.Id and ProbeFreeze.InbredSetId = + InbredSet.Id and ProbeSetFreeze.public > 0 order by + ProbeSetFreeze.CreateTime desc""".format(species, group, type_name)) Cursor.execute("""select ProbeSetFreeze.Name, ProbeSetFreeze.FullName from ProbeSetFreeze, ProbeFreeze, InbredSet, Tissue, Species where Species.Name = %s and Species.Id = InbredSet.SpeciesId and @@ -163,8 +189,7 @@ def build_datasets(species, group, type_name): ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id and Tissue.Name = %s and ProbeFreeze.TissueId = Tissue.Id and ProbeFreeze.InbredSetId = InbredSet.Id and ProbeSetFreeze.public > 0 order by - ProbeSetFreeze.CreateTime desc""", ( - species, group, type_name)) + ProbeSetFreeze.CreateTime desc""", (species, group, type_name)) return Cursor.fetchall() diff --git a/wqflask/wqflask/do_search.py b/wqflask/wqflask/do_search.py index 7b3e0869..5eb09aa1 100644 --- a/wqflask/wqflask/do_search.py +++ b/wqflask/wqflask/do_search.py @@ -36,7 +36,7 @@ class DoSearch(object): def execute(self, query): """Executes query and returns results""" query = self.normalize_spaces(query) - #print("in do_search query is:", pf(query)) + print("in do_search query is:", pf(query)) results = g.db.execute(query, no_parameters=True).fetchall() #results = self.cursor.fetchall() return results @@ -90,7 +90,7 @@ class QuickMrnaAssaySearch(DoSearch): AGAINST ('%s' IN BOOLEAN MODE)) """ % (escape(self.search_term[0])) - #print("final query is:", pf(query)) + print("final query is:", pf(query)) return self.execute(query) diff --git a/wqflask/wqflask/my_pylmm/pyLMM/lmm.py b/wqflask/wqflask/my_pylmm/pyLMM/lmm.py index bca90486..9a795c66 100644 --- a/wqflask/wqflask/my_pylmm/pyLMM/lmm.py +++ b/wqflask/wqflask/my_pylmm/pyLMM/lmm.py @@ -368,9 +368,9 @@ def GWAS(pheno_vector, if v.sum(): keep = True - v pheno_vector = pheno_vector[keep] - genotype_matrix = genotype_matrix[keep,:] - covariate_matrix = covariate_matrix[keep,:] - kinship_matrix = kinship_matrix[keep,:][:,keep] + #genotype_matrix = genotype_matrix[keep,:] + #covariate_matrix = covariate_matrix[keep,:] + #kinship_matrix = kinship_matrix[keep,:][:,keep] kinship_eigen_vals = [] kinship_eigen_vectors = [] @@ -465,7 +465,9 @@ class LMM: print("Removing %d missing values from Y\n" % ((True - x).sum())) if self.verbose: sys.stderr.write("Removing %d missing values from Y\n" % ((True - x).sum())) Y = Y[x] - K = K[x,:][:,x] + print("x: ", len(x)) + print("K: ", K.shape) + #K = K[x,:][:,x] X0 = X0[x,:] Kva = [] Kve = [] diff --git a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json index 4aae20ba..43575a18 100644 --- a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json +++ b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json @@ -63,14 +63,14 @@ ] ], "Leaf mRNA": [ - [ - "B1LI0809R", - "Barley1 Leaf INOC TTKS (Aug09) RMA" - ], [ "B1LI0809M5", "Barley1 Leaf INOC TTKS (Aug09) MAS5" ], + [ + "B1LI0809R", + "Barley1 Leaf INOC TTKS (Aug09) RMA" + ], [ "B1MI0809M5", "Barley1 Leaf MOCK TTKS (Aug09) MAS5" @@ -113,13 +113,13 @@ "B30_K_1206_M", "Barley1 Leaf MAS 5.0 SCRI (Dec06)" ], - [ - "B30_K_1206_Rn", - "Barley1 Leaf gcRMAn SCRI (Dec06)" - ], [ "B30_K_1206_R", "Barley1 Leaf gcRMA SCRI (Dec06)" + ], + [ + "B30_K_1206_Rn", + "Barley1 Leaf gcRMAn SCRI (Dec06)" ] ], "Phenotypes": [ @@ -211,14 +211,14 @@ }, "AD-cases-controls-Myers": { "Brain mRNA": [ - [ - "GSE15222_F_A_RI_0409", - "GSE15222 Human Brain Alzheimer Myers (Apr09) RankInv" - ], [ "GSE15222_F_N_RI_0409", "GSE15222 Human Brain Normal Myers (Apr09) RankInv" ], + [ + "GSE15222_F_A_RI_0409", + "GSE15222 Human Brain Alzheimer Myers (Apr09) RankInv" + ], [ "GSE15222_F_RI_0409", "GSE15222 Human Brain Myers (Apr09) RankInv" @@ -589,13 +589,13 @@ "NCI_Agil_Mam_Tum_RMA_0409", "NCI Mammary LMT miRNA v2 (Apr09) RMA" ], - [ - "MA_M_0704_R", - "NCI Mammary mRNA M430 (July04) RMA" - ], [ "MA_M_0704_M", "NCI Mammary mRNA M430 (July04) MAS5" + ], + [ + "MA_M_0704_R", + "NCI Mammary mRNA M430 (July04) RMA" ] ], "Phenotypes": [ @@ -651,13 +651,13 @@ ] ], "Liver mRNA": [ - [ - "LVF2_M_0704_R", - "(B6 x BTBR)F2-ob/ob Liver mRNA M430 (Jul04) RMA" - ], [ "LVF2_M_0704_M", "(B6 x BTBR)F2-ob/ob Liver mRNA M430 (Jul04) MAS5" + ], + [ + "LVF2_M_0704_R", + "(B6 x BTBR)F2-ob/ob Liver mRNA M430 (Jul04) RMA" ] ], "Phenotypes": [ @@ -669,6 +669,10 @@ }, "B6D2F2": { "Brain mRNA": [ + [ + "BRF2_M_0805_P", + "OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) PDNN" + ], [ "BRF2_M_0805_R", "OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) RMA" @@ -677,21 +681,17 @@ "BRF2_M_0805_M", "OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) MAS5" ], - [ - "BRF2_M_0805_P", - "OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) PDNN" - ], [ "BRF2_M_0304_P", "OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) PDNN" ], - [ - "BRF2_M_0304_R", - "OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) RMA" - ], [ "BRF2_M_0304_M", "OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) MAS5" + ], + [ + "BRF2_M_0304_R", + "OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) RMA" ] ], "Genotypes": [ @@ -793,10 +793,6 @@ ] ], "Striatum mRNA": [ - [ - "SA_M2_0905_R", - "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) RMA" - ], [ "SA_M2_0905_M", "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) MAS5" @@ -804,33 +800,37 @@ [ "SA_M2_0905_P", "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) PDNN" + ], + [ + "SA_M2_0905_R", + "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) RMA" ] ] }, "BHF2": { "Adipose mRNA": [ - [ - "UCLA_BHF2_ADIPOSE_MALE", - "UCLA BHF2 Adipose Male mlratio" - ], [ "UCLA_BHF2_ADIPOSE_FEMALE", "UCLA BHF2 Adipose Female mlratio" ], + [ + "UCLA_BHF2_ADIPOSE_MALE", + "UCLA BHF2 Adipose Male mlratio" + ], [ "UCLA_BHF2_ADIPOSE_0605", "UCLA BHF2 Adipose (June05) mlratio" ] ], "Brain mRNA": [ - [ - "UCLA_BHF2_BRAIN_MALE", - "UCLA BHF2 Brain Male mlratio" - ], [ "UCLA_BHF2_BRAIN_FEMALE", "UCLA BHF2 Brain Female mlratio" ], + [ + "UCLA_BHF2_BRAIN_MALE", + "UCLA BHF2 Brain Male mlratio" + ], [ "UCLA_BHF2_BRAIN_0605", "UCLA BHF2 Brain (June05) mlratio" @@ -843,28 +843,28 @@ ] ], "Liver mRNA": [ - [ - "UCLA_BHF2_LIVER_MALE", - "UCLA BHF2 Liver Male mlratio" - ], [ "UCLA_BHF2_LIVER_FEMALE", "UCLA BHF2 Liver Female mlratio" ], + [ + "UCLA_BHF2_LIVER_MALE", + "UCLA BHF2 Liver Male mlratio" + ], [ "UCLA_BHF2_LIVER_0605", "UCLA BHF2 Liver (June05) mlratio" ] ], "Muscle mRNA": [ - [ - "UCLA_BHF2_MUSCLE_MALE", - "UCLA BHF2 Muscle Male mlratio **" - ], [ "UCLA_BHF2_MUSCLE_FEMALE", "UCLA BHF2 Muscle Female mlratio **" ], + [ + "UCLA_BHF2_MUSCLE_MALE", + "UCLA BHF2 Muscle Male mlratio **" + ], [ "UCLA_BHF2_MUSCLE_0605", "UCLA BHF2 Muscle (June05) mlratio **" @@ -999,14 +999,14 @@ ] ], "Brain mRNA": [ - [ - "UTHSC_BXD_WB_RNASeq1112", - "UTHSC Mouse BXD Whole Brain RNA Sequence (Nov12) RPKM" - ], [ "UTHSC_BXD_WB_RNASeqEx1112", "UTHSC Mouse BXD Whole Brain RNA Sequence Exon Level (Nov12) RPKM" ], + [ + "UTHSC_BXD_WB_RNASeq1112", + "UTHSC Mouse BXD Whole Brain RNA Sequence (Nov12) RPKM" + ], [ "BR_M2_1106_R", "UCHSC BXD Whole Brain M430 2.0 (Nov06) RMA" @@ -1015,6 +1015,10 @@ "BR_U_1105_P", "UTHSC Brain mRNA U74Av2 (Nov05) PDNN" ], + [ + "BR_U_0805_P", + "UTHSC Brain mRNA U74Av2 (Aug05) PDNN" + ], [ "BR_U_0805_M", "UTHSC Brain mRNA U74Av2 (Aug05) MAS5" @@ -1023,10 +1027,6 @@ "BR_U_0805_R", "UTHSC Brain mRNA U74Av2 (Aug05) RMA" ], - [ - "BR_U_0805_P", - "UTHSC Brain mRNA U74Av2 (Aug05) PDNN" - ], [ "CB_M_0204_P", "INIA Brain mRNA M430 (Feb04) PDNN" @@ -1137,6 +1137,10 @@ "Eye_M2_0908_R_ND", "Eye M430v2 WT Gpnmb (Sep08) RMA **" ], + [ + "Eye_M2_0908_WTWT", + "Eye M430v2 WT WT (Sep08) RMA **" + ], [ "Eye_M2_0908_R_WT", "Eye M430v2 WT Tyrp1 (Sep08) RMA **" @@ -1149,10 +1153,6 @@ "Eye_M2_0908_R_MT", "Eye M430v2 Mutant Tyrp1 (Sep08) RMA **" ], - [ - "Eye_M2_0908_WTWT", - "Eye M430v2 WT WT (Sep08) RMA **" - ], [ "BXD_GLA_0911", "BXD Glaucoma Affy M430 2.0 Trial (Sep11) RMA **" @@ -1291,14 +1291,14 @@ ] ], "Kidney mRNA": [ - [ - "MA_M2F_0706_R", - "Mouse kidney M430v2 Female (Aug06) RMA" - ], [ "MA_M2M_0706_R", "Mouse kidney M430v2 Male (Aug06) RMA" ], + [ + "MA_M2F_0706_R", + "Mouse kidney M430v2 Female (Aug06) RMA" + ], [ "MA_M2_0806_R", "Mouse kidney M430v2 Sex Balanced (Aug06) RMA" @@ -1307,13 +1307,13 @@ "MA_M2_0806_P", "Mouse Kidney M430v2 Sex Balanced (Aug06) PDNN" ], - [ - "MA_M2_0706_P", - "Mouse Kidney M430v2 (Jul06) PDNN" - ], [ "MA_M2_0706_R", "Mouse Kidney M430v2 (Jul06) RMA" + ], + [ + "MA_M2_0706_P", + "Mouse Kidney M430v2 (Jul06) PDNN" ] ], "Leucocytes mRNA": [ @@ -1461,14 +1461,14 @@ ] ], "Neocortex mRNA": [ - [ - "DevNeocortex_ILM6.2P14RInv_1111", - "BIDMC/UTHSC Dev Neocortex P14 ILMv6.2 (Nov11) RankInv" - ], [ "DevNeocortex_ILM6.2P3RInv_1111", "BIDMC/UTHSC Dev Neocortex P3 ILMv6.2 (Nov11) RankInv" ], + [ + "DevNeocortex_ILM6.2P14RInv_1111", + "BIDMC/UTHSC Dev Neocortex P14 ILMv6.2 (Nov11) RankInv" + ], [ "HQFNeoc_1210v2_RankInv", "HQF BXD Neocortex ILM6v1.1 (Dec10v2) RankInv" @@ -1481,13 +1481,13 @@ "HQFNeoc_0208_RankInv", "HQF BXD Neocortex ILM6v1.1 (Feb08) RankInv" ], - [ - "DevNeocortex_ILM6.2P3RInv_1110", - "BIDMC/UTHSC Dev Neocortex P3 ILMv6.2 (Nov10) RankInv" - ], [ "DevNeocortex_ILM6.2P14RInv_1110", "BIDMC/UTHSC Dev Neocortex P14 ILMv6.2 (Nov10) RankInv" + ], + [ + "DevNeocortex_ILM6.2P3RInv_1110", + "BIDMC/UTHSC Dev Neocortex P3 ILMv6.2 (Nov10) RankInv" ] ], "Nucleus Accumbens mRNA": [ @@ -1597,13 +1597,13 @@ "B6D2ONCILM_0412", "B6D2 ONC Retina (April 2012) RankInv **" ], - [ - "HEIONCvsCRetILM6_0911", - "HEI ONC vs Control Retina Illumina V6.2 (Sep11) RankInv **" - ], [ "G2HEIONCRetILM6_0911", "G2 HEI ONC Retina Illumina V6.2 (Sep11) RankInv **" + ], + [ + "HEIONCvsCRetILM6_0911", + "HEI ONC vs Control Retina Illumina V6.2 (Sep11) RankInv **" ] ], "Spleen mRNA": [ @@ -1689,13 +1689,13 @@ "DevStriatum_ILM6.2P14RInv_1111", "BIDMC/UTHSC Dev Striatum P14 ILMv6.2 (Nov11) RankInv **" ], - [ - "DevStriatum_ILM6.2P14RInv_1110", - "BIDMC/UTHSC Dev Striatum P14 ILMv6.2 (Nov10) RankInv **" - ], [ "DevStriatum_ILM6.2P3RInv_1110", "BIDMC/UTHSC Dev Striatum P3 ILMv6.2 (Nov10) RankInv **" + ], + [ + "DevStriatum_ILM6.2P14RInv_1110", + "BIDMC/UTHSC Dev Striatum P14 ILMv6.2 (Nov10) RankInv **" ] ], "T Cell (helper) mRNA": [ @@ -1717,10 +1717,6 @@ ] ], "Ventral Tegmental Area mRNA": [ - [ - "VCUEtOH_0609_R", - "VCU BXD VTA EtOH M430 2.0 (Jun09) RMA **" - ], [ "VCUSal_0609_R", "VCU BXD VTA Sal M430 2.0 (Jun09) RMA **" @@ -1728,6 +1724,10 @@ [ "VCUEtvsSal_0609_R", "VCU BXD VTA Et vs Sal M430 2.0 (Jun09) Sscore **" + ], + [ + "VCUEtOH_0609_R", + "VCU BXD VTA EtOH M430 2.0 (Jun09) RMA **" ] ] }, @@ -1863,13 +1863,13 @@ ] ], "Hippocampus mRNA": [ - [ - "HC_M2CB_1205_R", - "Hippocampus Consortium M430v2 CXB (Dec05) RMA" - ], [ "HC_M2CB_1205_P", "Hippocampus Consortium M430v2 CXB (Dec05) PDNN" + ], + [ + "HC_M2CB_1205_R", + "Hippocampus Consortium M430v2 CXB (Dec05) RMA" ] ], "Phenotypes": [ @@ -1973,6 +1973,14 @@ "Hipp_Illumina_RankInv_0507", "Hippocampus Illumina (May07) RankInv" ], + [ + "Illum_LXS_Hipp_NOE_1008", + "Hippocampus Illumina NOE (Oct08) RankInv beta" + ], + [ + "Illum_LXS_Hipp_RSS_1008", + "Hippocampus Illumina RSS (Oct08) RankInv beta" + ], [ "Illum_LXS_Hipp_NOS_1008", "Hippocampus Illumina NOS (Oct08) RankInv beta" @@ -1984,14 +1992,6 @@ [ "Illum_LXS_Hipp_RSE_1008", "Hippocampus Illumina RSE (Oct08) RankInv beta" - ], - [ - "Illum_LXS_Hipp_NOE_1008", - "Hippocampus Illumina NOE (Oct08) RankInv beta" - ], - [ - "Illum_LXS_Hipp_RSS_1008", - "Hippocampus Illumina RSS (Oct08) RankInv beta" ] ], "Phenotypes": [ @@ -2001,10 +2001,6 @@ ] ], "Prefrontal Cortex mRNA": [ - [ - "VCUEtOH_0806_R", - "VCU LXS PFC EtOH M430A 2.0 (Aug06) RMA **" - ], [ "VCUSal_0806_R", "VCU LXS PFC Sal M430A 2.0 (Aug06) RMA" @@ -2012,6 +2008,10 @@ [ "VCUEt_vs_Sal_0806_R", "VCU LXS PFC Et vs Sal M430A 2.0 (Aug06) Sscore **" + ], + [ + "VCUEtOH_0806_R", + "VCU LXS PFC EtOH M430A 2.0 (Aug06) RMA **" ] ] }, @@ -2035,13 +2035,13 @@ ] ], "Hippocampus mRNA": [ - [ - "UMUTAffyExon_0209_RMA_MDP", - "UMUTAffy Hippocampus Exon (Feb09) RMA MDP" - ], [ "HC_M2_0606_MDP", "Hippocampus Consortium M430v2 (Jun06) RMA MDP" + ], + [ + "UMUTAffyExon_0209_RMA_MDP", + "UMUTAffy Hippocampus Exon (Feb09) RMA MDP" ] ], "Liver mRNA": [ @@ -2556,7 +2556,7 @@ ], [ "Leaf mRNA", - "Leaf mRNA mRNA" + "Leaf mRNA" ] ], "SXM": [ @@ -2570,11 +2570,11 @@ ], [ "Embryo mRNA", - "Embryo mRNA mRNA" + "Embryo mRNA" ], [ "Leaf mRNA", - "Leaf mRNA mRNA" + "Leaf mRNA" ] ] }, @@ -2590,7 +2590,7 @@ ], [ "Whole Body mRNA", - "Whole Body mRNA mRNA" + "Whole Body mRNA" ] ], "Oregon-R_x_2b3": [ @@ -2604,7 +2604,7 @@ ], [ "Whole Body mRNA", - "Whole Body mRNA mRNA" + "Whole Body mRNA" ] ] }, @@ -2620,7 +2620,7 @@ ], [ "Brain mRNA", - "Brain mRNA mRNA" + "Brain mRNA" ] ], "AD-cases-controls-Myers": [ @@ -2634,7 +2634,7 @@ ], [ "Brain mRNA", - "Brain mRNA mRNA" + "Brain mRNA" ] ], "CANDLE": [ @@ -2648,11 +2648,11 @@ ], [ "Methylation", - "Methylation mRNA" + "Methylation" ], [ "Newborn Cord Blood mRNA", - "Newborn Cord Blood mRNA mRNA" + "Newborn Cord Blood mRNA" ] ], "CEPH-2004": [ @@ -2666,7 +2666,7 @@ ], [ "Lymphoblast B-cell mRNA", - "Lymphoblast B-cell mRNA mRNA" + "Lymphoblast B-cell mRNA" ] ], "HB": [ @@ -2680,15 +2680,15 @@ ], [ "Cerebellum mRNA", - "Cerebellum mRNA mRNA" + "Cerebellum mRNA" ], [ "Prefrontal Cortex mRNA", - "Prefrontal Cortex mRNA mRNA" + "Prefrontal Cortex mRNA" ], [ "Primary Visual Cortex mRNA", - "Primary Visual Cortex mRNA mRNA" + "Primary Visual Cortex mRNA" ] ], "HLC": [ @@ -2702,7 +2702,7 @@ ], [ "Liver mRNA", - "Liver mRNA mRNA" + "Liver mRNA" ] ], "HLT": [ @@ -2716,7 +2716,7 @@ ], [ "Lung mRNA", - "Lung mRNA mRNA" + "Lung mRNA" ] ], "HSB": [ @@ -2730,67 +2730,67 @@ ], [ "Amygdala mRNA", - "Amygdala mRNA mRNA" + "Amygdala mRNA" ], [ "Cerebellar Cortex mRNA", - "Cerebellar Cortex mRNA mRNA" + "Cerebellar Cortex mRNA" ], [ "Dorsolateral Prefrontal Cortex mRNA", - "Dorsolateral Prefrontal Cortex mRNA mRNA" + "Dorsolateral Prefrontal Cortex mRNA" ], [ "Hippocampus mRNA", - "Hippocampus mRNA mRNA" + "Hippocampus mRNA" ], [ "Inferior Temporal Cortex mRNA", - "Inferior Temporal Cortex mRNA mRNA" + "Inferior Temporal Cortex mRNA" ], [ "Medial Prefrontal Cortex mRNA", - "Medial Prefrontal Cortex mRNA mRNA" + "Medial Prefrontal Cortex mRNA" ], [ "Mediodorsal Nucleus of Thalamus mRNA", - "Mediodorsal Nucleus of Thalamus mRNA mRNA" + "Mediodorsal Nucleus of Thalamus mRNA" ], [ "Orbital Prefrontal Cortex mRNA", - "Orbital Prefrontal Cortex mRNA mRNA" + "Orbital Prefrontal Cortex mRNA" ], [ "Posterior Inferior Parietal Cortex mRNA", - "Posterior Inferior Parietal Cortex mRNA mRNA" + "Posterior Inferior Parietal Cortex mRNA" ], [ "Posterior Superior Temporal Cortex mRNA", - "Posterior Superior Temporal Cortex mRNA mRNA" + "Posterior Superior Temporal Cortex mRNA" ], [ "Primary Auditory (A1) Cortex mRNA", - "Primary Auditory (A1) Cortex mRNA mRNA" + "Primary Auditory (A1) Cortex mRNA" ], [ "Primary Motor (M1) Cortex mRNA", - "Primary Motor (M1) Cortex mRNA mRNA" + "Primary Motor (M1) Cortex mRNA" ], [ "Primary Somatosensory (S1) Cortex mRNA", - "Primary Somatosensory (S1) Cortex mRNA mRNA" + "Primary Somatosensory (S1) Cortex mRNA" ], [ "Primary Visual Cortex mRNA", - "Primary Visual Cortex mRNA mRNA" + "Primary Visual Cortex mRNA" ], [ "Striatum mRNA", - "Striatum mRNA mRNA" + "Striatum mRNA" ], [ "Ventrolateral Prefrontal Cortex mRNA", - "Ventrolateral Prefrontal Cortex mRNA mRNA" + "Ventrolateral Prefrontal Cortex mRNA" ] ] }, @@ -2806,23 +2806,23 @@ ], [ "Amygdala mRNA", - "Amygdala mRNA mRNA" + "Amygdala mRNA" ], [ "Brain mRNA", - "Brain mRNA mRNA" + "Brain mRNA" ], [ "Hippocampus mRNA", - "Hippocampus mRNA mRNA" + "Hippocampus mRNA" ], [ "Nucleus Accumbens mRNA", - "Nucleus Accumbens mRNA mRNA" + "Nucleus Accumbens mRNA" ], [ "Prefrontal Cortex mRNA", - "Prefrontal Cortex mRNA mRNA" + "Prefrontal Cortex mRNA" ] ] }, @@ -2838,7 +2838,7 @@ ], [ "Mammary Tumors mRNA", - "Mammary Tumors mRNA mRNA" + "Mammary Tumors mRNA" ] ], "AXBXA": [ @@ -2852,19 +2852,19 @@ ], [ "Bone Femur mRNA", - "Bone Femur mRNA mRNA" + "Bone Femur mRNA" ], [ "Eye mRNA", - "Eye mRNA mRNA" + "Eye mRNA" ], [ "Heart mRNA", - "Heart mRNA mRNA" + "Heart mRNA" ], [ "Liver mRNA", - "Liver mRNA mRNA" + "Liver mRNA" ] ], "B6BTBRF2": [ @@ -2878,7 +2878,7 @@ ], [ "Liver mRNA", - "Liver mRNA mRNA" + "Liver mRNA" ] ], "B6D2F2": [ @@ -2892,7 +2892,7 @@ ], [ "Brain mRNA", - "Brain mRNA mRNA" + "Brain mRNA" ] ], "B6D2F2-PSU": [ @@ -2906,7 +2906,7 @@ ], [ "Muscle mRNA", - "Muscle mRNA mRNA" + "Muscle mRNA" ] ], "B6D2RI": [ @@ -2920,7 +2920,7 @@ ], [ "Hippocampus mRNA", - "Hippocampus mRNA mRNA" + "Hippocampus mRNA" ] ], "BDF2-1999": [ @@ -2934,7 +2934,7 @@ ], [ "Liver mRNA", - "Liver mRNA mRNA" + "Liver mRNA" ] ], "BDF2-2005": [ @@ -2948,7 +2948,7 @@ ], [ "Striatum mRNA", - "Striatum mRNA mRNA" + "Striatum mRNA" ] ], "BHF2": [ @@ -2962,19 +2962,19 @@ ], [ "Adipose mRNA", - "Adipose mRNA mRNA" + "Adipose mRNA" ], [ "Brain mRNA", - "Brain mRNA mRNA" + "Brain mRNA" ], [ "Liver mRNA", - "Liver mRNA mRNA" + "Liver mRNA" ], [ "Muscle mRNA", - "Muscle mRNA mRNA" + "Muscle mRNA" ] ], "BHHBF2": [ @@ -2988,19 +2988,19 @@ ], [ "Adipose mRNA", - "Adipose mRNA mRNA" + "Adipose mRNA" ], [ "Brain mRNA", - "Brain mRNA mRNA" + "Brain mRNA" ], [ "Liver mRNA", - "Liver mRNA mRNA" + "Liver mRNA" ], [ "Muscle mRNA", - "Muscle mRNA mRNA" + "Muscle mRNA" ] ], "BXD": [ @@ -3014,119 +3014,119 @@ ], [ "Adrenal Gland mRNA", - "Adrenal Gland mRNA mRNA" + "Adrenal Gland mRNA" ], [ "Amygdala mRNA", - "Amygdala mRNA mRNA" + "Amygdala mRNA" ], [ "Bone Femur mRNA", - "Bone Femur mRNA mRNA" + "Bone Femur mRNA" ], [ "Brain mRNA", - "Brain mRNA mRNA" + "Brain mRNA" ], [ "Cartilage mRNA", - "Cartilage mRNA mRNA" + "Cartilage mRNA" ], [ "Cerebellum mRNA", - "Cerebellum mRNA mRNA" + "Cerebellum mRNA" ], [ "Eye mRNA", - "Eye mRNA mRNA" + "Eye mRNA" ], [ "Hematopoietic Cells mRNA", - "Hematopoietic Cells mRNA mRNA" + "Hematopoietic Cells mRNA" ], [ "Hippocampus mRNA", - "Hippocampus mRNA mRNA" + "Hippocampus mRNA" ], [ "Hypothalamus mRNA", - "Hypothalamus mRNA mRNA" + "Hypothalamus mRNA" ], [ "Kidney mRNA", - "Kidney mRNA mRNA" + "Kidney mRNA" ], [ "Leucocytes mRNA", - "Leucocytes mRNA mRNA" + "Leucocytes mRNA" ], [ "Liver mRNA", - "Liver mRNA mRNA" + "Liver mRNA" ], [ "Liver Proteome", - "Liver Proteome mRNA" + "Liver Proteome" ], [ "Lung mRNA", - "Lung mRNA mRNA" + "Lung mRNA" ], [ "Midbrain mRNA", - "Midbrain mRNA mRNA" + "Midbrain mRNA" ], [ "Muscle mRNA", - "Muscle mRNA mRNA" + "Muscle mRNA" ], [ "Neocortex mRNA", - "Neocortex mRNA mRNA" + "Neocortex mRNA" ], [ "Nucleus Accumbens mRNA", - "Nucleus Accumbens mRNA mRNA" + "Nucleus Accumbens mRNA" ], [ "Pituitary Gland mRNA", - "Pituitary Gland mRNA mRNA" + "Pituitary Gland mRNA" ], [ "Popliteal Lymph Node mRNA", - "Popliteal Lymph Node mRNA mRNA" + "Popliteal Lymph Node mRNA" ], [ "Prefrontal Cortex mRNA", - "Prefrontal Cortex mRNA mRNA" + "Prefrontal Cortex mRNA" ], [ "Retina mRNA", - "Retina mRNA mRNA" + "Retina mRNA" ], [ "Spleen mRNA", - "Spleen mRNA mRNA" + "Spleen mRNA" ], [ "Striatum mRNA", - "Striatum mRNA mRNA" + "Striatum mRNA" ], [ "T Cell (helper) mRNA", - "T Cell (helper) mRNA mRNA" + "T Cell (helper) mRNA" ], [ "T Cell (regulatory) mRNA", - "T Cell (regulatory) mRNA mRNA" + "T Cell (regulatory) mRNA" ], [ "Thymus mRNA", - "Thymus mRNA mRNA" + "Thymus mRNA" ], [ "Ventral Tegmental Area mRNA", - "Ventral Tegmental Area mRNA mRNA" + "Ventral Tegmental Area mRNA" ] ], "BXH": [ @@ -3140,15 +3140,15 @@ ], [ "Bone Femur mRNA", - "Bone Femur mRNA mRNA" + "Bone Femur mRNA" ], [ "Cartilage mRNA", - "Cartilage mRNA mRNA" + "Cartilage mRNA" ], [ "Liver mRNA", - "Liver mRNA mRNA" + "Liver mRNA" ] ], "C57BL-6JxC57BL-6NJF2": [ @@ -3172,19 +3172,19 @@ ], [ "Adipose mRNA", - "Adipose mRNA mRNA" + "Adipose mRNA" ], [ "Brain mRNA", - "Brain mRNA mRNA" + "Brain mRNA" ], [ "Liver mRNA", - "Liver mRNA mRNA" + "Liver mRNA" ], [ "Muscle mRNA", - "Muscle mRNA mRNA" + "Muscle mRNA" ] ], "CXB": [ @@ -3198,11 +3198,11 @@ ], [ "Hippocampus mRNA", - "Hippocampus mRNA mRNA" + "Hippocampus mRNA" ], [ "Spleen mRNA", - "Spleen mRNA mRNA" + "Spleen mRNA" ] ], "HS": [ @@ -3216,15 +3216,15 @@ ], [ "Hippocampus mRNA", - "Hippocampus mRNA mRNA" + "Hippocampus mRNA" ], [ "Liver mRNA", - "Liver mRNA mRNA" + "Liver mRNA" ], [ "Lung mRNA", - "Lung mRNA mRNA" + "Lung mRNA" ] ], "HS-CC": [ @@ -3238,7 +3238,7 @@ ], [ "Striatum mRNA", - "Striatum mRNA mRNA" + "Striatum mRNA" ] ], "LXS": [ @@ -3252,11 +3252,11 @@ ], [ "Hippocampus mRNA", - "Hippocampus mRNA mRNA" + "Hippocampus mRNA" ], [ "Prefrontal Cortex mRNA", - "Prefrontal Cortex mRNA mRNA" + "Prefrontal Cortex mRNA" ] ], "MDP": [ @@ -3270,19 +3270,19 @@ ], [ "Bone Femur mRNA", - "Bone Femur mRNA mRNA" + "Bone Femur mRNA" ], [ "Dorsal Root Ganglia mRNA", - "Dorsal Root Ganglia mRNA mRNA" + "Dorsal Root Ganglia mRNA" ], [ "Hippocampus mRNA", - "Hippocampus mRNA mRNA" + "Hippocampus mRNA" ], [ "Liver mRNA", - "Liver mRNA mRNA" + "Liver mRNA" ] ], "NZBXFVB-N2": [ @@ -3296,7 +3296,7 @@ ], [ "Mammary Tumors mRNA", - "Mammary Tumors mRNA mRNA" + "Mammary Tumors mRNA" ] ], "SOTNOT-OHSU": [ @@ -3320,7 +3320,7 @@ ], [ "Anterior Cingulate Cortex mRNA", - "Anterior Cingulate Cortex mRNA mRNA" + "Anterior Cingulate Cortex mRNA" ] ] }, @@ -3346,27 +3346,27 @@ ], [ "Adrenal Gland mRNA", - "Adrenal Gland mRNA mRNA" + "Adrenal Gland mRNA" ], [ "Heart mRNA", - "Heart mRNA mRNA" + "Heart mRNA" ], [ "Hippocampus mRNA", - "Hippocampus mRNA mRNA" + "Hippocampus mRNA" ], [ "Kidney mRNA", - "Kidney mRNA mRNA" + "Kidney mRNA" ], [ "Liver mRNA", - "Liver mRNA mRNA" + "Liver mRNA" ], [ "Peritoneal Fat mRNA", - "Peritoneal Fat mRNA mRNA" + "Peritoneal Fat mRNA" ] ], "SRxSHRSPF2": [ @@ -3380,7 +3380,7 @@ ], [ "Eye mRNA", - "Eye mRNA mRNA" + "Eye mRNA" ] ] }, diff --git a/wqflask/wqflask/static/new/javascript/dataset_select_menu.js b/wqflask/wqflask/static/new/javascript/dataset_select_menu.js index 34fa7503..5c5b433a 100644 --- a/wqflask/wqflask/static/new/javascript/dataset_select_menu.js +++ b/wqflask/wqflask/static/new/javascript/dataset_select_menu.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.4.0 +// Generated by CoffeeScript 1.6.1 (function() { $(function() { diff --git a/wqflask/wqflask/static/new/javascript/login.js b/wqflask/wqflask/static/new/javascript/login.js index ce301353..f6fd1b2e 100644 --- a/wqflask/wqflask/static/new/javascript/login.js +++ b/wqflask/wqflask/static/new/javascript/login.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.4.0 +// Generated by CoffeeScript 1.6.1 (function() { $(function() { diff --git a/wqflask/wqflask/static/new/javascript/marker_regression.coffee b/wqflask/wqflask/static/new/javascript/marker_regression.coffee index 2f8da6dc..2221e030 100644 --- a/wqflask/wqflask/static/new/javascript/marker_regression.coffee +++ b/wqflask/wqflask/static/new/javascript/marker_regression.coffee @@ -15,6 +15,7 @@ $ -> console.time('Create coordinates') @create_coordinates() console.log("@x_coords: ", @x_coords) + console.log("@y_coords: ", @y_coords) console.timeEnd('Create coordinates') [@chr_lengths, @cumulative_chr_lengths] = @get_chr_lengths() @@ -270,7 +271,7 @@ $ -> .enter() .append("circle") .attr("cx", (d) => - return @x_buffer + ((@plot_width-@x_buffer) * d[0]/@x_max) + return parseFloat(@x_buffer + ((@plot_width-@x_buffer) * d[0]/@x_max)) ) .attr("cy", (d) => return @plot_height - ((@plot_height-@y_buffer) * d[1]/@y_max) diff --git a/wqflask/wqflask/static/new/javascript/marker_regression.js b/wqflask/wqflask/static/new/javascript/marker_regression.js index 50578125..a2b2ff57 100644 --- a/wqflask/wqflask/static/new/javascript/marker_regression.js +++ b/wqflask/wqflask/static/new/javascript/marker_regression.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.4.0 +// Generated by CoffeeScript 1.6.1 (function() { var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; @@ -21,6 +21,7 @@ console.time('Create coordinates'); this.create_coordinates(); console.log("@x_coords: ", this.x_coords); + console.log("@y_coords: ", this.y_coords); console.timeEnd('Create coordinates'); _ref = this.get_chr_lengths(), this.chr_lengths = _ref[0], this.cumulative_chr_lengths = _ref[1]; this.x_buffer = this.plot_width / 30; @@ -54,9 +55,9 @@ Manhattan_Plot.prototype.get_chr_lengths = function() { /* - Gets a list of both individual and cumulative (the position of one on the graph - is its own length plus the lengths of all preceding chromosomes) lengths in order - to draw the vertical lines separating chromosomes and the chromosome labels + Gets a list of both individual and cumulative (the position of one on the graph + is its own length plus the lengths of all preceding chromosomes) lengths in order + to draw the vertical lines separating chromosomes and the chromosome labels */ var chr_lengths, cumulative_chr_lengths, key, this_length, total_length; @@ -247,7 +248,7 @@ Manhattan_Plot.prototype.add_plot_points = function() { var _this = this; return this.svg.selectAll("circle").data(this.plot_coordinates).enter().append("circle").attr("cx", function(d) { - return _this.x_buffer + ((_this.plot_width - _this.x_buffer) * d[0] / _this.x_max); + return parseFloat(_this.x_buffer + ((_this.plot_width - _this.x_buffer) * d[0] / _this.x_max)); }).attr("cy", function(d) { return _this.plot_height - ((_this.plot_height - _this.y_buffer) * d[1] / _this.y_max); }).attr("r", 2).attr("id", function(d) { diff --git a/wqflask/wqflask/static/new/javascript/marker_regression_old.js b/wqflask/wqflask/static/new/javascript/marker_regression_old.js new file mode 100644 index 00000000..5dd5b508 --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/marker_regression_old.js @@ -0,0 +1,226 @@ +// Generated by CoffeeScript 1.6.1 +(function() { + + $(function() { + var Chromosome, Manhattan_Plot, Permutation_Histogram, sort_number; + sort_number = function(a, b) { + return a - b; + }; + Permutation_Histogram = (function() { + + function Permutation_Histogram() { + this.process_data(); + this.display_graph(); + } + + Permutation_Histogram.prototype.process_data = function() { + var bars, floored, key, keys, lrs, lrs_array, _i, _j, _len, _len1; + lrs_array = js_data.lrs_array; + bars = {}; + for (_i = 0, _len = lrs_array.length; _i < _len; _i++) { + lrs = lrs_array[_i]; + floored = Math.floor(lrs); + if (!(floored in bars)) { + bars[floored] = 0; + } + bars[floored] += 1; + } + keys = []; + for (key in bars) { + keys.push(key); + } + keys.sort(sort_number); + this.bars_ordered = []; + for (_j = 0, _len1 = keys.length; _j < _len1; _j++) { + key = keys[_j]; + this.bars_ordered.push([parseInt(key), bars[key]]); + } + console.log("bars is:", bars); + console.log("keys are:", keys); + return console.log("bars_ordered are:", this.bars_ordered); + }; + + Permutation_Histogram.prototype.display_graph = function() { + return $.jqplot('permutation_histogram', [this.bars_ordered], { + title: 'Permutation Histogram', + seriesDefaults: { + renderer: $.jqplot.BarRenderer, + rendererOptions: { + barWidth: 15 + }, + pointLabels: { + show: true + } + }, + axesDefaults: { + labelRenderer: $.jqplot.CanvasAxisLabelRenderer + }, + axes: { + xaxis: { + min: 0, + label: "LRS", + pad: 1.1 + }, + yaxis: { + min: 0, + label: "Frequency" + } + } + }); + }; + + return Permutation_Histogram; + + })(); + Chromosome = (function() { + + function Chromosome(name) { + this.name = name; + this.max_mb = 0; + this.plot_points = []; + } + + Chromosome.prototype.process_point = function(mb, lrs) { + if (mb > this.max_mb) { + this.max_mb = mb; + } + return this.plot_points.push([mb, lrs]); + }; + + Chromosome.prototype.display_graph = function(max_lrs) { + var div_name, plot_options, x_axis_max, x_axis_ticks, x_tick; + div_name = 'manhattan_plot_' + this.name; + console.log("div_name:", div_name); + x_axis_max = Math.ceil(this.max_mb / 25) * 25; + x_axis_ticks = []; + x_tick = 0; + while (x_tick <= x_axis_max) { + x_axis_ticks.push(x_tick); + x_tick += 25; + } + plot_options = { + title: this.name, + seriesDefaults: { + showLine: false, + markerRenderer: $.jqplot.MarkerRenderer, + markerOptions: { + style: "filledCircle", + size: 3 + } + }, + axesDefaults: { + tickRenderer: $.jqplot.CanvasAxisTickRenderer, + labelRenderer: $.jqplot.CanvasAxisLabelRenderer + }, + axes: { + xaxis: { + min: 0, + max: x_axis_max, + ticks: x_axis_ticks, + tickOptions: { + angle: 90, + showGridline: false, + formatString: '%d' + }, + label: "Megabases" + } + } + }; + if (this.name === "1") { + plot_options.axes.yaxis = { + min: 0, + max: Math.floor(max_lrs + 0.1 * max_lrs), + tickInterval: 1, + label: "LRS", + tickOptions: { + formatString: '%d', + showGridline: false + } + }; + } else { + plot_options.axes.yaxis = { + show: false, + min: 0, + max: Math.floor(max_lrs + 0.1 * max_lrs), + tickInterval: 1, + tickOptions: { + formatString: '%d', + showGridline: false + } + }; + } + return $.jqplot(div_name, [this.plot_points], plot_options); + }; + + return Chromosome; + + })(); + Manhattan_Plot = (function() { + + function Manhattan_Plot() { + this.max_lrs = 0; + this.chromosomes = {}; + this.build_chromosomes(); + this.display_graphs(); + } + + Manhattan_Plot.prototype.build_chromosomes = function() { + var chromosome, mb, result, _i, _len, _ref, _results; + _ref = js_data.qtl_results; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + result = _ref[_i]; + chromosome = result.locus.chromosome; + if (!(chromosome in this.chromosomes)) { + this.chromosomes[chromosome] = new Chromosome(chromosome); + } + mb = parseInt(result.locus.mb); + if (result.lrs > this.max_lrs) { + this.max_lrs = result.lrs; + } + _results.push(this.chromosomes[chromosome].process_point(mb, result.lrs)); + } + return _results; + }; + + Manhattan_Plot.prototype.display_graphs = function() { + /* Call display_graph for each chromosome + */ + + var extra_keys, html, key, keys, numbered_keys, this_class, _i, _len; + numbered_keys = []; + extra_keys = []; + for (key in this.chromosomes) { + if (isNaN(key)) { + extra_keys.push(key); + } else { + numbered_keys.push(key); + } + } + numbered_keys.sort(sort_number); + extra_keys.sort(); + keys = numbered_keys.concat(extra_keys); + console.log("keys are:", keys); + for (_i = 0, _len = keys.length; _i < _len; _i++) { + key = keys[_i]; + this_class = "manhattan_plot_segment"; + if (key !== "1") { + this_class += " no_y_axis"; + } + html = "
    "; + console.log("html is:", html); + $("#manhattan_plots").append(html); + this.chromosomes[key].display_graph(this.max_lrs); + } + $('.jqplot-yaxis').hide(); + return $('#manhattan_plot_1').find('.jqplot-yaxis').show(); + }; + + return Manhattan_Plot; + + })(); + new Permutation_Histogram; + return new Manhattan_Plot; + }); + +}).call(this); diff --git a/wqflask/wqflask/static/new/javascript/node_modules/.bin/cake b/wqflask/wqflask/static/new/javascript/node_modules/.bin/cake new file mode 120000 index 00000000..d95f32af --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/.bin/cake @@ -0,0 +1 @@ +../coffee-script/bin/cake \ No newline at end of file diff --git a/wqflask/wqflask/static/new/javascript/node_modules/.bin/coffee b/wqflask/wqflask/static/new/javascript/node_modules/.bin/coffee new file mode 120000 index 00000000..b57f275d --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/.bin/coffee @@ -0,0 +1 @@ +../coffee-script/bin/coffee \ No newline at end of file diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/.npmignore b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/.npmignore new file mode 100644 index 00000000..21e430d2 --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/.npmignore @@ -0,0 +1,11 @@ +*.coffee +*.html +.DS_Store +.git* +Cakefile +documentation/ +examples/ +extras/coffee-script.js +raw/ +src/ +test/ diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/CNAME b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/CNAME new file mode 100644 index 00000000..faadabe5 --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/CNAME @@ -0,0 +1 @@ +coffeescript.org \ No newline at end of file diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/CONTRIBUTING.md b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/CONTRIBUTING.md new file mode 100644 index 00000000..6390c68b --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/CONTRIBUTING.md @@ -0,0 +1,9 @@ +## How to contribute to CoffeeScript + +* Before you open a ticket or send a pull request, [search](https://github.com/jashkenas/coffee-script/issues) for previous discussions about the same feature or issue. Add to the earlier ticket if you find one. + +* Before sending a pull request for a feature, be sure to have [tests](https://github.com/jashkenas/coffee-script/tree/master/test). + +* Use the same coding style as the rest of the [codebase](https://github.com/jashkenas/coffee-script/tree/master/src). If you're just getting started with CoffeeScript, there's a nice [style guide](https://github.com/polarmobile/coffeescript-style-guide). + +* In your pull request, do not add documentation to `index.html` or re-build the minified `coffee-script.js` file. We'll do those things before cutting a new release. \ No newline at end of file diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/LICENSE b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/LICENSE new file mode 100644 index 00000000..dbe6b4e3 --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2009-2012 Jeremy Ashkenas + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/README b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/README new file mode 100644 index 00000000..69ee6f43 --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/README @@ -0,0 +1,51 @@ + + { + } } { + { { } } + } }{ { + { }{ } } _____ __ __ + ( }{ }{ { ) / ____| / _|/ _| + .- { { } { }} -. | | ___ | |_| |_ ___ ___ + ( ( } { } { } } ) | | / _ \| _| _/ _ \/ _ \ + |`-..________ ..-'| | |___| (_) | | | || __/ __/ + | | \_____\___/|_| |_| \___|\___| + | ;--. + | (__ \ _____ _ _ + | | ) ) / ____| (_) | | + | |/ / | (___ ___ _ __ _ _ __ | |_ + | ( / \___ \ / __| '__| | '_ \| __| + | |/ ____) | (__| | | | |_) | |_ + | | |_____/ \___|_| |_| .__/ \__| + `-.._________..-' | | + |_| + + + CoffeeScript is a little language that compiles into JavaScript. + + Install Node.js, and then the CoffeeScript compiler: + sudo bin/cake install + + Or, if you have the Node Package Manager installed: + npm install -g coffee-script + (Leave off the -g if you don't wish to install globally.) + + Execute a script: + coffee /path/to/script.coffee + + Compile a script: + coffee -c /path/to/script.coffee + + For documentation, usage, and examples, see: + http://coffeescript.org/ + + To suggest a feature, report a bug, or general discussion: + http://github.com/jashkenas/coffee-script/issues/ + + If you'd like to chat, drop by #coffeescript on Freenode IRC, + or on webchat.freenode.net. + + The source repository: + git://github.com/jashkenas/coffee-script.git + + All contributors are listed here: + http://github.com/jashkenas/coffee-script/contributors diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/Rakefile b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/Rakefile new file mode 100644 index 00000000..d90cce36 --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/Rakefile @@ -0,0 +1,79 @@ +require 'rubygems' +require 'erb' +require 'fileutils' +require 'rake/testtask' +require 'json' + +desc "Build the documentation page" +task :doc do + source = 'documentation/index.html.erb' + child = fork { exec "bin/coffee -bcw -o documentation/js documentation/coffee/*.coffee" } + at_exit { Process.kill("INT", child) } + Signal.trap("INT") { exit } + loop do + mtime = File.stat(source).mtime + if !@mtime || mtime > @mtime + rendered = ERB.new(File.read(source)).result(binding) + File.open('index.html', 'w+') {|f| f.write(rendered) } + end + @mtime = mtime + sleep 1 + end +end + +desc "Build coffee-script-source gem" +task :gem do + require 'rubygems' + require 'rubygems/package' + + gemspec = Gem::Specification.new do |s| + s.name = 'coffee-script-source' + s.version = JSON.parse(File.read('package.json'))["version"] + s.date = Time.now.strftime("%Y-%m-%d") + + s.homepage = "http://jashkenas.github.com/coffee-script/" + s.summary = "The CoffeeScript Compiler" + s.description = <<-EOS + CoffeeScript is a little language that compiles into JavaScript. + Underneath all of those embarrassing braces and semicolons, + JavaScript has always had a gorgeous object model at its heart. + CoffeeScript is an attempt to expose the good parts of JavaScript + in a simple way. + EOS + + s.files = [ + 'lib/coffee_script/coffee-script.js', + 'lib/coffee_script/source.rb' + ] + + s.authors = ['Jeremy Ashkenas'] + s.email = 'jashkenas@gmail.com' + s.rubyforge_project = 'coffee-script-source' + s.license = "MIT" + end + + file = File.open("coffee-script-source.gem", "w") + Gem::Package.open(file, 'w') do |pkg| + pkg.metadata = gemspec.to_yaml + + path = "lib/coffee_script/source.rb" + contents = <<-ERUBY +module CoffeeScript + module Source + def self.bundled_path + File.expand_path("../coffee-script.js", __FILE__) + end + end +end + ERUBY + pkg.add_file_simple(path, 0644, contents.size) do |tar_io| + tar_io.write(contents) + end + + contents = File.read("extras/coffee-script.js") + path = "lib/coffee_script/coffee-script.js" + pkg.add_file_simple(path, 0644, contents.size) do |tar_io| + tar_io.write(contents) + end + end +end diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/bin/cake b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/bin/cake new file mode 100755 index 00000000..5965f4ee --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/bin/cake @@ -0,0 +1,7 @@ +#!/usr/bin/env node + +var path = require('path'); +var fs = require('fs'); +var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib'); + +require(lib + '/coffee-script/cake').run(); diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/bin/coffee b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/bin/coffee new file mode 100755 index 00000000..3d1d71c8 --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/bin/coffee @@ -0,0 +1,7 @@ +#!/usr/bin/env node + +var path = require('path'); +var fs = require('fs'); +var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib'); + +require(lib + '/coffee-script/command').run(); diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/extras/jsl.conf b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/extras/jsl.conf new file mode 100644 index 00000000..1190da52 --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/extras/jsl.conf @@ -0,0 +1,44 @@ +# JavaScriptLint configuration file for CoffeeScript. + ++no_return_value # function {0} does not always return a value ++duplicate_formal # duplicate formal argument {0} +-equal_as_assign # test for equality (==) mistyped as assignment (=)?{0} ++var_hides_arg # variable {0} hides argument ++redeclared_var # redeclaration of {0} {1} +-anon_no_return_value # anonymous function does not always return a value ++missing_semicolon # missing semicolon ++meaningless_block # meaningless block; curly braces have no impact +-comma_separated_stmts # multiple statements separated by commas (use semicolons?) ++unreachable_code # unreachable code ++missing_break # missing break statement +-missing_break_for_last_case # missing break statement for last case in switch +-comparison_type_conv # comparisons against null, 0, true, false, or an empty string allowing implicit type conversion (use === or !==) +-inc_dec_within_stmt # increment (++) and decrement (--) operators used as part of greater statement +-useless_void # use of the void type may be unnecessary (void is always undefined) ++multiple_plus_minus # unknown order of operations for successive plus (e.g. x+++y) or minus (e.g. x---y) signs ++use_of_label # use of label +-block_without_braces # block statement without curly braces ++leading_decimal_point # leading decimal point may indicate a number or an object member ++trailing_decimal_point # trailing decimal point may indicate a number or an object member ++octal_number # leading zeros make an octal number ++nested_comment # nested comment ++misplaced_regex # regular expressions should be preceded by a left parenthesis, assignment, colon, or comma ++ambiguous_newline # unexpected end of line; it is ambiguous whether these lines are part of the same statement ++empty_statement # empty statement or extra semicolon +-missing_option_explicit # the "option explicit" control comment is missing ++partial_option_explicit # the "option explicit" control comment, if used, must be in the first script tag ++dup_option_explicit # duplicate "option explicit" control comment ++useless_assign # useless assignment ++ambiguous_nested_stmt # block statements containing block statements should use curly braces to resolve ambiguity ++ambiguous_else_stmt # the else statement could be matched with one of multiple if statements (use curly braces to indicate intent) +-missing_default_case # missing default case in switch statement ++duplicate_case_in_switch # duplicate case in switch statements ++default_not_at_end # the default case is not at the end of the switch statement ++legacy_cc_not_understood # couldn't understand control comment using /*@keyword@*/ syntax ++jsl_cc_not_understood # couldn't understand control comment using /*jsl:keyword*/ syntax ++useless_comparison # useless comparison; comparing identical expressions ++with_statement # with statement hides undeclared variables; use temporary variable instead ++trailing_comma_in_array # extra comma is not recommended in array initializers ++assign_to_function_call # assignment to a function call ++parseint_missing_radix # parseInt missing radix parameter ++lambda_assign_requires_semicolon diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/browser.js b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/browser.js new file mode 100644 index 00000000..fec8e690 --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/browser.js @@ -0,0 +1,101 @@ +// Generated by CoffeeScript 1.6.1 +(function() { + var CoffeeScript, runScripts, + __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; + + CoffeeScript = require('./coffee-script'); + + CoffeeScript.require = require; + + CoffeeScript["eval"] = function(code, options) { + var _ref; + if (options == null) { + options = {}; + } + if ((_ref = options.bare) == null) { + options.bare = true; + } + return eval(CoffeeScript.compile(code, options)); + }; + + CoffeeScript.run = function(code, options) { + if (options == null) { + options = {}; + } + options.bare = true; + return Function(CoffeeScript.compile(code, options))(); + }; + + if (typeof window === "undefined" || window === null) { + return; + } + + CoffeeScript.load = function(url, callback, options) { + var xhr; + if (options == null) { + options = {}; + } + xhr = window.ActiveXObject ? new window.ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest(); + xhr.open('GET', url, true); + if ('overrideMimeType' in xhr) { + xhr.overrideMimeType('text/plain'); + } + xhr.onreadystatechange = function() { + var _ref; + if (xhr.readyState === 4) { + if ((_ref = xhr.status) === 0 || _ref === 200) { + CoffeeScript.run(xhr.responseText, options); + } else { + throw new Error("Could not load " + url); + } + if (callback) { + return callback(); + } + } + }; + return xhr.send(null); + }; + + runScripts = function() { + var coffees, coffeetypes, execute, index, length, s, scripts; + scripts = document.getElementsByTagName('script'); + coffeetypes = ['text/coffeescript', 'text/literate-coffeescript']; + coffees = (function() { + var _i, _len, _ref, _results; + _results = []; + for (_i = 0, _len = scripts.length; _i < _len; _i++) { + s = scripts[_i]; + if (_ref = s.type, __indexOf.call(coffeetypes, _ref) >= 0) { + _results.push(s); + } + } + return _results; + })(); + index = 0; + length = coffees.length; + (execute = function() { + var mediatype, options, script; + script = coffees[index++]; + mediatype = script != null ? script.type : void 0; + if (__indexOf.call(coffeetypes, mediatype) >= 0) { + options = { + literate: mediatype === 'text/literate-coffeescript' + }; + if (script.src) { + return CoffeeScript.load(script.src, execute, options); + } else { + CoffeeScript.run(script.innerHTML, options); + return execute(); + } + } + })(); + return null; + }; + + if (window.addEventListener) { + addEventListener('DOMContentLoaded', runScripts, false); + } else { + attachEvent('onload', runScripts); + } + +}).call(this); diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/cake.js b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/cake.js new file mode 100644 index 00000000..a0b643f6 --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/cake.js @@ -0,0 +1,113 @@ +// Generated by CoffeeScript 1.6.1 +(function() { + var CoffeeScript, cakefileDirectory, existsSync, fatalError, fs, helpers, missingTask, oparse, options, optparse, path, printTasks, switches, tasks; + + fs = require('fs'); + + path = require('path'); + + helpers = require('./helpers'); + + optparse = require('./optparse'); + + CoffeeScript = require('./coffee-script'); + + existsSync = fs.existsSync || path.existsSync; + + tasks = {}; + + options = {}; + + switches = []; + + oparse = null; + + helpers.extend(global, { + task: function(name, description, action) { + var _ref; + if (!action) { + _ref = [description, action], action = _ref[0], description = _ref[1]; + } + return tasks[name] = { + name: name, + description: description, + action: action + }; + }, + option: function(letter, flag, description) { + return switches.push([letter, flag, description]); + }, + invoke: function(name) { + if (!tasks[name]) { + missingTask(name); + } + return tasks[name].action(options); + } + }); + + exports.run = function() { + var arg, args, _i, _len, _ref, _results; + global.__originalDirname = fs.realpathSync('.'); + process.chdir(cakefileDirectory(__originalDirname)); + args = process.argv.slice(2); + CoffeeScript.run(fs.readFileSync('Cakefile').toString(), { + filename: 'Cakefile' + }); + oparse = new optparse.OptionParser(switches); + if (!args.length) { + return printTasks(); + } + try { + options = oparse.parse(args); + } catch (e) { + return fatalError("" + e); + } + _ref = options["arguments"]; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + arg = _ref[_i]; + _results.push(invoke(arg)); + } + return _results; + }; + + printTasks = function() { + var cakefilePath, desc, name, relative, spaces, task; + relative = path.relative || path.resolve; + cakefilePath = path.join(relative(__originalDirname, process.cwd()), 'Cakefile'); + console.log("" + cakefilePath + " defines the following tasks:\n"); + for (name in tasks) { + task = tasks[name]; + spaces = 20 - name.length; + spaces = spaces > 0 ? Array(spaces + 1).join(' ') : ''; + desc = task.description ? "# " + task.description : ''; + console.log("cake " + name + spaces + " " + desc); + } + if (switches.length) { + return console.log(oparse.help()); + } + }; + + fatalError = function(message) { + console.error(message + '\n'); + console.log('To see a list of all tasks/options, run "cake"'); + return process.exit(1); + }; + + missingTask = function(task) { + return fatalError("No such task: " + task); + }; + + cakefileDirectory = function(dir) { + var parent; + if (existsSync(path.join(dir, 'Cakefile'))) { + return dir; + } + parent = path.normalize(path.join(dir, '..')); + if (parent !== dir) { + return cakefileDirectory(parent); + } + throw new Error("Cakefile not found in " + (process.cwd())); + }; + +}).call(this); diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/coffee-script.js b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/coffee-script.js new file mode 100644 index 00000000..d791035d --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/coffee-script.js @@ -0,0 +1,218 @@ +// Generated by CoffeeScript 1.6.1 +(function() { + var Lexer, compile, ext, fs, helpers, lexer, loadFile, parser, path, sourcemap, vm, _i, _len, _ref, + __hasProp = {}.hasOwnProperty; + + fs = require('fs'); + + path = require('path'); + + Lexer = require('./lexer').Lexer; + + parser = require('./parser').parser; + + helpers = require('./helpers'); + + vm = require('vm'); + + sourcemap = require('./sourcemap'); + + loadFile = function(module, filename) { + var raw, stripped; + raw = fs.readFileSync(filename, 'utf8'); + stripped = raw.charCodeAt(0) === 0xFEFF ? raw.substring(1) : raw; + return module._compile(compile(stripped, { + filename: filename, + literate: helpers.isLiterate(filename) + }), filename); + }; + + if (require.extensions) { + _ref = ['.coffee', '.litcoffee', '.md', '.coffee.md']; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + ext = _ref[_i]; + require.extensions[ext] = loadFile; + } + } + + exports.VERSION = '1.6.1'; + + exports.helpers = helpers; + + exports.compile = compile = function(code, options) { + var answer, coffeeFile, currentColumn, currentLine, fragment, fragments, header, js, jsFile, merge, newLines, sourceMap, _j, _len1; + if (options == null) { + options = {}; + } + merge = exports.helpers.merge; + try { + if (options.sourceMap) { + coffeeFile = helpers.baseFileName(options.filename); + jsFile = helpers.baseFileName(options.filename, true) + ".js"; + sourceMap = new sourcemap.SourceMap(); + } + fragments = (parser.parse(lexer.tokenize(code, options))).compileToFragments(options); + currentLine = 0; + if (options.header) { + currentLine += 1; + } + if (options.sourceMap) { + currentLine += 1; + } + currentColumn = 0; + js = ""; + for (_j = 0, _len1 = fragments.length; _j < _len1; _j++) { + fragment = fragments[_j]; + if (sourceMap) { + if (fragment.locationData) { + sourceMap.addMapping([fragment.locationData.first_line, fragment.locationData.first_column], [currentLine, currentColumn], { + noReplace: true + }); + } + newLines = helpers.count(fragment.code, "\n"); + currentLine += newLines; + currentColumn = fragment.code.length - (newLines ? fragment.code.lastIndexOf("\n") : 0); + } + js += fragment.code; + } + } catch (err) { + if (options.filename) { + err.message = "In " + options.filename + ", " + err.message; + } + throw err; + } + if (options.header) { + header = "Generated by CoffeeScript " + this.VERSION; + js = "// " + header + "\n" + js; + } + if (options.sourceMap) { + answer = { + js: js + }; + if (sourceMap) { + answer.sourceMap = sourceMap; + answer.v3SourceMap = sourcemap.generateV3SourceMap(sourceMap, coffeeFile, jsFile); + } + return answer; + } else { + return js; + } + }; + + exports.tokens = function(code, options) { + return lexer.tokenize(code, options); + }; + + exports.nodes = function(source, options) { + if (typeof source === 'string') { + return parser.parse(lexer.tokenize(source, options)); + } else { + return parser.parse(source); + } + }; + + exports.run = function(code, options) { + var mainModule; + if (options == null) { + options = {}; + } + mainModule = require.main; + mainModule.filename = process.argv[1] = options.filename ? fs.realpathSync(options.filename) : '.'; + mainModule.moduleCache && (mainModule.moduleCache = {}); + mainModule.paths = require('module')._nodeModulePaths(path.dirname(fs.realpathSync(options.filename))); + if (!helpers.isCoffee(mainModule.filename) || require.extensions) { + return mainModule._compile(compile(code, options), mainModule.filename); + } else { + return mainModule._compile(code, mainModule.filename); + } + }; + + exports["eval"] = function(code, options) { + var Module, Script, js, k, o, r, sandbox, v, _j, _len1, _module, _ref1, _ref2, _require; + if (options == null) { + options = {}; + } + if (!(code = code.trim())) { + return; + } + Script = vm.Script; + if (Script) { + if (options.sandbox != null) { + if (options.sandbox instanceof Script.createContext().constructor) { + sandbox = options.sandbox; + } else { + sandbox = Script.createContext(); + _ref1 = options.sandbox; + for (k in _ref1) { + if (!__hasProp.call(_ref1, k)) continue; + v = _ref1[k]; + sandbox[k] = v; + } + } + sandbox.global = sandbox.root = sandbox.GLOBAL = sandbox; + } else { + sandbox = global; + } + sandbox.__filename = options.filename || 'eval'; + sandbox.__dirname = path.dirname(sandbox.__filename); + if (!(sandbox !== global || sandbox.module || sandbox.require)) { + Module = require('module'); + sandbox.module = _module = new Module(options.modulename || 'eval'); + sandbox.require = _require = function(path) { + return Module._load(path, _module, true); + }; + _module.filename = sandbox.__filename; + _ref2 = Object.getOwnPropertyNames(require); + for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) { + r = _ref2[_j]; + if (r !== 'paths') { + _require[r] = require[r]; + } + } + _require.paths = _module.paths = Module._nodeModulePaths(process.cwd()); + _require.resolve = function(request) { + return Module._resolveFilename(request, _module); + }; + } + } + o = {}; + for (k in options) { + if (!__hasProp.call(options, k)) continue; + v = options[k]; + o[k] = v; + } + o.bare = true; + js = compile(code, o); + if (sandbox === global) { + return vm.runInThisContext(js); + } else { + return vm.runInContext(js, sandbox); + } + }; + + lexer = new Lexer; + + parser.lexer = { + lex: function() { + var tag, token; + token = this.tokens[this.pos++]; + if (token) { + tag = token[0], this.yytext = token[1], this.yylloc = token[2]; + this.yylineno = this.yylloc.first_line; + } else { + tag = ''; + } + return tag; + }, + setInput: function(tokens) { + this.tokens = tokens; + return this.pos = 0; + }, + upcomingInput: function() { + return ""; + } + }; + + parser.yy = require('./nodes'); + +}).call(this); diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/command.js b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/command.js new file mode 100644 index 00000000..4077577e --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/command.js @@ -0,0 +1,506 @@ +// Generated by CoffeeScript 1.6.1 +(function() { + var BANNER, CoffeeScript, EventEmitter, SWITCHES, compileJoin, compileOptions, compilePath, compileScript, compileStdio, exec, exists, forkNode, fs, helpers, hidden, joinTimeout, lint, notSources, optionParser, optparse, opts, outputPath, parseOptions, path, printLine, printTokens, printWarn, removeSource, sourceCode, sources, spawn, timeLog, unwatchDir, usage, version, wait, watch, watchDir, watchers, writeJs, _ref; + + fs = require('fs'); + + path = require('path'); + + helpers = require('./helpers'); + + optparse = require('./optparse'); + + CoffeeScript = require('./coffee-script'); + + _ref = require('child_process'), spawn = _ref.spawn, exec = _ref.exec; + + EventEmitter = require('events').EventEmitter; + + exists = fs.exists || path.exists; + + helpers.extend(CoffeeScript, new EventEmitter); + + printLine = function(line) { + return process.stdout.write(line + '\n'); + }; + + printWarn = function(line) { + return process.stderr.write(line + '\n'); + }; + + hidden = function(file) { + return /^\.|~$/.test(file); + }; + + BANNER = 'Usage: coffee [options] path/to/script.coffee -- [args]\n\nIf called without options, `coffee` will run your script.'; + + SWITCHES = [['-b', '--bare', 'compile without a top-level function wrapper'], ['-c', '--compile', 'compile to JavaScript and save as .js files'], ['-e', '--eval', 'pass a string from the command line as input'], ['-h', '--help', 'display this help message'], ['-i', '--interactive', 'run an interactive CoffeeScript REPL'], ['-j', '--join [FILE]', 'concatenate the source CoffeeScript before compiling'], ['-l', '--lint', 'pipe the compiled JavaScript through JavaScript Lint'], ['-m', '--map', 'generate source map and save as .map files'], ['-n', '--nodes', 'print out the parse tree that the parser produces'], ['--nodejs [ARGS]', 'pass options directly to the "node" binary'], ['-o', '--output [DIR]', 'set the output directory for compiled JavaScript'], ['-p', '--print', 'print out the compiled JavaScript'], ['-s', '--stdio', 'listen for and compile scripts over stdio'], ['-t', '--tokens', 'print out the tokens that the lexer/rewriter produce'], ['-v', '--version', 'display the version number'], ['-w', '--watch', 'watch scripts for changes and rerun commands']]; + + opts = {}; + + sources = []; + + sourceCode = []; + + notSources = {}; + + watchers = {}; + + optionParser = null; + + exports.run = function() { + var literals, source, _i, _len, _results; + parseOptions(); + if (opts.nodejs) { + return forkNode(); + } + if (opts.help) { + return usage(); + } + if (opts.version) { + return version(); + } + if (opts.interactive) { + return require('./repl').start(); + } + if (opts.watch && !fs.watch) { + return printWarn("The --watch feature depends on Node v0.6.0+. You are running " + process.version + "."); + } + if (opts.stdio) { + return compileStdio(); + } + if (opts["eval"]) { + return compileScript(null, sources[0]); + } + if (!sources.length) { + return require('./repl').start(); + } + literals = opts.run ? sources.splice(1) : []; + process.argv = process.argv.slice(0, 2).concat(literals); + process.argv[0] = 'coffee'; + _results = []; + for (_i = 0, _len = sources.length; _i < _len; _i++) { + source = sources[_i]; + _results.push(compilePath(source, true, path.normalize(source))); + } + return _results; + }; + + compilePath = function(source, topLevel, base) { + return fs.stat(source, function(err, stats) { + if (err && err.code !== 'ENOENT') { + throw err; + } + if ((err != null ? err.code : void 0) === 'ENOENT') { + console.error("File not found: " + source); + process.exit(1); + } + if (stats.isDirectory() && path.dirname(source) !== 'node_modules') { + if (opts.watch) { + watchDir(source, base); + } + return fs.readdir(source, function(err, files) { + var file, index, _ref1, _ref2; + if (err && err.code !== 'ENOENT') { + throw err; + } + if ((err != null ? err.code : void 0) === 'ENOENT') { + return; + } + index = sources.indexOf(source); + files = files.filter(function(file) { + return !hidden(file); + }); + [].splice.apply(sources, [index, index - index + 1].concat(_ref1 = (function() { + var _i, _len, _results; + _results = []; + for (_i = 0, _len = files.length; _i < _len; _i++) { + file = files[_i]; + _results.push(path.join(source, file)); + } + return _results; + })())), _ref1; + [].splice.apply(sourceCode, [index, index - index + 1].concat(_ref2 = files.map(function() { + return null; + }))), _ref2; + return files.forEach(function(file) { + return compilePath(path.join(source, file), false, base); + }); + }); + } else if (topLevel || helpers.isCoffee(source)) { + if (opts.watch) { + watch(source, base); + } + return fs.readFile(source, function(err, code) { + if (err && err.code !== 'ENOENT') { + throw err; + } + if ((err != null ? err.code : void 0) === 'ENOENT') { + return; + } + return compileScript(source, code.toString(), base); + }); + } else { + notSources[source] = true; + return removeSource(source, base); + } + }); + }; + + compileScript = function(file, input, base) { + var compiled, o, options, t, task; + o = opts; + options = compileOptions(file); + try { + t = task = { + file: file, + input: input, + options: options + }; + CoffeeScript.emit('compile', task); + if (o.tokens) { + return printTokens(CoffeeScript.tokens(t.input, t.options)); + } else if (o.nodes) { + return printLine(CoffeeScript.nodes(t.input, t.options).toString().trim()); + } else if (o.run) { + return CoffeeScript.run(t.input, t.options); + } else if (o.join && t.file !== o.join) { + sourceCode[sources.indexOf(t.file)] = t.input; + return compileJoin(); + } else { + compiled = CoffeeScript.compile(t.input, t.options); + t.output = compiled; + if (o.map) { + t.output = compiled.js; + t.sourceMap = compiled.v3SourceMap; + } + CoffeeScript.emit('success', task); + if (o.print) { + return printLine(t.output.trim()); + } else if (o.compile || o.map) { + return writeJs(base, t.file, t.output, t.sourceMap); + } else if (o.lint) { + return lint(t.file, t.output); + } + } + } catch (err) { + CoffeeScript.emit('failure', err, task); + if (CoffeeScript.listeners('failure').length) { + return; + } + if (o.watch) { + return printLine(err.message + '\x07'); + } + printWarn(err instanceof Error && err.stack || ("ERROR: " + err)); + return process.exit(1); + } + }; + + compileStdio = function() { + var code, stdin; + code = ''; + stdin = process.openStdin(); + stdin.on('data', function(buffer) { + if (buffer) { + return code += buffer.toString(); + } + }); + return stdin.on('end', function() { + return compileScript(null, code); + }); + }; + + joinTimeout = null; + + compileJoin = function() { + if (!opts.join) { + return; + } + if (!sourceCode.some(function(code) { + return code === null; + })) { + clearTimeout(joinTimeout); + return joinTimeout = wait(100, function() { + return compileScript(opts.join, sourceCode.join('\n'), opts.join); + }); + } + }; + + watch = function(source, base) { + var compile, compileTimeout, prevStats, rewatch, watchErr, watcher; + prevStats = null; + compileTimeout = null; + watchErr = function(e) { + if (e.code === 'ENOENT') { + if (sources.indexOf(source) === -1) { + return; + } + try { + rewatch(); + return compile(); + } catch (e) { + removeSource(source, base, true); + return compileJoin(); + } + } else { + throw e; + } + }; + compile = function() { + clearTimeout(compileTimeout); + return compileTimeout = wait(25, function() { + return fs.stat(source, function(err, stats) { + if (err) { + return watchErr(err); + } + if (prevStats && stats.size === prevStats.size && stats.mtime.getTime() === prevStats.mtime.getTime()) { + return rewatch(); + } + prevStats = stats; + return fs.readFile(source, function(err, code) { + if (err) { + return watchErr(err); + } + compileScript(source, code.toString(), base); + return rewatch(); + }); + }); + }); + }; + try { + watcher = fs.watch(source, compile); + } catch (e) { + watchErr(e); + } + return rewatch = function() { + if (watcher != null) { + watcher.close(); + } + return watcher = fs.watch(source, compile); + }; + }; + + watchDir = function(source, base) { + var readdirTimeout, watcher; + readdirTimeout = null; + try { + return watcher = fs.watch(source, function() { + clearTimeout(readdirTimeout); + return readdirTimeout = wait(25, function() { + return fs.readdir(source, function(err, files) { + var file, _i, _len, _results; + if (err) { + if (err.code !== 'ENOENT') { + throw err; + } + watcher.close(); + return unwatchDir(source, base); + } + _results = []; + for (_i = 0, _len = files.length; _i < _len; _i++) { + file = files[_i]; + if (!(!hidden(file) && !notSources[file])) { + continue; + } + file = path.join(source, file); + if (sources.some(function(s) { + return s.indexOf(file) >= 0; + })) { + continue; + } + sources.push(file); + sourceCode.push(null); + _results.push(compilePath(file, false, base)); + } + return _results; + }); + }); + }); + } catch (e) { + if (e.code !== 'ENOENT') { + throw e; + } + } + }; + + unwatchDir = function(source, base) { + var file, prevSources, toRemove, _i, _len; + prevSources = sources.slice(0); + toRemove = (function() { + var _i, _len, _results; + _results = []; + for (_i = 0, _len = sources.length; _i < _len; _i++) { + file = sources[_i]; + if (file.indexOf(source) >= 0) { + _results.push(file); + } + } + return _results; + })(); + for (_i = 0, _len = toRemove.length; _i < _len; _i++) { + file = toRemove[_i]; + removeSource(file, base, true); + } + if (!sources.some(function(s, i) { + return prevSources[i] !== s; + })) { + return; + } + return compileJoin(); + }; + + removeSource = function(source, base, removeJs) { + var index, jsPath; + index = sources.indexOf(source); + sources.splice(index, 1); + sourceCode.splice(index, 1); + if (removeJs && !opts.join) { + jsPath = outputPath(source, base); + return exists(jsPath, function(itExists) { + if (itExists) { + return fs.unlink(jsPath, function(err) { + if (err && err.code !== 'ENOENT') { + throw err; + } + return timeLog("removed " + source); + }); + } + }); + } + }; + + outputPath = function(source, base, extension) { + var baseDir, basename, dir, srcDir; + if (extension == null) { + extension = ".js"; + } + basename = helpers.baseFileName(source, true); + srcDir = path.dirname(source); + baseDir = base === '.' ? srcDir : srcDir.substring(base.length); + dir = opts.output ? path.join(opts.output, baseDir) : srcDir; + return path.join(dir, basename + extension); + }; + + writeJs = function(base, sourcePath, js, generatedSourceMap) { + var compile, jsDir, jsPath, sourceMapPath; + if (generatedSourceMap == null) { + generatedSourceMap = null; + } + jsPath = outputPath(sourcePath, base); + sourceMapPath = outputPath(sourcePath, base, ".map"); + jsDir = path.dirname(jsPath); + compile = function() { + if (opts.compile) { + if (js.length <= 0) { + js = ' '; + } + if (generatedSourceMap) { + js = "//@ sourceMappingURL=" + (helpers.baseFileName(sourceMapPath)) + "\n" + js; + } + fs.writeFile(jsPath, js, function(err) { + if (err) { + return printLine(err.message); + } else if (opts.compile && opts.watch) { + return timeLog("compiled " + sourcePath); + } + }); + } + if (generatedSourceMap) { + return fs.writeFile(sourceMapPath, generatedSourceMap, function(err) { + if (err) { + return printLine("Could not write source map: " + err.message); + } + }); + } + }; + return exists(jsDir, function(itExists) { + if (itExists) { + return compile(); + } else { + return exec("mkdir -p " + jsDir, compile); + } + }); + }; + + wait = function(milliseconds, func) { + return setTimeout(func, milliseconds); + }; + + timeLog = function(message) { + return console.log("" + ((new Date).toLocaleTimeString()) + " - " + message); + }; + + lint = function(file, js) { + var conf, jsl, printIt; + printIt = function(buffer) { + return printLine(file + ':\t' + buffer.toString().trim()); + }; + conf = __dirname + '/../../extras/jsl.conf'; + jsl = spawn('jsl', ['-nologo', '-stdin', '-conf', conf]); + jsl.stdout.on('data', printIt); + jsl.stderr.on('data', printIt); + jsl.stdin.write(js); + return jsl.stdin.end(); + }; + + printTokens = function(tokens) { + var strings, tag, token, value; + strings = (function() { + var _i, _len, _results; + _results = []; + for (_i = 0, _len = tokens.length; _i < _len; _i++) { + token = tokens[_i]; + tag = token[0]; + value = token[1].toString().replace(/\n/, '\\n'); + _results.push("[" + tag + " " + value + "]"); + } + return _results; + })(); + return printLine(strings.join(' ')); + }; + + parseOptions = function() { + var i, o, source, _i, _len; + optionParser = new optparse.OptionParser(SWITCHES, BANNER); + o = opts = optionParser.parse(process.argv.slice(2)); + o.compile || (o.compile = !!o.output); + o.run = !(o.compile || o.print || o.lint || o.map); + o.print = !!(o.print || (o["eval"] || o.stdio && o.compile)); + sources = o["arguments"]; + for (i = _i = 0, _len = sources.length; _i < _len; i = ++_i) { + source = sources[i]; + sourceCode[i] = null; + } + }; + + compileOptions = function(filename) { + return { + filename: filename, + literate: helpers.isLiterate(filename), + bare: opts.bare, + header: opts.compile, + sourceMap: opts.map + }; + }; + + forkNode = function() { + var args, nodeArgs; + nodeArgs = opts.nodejs.split(/\s+/); + args = process.argv.slice(1); + args.splice(args.indexOf('--nodejs'), 2); + return spawn(process.execPath, nodeArgs.concat(args), { + cwd: process.cwd(), + env: process.env, + customFds: [0, 1, 2] + }); + }; + + usage = function() { + return printLine((new optparse.OptionParser(SWITCHES, BANNER)).help()); + }; + + version = function() { + return printLine("CoffeeScript version " + CoffeeScript.VERSION); + }; + +}).call(this); diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/grammar.js b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/grammar.js new file mode 100644 index 00000000..4a767433 --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/grammar.js @@ -0,0 +1,623 @@ +// Generated by CoffeeScript 1.6.1 +(function() { + var Parser, alt, alternatives, grammar, name, o, operators, token, tokens, unwrap; + + Parser = require('jison').Parser; + + unwrap = /^function\s*\(\)\s*\{\s*return\s*([\s\S]*);\s*\}/; + + o = function(patternString, action, options) { + var addLocationDataFn, match, patternCount; + patternString = patternString.replace(/\s{2,}/g, ' '); + patternCount = patternString.split(' ').length; + if (!action) { + return [patternString, '$$ = $1;', options]; + } + action = (match = unwrap.exec(action)) ? match[1] : "(" + action + "())"; + action = action.replace(/\bnew /g, '$&yy.'); + action = action.replace(/\b(?:Block\.wrap|extend)\b/g, 'yy.$&'); + addLocationDataFn = function(first, last) { + if (!last) { + return "yy.addLocationDataFn(@" + first + ")"; + } else { + return "yy.addLocationDataFn(@" + first + ", @" + last + ")"; + } + }; + action = action.replace(/LOC\(([0-9]*)\)/g, addLocationDataFn('$1')); + action = action.replace(/LOC\(([0-9]*),\s*([0-9]*)\)/g, addLocationDataFn('$1', '$2')); + return [patternString, "$$ = " + (addLocationDataFn(1, patternCount)) + "(" + action + ");", options]; + }; + + grammar = { + Root: [ + o('', function() { + return new Block; + }), o('Body'), o('Block TERMINATOR') + ], + Body: [ + o('Line', function() { + return Block.wrap([$1]); + }), o('Body TERMINATOR Line', function() { + return $1.push($3); + }), o('Body TERMINATOR') + ], + Line: [o('Expression'), o('Statement')], + Statement: [ + o('Return'), o('Comment'), o('STATEMENT', function() { + return new Literal($1); + }) + ], + Expression: [o('Value'), o('Invocation'), o('Code'), o('Operation'), o('Assign'), o('If'), o('Try'), o('While'), o('For'), o('Switch'), o('Class'), o('Throw')], + Block: [ + o('INDENT OUTDENT', function() { + return new Block; + }), o('INDENT Body OUTDENT', function() { + return $2; + }) + ], + Identifier: [ + o('IDENTIFIER', function() { + return new Literal($1); + }) + ], + AlphaNumeric: [ + o('NUMBER', function() { + return new Literal($1); + }), o('STRING', function() { + return new Literal($1); + }) + ], + Literal: [ + o('AlphaNumeric'), o('JS', function() { + return new Literal($1); + }), o('REGEX', function() { + return new Literal($1); + }), o('DEBUGGER', function() { + return new Literal($1); + }), o('UNDEFINED', function() { + return new Undefined; + }), o('NULL', function() { + return new Null; + }), o('BOOL', function() { + return new Bool($1); + }) + ], + Assign: [ + o('Assignable = Expression', function() { + return new Assign($1, $3); + }), o('Assignable = TERMINATOR Expression', function() { + return new Assign($1, $4); + }), o('Assignable = INDENT Expression OUTDENT', function() { + return new Assign($1, $4); + }) + ], + AssignObj: [ + o('ObjAssignable', function() { + return new Value($1); + }), o('ObjAssignable : Expression', function() { + return new Assign(LOC(1)(new Value($1)), $3, 'object'); + }), o('ObjAssignable :\ + INDENT Expression OUTDENT', function() { + return new Assign(LOC(1)(new Value($1)), $4, 'object'); + }), o('Comment') + ], + ObjAssignable: [o('Identifier'), o('AlphaNumeric'), o('ThisProperty')], + Return: [ + o('RETURN Expression', function() { + return new Return($2); + }), o('RETURN', function() { + return new Return; + }) + ], + Comment: [ + o('HERECOMMENT', function() { + return new Comment($1); + }) + ], + Code: [ + o('PARAM_START ParamList PARAM_END FuncGlyph Block', function() { + return new Code($2, $5, $4); + }), o('FuncGlyph Block', function() { + return new Code([], $2, $1); + }) + ], + FuncGlyph: [ + o('->', function() { + return 'func'; + }), o('=>', function() { + return 'boundfunc'; + }) + ], + OptComma: [o(''), o(',')], + ParamList: [ + o('', function() { + return []; + }), o('Param', function() { + return [$1]; + }), o('ParamList , Param', function() { + return $1.concat($3); + }), o('ParamList OptComma TERMINATOR Param', function() { + return $1.concat($4); + }), o('ParamList OptComma INDENT ParamList OptComma OUTDENT', function() { + return $1.concat($4); + }) + ], + Param: [ + o('ParamVar', function() { + return new Param($1); + }), o('ParamVar ...', function() { + return new Param($1, null, true); + }), o('ParamVar = Expression', function() { + return new Param($1, $3); + }) + ], + ParamVar: [o('Identifier'), o('ThisProperty'), o('Array'), o('Object')], + Splat: [ + o('Expression ...', function() { + return new Splat($1); + }) + ], + SimpleAssignable: [ + o('Identifier', function() { + return new Value($1); + }), o('Value Accessor', function() { + return $1.add($2); + }), o('Invocation Accessor', function() { + return new Value($1, [].concat($2)); + }), o('ThisProperty') + ], + Assignable: [ + o('SimpleAssignable'), o('Array', function() { + return new Value($1); + }), o('Object', function() { + return new Value($1); + }) + ], + Value: [ + o('Assignable'), o('Literal', function() { + return new Value($1); + }), o('Parenthetical', function() { + return new Value($1); + }), o('Range', function() { + return new Value($1); + }), o('This') + ], + Accessor: [ + o('. Identifier', function() { + return new Access($2); + }), o('?. Identifier', function() { + return new Access($2, 'soak'); + }), o(':: Identifier', function() { + return [LOC(1)(new Access(new Literal('prototype'))), LOC(2)(new Access($2))]; + }), o('?:: Identifier', function() { + return [LOC(1)(new Access(new Literal('prototype'), 'soak')), LOC(2)(new Access($2))]; + }), o('::', function() { + return new Access(new Literal('prototype')); + }), o('Index') + ], + Index: [ + o('INDEX_START IndexValue INDEX_END', function() { + return $2; + }), o('INDEX_SOAK Index', function() { + return extend($2, { + soak: true + }); + }) + ], + IndexValue: [ + o('Expression', function() { + return new Index($1); + }), o('Slice', function() { + return new Slice($1); + }) + ], + Object: [ + o('{ AssignList OptComma }', function() { + return new Obj($2, $1.generated); + }) + ], + AssignList: [ + o('', function() { + return []; + }), o('AssignObj', function() { + return [$1]; + }), o('AssignList , AssignObj', function() { + return $1.concat($3); + }), o('AssignList OptComma TERMINATOR AssignObj', function() { + return $1.concat($4); + }), o('AssignList OptComma INDENT AssignList OptComma OUTDENT', function() { + return $1.concat($4); + }) + ], + Class: [ + o('CLASS', function() { + return new Class; + }), o('CLASS Block', function() { + return new Class(null, null, $2); + }), o('CLASS EXTENDS Expression', function() { + return new Class(null, $3); + }), o('CLASS EXTENDS Expression Block', function() { + return new Class(null, $3, $4); + }), o('CLASS SimpleAssignable', function() { + return new Class($2); + }), o('CLASS SimpleAssignable Block', function() { + return new Class($2, null, $3); + }), o('CLASS SimpleAssignable EXTENDS Expression', function() { + return new Class($2, $4); + }), o('CLASS SimpleAssignable EXTENDS Expression Block', function() { + return new Class($2, $4, $5); + }) + ], + Invocation: [ + o('Value OptFuncExist Arguments', function() { + return new Call($1, $3, $2); + }), o('Invocation OptFuncExist Arguments', function() { + return new Call($1, $3, $2); + }), o('SUPER', function() { + return new Call('super', [new Splat(new Literal('arguments'))]); + }), o('SUPER Arguments', function() { + return new Call('super', $2); + }) + ], + OptFuncExist: [ + o('', function() { + return false; + }), o('FUNC_EXIST', function() { + return true; + }) + ], + Arguments: [ + o('CALL_START CALL_END', function() { + return []; + }), o('CALL_START ArgList OptComma CALL_END', function() { + return $2; + }) + ], + This: [ + o('THIS', function() { + return new Value(new Literal('this')); + }), o('@', function() { + return new Value(new Literal('this')); + }) + ], + ThisProperty: [ + o('@ Identifier', function() { + return new Value(LOC(1)(new Literal('this')), [LOC(2)(new Access($2))], 'this'); + }) + ], + Array: [ + o('[ ]', function() { + return new Arr([]); + }), o('[ ArgList OptComma ]', function() { + return new Arr($2); + }) + ], + RangeDots: [ + o('..', function() { + return 'inclusive'; + }), o('...', function() { + return 'exclusive'; + }) + ], + Range: [ + o('[ Expression RangeDots Expression ]', function() { + return new Range($2, $4, $3); + }) + ], + Slice: [ + o('Expression RangeDots Expression', function() { + return new Range($1, $3, $2); + }), o('Expression RangeDots', function() { + return new Range($1, null, $2); + }), o('RangeDots Expression', function() { + return new Range(null, $2, $1); + }), o('RangeDots', function() { + return new Range(null, null, $1); + }) + ], + ArgList: [ + o('Arg', function() { + return [$1]; + }), o('ArgList , Arg', function() { + return $1.concat($3); + }), o('ArgList OptComma TERMINATOR Arg', function() { + return $1.concat($4); + }), o('INDENT ArgList OptComma OUTDENT', function() { + return $2; + }), o('ArgList OptComma INDENT ArgList OptComma OUTDENT', function() { + return $1.concat($4); + }) + ], + Arg: [o('Expression'), o('Splat')], + SimpleArgs: [ + o('Expression'), o('SimpleArgs , Expression', function() { + return [].concat($1, $3); + }) + ], + Try: [ + o('TRY Block', function() { + return new Try($2); + }), o('TRY Block Catch', function() { + return new Try($2, $3[0], $3[1]); + }), o('TRY Block FINALLY Block', function() { + return new Try($2, null, null, $4); + }), o('TRY Block Catch FINALLY Block', function() { + return new Try($2, $3[0], $3[1], $5); + }) + ], + Catch: [ + o('CATCH Identifier Block', function() { + return [$2, $3]; + }), o('CATCH Object Block', function() { + return [LOC(2)(new Value($2)), $3]; + }) + ], + Throw: [ + o('THROW Expression', function() { + return new Throw($2); + }) + ], + Parenthetical: [ + o('( Body )', function() { + return new Parens($2); + }), o('( INDENT Body OUTDENT )', function() { + return new Parens($3); + }) + ], + WhileSource: [ + o('WHILE Expression', function() { + return new While($2); + }), o('WHILE Expression WHEN Expression', function() { + return new While($2, { + guard: $4 + }); + }), o('UNTIL Expression', function() { + return new While($2, { + invert: true + }); + }), o('UNTIL Expression WHEN Expression', function() { + return new While($2, { + invert: true, + guard: $4 + }); + }) + ], + While: [ + o('WhileSource Block', function() { + return $1.addBody($2); + }), o('Statement WhileSource', function() { + return $2.addBody(LOC(1)(Block.wrap([$1]))); + }), o('Expression WhileSource', function() { + return $2.addBody(LOC(1)(Block.wrap([$1]))); + }), o('Loop', function() { + return $1; + }) + ], + Loop: [ + o('LOOP Block', function() { + return new While(LOC(1)(new Literal('true'))).addBody($2); + }), o('LOOP Expression', function() { + return new While(LOC(1)(new Literal('true'))).addBody(LOC(2)(Block.wrap([$2]))); + }) + ], + For: [ + o('Statement ForBody', function() { + return new For($1, $2); + }), o('Expression ForBody', function() { + return new For($1, $2); + }), o('ForBody Block', function() { + return new For($2, $1); + }) + ], + ForBody: [ + o('FOR Range', function() { + return { + source: LOC(2)(new Value($2)) + }; + }), o('ForStart ForSource', function() { + $2.own = $1.own; + $2.name = $1[0]; + $2.index = $1[1]; + return $2; + }) + ], + ForStart: [ + o('FOR ForVariables', function() { + return $2; + }), o('FOR OWN ForVariables', function() { + $3.own = true; + return $3; + }) + ], + ForValue: [ + o('Identifier'), o('ThisProperty'), o('Array', function() { + return new Value($1); + }), o('Object', function() { + return new Value($1); + }) + ], + ForVariables: [ + o('ForValue', function() { + return [$1]; + }), o('ForValue , ForValue', function() { + return [$1, $3]; + }) + ], + ForSource: [ + o('FORIN Expression', function() { + return { + source: $2 + }; + }), o('FOROF Expression', function() { + return { + source: $2, + object: true + }; + }), o('FORIN Expression WHEN Expression', function() { + return { + source: $2, + guard: $4 + }; + }), o('FOROF Expression WHEN Expression', function() { + return { + source: $2, + guard: $4, + object: true + }; + }), o('FORIN Expression BY Expression', function() { + return { + source: $2, + step: $4 + }; + }), o('FORIN Expression WHEN Expression BY Expression', function() { + return { + source: $2, + guard: $4, + step: $6 + }; + }), o('FORIN Expression BY Expression WHEN Expression', function() { + return { + source: $2, + step: $4, + guard: $6 + }; + }) + ], + Switch: [ + o('SWITCH Expression INDENT Whens OUTDENT', function() { + return new Switch($2, $4); + }), o('SWITCH Expression INDENT Whens ELSE Block OUTDENT', function() { + return new Switch($2, $4, $6); + }), o('SWITCH INDENT Whens OUTDENT', function() { + return new Switch(null, $3); + }), o('SWITCH INDENT Whens ELSE Block OUTDENT', function() { + return new Switch(null, $3, $5); + }) + ], + Whens: [ + o('When'), o('Whens When', function() { + return $1.concat($2); + }) + ], + When: [ + o('LEADING_WHEN SimpleArgs Block', function() { + return [[$2, $3]]; + }), o('LEADING_WHEN SimpleArgs Block TERMINATOR', function() { + return [[$2, $3]]; + }) + ], + IfBlock: [ + o('IF Expression Block', function() { + return new If($2, $3, { + type: $1 + }); + }), o('IfBlock ELSE IF Expression Block', function() { + return $1.addElse(new If($4, $5, { + type: $3 + })); + }) + ], + If: [ + o('IfBlock'), o('IfBlock ELSE Block', function() { + return $1.addElse($3); + }), o('Statement POST_IF Expression', function() { + return new If($3, LOC(1)(Block.wrap([$1])), { + type: $2, + statement: true + }); + }), o('Expression POST_IF Expression', function() { + return new If($3, LOC(1)(Block.wrap([$1])), { + type: $2, + statement: true + }); + }) + ], + Operation: [ + o('UNARY Expression', function() { + return new Op($1, $2); + }), o('- Expression', (function() { + return new Op('-', $2); + }), { + prec: 'UNARY' + }), o('+ Expression', (function() { + return new Op('+', $2); + }), { + prec: 'UNARY' + }), o('-- SimpleAssignable', function() { + return new Op('--', $2); + }), o('++ SimpleAssignable', function() { + return new Op('++', $2); + }), o('SimpleAssignable --', function() { + return new Op('--', $1, null, true); + }), o('SimpleAssignable ++', function() { + return new Op('++', $1, null, true); + }), o('Expression ?', function() { + return new Existence($1); + }), o('Expression + Expression', function() { + return new Op('+', $1, $3); + }), o('Expression - Expression', function() { + return new Op('-', $1, $3); + }), o('Expression MATH Expression', function() { + return new Op($2, $1, $3); + }), o('Expression SHIFT Expression', function() { + return new Op($2, $1, $3); + }), o('Expression COMPARE Expression', function() { + return new Op($2, $1, $3); + }), o('Expression LOGIC Expression', function() { + return new Op($2, $1, $3); + }), o('Expression RELATION Expression', function() { + if ($2.charAt(0) === '!') { + return new Op($2.slice(1), $1, $3).invert(); + } else { + return new Op($2, $1, $3); + } + }), o('SimpleAssignable COMPOUND_ASSIGN\ + Expression', function() { + return new Assign($1, $3, $2); + }), o('SimpleAssignable COMPOUND_ASSIGN\ + INDENT Expression OUTDENT', function() { + return new Assign($1, $4, $2); + }), o('SimpleAssignable COMPOUND_ASSIGN TERMINATOR\ + Expression', function() { + return new Assign($1, $4, $2); + }), o('SimpleAssignable EXTENDS Expression', function() { + return new Extends($1, $3); + }) + ] + }; + + operators = [['left', '.', '?.', '::', '?::'], ['left', 'CALL_START', 'CALL_END'], ['nonassoc', '++', '--'], ['left', '?'], ['right', 'UNARY'], ['left', 'MATH'], ['left', '+', '-'], ['left', 'SHIFT'], ['left', 'RELATION'], ['left', 'COMPARE'], ['left', 'LOGIC'], ['nonassoc', 'INDENT', 'OUTDENT'], ['right', '=', ':', 'COMPOUND_ASSIGN', 'RETURN', 'THROW', 'EXTENDS'], ['right', 'FORIN', 'FOROF', 'BY', 'WHEN'], ['right', 'IF', 'ELSE', 'FOR', 'WHILE', 'UNTIL', 'LOOP', 'SUPER', 'CLASS'], ['right', 'POST_IF']]; + + tokens = []; + + for (name in grammar) { + alternatives = grammar[name]; + grammar[name] = (function() { + var _i, _j, _len, _len1, _ref, _results; + _results = []; + for (_i = 0, _len = alternatives.length; _i < _len; _i++) { + alt = alternatives[_i]; + _ref = alt[0].split(' '); + for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) { + token = _ref[_j]; + if (!grammar[token]) { + tokens.push(token); + } + } + if (name === 'Root') { + alt[1] = "return " + alt[1]; + } + _results.push(alt); + } + return _results; + })(); + } + + exports.parser = new Parser({ + tokens: tokens.join(' '), + bnf: grammar, + operators: operators.reverse(), + startSymbol: 'Root' + }); + +}).call(this); diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/helpers.js b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/helpers.js new file mode 100644 index 00000000..d7bac3b3 --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/helpers.js @@ -0,0 +1,150 @@ +// Generated by CoffeeScript 1.6.1 +(function() { + var buildLocationData, extend, flatten, _ref; + + exports.starts = function(string, literal, start) { + return literal === string.substr(start, literal.length); + }; + + exports.ends = function(string, literal, back) { + var len; + len = literal.length; + return literal === string.substr(string.length - len - (back || 0), len); + }; + + exports.compact = function(array) { + var item, _i, _len, _results; + _results = []; + for (_i = 0, _len = array.length; _i < _len; _i++) { + item = array[_i]; + if (item) { + _results.push(item); + } + } + return _results; + }; + + exports.count = function(string, substr) { + var num, pos; + num = pos = 0; + if (!substr.length) { + return 1 / 0; + } + while (pos = 1 + string.indexOf(substr, pos)) { + num++; + } + return num; + }; + + exports.merge = function(options, overrides) { + return extend(extend({}, options), overrides); + }; + + extend = exports.extend = function(object, properties) { + var key, val; + for (key in properties) { + val = properties[key]; + object[key] = val; + } + return object; + }; + + exports.flatten = flatten = function(array) { + var element, flattened, _i, _len; + flattened = []; + for (_i = 0, _len = array.length; _i < _len; _i++) { + element = array[_i]; + if (element instanceof Array) { + flattened = flattened.concat(flatten(element)); + } else { + flattened.push(element); + } + } + return flattened; + }; + + exports.del = function(obj, key) { + var val; + val = obj[key]; + delete obj[key]; + return val; + }; + + exports.last = function(array, back) { + return array[array.length - (back || 0) - 1]; + }; + + exports.some = (_ref = Array.prototype.some) != null ? _ref : function(fn) { + var e, _i, _len; + for (_i = 0, _len = this.length; _i < _len; _i++) { + e = this[_i]; + if (fn(e)) { + return true; + } + } + return false; + }; + + buildLocationData = function(first, last) { + if (!last) { + return first; + } else { + return { + first_line: first.first_line, + first_column: first.first_column, + last_line: last.last_line, + last_column: last.last_column + }; + } + }; + + exports.addLocationDataFn = function(first, last) { + return function(obj) { + if (((typeof obj) === 'object') && (!!obj['updateLocationDataIfMissing'])) { + obj.updateLocationDataIfMissing(buildLocationData(first, last)); + } + return obj; + }; + }; + + exports.locationDataToString = function(obj) { + var locationData; + if (("2" in obj) && ("first_line" in obj[2])) { + locationData = obj[2]; + } else if ("first_line" in obj) { + locationData = obj; + } + if (locationData) { + return ("" + (locationData.first_line + 1) + ":" + (locationData.first_column + 1) + "-") + ("" + (locationData.last_line + 1) + ":" + (locationData.last_column + 1)); + } else { + return "No location data"; + } + }; + + exports.baseFileName = function(file, stripExt) { + var parts; + if (stripExt == null) { + stripExt = false; + } + parts = file.split('/'); + file = parts[parts.length - 1]; + if (!stripExt) { + return file; + } + parts = file.split('.'); + parts.pop(); + if (parts[parts.length - 1] === 'coffee') { + parts.pop(); + } + return parts.join('.'); + }; + + exports.isCoffee = function(file) { + return /\.((lit)?coffee|coffee\.md)$/.test(file); + }; + + exports.isLiterate = function(file) { + return /\.(litcoffee|coffee\.md)$/.test(file); + }; + +}).call(this); diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/index.js b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/index.js new file mode 100644 index 00000000..1452b452 --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/index.js @@ -0,0 +1,11 @@ +// Generated by CoffeeScript 1.6.1 +(function() { + var key, val, _ref; + + _ref = require('./coffee-script'); + for (key in _ref) { + val = _ref[key]; + exports[key] = val; + } + +}).call(this); diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/lexer.js b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/lexer.js new file mode 100644 index 00000000..5261242e --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/lexer.js @@ -0,0 +1,905 @@ +// Generated by CoffeeScript 1.6.1 +(function() { + var BOM, BOOL, CALLABLE, CODE, COFFEE_ALIASES, COFFEE_ALIAS_MAP, COFFEE_KEYWORDS, COMMENT, COMPARE, COMPOUND_ASSIGN, HEREDOC, HEREDOC_ILLEGAL, HEREDOC_INDENT, HEREGEX, HEREGEX_OMIT, IDENTIFIER, INDEXABLE, INVERSES, JSTOKEN, JS_FORBIDDEN, JS_KEYWORDS, LINE_BREAK, LINE_CONTINUER, LITERATE, LOGIC, Lexer, MATH, MULTILINER, MULTI_DENT, NOT_REGEX, NOT_SPACED_REGEX, NUMBER, OPERATOR, REGEX, RELATION, RESERVED, Rewriter, SHIFT, SIMPLESTR, STRICT_PROSCRIBED, TRAILING_SPACES, UNARY, WHITESPACE, compact, count, key, last, locationDataToString, starts, _ref, _ref1, + __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; + + _ref = require('./rewriter'), Rewriter = _ref.Rewriter, INVERSES = _ref.INVERSES; + + _ref1 = require('./helpers'), count = _ref1.count, starts = _ref1.starts, compact = _ref1.compact, last = _ref1.last, locationDataToString = _ref1.locationDataToString; + + exports.Lexer = Lexer = (function() { + + function Lexer() {} + + Lexer.prototype.tokenize = function(code, opts) { + var consumed, i, tag, _ref2; + if (opts == null) { + opts = {}; + } + this.literate = opts.literate; + this.indent = 0; + this.indebt = 0; + this.outdebt = 0; + this.indents = []; + this.ends = []; + this.tokens = []; + this.chunkLine = opts.line || 0; + this.chunkColumn = opts.column || 0; + code = this.clean(code); + i = 0; + while (this.chunk = code.slice(i)) { + consumed = this.identifierToken() || this.commentToken() || this.whitespaceToken() || this.lineToken() || this.heredocToken() || this.stringToken() || this.numberToken() || this.regexToken() || this.jsToken() || this.literalToken(); + _ref2 = this.getLineAndColumnFromChunk(consumed), this.chunkLine = _ref2[0], this.chunkColumn = _ref2[1]; + i += consumed; + } + this.closeIndentation(); + if (tag = this.ends.pop()) { + this.error("missing " + tag); + } + if (opts.rewrite === false) { + return this.tokens; + } + return (new Rewriter).rewrite(this.tokens); + }; + + Lexer.prototype.clean = function(code) { + var line, lines, match; + if (code.charCodeAt(0) === BOM) { + code = code.slice(1); + } + code = code.replace(/\r/g, '').replace(TRAILING_SPACES, ''); + if (WHITESPACE.test(code)) { + code = "\n" + code; + this.chunkLine--; + } + if (this.literate) { + lines = (function() { + var _i, _len, _ref2, _results; + _ref2 = code.split('\n'); + _results = []; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + line = _ref2[_i]; + if (match = LITERATE.exec(line)) { + _results.push(line.slice(match[0].length)); + } else { + _results.push('# ' + line); + } + } + return _results; + })(); + code = lines.join('\n'); + } + return code; + }; + + Lexer.prototype.identifierToken = function() { + var colon, colonOffset, forcedIdentifier, id, idLength, input, match, poppedToken, prev, tag, tagToken, _ref2, _ref3, _ref4; + if (!(match = IDENTIFIER.exec(this.chunk))) { + return 0; + } + input = match[0], id = match[1], colon = match[2]; + idLength = id.length; + poppedToken = void 0; + if (id === 'own' && this.tag() === 'FOR') { + this.token('OWN', id); + return id.length; + } + forcedIdentifier = colon || (prev = last(this.tokens)) && (((_ref2 = prev[0]) === '.' || _ref2 === '?.' || _ref2 === '::' || _ref2 === '?::') || !prev.spaced && prev[0] === '@'); + tag = 'IDENTIFIER'; + if (!forcedIdentifier && (__indexOf.call(JS_KEYWORDS, id) >= 0 || __indexOf.call(COFFEE_KEYWORDS, id) >= 0)) { + tag = id.toUpperCase(); + if (tag === 'WHEN' && (_ref3 = this.tag(), __indexOf.call(LINE_BREAK, _ref3) >= 0)) { + tag = 'LEADING_WHEN'; + } else if (tag === 'FOR') { + this.seenFor = true; + } else if (tag === 'UNLESS') { + tag = 'IF'; + } else if (__indexOf.call(UNARY, tag) >= 0) { + tag = 'UNARY'; + } else if (__indexOf.call(RELATION, tag) >= 0) { + if (tag !== 'INSTANCEOF' && this.seenFor) { + tag = 'FOR' + tag; + this.seenFor = false; + } else { + tag = 'RELATION'; + if (this.value() === '!') { + poppedToken = this.tokens.pop(); + id = '!' + id; + } + } + } + } + if (__indexOf.call(JS_FORBIDDEN, id) >= 0) { + if (forcedIdentifier) { + tag = 'IDENTIFIER'; + id = new String(id); + id.reserved = true; + } else if (__indexOf.call(RESERVED, id) >= 0) { + this.error("reserved word \"" + id + "\""); + } + } + if (!forcedIdentifier) { + if (__indexOf.call(COFFEE_ALIASES, id) >= 0) { + id = COFFEE_ALIAS_MAP[id]; + } + tag = (function() { + switch (id) { + case '!': + return 'UNARY'; + case '==': + case '!=': + return 'COMPARE'; + case '&&': + case '||': + return 'LOGIC'; + case 'true': + case 'false': + return 'BOOL'; + case 'break': + case 'continue': + return 'STATEMENT'; + default: + return tag; + } + })(); + } + tagToken = this.token(tag, id, 0, idLength); + if (poppedToken) { + _ref4 = [poppedToken[2].first_line, poppedToken[2].first_column], tagToken[2].first_line = _ref4[0], tagToken[2].first_column = _ref4[1]; + } + if (colon) { + colonOffset = input.lastIndexOf(':'); + this.token(':', ':', colonOffset, colon.length); + } + return input.length; + }; + + Lexer.prototype.numberToken = function() { + var binaryLiteral, lexedLength, match, number, octalLiteral; + if (!(match = NUMBER.exec(this.chunk))) { + return 0; + } + number = match[0]; + if (/^0[BOX]/.test(number)) { + this.error("radix prefix '" + number + "' must be lowercase"); + } else if (/E/.test(number) && !/^0x/.test(number)) { + this.error("exponential notation '" + number + "' must be indicated with a lowercase 'e'"); + } else if (/^0\d*[89]/.test(number)) { + this.error("decimal literal '" + number + "' must not be prefixed with '0'"); + } else if (/^0\d+/.test(number)) { + this.error("octal literal '" + number + "' must be prefixed with '0o'"); + } + lexedLength = number.length; + if (octalLiteral = /^0o([0-7]+)/.exec(number)) { + number = '0x' + (parseInt(octalLiteral[1], 8)).toString(16); + } + if (binaryLiteral = /^0b([01]+)/.exec(number)) { + number = '0x' + (parseInt(binaryLiteral[1], 2)).toString(16); + } + this.token('NUMBER', number, 0, lexedLength); + return lexedLength; + }; + + Lexer.prototype.stringToken = function() { + var match, octalEsc, string; + switch (this.chunk.charAt(0)) { + case "'": + if (!(match = SIMPLESTR.exec(this.chunk))) { + return 0; + } + string = match[0]; + this.token('STRING', string.replace(MULTILINER, '\\\n'), 0, string.length); + break; + case '"': + if (!(string = this.balancedString(this.chunk, '"'))) { + return 0; + } + if (0 < string.indexOf('#{', 1)) { + this.interpolateString(string.slice(1, -1), { + strOffset: 1, + lexedLength: string.length + }); + } else { + this.token('STRING', this.escapeLines(string, 0, string.length)); + } + break; + default: + return 0; + } + if (octalEsc = /^(?:\\.|[^\\])*\\(?:0[0-7]|[1-7])/.test(string)) { + this.error("octal escape sequences " + string + " are not allowed"); + } + return string.length; + }; + + Lexer.prototype.heredocToken = function() { + var doc, heredoc, match, quote; + if (!(match = HEREDOC.exec(this.chunk))) { + return 0; + } + heredoc = match[0]; + quote = heredoc.charAt(0); + doc = this.sanitizeHeredoc(match[2], { + quote: quote, + indent: null + }); + if (quote === '"' && 0 <= doc.indexOf('#{')) { + this.interpolateString(doc, { + heredoc: true, + strOffset: 3, + lexedLength: heredoc.length + }); + } else { + this.token('STRING', this.makeString(doc, quote, true), 0, heredoc.length); + } + return heredoc.length; + }; + + Lexer.prototype.commentToken = function() { + var comment, here, match; + if (!(match = this.chunk.match(COMMENT))) { + return 0; + } + comment = match[0], here = match[1]; + if (here) { + this.token('HERECOMMENT', this.sanitizeHeredoc(here, { + herecomment: true, + indent: Array(this.indent + 1).join(' ') + }), 0, comment.length); + } + return comment.length; + }; + + Lexer.prototype.jsToken = function() { + var match, script; + if (!(this.chunk.charAt(0) === '`' && (match = JSTOKEN.exec(this.chunk)))) { + return 0; + } + this.token('JS', (script = match[0]).slice(1, -1), 0, script.length); + return script.length; + }; + + Lexer.prototype.regexToken = function() { + var flags, length, match, prev, regex, _ref2, _ref3; + if (this.chunk.charAt(0) !== '/') { + return 0; + } + if (match = HEREGEX.exec(this.chunk)) { + length = this.heregexToken(match); + return length; + } + prev = last(this.tokens); + if (prev && (_ref2 = prev[0], __indexOf.call((prev.spaced ? NOT_REGEX : NOT_SPACED_REGEX), _ref2) >= 0)) { + return 0; + } + if (!(match = REGEX.exec(this.chunk))) { + return 0; + } + _ref3 = match, match = _ref3[0], regex = _ref3[1], flags = _ref3[2]; + if (regex.slice(0, 2) === '/*') { + this.error('regular expressions cannot begin with `*`'); + } + if (regex === '//') { + regex = '/(?:)/'; + } + this.token('REGEX', "" + regex + flags, 0, match.length); + return match.length; + }; + + Lexer.prototype.heregexToken = function(match) { + var body, flags, flagsOffset, heregex, plusToken, prev, re, tag, token, tokens, value, _i, _len, _ref2, _ref3, _ref4; + heregex = match[0], body = match[1], flags = match[2]; + if (0 > body.indexOf('#{')) { + re = body.replace(HEREGEX_OMIT, '').replace(/\//g, '\\/'); + if (re.match(/^\*/)) { + this.error('regular expressions cannot begin with `*`'); + } + this.token('REGEX', "/" + (re || '(?:)') + "/" + flags, 0, heregex.length); + return heregex.length; + } + this.token('IDENTIFIER', 'RegExp', 0, 0); + this.token('CALL_START', '(', 0, 0); + tokens = []; + _ref2 = this.interpolateString(body, { + regex: true + }); + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + token = _ref2[_i]; + tag = token[0], value = token[1]; + if (tag === 'TOKENS') { + tokens.push.apply(tokens, value); + } else if (tag === 'NEOSTRING') { + if (!(value = value.replace(HEREGEX_OMIT, ''))) { + continue; + } + value = value.replace(/\\/g, '\\\\'); + token[0] = 'STRING'; + token[1] = this.makeString(value, '"', true); + tokens.push(token); + } else { + this.error("Unexpected " + tag); + } + prev = last(this.tokens); + plusToken = ['+', '+']; + plusToken[2] = prev[2]; + tokens.push(plusToken); + } + tokens.pop(); + if (((_ref3 = tokens[0]) != null ? _ref3[0] : void 0) !== 'STRING') { + this.token('STRING', '""', 0, 0); + this.token('+', '+', 0, 0); + } + (_ref4 = this.tokens).push.apply(_ref4, tokens); + if (flags) { + flagsOffset = heregex.lastIndexOf(flags); + this.token(',', ',', flagsOffset, 0); + this.token('STRING', '"' + flags + '"', flagsOffset, flags.length); + } + this.token(')', ')', heregex.length - 1, 0); + return heregex.length; + }; + + Lexer.prototype.lineToken = function() { + var diff, indent, match, noNewlines, size; + if (!(match = MULTI_DENT.exec(this.chunk))) { + return 0; + } + indent = match[0]; + this.seenFor = false; + size = indent.length - 1 - indent.lastIndexOf('\n'); + noNewlines = this.unfinished(); + if (size - this.indebt === this.indent) { + if (noNewlines) { + this.suppressNewlines(); + } else { + this.newlineToken(0); + } + return indent.length; + } + if (size > this.indent) { + if (noNewlines) { + this.indebt = size - this.indent; + this.suppressNewlines(); + return indent.length; + } + diff = size - this.indent + this.outdebt; + this.token('INDENT', diff, 0, indent.length); + this.indents.push(diff); + this.ends.push('OUTDENT'); + this.outdebt = this.indebt = 0; + } else { + this.indebt = 0; + this.outdentToken(this.indent - size, noNewlines, indent.length); + } + this.indent = size; + return indent.length; + }; + + Lexer.prototype.outdentToken = function(moveOut, noNewlines, outdentLength) { + var dent, len; + while (moveOut > 0) { + len = this.indents.length - 1; + if (this.indents[len] === void 0) { + moveOut = 0; + } else if (this.indents[len] === this.outdebt) { + moveOut -= this.outdebt; + this.outdebt = 0; + } else if (this.indents[len] < this.outdebt) { + this.outdebt -= this.indents[len]; + moveOut -= this.indents[len]; + } else { + dent = this.indents.pop() + this.outdebt; + moveOut -= dent; + this.outdebt = 0; + this.pair('OUTDENT'); + this.token('OUTDENT', dent, 0, outdentLength); + } + } + if (dent) { + this.outdebt -= moveOut; + } + while (this.value() === ';') { + this.tokens.pop(); + } + if (!(this.tag() === 'TERMINATOR' || noNewlines)) { + this.token('TERMINATOR', '\n', outdentLength, 0); + } + return this; + }; + + Lexer.prototype.whitespaceToken = function() { + var match, nline, prev; + if (!((match = WHITESPACE.exec(this.chunk)) || (nline = this.chunk.charAt(0) === '\n'))) { + return 0; + } + prev = last(this.tokens); + if (prev) { + prev[match ? 'spaced' : 'newLine'] = true; + } + if (match) { + return match[0].length; + } else { + return 0; + } + }; + + Lexer.prototype.newlineToken = function(offset) { + while (this.value() === ';') { + this.tokens.pop(); + } + if (this.tag() !== 'TERMINATOR') { + this.token('TERMINATOR', '\n', offset, 0); + } + return this; + }; + + Lexer.prototype.suppressNewlines = function() { + if (this.value() === '\\') { + this.tokens.pop(); + } + return this; + }; + + Lexer.prototype.literalToken = function() { + var match, prev, tag, value, _ref2, _ref3, _ref4, _ref5; + if (match = OPERATOR.exec(this.chunk)) { + value = match[0]; + if (CODE.test(value)) { + this.tagParameters(); + } + } else { + value = this.chunk.charAt(0); + } + tag = value; + prev = last(this.tokens); + if (value === '=' && prev) { + if (!prev[1].reserved && (_ref2 = prev[1], __indexOf.call(JS_FORBIDDEN, _ref2) >= 0)) { + this.error("reserved word \"" + (this.value()) + "\" can't be assigned"); + } + if ((_ref3 = prev[1]) === '||' || _ref3 === '&&') { + prev[0] = 'COMPOUND_ASSIGN'; + prev[1] += '='; + return value.length; + } + } + if (value === ';') { + this.seenFor = false; + tag = 'TERMINATOR'; + } else if (__indexOf.call(MATH, value) >= 0) { + tag = 'MATH'; + } else if (__indexOf.call(COMPARE, value) >= 0) { + tag = 'COMPARE'; + } else if (__indexOf.call(COMPOUND_ASSIGN, value) >= 0) { + tag = 'COMPOUND_ASSIGN'; + } else if (__indexOf.call(UNARY, value) >= 0) { + tag = 'UNARY'; + } else if (__indexOf.call(SHIFT, value) >= 0) { + tag = 'SHIFT'; + } else if (__indexOf.call(LOGIC, value) >= 0 || value === '?' && (prev != null ? prev.spaced : void 0)) { + tag = 'LOGIC'; + } else if (prev && !prev.spaced) { + if (value === '(' && (_ref4 = prev[0], __indexOf.call(CALLABLE, _ref4) >= 0)) { + if (prev[0] === '?') { + prev[0] = 'FUNC_EXIST'; + } + tag = 'CALL_START'; + } else if (value === '[' && (_ref5 = prev[0], __indexOf.call(INDEXABLE, _ref5) >= 0)) { + tag = 'INDEX_START'; + switch (prev[0]) { + case '?': + prev[0] = 'INDEX_SOAK'; + } + } + } + switch (value) { + case '(': + case '{': + case '[': + this.ends.push(INVERSES[value]); + break; + case ')': + case '}': + case ']': + this.pair(value); + } + this.token(tag, value); + return value.length; + }; + + Lexer.prototype.sanitizeHeredoc = function(doc, options) { + var attempt, herecomment, indent, match, _ref2; + indent = options.indent, herecomment = options.herecomment; + if (herecomment) { + if (HEREDOC_ILLEGAL.test(doc)) { + this.error("block comment cannot contain \"*/\", starting"); + } + if (doc.indexOf('\n') < 0) { + return doc; + } + } else { + while (match = HEREDOC_INDENT.exec(doc)) { + attempt = match[1]; + if (indent === null || (0 < (_ref2 = attempt.length) && _ref2 < indent.length)) { + indent = attempt; + } + } + } + if (indent) { + doc = doc.replace(RegExp("\\n" + indent, "g"), '\n'); + } + if (this.literate) { + doc = doc.replace(/\n# \n/g, '\n\n'); + } + if (!herecomment) { + doc = doc.replace(/^\n/, ''); + } + return doc; + }; + + Lexer.prototype.tagParameters = function() { + var i, stack, tok, tokens; + if (this.tag() !== ')') { + return this; + } + stack = []; + tokens = this.tokens; + i = tokens.length; + tokens[--i][0] = 'PARAM_END'; + while (tok = tokens[--i]) { + switch (tok[0]) { + case ')': + stack.push(tok); + break; + case '(': + case 'CALL_START': + if (stack.length) { + stack.pop(); + } else if (tok[0] === '(') { + tok[0] = 'PARAM_START'; + return this; + } else { + return this; + } + } + } + return this; + }; + + Lexer.prototype.closeIndentation = function() { + return this.outdentToken(this.indent); + }; + + Lexer.prototype.balancedString = function(str, end) { + var continueCount, i, letter, match, prev, stack, _i, _ref2; + continueCount = 0; + stack = [end]; + for (i = _i = 1, _ref2 = str.length; 1 <= _ref2 ? _i < _ref2 : _i > _ref2; i = 1 <= _ref2 ? ++_i : --_i) { + if (continueCount) { + --continueCount; + continue; + } + switch (letter = str.charAt(i)) { + case '\\': + ++continueCount; + continue; + case end: + stack.pop(); + if (!stack.length) { + return str.slice(0, +i + 1 || 9e9); + } + end = stack[stack.length - 1]; + continue; + } + if (end === '}' && (letter === '"' || letter === "'")) { + stack.push(end = letter); + } else if (end === '}' && letter === '/' && (match = HEREGEX.exec(str.slice(i)) || REGEX.exec(str.slice(i)))) { + continueCount += match[0].length - 1; + } else if (end === '}' && letter === '{') { + stack.push(end = '}'); + } else if (end === '"' && prev === '#' && letter === '{') { + stack.push(end = '}'); + } + prev = letter; + } + return this.error("missing " + (stack.pop()) + ", starting"); + }; + + Lexer.prototype.interpolateString = function(str, options) { + var column, expr, heredoc, i, inner, interpolated, len, letter, lexedLength, line, locationToken, nested, offsetInChunk, pi, plusToken, popped, regex, strOffset, tag, token, tokens, value, _i, _len, _ref2, _ref3, _ref4; + if (options == null) { + options = {}; + } + heredoc = options.heredoc, regex = options.regex, offsetInChunk = options.offsetInChunk, strOffset = options.strOffset, lexedLength = options.lexedLength; + offsetInChunk = offsetInChunk || 0; + strOffset = strOffset || 0; + lexedLength = lexedLength || str.length; + if (heredoc && str.length > 0 && str[0] === '\n') { + str = str.slice(1); + strOffset++; + } + tokens = []; + pi = 0; + i = -1; + while (letter = str.charAt(i += 1)) { + if (letter === '\\') { + i += 1; + continue; + } + if (!(letter === '#' && str.charAt(i + 1) === '{' && (expr = this.balancedString(str.slice(i + 1), '}')))) { + continue; + } + if (pi < i) { + tokens.push(this.makeToken('NEOSTRING', str.slice(pi, i), strOffset + pi)); + } + inner = expr.slice(1, -1); + if (inner.length) { + _ref2 = this.getLineAndColumnFromChunk(strOffset + i + 1), line = _ref2[0], column = _ref2[1]; + nested = new Lexer().tokenize(inner, { + line: line, + column: column, + rewrite: false + }); + popped = nested.pop(); + if (((_ref3 = nested[0]) != null ? _ref3[0] : void 0) === 'TERMINATOR') { + popped = nested.shift(); + } + if (len = nested.length) { + if (len > 1) { + nested.unshift(this.makeToken('(', '(', strOffset + i + 1, 0)); + nested.push(this.makeToken(')', ')', strOffset + i + 1 + inner.length, 0)); + } + tokens.push(['TOKENS', nested]); + } + } + i += expr.length; + pi = i + 1; + } + if ((i > pi && pi < str.length)) { + tokens.push(this.makeToken('NEOSTRING', str.slice(pi), strOffset + pi)); + } + if (regex) { + return tokens; + } + if (!tokens.length) { + return this.token('STRING', '""', offsetInChunk, lexedLength); + } + if (tokens[0][0] !== 'NEOSTRING') { + tokens.unshift(this.makeToken('NEOSTRING', '', offsetInChunk)); + } + if (interpolated = tokens.length > 1) { + this.token('(', '(', offsetInChunk, 0); + } + for (i = _i = 0, _len = tokens.length; _i < _len; i = ++_i) { + token = tokens[i]; + tag = token[0], value = token[1]; + if (i) { + if (i) { + plusToken = this.token('+', '+'); + } + locationToken = tag === 'TOKENS' ? value[0] : token; + plusToken[2] = { + first_line: locationToken[2].first_line, + first_column: locationToken[2].first_column, + last_line: locationToken[2].first_line, + last_column: locationToken[2].first_column + }; + } + if (tag === 'TOKENS') { + (_ref4 = this.tokens).push.apply(_ref4, value); + } else if (tag === 'NEOSTRING') { + token[0] = 'STRING'; + token[1] = this.makeString(value, '"', heredoc); + this.tokens.push(token); + } else { + this.error("Unexpected " + tag); + } + } + if (interpolated) { + this.token(')', ')', offsetInChunk + lexedLength, 0); + } + return tokens; + }; + + Lexer.prototype.pair = function(tag) { + var size, wanted; + if (tag !== (wanted = last(this.ends))) { + if ('OUTDENT' !== wanted) { + this.error("unmatched " + tag); + } + this.indent -= size = last(this.indents); + this.outdentToken(size, true); + return this.pair(tag); + } + return this.ends.pop(); + }; + + Lexer.prototype.getLineAndColumnFromChunk = function(offset) { + var column, lineCount, lines, string; + if (offset === 0) { + return [this.chunkLine, this.chunkColumn]; + } + if (offset >= this.chunk.length) { + string = this.chunk; + } else { + string = this.chunk.slice(0, +(offset - 1) + 1 || 9e9); + } + lineCount = count(string, '\n'); + column = this.chunkColumn; + if (lineCount > 0) { + lines = string.split('\n'); + column = (last(lines)).length; + } else { + column += string.length; + } + return [this.chunkLine + lineCount, column]; + }; + + Lexer.prototype.makeToken = function(tag, value, offsetInChunk, length) { + var lastCharacter, locationData, token, _ref2, _ref3; + if (offsetInChunk == null) { + offsetInChunk = 0; + } + if (length == null) { + length = value.length; + } + locationData = {}; + _ref2 = this.getLineAndColumnFromChunk(offsetInChunk), locationData.first_line = _ref2[0], locationData.first_column = _ref2[1]; + lastCharacter = Math.max(0, length - 1); + _ref3 = this.getLineAndColumnFromChunk(offsetInChunk + (length - 1)), locationData.last_line = _ref3[0], locationData.last_column = _ref3[1]; + token = [tag, value, locationData]; + return token; + }; + + Lexer.prototype.token = function(tag, value, offsetInChunk, length) { + var token; + token = this.makeToken(tag, value, offsetInChunk, length); + this.tokens.push(token); + return token; + }; + + Lexer.prototype.tag = function(index, tag) { + var tok; + return (tok = last(this.tokens, index)) && (tag ? tok[0] = tag : tok[0]); + }; + + Lexer.prototype.value = function(index, val) { + var tok; + return (tok = last(this.tokens, index)) && (val ? tok[1] = val : tok[1]); + }; + + Lexer.prototype.unfinished = function() { + var _ref2; + return LINE_CONTINUER.test(this.chunk) || ((_ref2 = this.tag()) === '\\' || _ref2 === '.' || _ref2 === '?.' || _ref2 === '?::' || _ref2 === 'UNARY' || _ref2 === 'MATH' || _ref2 === '+' || _ref2 === '-' || _ref2 === 'SHIFT' || _ref2 === 'RELATION' || _ref2 === 'COMPARE' || _ref2 === 'LOGIC' || _ref2 === 'THROW' || _ref2 === 'EXTENDS'); + }; + + Lexer.prototype.escapeLines = function(str, heredoc) { + return str.replace(MULTILINER, heredoc ? '\\n' : ''); + }; + + Lexer.prototype.makeString = function(body, quote, heredoc) { + if (!body) { + return quote + quote; + } + body = body.replace(/\\([\s\S])/g, function(match, contents) { + if (contents === '\n' || contents === quote) { + return contents; + } else { + return match; + } + }); + body = body.replace(RegExp("" + quote, "g"), '\\$&'); + return quote + this.escapeLines(body, heredoc) + quote; + }; + + Lexer.prototype.error = function(message) { + throw SyntaxError("" + message + " on line " + (this.chunkLine + 1)); + }; + + return Lexer; + + })(); + + JS_KEYWORDS = ['true', 'false', 'null', 'this', 'new', 'delete', 'typeof', 'in', 'instanceof', 'return', 'throw', 'break', 'continue', 'debugger', 'if', 'else', 'switch', 'for', 'while', 'do', 'try', 'catch', 'finally', 'class', 'extends', 'super']; + + COFFEE_KEYWORDS = ['undefined', 'then', 'unless', 'until', 'loop', 'of', 'by', 'when']; + + COFFEE_ALIAS_MAP = { + and: '&&', + or: '||', + is: '==', + isnt: '!=', + not: '!', + yes: 'true', + no: 'false', + on: 'true', + off: 'false' + }; + + COFFEE_ALIASES = (function() { + var _results; + _results = []; + for (key in COFFEE_ALIAS_MAP) { + _results.push(key); + } + return _results; + })(); + + COFFEE_KEYWORDS = COFFEE_KEYWORDS.concat(COFFEE_ALIASES); + + RESERVED = ['case', 'default', 'function', 'var', 'void', 'with', 'const', 'let', 'enum', 'export', 'import', 'native', '__hasProp', '__extends', '__slice', '__bind', '__indexOf', 'implements', 'interface', 'package', 'private', 'protected', 'public', 'static', 'yield']; + + STRICT_PROSCRIBED = ['arguments', 'eval']; + + JS_FORBIDDEN = JS_KEYWORDS.concat(RESERVED).concat(STRICT_PROSCRIBED); + + exports.RESERVED = RESERVED.concat(JS_KEYWORDS).concat(COFFEE_KEYWORDS).concat(STRICT_PROSCRIBED); + + exports.STRICT_PROSCRIBED = STRICT_PROSCRIBED; + + BOM = 65279; + + IDENTIFIER = /^([$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)([^\n\S]*:(?!:))?/; + + NUMBER = /^0b[01]+|^0o[0-7]+|^0x[\da-f]+|^\d*\.?\d+(?:e[+-]?\d+)?/i; + + HEREDOC = /^("""|''')([\s\S]*?)(?:\n[^\n\S]*)?\1/; + + OPERATOR = /^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>])\2=?|\?(\.|::)|\.{2,3})/; + + WHITESPACE = /^[^\n\S]+/; + + COMMENT = /^###([^#][\s\S]*?)(?:###[^\n\S]*|(?:###)$)|^(?:\s*#(?!##[^#]).*)+/; + + LITERATE = /^([ ]{4}|\t)/; + + CODE = /^[-=]>/; + + MULTI_DENT = /^(?:\n[^\n\S]*)+/; + + SIMPLESTR = /^'[^\\']*(?:\\.[^\\']*)*'/; + + JSTOKEN = /^`[^\\`]*(?:\\.[^\\`]*)*`/; + + REGEX = /^(\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)([imgy]{0,4})(?!\w)/; + + HEREGEX = /^\/{3}([\s\S]+?)\/{3}([imgy]{0,4})(?!\w)/; + + HEREGEX_OMIT = /\s+(?:#.*)?/g; + + MULTILINER = /\n/g; + + HEREDOC_INDENT = /\n+([^\n\S]*)/g; + + HEREDOC_ILLEGAL = /\*\//; + + LINE_CONTINUER = /^\s*(?:,|\??\.(?![.\d])|::)/; + + TRAILING_SPACES = /\s+$/; + + COMPOUND_ASSIGN = ['-=', '+=', '/=', '*=', '%=', '||=', '&&=', '?=', '<<=', '>>=', '>>>=', '&=', '^=', '|=']; + + UNARY = ['!', '~', 'NEW', 'TYPEOF', 'DELETE', 'DO']; + + LOGIC = ['&&', '||', '&', '|', '^']; + + SHIFT = ['<<', '>>', '>>>']; + + COMPARE = ['==', '!=', '<', '>', '<=', '>=']; + + MATH = ['*', '/', '%']; + + RELATION = ['IN', 'OF', 'INSTANCEOF']; + + BOOL = ['TRUE', 'FALSE']; + + NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', 'NULL', 'UNDEFINED', '++', '--', ']']; + + NOT_SPACED_REGEX = NOT_REGEX.concat(')', '}', 'THIS', 'IDENTIFIER', 'STRING'); + + CALLABLE = ['IDENTIFIER', 'STRING', 'REGEX', ')', ']', '}', '?', '::', '@', 'THIS', 'SUPER']; + + INDEXABLE = CALLABLE.concat('NUMBER', 'BOOL', 'NULL', 'UNDEFINED'); + + LINE_BREAK = ['INDENT', 'OUTDENT', 'TERMINATOR']; + +}).call(this); diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/nodes.js b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/nodes.js new file mode 100644 index 00000000..c274724d --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/nodes.js @@ -0,0 +1,3088 @@ +// Generated by CoffeeScript 1.6.1 +(function() { + var Access, Arr, Assign, Base, Block, Call, Class, Closure, Code, CodeFragment, Comment, Existence, Extends, For, IDENTIFIER, IDENTIFIER_STR, IS_STRING, If, In, Index, LEVEL_ACCESS, LEVEL_COND, LEVEL_LIST, LEVEL_OP, LEVEL_PAREN, LEVEL_TOP, Literal, METHOD_DEF, NEGATE, NO, Obj, Op, Param, Parens, RESERVED, Range, Return, SIMPLENUM, STRICT_PROSCRIBED, Scope, Slice, Splat, Switch, TAB, THIS, Throw, Try, UTILITIES, Value, While, YES, addLocationDataFn, compact, del, ends, extend, flatten, fragmentsToText, last, locationDataToString, merge, multident, some, starts, unfoldSoak, utility, _ref, _ref1, + __hasProp = {}.hasOwnProperty, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, + __slice = [].slice; + + Error.stackTraceLimit = Infinity; + + Scope = require('./scope').Scope; + + _ref = require('./lexer'), RESERVED = _ref.RESERVED, STRICT_PROSCRIBED = _ref.STRICT_PROSCRIBED; + + _ref1 = require('./helpers'), compact = _ref1.compact, flatten = _ref1.flatten, extend = _ref1.extend, merge = _ref1.merge, del = _ref1.del, starts = _ref1.starts, ends = _ref1.ends, last = _ref1.last, some = _ref1.some, addLocationDataFn = _ref1.addLocationDataFn, locationDataToString = _ref1.locationDataToString; + + exports.extend = extend; + + exports.addLocationDataFn = addLocationDataFn; + + YES = function() { + return true; + }; + + NO = function() { + return false; + }; + + THIS = function() { + return this; + }; + + NEGATE = function() { + this.negated = !this.negated; + return this; + }; + + exports.CodeFragment = CodeFragment = (function() { + + function CodeFragment(parent, code) { + var _ref2; + this.code = "" + code; + this.locationData = parent != null ? parent.locationData : void 0; + this.type = (parent != null ? (_ref2 = parent.constructor) != null ? _ref2.name : void 0 : void 0) || 'unknown'; + } + + CodeFragment.prototype.toString = function() { + return "" + this.code + [this.locationData ? ": " + locationDataToString(this.locationData) : void 0]; + }; + + return CodeFragment; + + })(); + + fragmentsToText = function(fragments) { + var fragment; + return ((function() { + var _i, _len, _results; + _results = []; + for (_i = 0, _len = fragments.length; _i < _len; _i++) { + fragment = fragments[_i]; + _results.push(fragment.code); + } + return _results; + })()).join(''); + }; + + exports.Base = Base = (function() { + + function Base() {} + + Base.prototype.compile = function(o, lvl) { + return fragmentsToText(this.compileToFragments(o, lvl)); + }; + + Base.prototype.compileToFragments = function(o, lvl) { + var node; + o = extend({}, o); + if (lvl) { + o.level = lvl; + } + node = this.unfoldSoak(o) || this; + node.tab = o.indent; + if (o.level === LEVEL_TOP || !node.isStatement(o)) { + return node.compileNode(o); + } else { + return node.compileClosure(o); + } + }; + + Base.prototype.compileClosure = function(o) { + if (this.jumps()) { + throw SyntaxError('cannot use a pure statement in an expression.'); + } + o.sharedScope = true; + return Closure.wrap(this).compileNode(o); + }; + + Base.prototype.cache = function(o, level, reused) { + var ref, sub; + if (!this.isComplex()) { + ref = level ? this.compileToFragments(o, level) : this; + return [ref, ref]; + } else { + ref = new Literal(reused || o.scope.freeVariable('ref')); + sub = new Assign(ref, this); + if (level) { + return [sub.compileToFragments(o, level), [this.makeCode(ref.value)]]; + } else { + return [sub, ref]; + } + } + }; + + Base.prototype.cacheToCodeFragments = function(cacheValues) { + return [fragmentsToText(cacheValues[0]), fragmentsToText(cacheValues[1])]; + }; + + Base.prototype.makeReturn = function(res) { + var me; + me = this.unwrapAll(); + if (res) { + return new Call(new Literal("" + res + ".push"), [me]); + } else { + return new Return(me); + } + }; + + Base.prototype.contains = function(pred) { + var contains; + contains = false; + this.traverseChildren(false, function(node) { + if (pred(node)) { + contains = true; + return false; + } + }); + return contains; + }; + + Base.prototype.containsType = function(type) { + return this instanceof type || this.contains(function(node) { + return node instanceof type; + }); + }; + + Base.prototype.lastNonComment = function(list) { + var i; + i = list.length; + while (i--) { + if (!(list[i] instanceof Comment)) { + return list[i]; + } + } + return null; + }; + + Base.prototype.toString = function(idt, name) { + var location, tree; + if (idt == null) { + idt = ''; + } + if (name == null) { + name = this.constructor.name; + } + location = this.locationData ? locationDataToString(this.locationData) : "??"; + tree = '\n' + idt + location + ": " + name; + if (this.soak) { + tree += '?'; + } + this.eachChild(function(node) { + return tree += node.toString(idt + TAB); + }); + return tree; + }; + + Base.prototype.eachChild = function(func) { + var attr, child, _i, _j, _len, _len1, _ref2, _ref3; + if (!this.children) { + return this; + } + _ref2 = this.children; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + attr = _ref2[_i]; + if (this[attr]) { + _ref3 = flatten([this[attr]]); + for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) { + child = _ref3[_j]; + if (func(child) === false) { + return this; + } + } + } + } + return this; + }; + + Base.prototype.traverseChildren = function(crossScope, func) { + return this.eachChild(function(child) { + if (func(child) === false) { + return false; + } + return child.traverseChildren(crossScope, func); + }); + }; + + Base.prototype.invert = function() { + return new Op('!', this); + }; + + Base.prototype.unwrapAll = function() { + var node; + node = this; + while (node !== (node = node.unwrap())) { + continue; + } + return node; + }; + + Base.prototype.children = []; + + Base.prototype.isStatement = NO; + + Base.prototype.jumps = NO; + + Base.prototype.isComplex = YES; + + Base.prototype.isChainable = NO; + + Base.prototype.isAssignable = NO; + + Base.prototype.unwrap = THIS; + + Base.prototype.unfoldSoak = NO; + + Base.prototype.assigns = NO; + + Base.prototype.updateLocationDataIfMissing = function(locationData) { + if (!this.locationData) { + this.locationData = {}; + extend(this.locationData, locationData); + } + return this.eachChild(function(child) { + return child.updateLocationDataIfMissing(locationData); + }); + }; + + Base.prototype.makeCode = function(code) { + return new CodeFragment(this, code); + }; + + Base.prototype.wrapInBraces = function(fragments) { + return [].concat(this.makeCode('('), fragments, this.makeCode(')')); + }; + + Base.prototype.joinFragmentArrays = function(fragmentsList, joinStr) { + var answer, fragments, i, _i, _len; + answer = []; + for (i = _i = 0, _len = fragmentsList.length; _i < _len; i = ++_i) { + fragments = fragmentsList[i]; + if (i) { + answer.push(this.makeCode(joinStr)); + } + answer = answer.concat(fragments); + } + return answer; + }; + + return Base; + + })(); + + exports.Block = Block = (function(_super) { + + __extends(Block, _super); + + function Block(nodes) { + this.expressions = compact(flatten(nodes || [])); + } + + Block.prototype.children = ['expressions']; + + Block.prototype.push = function(node) { + this.expressions.push(node); + return this; + }; + + Block.prototype.pop = function() { + return this.expressions.pop(); + }; + + Block.prototype.unshift = function(node) { + this.expressions.unshift(node); + return this; + }; + + Block.prototype.unwrap = function() { + if (this.expressions.length === 1) { + return this.expressions[0]; + } else { + return this; + } + }; + + Block.prototype.isEmpty = function() { + return !this.expressions.length; + }; + + Block.prototype.isStatement = function(o) { + var exp, _i, _len, _ref2; + _ref2 = this.expressions; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + exp = _ref2[_i]; + if (exp.isStatement(o)) { + return true; + } + } + return false; + }; + + Block.prototype.jumps = function(o) { + var exp, _i, _len, _ref2; + _ref2 = this.expressions; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + exp = _ref2[_i]; + if (exp.jumps(o)) { + return exp; + } + } + }; + + Block.prototype.makeReturn = function(res) { + var expr, len; + len = this.expressions.length; + while (len--) { + expr = this.expressions[len]; + if (!(expr instanceof Comment)) { + this.expressions[len] = expr.makeReturn(res); + if (expr instanceof Return && !expr.expression) { + this.expressions.splice(len, 1); + } + break; + } + } + return this; + }; + + Block.prototype.compileToFragments = function(o, level) { + if (o == null) { + o = {}; + } + if (o.scope) { + return Block.__super__.compileToFragments.call(this, o, level); + } else { + return this.compileRoot(o); + } + }; + + Block.prototype.compileNode = function(o) { + var answer, compiledNodes, fragments, index, node, top, _i, _len, _ref2; + this.tab = o.indent; + top = o.level === LEVEL_TOP; + compiledNodes = []; + _ref2 = this.expressions; + for (index = _i = 0, _len = _ref2.length; _i < _len; index = ++_i) { + node = _ref2[index]; + node = node.unwrapAll(); + node = node.unfoldSoak(o) || node; + if (node instanceof Block) { + compiledNodes.push(node.compileNode(o)); + } else if (top) { + node.front = true; + fragments = node.compileToFragments(o); + if (!node.isStatement(o)) { + fragments.unshift(this.makeCode("" + this.tab)); + fragments.push(this.makeCode(";")); + } + compiledNodes.push(fragments); + } else { + compiledNodes.push(node.compileToFragments(o, LEVEL_LIST)); + } + } + if (top) { + if (this.spaced) { + return [].concat(this.makeCode("\n"), this.joinFragmentArrays(compiledNodes, '\n\n'), this.makeCode("\n")); + } else { + return this.joinFragmentArrays(compiledNodes, '\n'); + } + } + if (compiledNodes.length) { + answer = this.joinFragmentArrays(compiledNodes, ', '); + } else { + answer = [this.makeCode("void 0")]; + } + if (compiledNodes.length > 1 && o.level >= LEVEL_LIST) { + return this.wrapInBraces(answer); + } else { + return answer; + } + }; + + Block.prototype.compileRoot = function(o) { + var exp, fragments, i, prelude, preludeExps, rest; + o.indent = o.bare ? '' : TAB; + o.scope = new Scope(null, this, null); + o.level = LEVEL_TOP; + this.spaced = true; + prelude = []; + if (!o.bare) { + preludeExps = (function() { + var _i, _len, _ref2, _results; + _ref2 = this.expressions; + _results = []; + for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) { + exp = _ref2[i]; + if (!(exp.unwrap() instanceof Comment)) { + break; + } + _results.push(exp); + } + return _results; + }).call(this); + rest = this.expressions.slice(preludeExps.length); + this.expressions = preludeExps; + if (preludeExps.length) { + prelude = this.compileNode(merge(o, { + indent: '' + })); + prelude.push(this.makeCode("\n")); + } + this.expressions = rest; + } + fragments = this.compileWithDeclarations(o); + if (o.bare) { + return fragments; + } + return [].concat(prelude, this.makeCode("(function() {\n"), fragments, this.makeCode("\n}).call(this);\n")); + }; + + Block.prototype.compileWithDeclarations = function(o) { + var assigns, declars, exp, fragments, i, post, rest, scope, spaced, _i, _len, _ref2, _ref3, _ref4; + fragments = []; + post = []; + _ref2 = this.expressions; + for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) { + exp = _ref2[i]; + exp = exp.unwrap(); + if (!(exp instanceof Comment || exp instanceof Literal)) { + break; + } + } + o = merge(o, { + level: LEVEL_TOP + }); + if (i) { + rest = this.expressions.splice(i, 9e9); + _ref3 = [this.spaced, false], spaced = _ref3[0], this.spaced = _ref3[1]; + _ref4 = [this.compileNode(o), spaced], fragments = _ref4[0], this.spaced = _ref4[1]; + this.expressions = rest; + } + post = this.compileNode(o); + scope = o.scope; + if (scope.expressions === this) { + declars = o.scope.hasDeclarations(); + assigns = scope.hasAssignments; + if (declars || assigns) { + if (i) { + fragments.push(this.makeCode('\n')); + } + fragments.push(this.makeCode("" + this.tab + "var ")); + if (declars) { + fragments.push(this.makeCode(scope.declaredVariables().join(', '))); + } + if (assigns) { + if (declars) { + fragments.push(this.makeCode(",\n" + (this.tab + TAB))); + } + fragments.push(this.makeCode(scope.assignedVariables().join(",\n" + (this.tab + TAB)))); + } + fragments.push(this.makeCode(';\n')); + } + } + return fragments.concat(post); + }; + + Block.wrap = function(nodes) { + if (nodes.length === 1 && nodes[0] instanceof Block) { + return nodes[0]; + } + return new Block(nodes); + }; + + return Block; + + })(Base); + + exports.Literal = Literal = (function(_super) { + + __extends(Literal, _super); + + function Literal(value) { + this.value = value; + } + + Literal.prototype.makeReturn = function() { + if (this.isStatement()) { + return this; + } else { + return Literal.__super__.makeReturn.apply(this, arguments); + } + }; + + Literal.prototype.isAssignable = function() { + return IDENTIFIER.test(this.value); + }; + + Literal.prototype.isStatement = function() { + var _ref2; + return (_ref2 = this.value) === 'break' || _ref2 === 'continue' || _ref2 === 'debugger'; + }; + + Literal.prototype.isComplex = NO; + + Literal.prototype.assigns = function(name) { + return name === this.value; + }; + + Literal.prototype.jumps = function(o) { + if (this.value === 'break' && !((o != null ? o.loop : void 0) || (o != null ? o.block : void 0))) { + return this; + } + if (this.value === 'continue' && !(o != null ? o.loop : void 0)) { + return this; + } + }; + + Literal.prototype.compileNode = function(o) { + var answer, code, _ref2; + code = this.value === 'this' ? ((_ref2 = o.scope.method) != null ? _ref2.bound : void 0) ? o.scope.method.context : this.value : this.value.reserved ? "\"" + this.value + "\"" : this.value; + answer = this.isStatement() ? "" + this.tab + code + ";" : code; + return [this.makeCode(answer)]; + }; + + Literal.prototype.toString = function() { + return ' "' + this.value + '"'; + }; + + return Literal; + + })(Base); + + exports.Undefined = (function(_super) { + + __extends(Undefined, _super); + + function Undefined() { + return Undefined.__super__.constructor.apply(this, arguments); + } + + Undefined.prototype.isAssignable = NO; + + Undefined.prototype.isComplex = NO; + + Undefined.prototype.compileNode = function(o) { + return [this.makeCode(o.level >= LEVEL_ACCESS ? '(void 0)' : 'void 0')]; + }; + + return Undefined; + + })(Base); + + exports.Null = (function(_super) { + + __extends(Null, _super); + + function Null() { + return Null.__super__.constructor.apply(this, arguments); + } + + Null.prototype.isAssignable = NO; + + Null.prototype.isComplex = NO; + + Null.prototype.compileNode = function() { + return [this.makeCode("null")]; + }; + + return Null; + + })(Base); + + exports.Bool = (function(_super) { + + __extends(Bool, _super); + + Bool.prototype.isAssignable = NO; + + Bool.prototype.isComplex = NO; + + Bool.prototype.compileNode = function() { + return [this.makeCode(this.val)]; + }; + + function Bool(val) { + this.val = val; + } + + return Bool; + + })(Base); + + exports.Return = Return = (function(_super) { + + __extends(Return, _super); + + function Return(expr) { + if (expr && !expr.unwrap().isUndefined) { + this.expression = expr; + } + } + + Return.prototype.children = ['expression']; + + Return.prototype.isStatement = YES; + + Return.prototype.makeReturn = THIS; + + Return.prototype.jumps = THIS; + + Return.prototype.compileToFragments = function(o, level) { + var expr, _ref2; + expr = (_ref2 = this.expression) != null ? _ref2.makeReturn() : void 0; + if (expr && !(expr instanceof Return)) { + return expr.compileToFragments(o, level); + } else { + return Return.__super__.compileToFragments.call(this, o, level); + } + }; + + Return.prototype.compileNode = function(o) { + var answer; + answer = []; + answer.push(this.makeCode(this.tab + ("return" + [this.expression ? " " : void 0]))); + if (this.expression) { + answer = answer.concat(this.expression.compileToFragments(o, LEVEL_PAREN)); + } + answer.push(this.makeCode(";")); + return answer; + }; + + return Return; + + })(Base); + + exports.Value = Value = (function(_super) { + + __extends(Value, _super); + + function Value(base, props, tag) { + if (!props && base instanceof Value) { + return base; + } + this.base = base; + this.properties = props || []; + if (tag) { + this[tag] = true; + } + return this; + } + + Value.prototype.children = ['base', 'properties']; + + Value.prototype.add = function(props) { + this.properties = this.properties.concat(props); + return this; + }; + + Value.prototype.hasProperties = function() { + return !!this.properties.length; + }; + + Value.prototype.isArray = function() { + return !this.properties.length && this.base instanceof Arr; + }; + + Value.prototype.isComplex = function() { + return this.hasProperties() || this.base.isComplex(); + }; + + Value.prototype.isAssignable = function() { + return this.hasProperties() || this.base.isAssignable(); + }; + + Value.prototype.isSimpleNumber = function() { + return this.base instanceof Literal && SIMPLENUM.test(this.base.value); + }; + + Value.prototype.isString = function() { + return this.base instanceof Literal && IS_STRING.test(this.base.value); + }; + + Value.prototype.isAtomic = function() { + var node, _i, _len, _ref2; + _ref2 = this.properties.concat(this.base); + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + node = _ref2[_i]; + if (node.soak || node instanceof Call) { + return false; + } + } + return true; + }; + + Value.prototype.isStatement = function(o) { + return !this.properties.length && this.base.isStatement(o); + }; + + Value.prototype.assigns = function(name) { + return !this.properties.length && this.base.assigns(name); + }; + + Value.prototype.jumps = function(o) { + return !this.properties.length && this.base.jumps(o); + }; + + Value.prototype.isObject = function(onlyGenerated) { + if (this.properties.length) { + return false; + } + return (this.base instanceof Obj) && (!onlyGenerated || this.base.generated); + }; + + Value.prototype.isSplice = function() { + return last(this.properties) instanceof Slice; + }; + + Value.prototype.unwrap = function() { + if (this.properties.length) { + return this; + } else { + return this.base; + } + }; + + Value.prototype.cacheReference = function(o) { + var base, bref, name, nref; + name = last(this.properties); + if (this.properties.length < 2 && !this.base.isComplex() && !(name != null ? name.isComplex() : void 0)) { + return [this, this]; + } + base = new Value(this.base, this.properties.slice(0, -1)); + if (base.isComplex()) { + bref = new Literal(o.scope.freeVariable('base')); + base = new Value(new Parens(new Assign(bref, base))); + } + if (!name) { + return [base, bref]; + } + if (name.isComplex()) { + nref = new Literal(o.scope.freeVariable('name')); + name = new Index(new Assign(nref, name.index)); + nref = new Index(nref); + } + return [base.add(name), new Value(bref || base.base, [nref || name])]; + }; + + Value.prototype.compileNode = function(o) { + var fragments, prop, props, _i, _len; + this.base.front = this.front; + props = this.properties; + fragments = this.base.compileToFragments(o, (props.length ? LEVEL_ACCESS : null)); + if ((this.base instanceof Parens || props.length) && SIMPLENUM.test(fragmentsToText(fragments))) { + fragments.push(this.makeCode('.')); + } + for (_i = 0, _len = props.length; _i < _len; _i++) { + prop = props[_i]; + fragments.push.apply(fragments, prop.compileToFragments(o)); + } + return fragments; + }; + + Value.prototype.unfoldSoak = function(o) { + var _ref2, + _this = this; + return (_ref2 = this.unfoldedSoak) != null ? _ref2 : this.unfoldedSoak = (function() { + var fst, i, ifn, prop, ref, snd, _i, _len, _ref3, _ref4; + if (ifn = _this.base.unfoldSoak(o)) { + (_ref3 = ifn.body.properties).push.apply(_ref3, _this.properties); + return ifn; + } + _ref4 = _this.properties; + for (i = _i = 0, _len = _ref4.length; _i < _len; i = ++_i) { + prop = _ref4[i]; + if (!prop.soak) { + continue; + } + prop.soak = false; + fst = new Value(_this.base, _this.properties.slice(0, i)); + snd = new Value(_this.base, _this.properties.slice(i)); + if (fst.isComplex()) { + ref = new Literal(o.scope.freeVariable('ref')); + fst = new Parens(new Assign(ref, fst)); + snd.base = ref; + } + return new If(new Existence(fst), snd, { + soak: true + }); + } + return false; + })(); + }; + + return Value; + + })(Base); + + exports.Comment = Comment = (function(_super) { + + __extends(Comment, _super); + + function Comment(comment) { + this.comment = comment; + } + + Comment.prototype.isStatement = YES; + + Comment.prototype.makeReturn = THIS; + + Comment.prototype.compileNode = function(o, level) { + var code; + code = '/*' + multident(this.comment, this.tab) + ("\n" + this.tab + "*/\n"); + if ((level || o.level) === LEVEL_TOP) { + code = o.indent + code; + } + return [this.makeCode(code)]; + }; + + return Comment; + + })(Base); + + exports.Call = Call = (function(_super) { + + __extends(Call, _super); + + function Call(variable, args, soak) { + this.args = args != null ? args : []; + this.soak = soak; + this.isNew = false; + this.isSuper = variable === 'super'; + this.variable = this.isSuper ? null : variable; + } + + Call.prototype.children = ['variable', 'args']; + + Call.prototype.newInstance = function() { + var base, _ref2; + base = ((_ref2 = this.variable) != null ? _ref2.base : void 0) || this.variable; + if (base instanceof Call && !base.isNew) { + base.newInstance(); + } else { + this.isNew = true; + } + return this; + }; + + Call.prototype.superReference = function(o) { + var accesses, method; + method = o.scope.namedMethod(); + if (method != null ? method.klass : void 0) { + accesses = [new Access(new Literal('__super__'))]; + if (method["static"]) { + accesses.push(new Access(new Literal('constructor'))); + } + accesses.push(new Access(new Literal(method.name))); + return (new Value(new Literal(method.klass), accesses)).compile(o); + } else if (method != null ? method.ctor : void 0) { + return "" + method.name + ".__super__.constructor"; + } else { + throw SyntaxError('cannot call super outside of an instance method.'); + } + }; + + Call.prototype.superThis = function(o) { + var method; + method = o.scope.method; + return (method && !method.klass && method.context) || "this"; + }; + + Call.prototype.unfoldSoak = function(o) { + var call, ifn, left, list, rite, _i, _len, _ref2, _ref3; + if (this.soak) { + if (this.variable) { + if (ifn = unfoldSoak(o, this, 'variable')) { + return ifn; + } + _ref2 = new Value(this.variable).cacheReference(o), left = _ref2[0], rite = _ref2[1]; + } else { + left = new Literal(this.superReference(o)); + rite = new Value(left); + } + rite = new Call(rite, this.args); + rite.isNew = this.isNew; + left = new Literal("typeof " + (left.compile(o)) + " === \"function\""); + return new If(left, new Value(rite), { + soak: true + }); + } + call = this; + list = []; + while (true) { + if (call.variable instanceof Call) { + list.push(call); + call = call.variable; + continue; + } + if (!(call.variable instanceof Value)) { + break; + } + list.push(call); + if (!((call = call.variable.base) instanceof Call)) { + break; + } + } + _ref3 = list.reverse(); + for (_i = 0, _len = _ref3.length; _i < _len; _i++) { + call = _ref3[_i]; + if (ifn) { + if (call.variable instanceof Call) { + call.variable = ifn; + } else { + call.variable.base = ifn; + } + } + ifn = unfoldSoak(o, call, 'variable'); + } + return ifn; + }; + + Call.prototype.compileNode = function(o) { + var arg, argIndex, compiledArgs, compiledArray, fragments, preface, _i, _len, _ref2, _ref3; + if ((_ref2 = this.variable) != null) { + _ref2.front = this.front; + } + compiledArray = Splat.compileSplattedArray(o, this.args, true); + if (compiledArray.length) { + return this.compileSplat(o, compiledArray); + } + compiledArgs = []; + _ref3 = this.args; + for (argIndex = _i = 0, _len = _ref3.length; _i < _len; argIndex = ++_i) { + arg = _ref3[argIndex]; + if (argIndex) { + compiledArgs.push(this.makeCode(", ")); + } + compiledArgs.push.apply(compiledArgs, arg.compileToFragments(o, LEVEL_LIST)); + } + fragments = []; + if (this.isSuper) { + preface = this.superReference(o) + (".call(" + (this.superThis(o))); + if (compiledArgs.length) { + preface += ", "; + } + fragments.push(this.makeCode(preface)); + } else { + if (this.isNew) { + fragments.push(this.makeCode('new ')); + } + fragments.push.apply(fragments, this.variable.compileToFragments(o, LEVEL_ACCESS)); + fragments.push(this.makeCode("(")); + } + fragments.push.apply(fragments, compiledArgs); + fragments.push(this.makeCode(")")); + return fragments; + }; + + Call.prototype.compileSplat = function(o, splatArgs) { + var answer, base, fun, idt, name, ref; + if (this.isSuper) { + return [].concat(this.makeCode("" + (this.superReference(o)) + ".apply(" + (this.superThis(o)) + ", "), splatArgs, this.makeCode(")")); + } + if (this.isNew) { + idt = this.tab + TAB; + return [].concat(this.makeCode("(function(func, args, ctor) {\n" + idt + "ctor.prototype = func.prototype;\n" + idt + "var child = new ctor, result = func.apply(child, args);\n" + idt + "return Object(result) === result ? result : child;\n" + this.tab + "})("), this.variable.compileToFragments(o, LEVEL_LIST), this.makeCode(", "), splatArgs, this.makeCode(", function(){})")); + } + answer = []; + base = new Value(this.variable); + if ((name = base.properties.pop()) && base.isComplex()) { + ref = o.scope.freeVariable('ref'); + answer = answer.concat(this.makeCode("(" + ref + " = "), base.compileToFragments(o, LEVEL_LIST), this.makeCode(")"), name.compileToFragments(o)); + } else { + fun = base.compileToFragments(o, LEVEL_ACCESS); + if (SIMPLENUM.test(fragmentsToText(fun))) { + fun = this.wrapInBraces(fun); + } + if (name) { + ref = fragmentsToText(fun); + fun.push.apply(fun, name.compileToFragments(o)); + } else { + ref = 'null'; + } + answer = answer.concat(fun); + } + return answer = answer.concat(this.makeCode(".apply(" + ref + ", "), splatArgs, this.makeCode(")")); + }; + + return Call; + + })(Base); + + exports.Extends = Extends = (function(_super) { + + __extends(Extends, _super); + + function Extends(child, parent) { + this.child = child; + this.parent = parent; + } + + Extends.prototype.children = ['child', 'parent']; + + Extends.prototype.compileToFragments = function(o) { + return new Call(new Value(new Literal(utility('extends'))), [this.child, this.parent]).compileToFragments(o); + }; + + return Extends; + + })(Base); + + exports.Access = Access = (function(_super) { + + __extends(Access, _super); + + function Access(name, tag) { + this.name = name; + this.name.asKey = true; + this.soak = tag === 'soak'; + } + + Access.prototype.children = ['name']; + + Access.prototype.compileToFragments = function(o) { + var name; + name = this.name.compileToFragments(o); + if (IDENTIFIER.test(fragmentsToText(name))) { + name.unshift(this.makeCode(".")); + } else { + name.unshift(this.makeCode("[")); + name.push(this.makeCode("]")); + } + return name; + }; + + Access.prototype.isComplex = NO; + + return Access; + + })(Base); + + exports.Index = Index = (function(_super) { + + __extends(Index, _super); + + function Index(index) { + this.index = index; + } + + Index.prototype.children = ['index']; + + Index.prototype.compileToFragments = function(o) { + return [].concat(this.makeCode("["), this.index.compileToFragments(o, LEVEL_PAREN), this.makeCode("]")); + }; + + Index.prototype.isComplex = function() { + return this.index.isComplex(); + }; + + return Index; + + })(Base); + + exports.Range = Range = (function(_super) { + + __extends(Range, _super); + + Range.prototype.children = ['from', 'to']; + + function Range(from, to, tag) { + this.from = from; + this.to = to; + this.exclusive = tag === 'exclusive'; + this.equals = this.exclusive ? '' : '='; + } + + Range.prototype.compileVariables = function(o) { + var step, _ref2, _ref3, _ref4, _ref5; + o = merge(o, { + top: true + }); + _ref2 = this.cacheToCodeFragments(this.from.cache(o, LEVEL_LIST)), this.fromC = _ref2[0], this.fromVar = _ref2[1]; + _ref3 = this.cacheToCodeFragments(this.to.cache(o, LEVEL_LIST)), this.toC = _ref3[0], this.toVar = _ref3[1]; + if (step = del(o, 'step')) { + _ref4 = this.cacheToCodeFragments(step.cache(o, LEVEL_LIST)), this.step = _ref4[0], this.stepVar = _ref4[1]; + } + _ref5 = [this.fromVar.match(SIMPLENUM), this.toVar.match(SIMPLENUM)], this.fromNum = _ref5[0], this.toNum = _ref5[1]; + if (this.stepVar) { + return this.stepNum = this.stepVar.match(SIMPLENUM); + } + }; + + Range.prototype.compileNode = function(o) { + var cond, condPart, from, gt, idx, idxName, known, lt, namedIndex, stepPart, to, varPart, _ref2, _ref3; + if (!this.fromVar) { + this.compileVariables(o); + } + if (!o.index) { + return this.compileArray(o); + } + known = this.fromNum && this.toNum; + idx = del(o, 'index'); + idxName = del(o, 'name'); + namedIndex = idxName && idxName !== idx; + varPart = "" + idx + " = " + this.fromC; + if (this.toC !== this.toVar) { + varPart += ", " + this.toC; + } + if (this.step !== this.stepVar) { + varPart += ", " + this.step; + } + _ref2 = ["" + idx + " <" + this.equals, "" + idx + " >" + this.equals], lt = _ref2[0], gt = _ref2[1]; + condPart = this.stepNum ? +this.stepNum > 0 ? "" + lt + " " + this.toVar : "" + gt + " " + this.toVar : known ? ((_ref3 = [+this.fromNum, +this.toNum], from = _ref3[0], to = _ref3[1], _ref3), from <= to ? "" + lt + " " + to : "" + gt + " " + to) : (cond = this.stepVar ? "" + this.stepVar + " > 0" : "" + this.fromVar + " <= " + this.toVar, "" + cond + " ? " + lt + " " + this.toVar + " : " + gt + " " + this.toVar); + stepPart = this.stepVar ? "" + idx + " += " + this.stepVar : known ? namedIndex ? from <= to ? "++" + idx : "--" + idx : from <= to ? "" + idx + "++" : "" + idx + "--" : namedIndex ? "" + cond + " ? ++" + idx + " : --" + idx : "" + cond + " ? " + idx + "++ : " + idx + "--"; + if (namedIndex) { + varPart = "" + idxName + " = " + varPart; + } + if (namedIndex) { + stepPart = "" + idxName + " = " + stepPart; + } + return [this.makeCode("" + varPart + "; " + condPart + "; " + stepPart)]; + }; + + Range.prototype.compileArray = function(o) { + var args, body, cond, hasArgs, i, idt, post, pre, range, result, vars, _i, _ref2, _ref3, _results; + if (this.fromNum && this.toNum && Math.abs(this.fromNum - this.toNum) <= 20) { + range = (function() { + _results = []; + for (var _i = _ref2 = +this.fromNum, _ref3 = +this.toNum; _ref2 <= _ref3 ? _i <= _ref3 : _i >= _ref3; _ref2 <= _ref3 ? _i++ : _i--){ _results.push(_i); } + return _results; + }).apply(this); + if (this.exclusive) { + range.pop(); + } + return [this.makeCode("[" + (range.join(', ')) + "]")]; + } + idt = this.tab + TAB; + i = o.scope.freeVariable('i'); + result = o.scope.freeVariable('results'); + pre = "\n" + idt + result + " = [];"; + if (this.fromNum && this.toNum) { + o.index = i; + body = fragmentsToText(this.compileNode(o)); + } else { + vars = ("" + i + " = " + this.fromC) + (this.toC !== this.toVar ? ", " + this.toC : ''); + cond = "" + this.fromVar + " <= " + this.toVar; + body = "var " + vars + "; " + cond + " ? " + i + " <" + this.equals + " " + this.toVar + " : " + i + " >" + this.equals + " " + this.toVar + "; " + cond + " ? " + i + "++ : " + i + "--"; + } + post = "{ " + result + ".push(" + i + "); }\n" + idt + "return " + result + ";\n" + o.indent; + hasArgs = function(node) { + return node != null ? node.contains(function(n) { + return n instanceof Literal && n.value === 'arguments' && !n.asKey; + }) : void 0; + }; + if (hasArgs(this.from) || hasArgs(this.to)) { + args = ', arguments'; + } + return [this.makeCode("(function() {" + pre + "\n" + idt + "for (" + body + ")" + post + "}).apply(this" + (args != null ? args : '') + ")")]; + }; + + return Range; + + })(Base); + + exports.Slice = Slice = (function(_super) { + + __extends(Slice, _super); + + Slice.prototype.children = ['range']; + + function Slice(range) { + this.range = range; + Slice.__super__.constructor.call(this); + } + + Slice.prototype.compileNode = function(o) { + var compiled, compiledText, from, fromCompiled, to, toStr, _ref2; + _ref2 = this.range, to = _ref2.to, from = _ref2.from; + fromCompiled = from && from.compileToFragments(o, LEVEL_PAREN) || [this.makeCode('0')]; + if (to) { + compiled = to.compileToFragments(o, LEVEL_PAREN); + compiledText = fragmentsToText(compiled); + if (!(!this.range.exclusive && +compiledText === -1)) { + toStr = ', ' + (this.range.exclusive ? compiledText : SIMPLENUM.test(compiledText) ? "" + (+compiledText + 1) : (compiled = to.compileToFragments(o, LEVEL_ACCESS), "+" + (fragmentsToText(compiled)) + " + 1 || 9e9")); + } + } + return [this.makeCode(".slice(" + (fragmentsToText(fromCompiled)) + (toStr || '') + ")")]; + }; + + return Slice; + + })(Base); + + exports.Obj = Obj = (function(_super) { + + __extends(Obj, _super); + + function Obj(props, generated) { + this.generated = generated != null ? generated : false; + this.objects = this.properties = props || []; + } + + Obj.prototype.children = ['properties']; + + Obj.prototype.compileNode = function(o) { + var answer, i, idt, indent, join, lastNoncom, node, prop, props, _i, _j, _len, _len1; + props = this.properties; + if (!props.length) { + return [this.makeCode(this.front ? '({})' : '{}')]; + } + if (this.generated) { + for (_i = 0, _len = props.length; _i < _len; _i++) { + node = props[_i]; + if (node instanceof Value) { + throw new Error('cannot have an implicit value in an implicit object'); + } + } + } + idt = o.indent += TAB; + lastNoncom = this.lastNonComment(this.properties); + answer = []; + for (i = _j = 0, _len1 = props.length; _j < _len1; i = ++_j) { + prop = props[i]; + join = i === props.length - 1 ? '' : prop === lastNoncom || prop instanceof Comment ? '\n' : ',\n'; + indent = prop instanceof Comment ? '' : idt; + if (prop instanceof Value && prop["this"]) { + prop = new Assign(prop.properties[0].name, prop, 'object'); + } + if (!(prop instanceof Comment)) { + if (!(prop instanceof Assign)) { + prop = new Assign(prop, prop, 'object'); + } + (prop.variable.base || prop.variable).asKey = true; + } + if (indent) { + answer.push(this.makeCode(indent)); + } + answer.push.apply(answer, prop.compileToFragments(o, LEVEL_TOP)); + if (join) { + answer.push(this.makeCode(join)); + } + } + answer.unshift(this.makeCode("{" + (props.length && '\n'))); + answer.push(this.makeCode("" + (props.length && '\n' + this.tab) + "}")); + if (this.front) { + return this.wrapInBraces(answer); + } else { + return answer; + } + }; + + Obj.prototype.assigns = function(name) { + var prop, _i, _len, _ref2; + _ref2 = this.properties; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + prop = _ref2[_i]; + if (prop.assigns(name)) { + return true; + } + } + return false; + }; + + return Obj; + + })(Base); + + exports.Arr = Arr = (function(_super) { + + __extends(Arr, _super); + + function Arr(objs) { + this.objects = objs || []; + } + + Arr.prototype.children = ['objects']; + + Arr.prototype.compileNode = function(o) { + var answer, compiledObjs, fragments, index, obj, _i, _len; + if (!this.objects.length) { + return [this.makeCode('[]')]; + } + o.indent += TAB; + answer = Splat.compileSplattedArray(o, this.objects); + if (answer.length) { + return answer; + } + answer = []; + compiledObjs = (function() { + var _i, _len, _ref2, _results; + _ref2 = this.objects; + _results = []; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + obj = _ref2[_i]; + _results.push(obj.compileToFragments(o, LEVEL_LIST)); + } + return _results; + }).call(this); + for (index = _i = 0, _len = compiledObjs.length; _i < _len; index = ++_i) { + fragments = compiledObjs[index]; + if (index) { + answer.push(this.makeCode(", ")); + } + answer.push.apply(answer, fragments); + } + if ((fragmentsToText(answer)).indexOf('\n') >= 0) { + answer.unshift(this.makeCode("[\n" + o.indent)); + answer.push(this.makeCode("\n" + this.tab + "]")); + } else { + answer.unshift(this.makeCode("[")); + answer.push(this.makeCode("]")); + } + return answer; + }; + + Arr.prototype.assigns = function(name) { + var obj, _i, _len, _ref2; + _ref2 = this.objects; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + obj = _ref2[_i]; + if (obj.assigns(name)) { + return true; + } + } + return false; + }; + + return Arr; + + })(Base); + + exports.Class = Class = (function(_super) { + + __extends(Class, _super); + + function Class(variable, parent, body) { + this.variable = variable; + this.parent = parent; + this.body = body != null ? body : new Block; + this.boundFuncs = []; + this.body.classBody = true; + } + + Class.prototype.children = ['variable', 'parent', 'body']; + + Class.prototype.determineName = function() { + var decl, tail; + if (!this.variable) { + return null; + } + decl = (tail = last(this.variable.properties)) ? tail instanceof Access && tail.name.value : this.variable.base.value; + if (__indexOf.call(STRICT_PROSCRIBED, decl) >= 0) { + throw SyntaxError("variable name may not be " + decl); + } + return decl && (decl = IDENTIFIER.test(decl) && decl); + }; + + Class.prototype.setContext = function(name) { + return this.body.traverseChildren(false, function(node) { + if (node.classBody) { + return false; + } + if (node instanceof Literal && node.value === 'this') { + return node.value = name; + } else if (node instanceof Code) { + node.klass = name; + if (node.bound) { + return node.context = name; + } + } + }); + }; + + Class.prototype.addBoundFunctions = function(o) { + var body, bound, func, lhs, name, rhs, _i, _len, _ref2, _ref3; + if (this.boundFuncs.length) { + o.scope.assign('_this', 'this'); + _ref2 = this.boundFuncs; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + _ref3 = _ref2[_i], name = _ref3[0], func = _ref3[1]; + lhs = new Value(new Literal("this"), [new Access(name)]); + body = new Block([new Return(new Literal("" + this.ctor.name + ".prototype." + name.value + ".apply(_this, arguments)"))]); + rhs = new Code(func.params, body, 'boundfunc'); + bound = new Assign(lhs, rhs); + this.ctor.body.unshift(bound); + } + } + }; + + Class.prototype.addProperties = function(node, name, o) { + var assign, base, exprs, func, props; + props = node.base.properties.slice(0); + exprs = (function() { + var _results; + _results = []; + while (assign = props.shift()) { + if (assign instanceof Assign) { + base = assign.variable.base; + delete assign.context; + func = assign.value; + if (base.value === 'constructor') { + if (this.ctor) { + throw new Error('cannot define more than one constructor in a class'); + } + if (func.bound) { + throw new Error('cannot define a constructor as a bound function'); + } + if (func instanceof Code) { + assign = this.ctor = func; + } else { + this.externalCtor = o.scope.freeVariable('class'); + assign = new Assign(new Literal(this.externalCtor), func); + } + } else { + if (assign.variable["this"]) { + func["static"] = true; + if (func.bound) { + func.context = name; + } + } else { + assign.variable = new Value(new Literal(name), [new Access(new Literal('prototype')), new Access(base)]); + if (func instanceof Code && func.bound) { + this.boundFuncs.push([base, func]); + func.bound = false; + } + } + } + } + _results.push(assign); + } + return _results; + }).call(this); + return compact(exprs); + }; + + Class.prototype.walkBody = function(name, o) { + var _this = this; + return this.traverseChildren(false, function(child) { + var cont, exps, i, node, _i, _len, _ref2; + cont = true; + if (child instanceof Class) { + return false; + } + if (child instanceof Block) { + _ref2 = exps = child.expressions; + for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) { + node = _ref2[i]; + if (node instanceof Value && node.isObject(true)) { + cont = false; + exps[i] = _this.addProperties(node, name, o); + } + } + child.expressions = exps = flatten(exps); + } + return cont && !(child instanceof Class); + }); + }; + + Class.prototype.hoistDirectivePrologue = function() { + var expressions, index, node; + index = 0; + expressions = this.body.expressions; + while ((node = expressions[index]) && node instanceof Comment || node instanceof Value && node.isString()) { + ++index; + } + return this.directives = expressions.splice(0, index); + }; + + Class.prototype.ensureConstructor = function(name) { + if (!this.ctor) { + this.ctor = new Code; + if (this.parent) { + this.ctor.body.push(new Literal("" + name + ".__super__.constructor.apply(this, arguments)")); + } + if (this.externalCtor) { + this.ctor.body.push(new Literal("" + this.externalCtor + ".apply(this, arguments)")); + } + this.ctor.body.makeReturn(); + this.body.expressions.unshift(this.ctor); + } + this.ctor.ctor = this.ctor.name = name; + this.ctor.klass = null; + return this.ctor.noReturn = true; + }; + + Class.prototype.compileNode = function(o) { + var call, decl, klass, lname, name, params, _ref2; + decl = this.determineName(); + name = decl || '_Class'; + if (name.reserved) { + name = "_" + name; + } + lname = new Literal(name); + this.hoistDirectivePrologue(); + this.setContext(name); + this.walkBody(name, o); + this.ensureConstructor(name); + this.body.spaced = true; + if (!(this.ctor instanceof Code)) { + this.body.expressions.unshift(this.ctor); + } + this.body.expressions.push(lname); + (_ref2 = this.body.expressions).unshift.apply(_ref2, this.directives); + this.addBoundFunctions(o); + call = Closure.wrap(this.body); + if (this.parent) { + this.superClass = new Literal(o.scope.freeVariable('super', false)); + this.body.expressions.unshift(new Extends(lname, this.superClass)); + call.args.push(this.parent); + params = call.variable.params || call.variable.base.params; + params.push(new Param(this.superClass)); + } + klass = new Parens(call, true); + if (this.variable) { + klass = new Assign(this.variable, klass); + } + return klass.compileToFragments(o); + }; + + return Class; + + })(Base); + + exports.Assign = Assign = (function(_super) { + + __extends(Assign, _super); + + function Assign(variable, value, context, options) { + var forbidden, name, _ref2; + this.variable = variable; + this.value = value; + this.context = context; + this.param = options && options.param; + this.subpattern = options && options.subpattern; + forbidden = (_ref2 = (name = this.variable.unwrapAll().value), __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0); + if (forbidden && this.context !== 'object') { + throw SyntaxError("variable name may not be \"" + name + "\""); + } + } + + Assign.prototype.children = ['variable', 'value']; + + Assign.prototype.isStatement = function(o) { + return (o != null ? o.level : void 0) === LEVEL_TOP && (this.context != null) && __indexOf.call(this.context, "?") >= 0; + }; + + Assign.prototype.assigns = function(name) { + return this[this.context === 'object' ? 'value' : 'variable'].assigns(name); + }; + + Assign.prototype.unfoldSoak = function(o) { + return unfoldSoak(o, this, 'variable'); + }; + + Assign.prototype.compileNode = function(o) { + var answer, compiledName, isValue, match, name, val, varBase, _ref2, _ref3, _ref4, _ref5; + if (isValue = this.variable instanceof Value) { + if (this.variable.isArray() || this.variable.isObject()) { + return this.compilePatternMatch(o); + } + if (this.variable.isSplice()) { + return this.compileSplice(o); + } + if ((_ref2 = this.context) === '||=' || _ref2 === '&&=' || _ref2 === '?=') { + return this.compileConditional(o); + } + } + compiledName = this.variable.compileToFragments(o, LEVEL_LIST); + name = fragmentsToText(compiledName); + if (!this.context) { + if (!(varBase = this.variable.unwrapAll()).isAssignable()) { + throw SyntaxError("\"" + (this.variable.compile(o)) + "\" cannot be assigned."); + } + if (!(typeof varBase.hasProperties === "function" ? varBase.hasProperties() : void 0)) { + if (this.param) { + o.scope.add(name, 'var'); + } else { + o.scope.find(name); + } + } + } + if (this.value instanceof Code && (match = METHOD_DEF.exec(name))) { + if (match[1]) { + this.value.klass = match[1]; + } + this.value.name = (_ref3 = (_ref4 = (_ref5 = match[2]) != null ? _ref5 : match[3]) != null ? _ref4 : match[4]) != null ? _ref3 : match[5]; + } + val = this.value.compileToFragments(o, LEVEL_LIST); + if (this.context === 'object') { + return compiledName.concat(this.makeCode(": "), val); + } + answer = compiledName.concat(this.makeCode(" " + (this.context || '=') + " "), val); + if (o.level <= LEVEL_LIST) { + return answer; + } else { + return this.wrapInBraces(answer); + } + }; + + Assign.prototype.compilePatternMatch = function(o) { + var acc, assigns, code, fragments, i, idx, isObject, ivar, name, obj, objects, olen, ref, rest, splat, top, val, value, vvar, vvarText, _i, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7; + top = o.level === LEVEL_TOP; + value = this.value; + objects = this.variable.base.objects; + if (!(olen = objects.length)) { + code = value.compileToFragments(o); + if (o.level >= LEVEL_OP) { + return this.wrapInBraces(code); + } else { + return code; + } + } + isObject = this.variable.isObject(); + if (top && olen === 1 && !((obj = objects[0]) instanceof Splat)) { + if (obj instanceof Assign) { + _ref2 = obj, (_ref3 = _ref2.variable, idx = _ref3.base), obj = _ref2.value; + } else { + idx = isObject ? obj["this"] ? obj.properties[0].name : obj : new Literal(0); + } + acc = IDENTIFIER.test(idx.unwrap().value || 0); + value = new Value(value); + value.properties.push(new (acc ? Access : Index)(idx)); + if (_ref4 = obj.unwrap().value, __indexOf.call(RESERVED, _ref4) >= 0) { + throw new SyntaxError("assignment to a reserved word: " + (obj.compile(o)) + " = " + (value.compile(o))); + } + return new Assign(obj, value, null, { + param: this.param + }).compileToFragments(o, LEVEL_TOP); + } + vvar = value.compileToFragments(o, LEVEL_LIST); + vvarText = fragmentsToText(vvar); + assigns = []; + splat = false; + if (!IDENTIFIER.test(vvarText) || this.variable.assigns(vvarText)) { + assigns.push([this.makeCode("" + (ref = o.scope.freeVariable('ref')) + " = ")].concat(__slice.call(vvar))); + vvar = [this.makeCode(ref)]; + vvarText = ref; + } + for (i = _i = 0, _len = objects.length; _i < _len; i = ++_i) { + obj = objects[i]; + idx = i; + if (isObject) { + if (obj instanceof Assign) { + _ref5 = obj, (_ref6 = _ref5.variable, idx = _ref6.base), obj = _ref5.value; + } else { + if (obj.base instanceof Parens) { + _ref7 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref7[0], idx = _ref7[1]; + } else { + idx = obj["this"] ? obj.properties[0].name : obj; + } + } + } + if (!splat && obj instanceof Splat) { + name = obj.name.unwrap().value; + obj = obj.unwrap(); + val = "" + olen + " <= " + vvarText + ".length ? " + (utility('slice')) + ".call(" + vvarText + ", " + i; + if (rest = olen - i - 1) { + ivar = o.scope.freeVariable('i'); + val += ", " + ivar + " = " + vvarText + ".length - " + rest + ") : (" + ivar + " = " + i + ", [])"; + } else { + val += ") : []"; + } + val = new Literal(val); + splat = "" + ivar + "++"; + } else { + name = obj.unwrap().value; + if (obj instanceof Splat) { + obj = obj.name.compileToFragments(o); + throw new SyntaxError("multiple splats are disallowed in an assignment: " + obj + "..."); + } + if (typeof idx === 'number') { + idx = new Literal(splat || idx); + acc = false; + } else { + acc = isObject && IDENTIFIER.test(idx.unwrap().value || 0); + } + val = new Value(new Literal(vvarText), [new (acc ? Access : Index)(idx)]); + } + if ((name != null) && __indexOf.call(RESERVED, name) >= 0) { + throw new SyntaxError("assignment to a reserved word: " + (obj.compile(o)) + " = " + (val.compile(o))); + } + assigns.push(new Assign(obj, val, null, { + param: this.param, + subpattern: true + }).compileToFragments(o, LEVEL_LIST)); + } + if (!(top || this.subpattern)) { + assigns.push(vvar); + } + fragments = this.joinFragmentArrays(assigns, ', '); + if (o.level < LEVEL_LIST) { + return fragments; + } else { + return this.wrapInBraces(fragments); + } + }; + + Assign.prototype.compileConditional = function(o) { + var left, right, _ref2; + _ref2 = this.variable.cacheReference(o), left = _ref2[0], right = _ref2[1]; + if (!left.properties.length && left.base instanceof Literal && left.base.value !== "this" && !o.scope.check(left.base.value)) { + throw new Error("the variable \"" + left.base.value + "\" can't be assigned with " + this.context + " because it has not been defined."); + } + if (__indexOf.call(this.context, "?") >= 0) { + o.isExistentialEquals = true; + } + return new Op(this.context.slice(0, -1), left, new Assign(right, this.value, '=')).compileToFragments(o); + }; + + Assign.prototype.compileSplice = function(o) { + var answer, exclusive, from, fromDecl, fromRef, name, to, valDef, valRef, _ref2, _ref3, _ref4; + _ref2 = this.variable.properties.pop().range, from = _ref2.from, to = _ref2.to, exclusive = _ref2.exclusive; + name = this.variable.compile(o); + if (from) { + _ref3 = this.cacheToCodeFragments(from.cache(o, LEVEL_OP)), fromDecl = _ref3[0], fromRef = _ref3[1]; + } else { + fromDecl = fromRef = '0'; + } + if (to) { + if ((from != null ? from.isSimpleNumber() : void 0) && to.isSimpleNumber()) { + to = +to.compile(o) - +fromRef; + if (!exclusive) { + to += 1; + } + } else { + to = to.compile(o, LEVEL_ACCESS) + ' - ' + fromRef; + if (!exclusive) { + to += ' + 1'; + } + } + } else { + to = "9e9"; + } + _ref4 = this.value.cache(o, LEVEL_LIST), valDef = _ref4[0], valRef = _ref4[1]; + answer = [].concat(this.makeCode("[].splice.apply(" + name + ", [" + fromDecl + ", " + to + "].concat("), valDef, this.makeCode(")), "), valRef); + if (o.level > LEVEL_TOP) { + return this.wrapInBraces(answer); + } else { + return answer; + } + }; + + return Assign; + + })(Base); + + exports.Code = Code = (function(_super) { + + __extends(Code, _super); + + function Code(params, body, tag) { + this.params = params || []; + this.body = body || new Block; + this.bound = tag === 'boundfunc'; + if (this.bound) { + this.context = '_this'; + } + } + + Code.prototype.children = ['params', 'body']; + + Code.prototype.isStatement = function() { + return !!this.ctor; + }; + + Code.prototype.jumps = NO; + + Code.prototype.compileNode = function(o) { + var answer, code, exprs, i, idt, lit, name, p, param, params, ref, splats, uniqs, val, wasEmpty, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _len6, _m, _n, _o, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8; + o.scope = new Scope(o.scope, this.body, this); + o.scope.shared = del(o, 'sharedScope'); + o.indent += TAB; + delete o.bare; + delete o.isExistentialEquals; + params = []; + exprs = []; + _ref2 = this.paramNames(); + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + name = _ref2[_i]; + if (!o.scope.check(name)) { + o.scope.parameter(name); + } + } + _ref3 = this.params; + for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) { + param = _ref3[_j]; + if (!param.splat) { + continue; + } + _ref4 = this.params; + for (_k = 0, _len2 = _ref4.length; _k < _len2; _k++) { + p = _ref4[_k].name; + if (p["this"]) { + p = p.properties[0].name; + } + if (p.value) { + o.scope.add(p.value, 'var', true); + } + } + splats = new Assign(new Value(new Arr((function() { + var _l, _len3, _ref5, _results; + _ref5 = this.params; + _results = []; + for (_l = 0, _len3 = _ref5.length; _l < _len3; _l++) { + p = _ref5[_l]; + _results.push(p.asReference(o)); + } + return _results; + }).call(this))), new Value(new Literal('arguments'))); + break; + } + _ref5 = this.params; + for (_l = 0, _len3 = _ref5.length; _l < _len3; _l++) { + param = _ref5[_l]; + if (param.isComplex()) { + val = ref = param.asReference(o); + if (param.value) { + val = new Op('?', ref, param.value); + } + exprs.push(new Assign(new Value(param.name), val, '=', { + param: true + })); + } else { + ref = param; + if (param.value) { + lit = new Literal(ref.name.value + ' == null'); + val = new Assign(new Value(param.name), param.value, '='); + exprs.push(new If(lit, val)); + } + } + if (!splats) { + params.push(ref); + } + } + wasEmpty = this.body.isEmpty(); + if (splats) { + exprs.unshift(splats); + } + if (exprs.length) { + (_ref6 = this.body.expressions).unshift.apply(_ref6, exprs); + } + for (i = _m = 0, _len4 = params.length; _m < _len4; i = ++_m) { + p = params[i]; + params[i] = p.compileToFragments(o); + o.scope.parameter(fragmentsToText(params[i])); + } + uniqs = []; + _ref7 = this.paramNames(); + for (_n = 0, _len5 = _ref7.length; _n < _len5; _n++) { + name = _ref7[_n]; + if (__indexOf.call(uniqs, name) >= 0) { + throw SyntaxError("multiple parameters named '" + name + "'"); + } + uniqs.push(name); + } + if (!(wasEmpty || this.noReturn)) { + this.body.makeReturn(); + } + if (this.bound) { + if ((_ref8 = o.scope.parent.method) != null ? _ref8.bound : void 0) { + this.bound = this.context = o.scope.parent.method.context; + } else if (!this["static"]) { + o.scope.parent.assign('_this', 'this'); + } + } + idt = o.indent; + code = 'function'; + if (this.ctor) { + code += ' ' + this.name; + } + code += '('; + answer = [this.makeCode(code)]; + for (i = _o = 0, _len6 = params.length; _o < _len6; i = ++_o) { + p = params[i]; + if (i) { + answer.push(this.makeCode(", ")); + } + answer.push.apply(answer, p); + } + answer.push(this.makeCode(') {')); + if (!this.body.isEmpty()) { + answer = answer.concat(this.makeCode("\n"), this.body.compileWithDeclarations(o), this.makeCode("\n" + this.tab)); + } + answer.push(this.makeCode('}')); + if (this.ctor) { + return [this.makeCode(this.tab)].concat(__slice.call(answer)); + } + if (this.front || (o.level >= LEVEL_ACCESS)) { + return this.wrapInBraces(answer); + } else { + return answer; + } + }; + + Code.prototype.paramNames = function() { + var names, param, _i, _len, _ref2; + names = []; + _ref2 = this.params; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + param = _ref2[_i]; + names.push.apply(names, param.names()); + } + return names; + }; + + Code.prototype.traverseChildren = function(crossScope, func) { + if (crossScope) { + return Code.__super__.traverseChildren.call(this, crossScope, func); + } + }; + + return Code; + + })(Base); + + exports.Param = Param = (function(_super) { + + __extends(Param, _super); + + function Param(name, value, splat) { + var _ref2; + this.name = name; + this.value = value; + this.splat = splat; + if (_ref2 = (name = this.name.unwrapAll().value), __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0) { + throw SyntaxError("parameter name \"" + name + "\" is not allowed"); + } + } + + Param.prototype.children = ['name', 'value']; + + Param.prototype.compileToFragments = function(o) { + return this.name.compileToFragments(o, LEVEL_LIST); + }; + + Param.prototype.asReference = function(o) { + var node; + if (this.reference) { + return this.reference; + } + node = this.name; + if (node["this"]) { + node = node.properties[0].name; + if (node.value.reserved) { + node = new Literal(o.scope.freeVariable(node.value)); + } + } else if (node.isComplex()) { + node = new Literal(o.scope.freeVariable('arg')); + } + node = new Value(node); + if (this.splat) { + node = new Splat(node); + } + return this.reference = node; + }; + + Param.prototype.isComplex = function() { + return this.name.isComplex(); + }; + + Param.prototype.names = function(name) { + var atParam, names, obj, _i, _len, _ref2; + if (name == null) { + name = this.name; + } + atParam = function(obj) { + var value; + value = obj.properties[0].name.value; + if (value.reserved) { + return []; + } else { + return [value]; + } + }; + if (name instanceof Literal) { + return [name.value]; + } + if (name instanceof Value) { + return atParam(name); + } + names = []; + _ref2 = name.objects; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + obj = _ref2[_i]; + if (obj instanceof Assign) { + names.push.apply(names, this.names(obj.value.unwrap())); + } else if (obj instanceof Splat) { + names.push(obj.name.unwrap().value); + } else if (obj instanceof Value) { + if (obj.isArray() || obj.isObject()) { + names.push.apply(names, this.names(obj.base)); + } else if (obj["this"]) { + names.push.apply(names, atParam(obj)); + } else { + names.push(obj.base.value); + } + } else { + throw SyntaxError("illegal parameter " + (obj.compile())); + } + } + return names; + }; + + return Param; + + })(Base); + + exports.Splat = Splat = (function(_super) { + + __extends(Splat, _super); + + Splat.prototype.children = ['name']; + + Splat.prototype.isAssignable = YES; + + function Splat(name) { + this.name = name.compile ? name : new Literal(name); + } + + Splat.prototype.assigns = function(name) { + return this.name.assigns(name); + }; + + Splat.prototype.compileToFragments = function(o) { + return this.name.compileToFragments(o); + }; + + Splat.prototype.unwrap = function() { + return this.name; + }; + + Splat.compileSplattedArray = function(o, list, apply) { + var args, base, compiledNode, concatPart, fragments, i, index, node, _i, _len; + index = -1; + while ((node = list[++index]) && !(node instanceof Splat)) { + continue; + } + if (index >= list.length) { + return []; + } + if (list.length === 1) { + node = list[0]; + fragments = node.compileToFragments(o, LEVEL_LIST); + if (apply) { + return fragments; + } + return [].concat(node.makeCode("" + (utility('slice')) + ".call("), fragments, node.makeCode(")")); + } + args = list.slice(index); + for (i = _i = 0, _len = args.length; _i < _len; i = ++_i) { + node = args[i]; + compiledNode = node.compileToFragments(o, LEVEL_LIST); + args[i] = node instanceof Splat ? [].concat(node.makeCode("" + (utility('slice')) + ".call("), compiledNode, node.makeCode(")")) : [].concat(node.makeCode("["), compiledNode, node.makeCode("]")); + } + if (index === 0) { + node = list[0]; + concatPart = node.joinFragmentArrays(args.slice(1), ', '); + return args[0].concat(node.makeCode(".concat("), concatPart, node.makeCode(")")); + } + base = (function() { + var _j, _len1, _ref2, _results; + _ref2 = list.slice(0, index); + _results = []; + for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) { + node = _ref2[_j]; + _results.push(node.compileToFragments(o, LEVEL_LIST)); + } + return _results; + })(); + base = list[0].joinFragmentArrays(base, ', '); + concatPart = list[index].joinFragmentArrays(args, ', '); + return [].concat(list[0].makeCode("["), base, list[index].makeCode("].concat("), concatPart, (last(list)).makeCode(")")); + }; + + return Splat; + + })(Base); + + exports.While = While = (function(_super) { + + __extends(While, _super); + + function While(condition, options) { + this.condition = (options != null ? options.invert : void 0) ? condition.invert() : condition; + this.guard = options != null ? options.guard : void 0; + } + + While.prototype.children = ['condition', 'guard', 'body']; + + While.prototype.isStatement = YES; + + While.prototype.makeReturn = function(res) { + if (res) { + return While.__super__.makeReturn.apply(this, arguments); + } else { + this.returns = !this.jumps({ + loop: true + }); + return this; + } + }; + + While.prototype.addBody = function(body) { + this.body = body; + return this; + }; + + While.prototype.jumps = function() { + var expressions, node, _i, _len; + expressions = this.body.expressions; + if (!expressions.length) { + return false; + } + for (_i = 0, _len = expressions.length; _i < _len; _i++) { + node = expressions[_i]; + if (node.jumps({ + loop: true + })) { + return node; + } + } + return false; + }; + + While.prototype.compileNode = function(o) { + var answer, body, rvar, set; + o.indent += TAB; + set = ''; + body = this.body; + if (body.isEmpty()) { + body = ''; + } else { + if (this.returns) { + body.makeReturn(rvar = o.scope.freeVariable('results')); + set = "" + this.tab + rvar + " = [];\n"; + } + if (this.guard) { + if (body.expressions.length > 1) { + body.expressions.unshift(new If((new Parens(this.guard)).invert(), new Literal("continue"))); + } else { + if (this.guard) { + body = Block.wrap([new If(this.guard, body)]); + } + } + } + body = [].concat(this.makeCode("\n"), body.compileToFragments(o, LEVEL_TOP), this.makeCode("\n" + this.tab)); + } + answer = [].concat(this.makeCode(set + this.tab + "while ("), this.condition.compileToFragments(o, LEVEL_PAREN), this.makeCode(") {"), body, this.makeCode("}")); + if (this.returns) { + answer.push(this.makeCode("\n" + this.tab + "return " + rvar + ";")); + } + return answer; + }; + + return While; + + })(Base); + + exports.Op = Op = (function(_super) { + var CONVERSIONS, INVERSIONS; + + __extends(Op, _super); + + function Op(op, first, second, flip) { + if (op === 'in') { + return new In(first, second); + } + if (op === 'do') { + return this.generateDo(first); + } + if (op === 'new') { + if (first instanceof Call && !first["do"] && !first.isNew) { + return first.newInstance(); + } + if (first instanceof Code && first.bound || first["do"]) { + first = new Parens(first); + } + } + this.operator = CONVERSIONS[op] || op; + this.first = first; + this.second = second; + this.flip = !!flip; + return this; + } + + CONVERSIONS = { + '==': '===', + '!=': '!==', + 'of': 'in' + }; + + INVERSIONS = { + '!==': '===', + '===': '!==' + }; + + Op.prototype.children = ['first', 'second']; + + Op.prototype.isSimpleNumber = NO; + + Op.prototype.isUnary = function() { + return !this.second; + }; + + Op.prototype.isComplex = function() { + var _ref2; + return !(this.isUnary() && ((_ref2 = this.operator) === '+' || _ref2 === '-')) || this.first.isComplex(); + }; + + Op.prototype.isChainable = function() { + var _ref2; + return (_ref2 = this.operator) === '<' || _ref2 === '>' || _ref2 === '>=' || _ref2 === '<=' || _ref2 === '===' || _ref2 === '!=='; + }; + + Op.prototype.invert = function() { + var allInvertable, curr, fst, op, _ref2; + if (this.isChainable() && this.first.isChainable()) { + allInvertable = true; + curr = this; + while (curr && curr.operator) { + allInvertable && (allInvertable = curr.operator in INVERSIONS); + curr = curr.first; + } + if (!allInvertable) { + return new Parens(this).invert(); + } + curr = this; + while (curr && curr.operator) { + curr.invert = !curr.invert; + curr.operator = INVERSIONS[curr.operator]; + curr = curr.first; + } + return this; + } else if (op = INVERSIONS[this.operator]) { + this.operator = op; + if (this.first.unwrap() instanceof Op) { + this.first.invert(); + } + return this; + } else if (this.second) { + return new Parens(this).invert(); + } else if (this.operator === '!' && (fst = this.first.unwrap()) instanceof Op && ((_ref2 = fst.operator) === '!' || _ref2 === 'in' || _ref2 === 'instanceof')) { + return fst; + } else { + return new Op('!', this); + } + }; + + Op.prototype.unfoldSoak = function(o) { + var _ref2; + return ((_ref2 = this.operator) === '++' || _ref2 === '--' || _ref2 === 'delete') && unfoldSoak(o, this, 'first'); + }; + + Op.prototype.generateDo = function(exp) { + var call, func, param, passedParams, ref, _i, _len, _ref2; + passedParams = []; + func = exp instanceof Assign && (ref = exp.value.unwrap()) instanceof Code ? ref : exp; + _ref2 = func.params || []; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + param = _ref2[_i]; + if (param.value) { + passedParams.push(param.value); + delete param.value; + } else { + passedParams.push(param); + } + } + call = new Call(exp, passedParams); + call["do"] = true; + return call; + }; + + Op.prototype.compileNode = function(o) { + var answer, isChain, _ref2, _ref3; + isChain = this.isChainable() && this.first.isChainable(); + if (!isChain) { + this.first.front = this.front; + } + if (this.operator === 'delete' && o.scope.check(this.first.unwrapAll().value)) { + throw SyntaxError('delete operand may not be argument or var'); + } + if (((_ref2 = this.operator) === '--' || _ref2 === '++') && (_ref3 = this.first.unwrapAll().value, __indexOf.call(STRICT_PROSCRIBED, _ref3) >= 0)) { + throw SyntaxError('prefix increment/decrement may not have eval or arguments operand'); + } + if (this.isUnary()) { + return this.compileUnary(o); + } + if (isChain) { + return this.compileChain(o); + } + if (this.operator === '?') { + return this.compileExistence(o); + } + answer = [].concat(this.first.compileToFragments(o, LEVEL_OP), this.makeCode(' ' + this.operator + ' '), this.second.compileToFragments(o, LEVEL_OP)); + if (o.level <= LEVEL_OP) { + return answer; + } else { + return this.wrapInBraces(answer); + } + }; + + Op.prototype.compileChain = function(o) { + var fragments, fst, shared, _ref2; + _ref2 = this.first.second.cache(o), this.first.second = _ref2[0], shared = _ref2[1]; + fst = this.first.compileToFragments(o, LEVEL_OP); + fragments = fst.concat(this.makeCode(" " + (this.invert ? '&&' : '||') + " "), shared.compileToFragments(o), this.makeCode(" " + this.operator + " "), this.second.compileToFragments(o, LEVEL_OP)); + return this.wrapInBraces(fragments); + }; + + Op.prototype.compileExistence = function(o) { + var fst, ref; + if (this.first.isComplex()) { + ref = new Literal(o.scope.freeVariable('ref')); + fst = new Parens(new Assign(ref, this.first)); + } else { + fst = this.first; + ref = fst; + } + return new If(new Existence(fst), ref, { + type: 'if' + }).addElse(this.second).compileToFragments(o); + }; + + Op.prototype.compileUnary = function(o) { + var op, parts, plusMinus; + parts = []; + op = this.operator; + parts.push([this.makeCode(op)]); + if (op === '!' && this.first instanceof Existence) { + this.first.negated = !this.first.negated; + return this.first.compileToFragments(o); + } + if (o.level >= LEVEL_ACCESS) { + return (new Parens(this)).compileToFragments(o); + } + plusMinus = op === '+' || op === '-'; + if ((op === 'new' || op === 'typeof' || op === 'delete') || plusMinus && this.first instanceof Op && this.first.operator === op) { + parts.push([this.makeCode(' ')]); + } + if ((plusMinus && this.first instanceof Op) || (op === 'new' && this.first.isStatement(o))) { + this.first = new Parens(this.first); + } + parts.push(this.first.compileToFragments(o, LEVEL_OP)); + if (this.flip) { + parts.reverse(); + } + return this.joinFragmentArrays(parts, ''); + }; + + Op.prototype.toString = function(idt) { + return Op.__super__.toString.call(this, idt, this.constructor.name + ' ' + this.operator); + }; + + return Op; + + })(Base); + + exports.In = In = (function(_super) { + + __extends(In, _super); + + function In(object, array) { + this.object = object; + this.array = array; + } + + In.prototype.children = ['object', 'array']; + + In.prototype.invert = NEGATE; + + In.prototype.compileNode = function(o) { + var hasSplat, obj, _i, _len, _ref2; + if (this.array instanceof Value && this.array.isArray()) { + _ref2 = this.array.base.objects; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + obj = _ref2[_i]; + if (!(obj instanceof Splat)) { + continue; + } + hasSplat = true; + break; + } + if (!hasSplat) { + return this.compileOrTest(o); + } + } + return this.compileLoopTest(o); + }; + + In.prototype.compileOrTest = function(o) { + var cmp, cnj, i, item, ref, sub, tests, _i, _len, _ref2, _ref3, _ref4; + if (this.array.base.objects.length === 0) { + return [this.makeCode("" + (!!this.negated))]; + } + _ref2 = this.object.cache(o, LEVEL_OP), sub = _ref2[0], ref = _ref2[1]; + _ref3 = this.negated ? [' !== ', ' && '] : [' === ', ' || '], cmp = _ref3[0], cnj = _ref3[1]; + tests = []; + _ref4 = this.array.base.objects; + for (i = _i = 0, _len = _ref4.length; _i < _len; i = ++_i) { + item = _ref4[i]; + if (i) { + tests.push(this.makeCode(cnj)); + } + tests = tests.concat((i ? ref : sub), this.makeCode(cmp), item.compileToFragments(o, LEVEL_ACCESS)); + } + if (o.level < LEVEL_OP) { + return tests; + } else { + return this.wrapInBraces(tests); + } + }; + + In.prototype.compileLoopTest = function(o) { + var fragments, ref, sub, _ref2; + _ref2 = this.object.cache(o, LEVEL_LIST), sub = _ref2[0], ref = _ref2[1]; + fragments = [].concat(this.makeCode(utility('indexOf') + ".call("), this.array.compileToFragments(o, LEVEL_LIST), this.makeCode(", "), ref, this.makeCode(") " + (this.negated ? '< 0' : '>= 0'))); + if ((fragmentsToText(sub)) === (fragmentsToText(ref))) { + return fragments; + } + fragments = sub.concat(this.makeCode(', '), fragments); + if (o.level < LEVEL_LIST) { + return fragments; + } else { + return this.wrapInBraces(fragments); + } + }; + + In.prototype.toString = function(idt) { + return In.__super__.toString.call(this, idt, this.constructor.name + (this.negated ? '!' : '')); + }; + + return In; + + })(Base); + + exports.Try = Try = (function(_super) { + + __extends(Try, _super); + + function Try(attempt, error, recovery, ensure) { + this.attempt = attempt; + this.error = error; + this.recovery = recovery; + this.ensure = ensure; + } + + Try.prototype.children = ['attempt', 'recovery', 'ensure']; + + Try.prototype.isStatement = YES; + + Try.prototype.jumps = function(o) { + var _ref2; + return this.attempt.jumps(o) || ((_ref2 = this.recovery) != null ? _ref2.jumps(o) : void 0); + }; + + Try.prototype.makeReturn = function(res) { + if (this.attempt) { + this.attempt = this.attempt.makeReturn(res); + } + if (this.recovery) { + this.recovery = this.recovery.makeReturn(res); + } + return this; + }; + + Try.prototype.compileNode = function(o) { + var catchPart, ensurePart, placeholder, tryPart; + o.indent += TAB; + tryPart = this.attempt.compileToFragments(o, LEVEL_TOP); + catchPart = (function() { + var _base, _ref2; + if (this.recovery) { + if (typeof (_base = this.error).isObject === "function" ? _base.isObject() : void 0) { + placeholder = new Literal('_error'); + this.recovery.unshift(new Assign(this.error, placeholder)); + this.error = placeholder; + } + if (_ref2 = this.error.value, __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0) { + throw SyntaxError("catch variable may not be \"" + this.error.value + "\""); + } + if (!o.scope.check(this.error.value)) { + o.scope.add(this.error.value, 'param'); + } + return [].concat(this.makeCode(" catch ("), this.error.compileToFragments(o), this.makeCode(") {\n"), this.recovery.compileToFragments(o, LEVEL_TOP), this.makeCode("\n" + this.tab + "}")); + } else if (!(this.ensure || this.recovery)) { + return [this.makeCode(' catch (_error) {}')]; + } else { + return []; + } + }).call(this); + ensurePart = this.ensure ? [].concat(this.makeCode(" finally {\n"), this.ensure.compileToFragments(o, LEVEL_TOP), this.makeCode("\n" + this.tab + "}")) : []; + return [].concat(this.makeCode("" + this.tab + "try {\n"), tryPart, this.makeCode("\n" + this.tab + "}"), catchPart, ensurePart); + }; + + return Try; + + })(Base); + + exports.Throw = Throw = (function(_super) { + + __extends(Throw, _super); + + function Throw(expression) { + this.expression = expression; + } + + Throw.prototype.children = ['expression']; + + Throw.prototype.isStatement = YES; + + Throw.prototype.jumps = NO; + + Throw.prototype.makeReturn = THIS; + + Throw.prototype.compileNode = function(o) { + return [].concat(this.makeCode(this.tab + "throw "), this.expression.compileToFragments(o), this.makeCode(";")); + }; + + return Throw; + + })(Base); + + exports.Existence = Existence = (function(_super) { + + __extends(Existence, _super); + + function Existence(expression) { + this.expression = expression; + } + + Existence.prototype.children = ['expression']; + + Existence.prototype.invert = NEGATE; + + Existence.prototype.compileNode = function(o) { + var cmp, cnj, code, _ref2; + this.expression.front = this.front; + code = this.expression.compile(o, LEVEL_OP); + if (IDENTIFIER.test(code) && !o.scope.check(code)) { + _ref2 = this.negated ? ['===', '||'] : ['!==', '&&'], cmp = _ref2[0], cnj = _ref2[1]; + code = "typeof " + code + " " + cmp + " \"undefined\" " + cnj + " " + code + " " + cmp + " null"; + } else { + code = "" + code + " " + (this.negated ? '==' : '!=') + " null"; + } + return [this.makeCode(o.level <= LEVEL_COND ? code : "(" + code + ")")]; + }; + + return Existence; + + })(Base); + + exports.Parens = Parens = (function(_super) { + + __extends(Parens, _super); + + function Parens(body) { + this.body = body; + } + + Parens.prototype.children = ['body']; + + Parens.prototype.unwrap = function() { + return this.body; + }; + + Parens.prototype.isComplex = function() { + return this.body.isComplex(); + }; + + Parens.prototype.compileNode = function(o) { + var bare, expr, fragments; + expr = this.body.unwrap(); + if (expr instanceof Value && expr.isAtomic()) { + expr.front = this.front; + return expr.compileToFragments(o); + } + fragments = expr.compileToFragments(o, LEVEL_PAREN); + bare = o.level < LEVEL_OP && (expr instanceof Op || expr instanceof Call || (expr instanceof For && expr.returns)); + if (bare) { + return fragments; + } else { + return this.wrapInBraces(fragments); + } + }; + + return Parens; + + })(Base); + + exports.For = For = (function(_super) { + + __extends(For, _super); + + function For(body, source) { + var _ref2; + this.source = source.source, this.guard = source.guard, this.step = source.step, this.name = source.name, this.index = source.index; + this.body = Block.wrap([body]); + this.own = !!source.own; + this.object = !!source.object; + if (this.object) { + _ref2 = [this.index, this.name], this.name = _ref2[0], this.index = _ref2[1]; + } + if (this.index instanceof Value) { + throw SyntaxError('index cannot be a pattern matching expression'); + } + this.range = this.source instanceof Value && this.source.base instanceof Range && !this.source.properties.length; + this.pattern = this.name instanceof Value; + if (this.range && this.index) { + throw SyntaxError('indexes do not apply to range loops'); + } + if (this.range && this.pattern) { + throw SyntaxError('cannot pattern match over range loops'); + } + this.returns = false; + } + + For.prototype.children = ['body', 'source', 'guard', 'step']; + + For.prototype.compileNode = function(o) { + var body, bodyFragments, compare, compareDown, declare, declareDown, defPart, defPartFragments, down, forPartFragments, guardPart, idt1, increment, index, ivar, kvar, kvarAssign, lastJumps, lvar, name, namePart, ref, resultPart, returnResult, rvar, scope, source, step, stepNum, stepVar, svar, varPart, _ref2, _ref3; + body = Block.wrap([this.body]); + lastJumps = (_ref2 = last(body.expressions)) != null ? _ref2.jumps() : void 0; + if (lastJumps && lastJumps instanceof Return) { + this.returns = false; + } + source = this.range ? this.source.base : this.source; + scope = o.scope; + name = this.name && (this.name.compile(o, LEVEL_LIST)); + index = this.index && (this.index.compile(o, LEVEL_LIST)); + if (name && !this.pattern) { + scope.find(name); + } + if (index) { + scope.find(index); + } + if (this.returns) { + rvar = scope.freeVariable('results'); + } + ivar = (this.object && index) || scope.freeVariable('i'); + kvar = (this.range && name) || index || ivar; + kvarAssign = kvar !== ivar ? "" + kvar + " = " : ""; + if (this.step && !this.range) { + _ref3 = this.cacheToCodeFragments(this.step.cache(o, LEVEL_LIST)), step = _ref3[0], stepVar = _ref3[1]; + stepNum = stepVar.match(SIMPLENUM); + } + if (this.pattern) { + name = ivar; + } + varPart = ''; + guardPart = ''; + defPart = ''; + idt1 = this.tab + TAB; + if (this.range) { + forPartFragments = source.compileToFragments(merge(o, { + index: ivar, + name: name, + step: this.step + })); + } else { + svar = this.source.compile(o, LEVEL_LIST); + if ((name || this.own) && !IDENTIFIER.test(svar)) { + defPart += "" + this.tab + (ref = scope.freeVariable('ref')) + " = " + svar + ";\n"; + svar = ref; + } + if (name && !this.pattern) { + namePart = "" + name + " = " + svar + "[" + kvar + "]"; + } + if (!this.object) { + if (step !== stepVar) { + defPart += "" + this.tab + step + ";\n"; + } + if (!(this.step && stepNum && (down = +stepNum < 0))) { + lvar = scope.freeVariable('len'); + } + declare = "" + kvarAssign + ivar + " = 0, " + lvar + " = " + svar + ".length"; + declareDown = "" + kvarAssign + ivar + " = " + svar + ".length - 1"; + compare = "" + ivar + " < " + lvar; + compareDown = "" + ivar + " >= 0"; + if (this.step) { + if (stepNum) { + if (down) { + compare = compareDown; + declare = declareDown; + } + } else { + compare = "" + stepVar + " > 0 ? " + compare + " : " + compareDown; + declare = "(" + stepVar + " > 0 ? (" + declare + ") : " + declareDown + ")"; + } + increment = "" + ivar + " += " + stepVar; + } else { + increment = "" + (kvar !== ivar ? "++" + ivar : "" + ivar + "++"); + } + forPartFragments = [this.makeCode("" + declare + "; " + compare + "; " + kvarAssign + increment)]; + } + } + if (this.returns) { + resultPart = "" + this.tab + rvar + " = [];\n"; + returnResult = "\n" + this.tab + "return " + rvar + ";"; + body.makeReturn(rvar); + } + if (this.guard) { + if (body.expressions.length > 1) { + body.expressions.unshift(new If((new Parens(this.guard)).invert(), new Literal("continue"))); + } else { + if (this.guard) { + body = Block.wrap([new If(this.guard, body)]); + } + } + } + if (this.pattern) { + body.expressions.unshift(new Assign(this.name, new Literal("" + svar + "[" + kvar + "]"))); + } + defPartFragments = [].concat(this.makeCode(defPart), this.pluckDirectCall(o, body)); + if (namePart) { + varPart = "\n" + idt1 + namePart + ";"; + } + if (this.object) { + forPartFragments = [this.makeCode("" + kvar + " in " + svar)]; + if (this.own) { + guardPart = "\n" + idt1 + "if (!" + (utility('hasProp')) + ".call(" + svar + ", " + kvar + ")) continue;"; + } + } + bodyFragments = body.compileToFragments(merge(o, { + indent: idt1 + }), LEVEL_TOP); + if (bodyFragments && (bodyFragments.length > 0)) { + bodyFragments = [].concat(this.makeCode("\n"), bodyFragments, this.makeCode("\n")); + } + return [].concat(defPartFragments, this.makeCode("" + (resultPart || '') + this.tab + "for ("), forPartFragments, this.makeCode(") {" + guardPart + varPart), bodyFragments, this.makeCode("" + this.tab + "}" + (returnResult || ''))); + }; + + For.prototype.pluckDirectCall = function(o, body) { + var base, defs, expr, fn, idx, ref, val, _i, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7; + defs = []; + _ref2 = body.expressions; + for (idx = _i = 0, _len = _ref2.length; _i < _len; idx = ++_i) { + expr = _ref2[idx]; + expr = expr.unwrapAll(); + if (!(expr instanceof Call)) { + continue; + } + val = expr.variable.unwrapAll(); + if (!((val instanceof Code) || (val instanceof Value && ((_ref3 = val.base) != null ? _ref3.unwrapAll() : void 0) instanceof Code && val.properties.length === 1 && ((_ref4 = (_ref5 = val.properties[0].name) != null ? _ref5.value : void 0) === 'call' || _ref4 === 'apply')))) { + continue; + } + fn = ((_ref6 = val.base) != null ? _ref6.unwrapAll() : void 0) || val; + ref = new Literal(o.scope.freeVariable('fn')); + base = new Value(ref); + if (val.base) { + _ref7 = [base, val], val.base = _ref7[0], base = _ref7[1]; + } + body.expressions[idx] = new Call(base, expr.args); + defs = defs.concat(this.makeCode(this.tab), new Assign(ref, fn).compileToFragments(o, LEVEL_TOP), this.makeCode(';\n')); + } + return defs; + }; + + return For; + + })(While); + + exports.Switch = Switch = (function(_super) { + + __extends(Switch, _super); + + function Switch(subject, cases, otherwise) { + this.subject = subject; + this.cases = cases; + this.otherwise = otherwise; + } + + Switch.prototype.children = ['subject', 'cases', 'otherwise']; + + Switch.prototype.isStatement = YES; + + Switch.prototype.jumps = function(o) { + var block, conds, _i, _len, _ref2, _ref3, _ref4; + if (o == null) { + o = { + block: true + }; + } + _ref2 = this.cases; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + _ref3 = _ref2[_i], conds = _ref3[0], block = _ref3[1]; + if (block.jumps(o)) { + return block; + } + } + return (_ref4 = this.otherwise) != null ? _ref4.jumps(o) : void 0; + }; + + Switch.prototype.makeReturn = function(res) { + var pair, _i, _len, _ref2, _ref3; + _ref2 = this.cases; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + pair = _ref2[_i]; + pair[1].makeReturn(res); + } + if (res) { + this.otherwise || (this.otherwise = new Block([new Literal('void 0')])); + } + if ((_ref3 = this.otherwise) != null) { + _ref3.makeReturn(res); + } + return this; + }; + + Switch.prototype.compileNode = function(o) { + var block, body, cond, conditions, expr, fragments, i, idt1, idt2, _i, _j, _len, _len1, _ref2, _ref3, _ref4; + idt1 = o.indent + TAB; + idt2 = o.indent = idt1 + TAB; + fragments = [].concat(this.makeCode(this.tab + "switch ("), (this.subject ? this.subject.compileToFragments(o, LEVEL_PAREN) : this.makeCode("false")), this.makeCode(") {\n")); + _ref2 = this.cases; + for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) { + _ref3 = _ref2[i], conditions = _ref3[0], block = _ref3[1]; + _ref4 = flatten([conditions]); + for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) { + cond = _ref4[_j]; + if (!this.subject) { + cond = cond.invert(); + } + fragments = fragments.concat(this.makeCode(idt1 + "case "), cond.compileToFragments(o, LEVEL_PAREN), this.makeCode(":\n")); + } + if ((body = block.compileToFragments(o, LEVEL_TOP)).length > 0) { + fragments = fragments.concat(body, this.makeCode('\n')); + } + if (i === this.cases.length - 1 && !this.otherwise) { + break; + } + expr = this.lastNonComment(block.expressions); + if (expr instanceof Return || (expr instanceof Literal && expr.jumps() && expr.value !== 'debugger')) { + continue; + } + fragments.push(cond.makeCode(idt2 + 'break;\n')); + } + if (this.otherwise && this.otherwise.expressions.length) { + fragments.push.apply(fragments, [this.makeCode(idt1 + "default:\n")].concat(__slice.call(this.otherwise.compileToFragments(o, LEVEL_TOP)), [this.makeCode("\n")])); + } + fragments.push(this.makeCode(this.tab + '}')); + return fragments; + }; + + return Switch; + + })(Base); + + exports.If = If = (function(_super) { + + __extends(If, _super); + + function If(condition, body, options) { + this.body = body; + if (options == null) { + options = {}; + } + this.condition = options.type === 'unless' ? condition.invert() : condition; + this.elseBody = null; + this.isChain = false; + this.soak = options.soak; + } + + If.prototype.children = ['condition', 'body', 'elseBody']; + + If.prototype.bodyNode = function() { + var _ref2; + return (_ref2 = this.body) != null ? _ref2.unwrap() : void 0; + }; + + If.prototype.elseBodyNode = function() { + var _ref2; + return (_ref2 = this.elseBody) != null ? _ref2.unwrap() : void 0; + }; + + If.prototype.addElse = function(elseBody) { + if (this.isChain) { + this.elseBodyNode().addElse(elseBody); + } else { + this.isChain = elseBody instanceof If; + this.elseBody = this.ensureBlock(elseBody); + } + return this; + }; + + If.prototype.isStatement = function(o) { + var _ref2; + return (o != null ? o.level : void 0) === LEVEL_TOP || this.bodyNode().isStatement(o) || ((_ref2 = this.elseBodyNode()) != null ? _ref2.isStatement(o) : void 0); + }; + + If.prototype.jumps = function(o) { + var _ref2; + return this.body.jumps(o) || ((_ref2 = this.elseBody) != null ? _ref2.jumps(o) : void 0); + }; + + If.prototype.compileNode = function(o) { + if (this.isStatement(o)) { + return this.compileStatement(o); + } else { + return this.compileExpression(o); + } + }; + + If.prototype.makeReturn = function(res) { + if (res) { + this.elseBody || (this.elseBody = new Block([new Literal('void 0')])); + } + this.body && (this.body = new Block([this.body.makeReturn(res)])); + this.elseBody && (this.elseBody = new Block([this.elseBody.makeReturn(res)])); + return this; + }; + + If.prototype.ensureBlock = function(node) { + if (node instanceof Block) { + return node; + } else { + return new Block([node]); + } + }; + + If.prototype.compileStatement = function(o) { + var answer, body, child, cond, exeq, ifPart, indent; + child = del(o, 'chainChild'); + exeq = del(o, 'isExistentialEquals'); + if (exeq) { + return new If(this.condition.invert(), this.elseBodyNode(), { + type: 'if' + }).compileToFragments(o); + } + indent = o.indent + TAB; + cond = this.condition.compileToFragments(o, LEVEL_PAREN); + body = this.ensureBlock(this.body).compileToFragments(merge(o, { + indent: indent + })); + ifPart = [].concat(this.makeCode("if ("), cond, this.makeCode(") {\n"), body, this.makeCode("\n" + this.tab + "}")); + if (!child) { + ifPart.unshift(this.makeCode(this.tab)); + } + if (!this.elseBody) { + return ifPart; + } + answer = ifPart.concat(this.makeCode(' else ')); + if (this.isChain) { + o.chainChild = true; + answer = answer.concat(this.elseBody.unwrap().compileToFragments(o, LEVEL_TOP)); + } else { + answer = answer.concat(this.makeCode("{\n"), this.elseBody.compileToFragments(merge(o, { + indent: indent + }), LEVEL_TOP), this.makeCode("\n" + this.tab + "}")); + } + return answer; + }; + + If.prototype.compileExpression = function(o) { + var alt, body, cond, fragments; + cond = this.condition.compileToFragments(o, LEVEL_COND); + body = this.bodyNode().compileToFragments(o, LEVEL_LIST); + alt = this.elseBodyNode() ? this.elseBodyNode().compileToFragments(o, LEVEL_LIST) : [this.makeCode('void 0')]; + fragments = cond.concat(this.makeCode(" ? "), body, this.makeCode(" : "), alt); + if (o.level >= LEVEL_COND) { + return this.wrapInBraces(fragments); + } else { + return fragments; + } + }; + + If.prototype.unfoldSoak = function() { + return this.soak && this; + }; + + return If; + + })(Base); + + Closure = { + wrap: function(expressions, statement, noReturn) { + var args, call, func, mentionsArgs, meth; + if (expressions.jumps()) { + return expressions; + } + func = new Code([], Block.wrap([expressions])); + args = []; + if ((mentionsArgs = expressions.contains(this.literalArgs)) || expressions.contains(this.literalThis)) { + if (mentionsArgs && expressions.classBody) { + throw SyntaxError("Class bodies shouldn't reference arguments"); + } + meth = new Literal(mentionsArgs ? 'apply' : 'call'); + args = [new Literal('this')]; + if (mentionsArgs) { + args.push(new Literal('arguments')); + } + func = new Value(func, [new Access(meth)]); + } + func.noReturn = noReturn; + call = new Call(func, args); + if (statement) { + return Block.wrap([call]); + } else { + return call; + } + }, + literalArgs: function(node) { + return node instanceof Literal && node.value === 'arguments' && !node.asKey; + }, + literalThis: function(node) { + return (node instanceof Literal && node.value === 'this' && !node.asKey) || (node instanceof Code && node.bound) || (node instanceof Call && node.isSuper); + } + }; + + unfoldSoak = function(o, parent, name) { + var ifn; + if (!(ifn = parent[name].unfoldSoak(o))) { + return; + } + parent[name] = ifn.body; + ifn.body = new Value(parent); + return ifn; + }; + + UTILITIES = { + "extends": function() { + return "function(child, parent) { for (var key in parent) { if (" + (utility('hasProp')) + ".call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }"; + }, + indexOf: function() { + return "[].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }"; + }, + hasProp: function() { + return '{}.hasOwnProperty'; + }, + slice: function() { + return '[].slice'; + } + }; + + LEVEL_TOP = 1; + + LEVEL_PAREN = 2; + + LEVEL_LIST = 3; + + LEVEL_COND = 4; + + LEVEL_OP = 5; + + LEVEL_ACCESS = 6; + + TAB = ' '; + + IDENTIFIER_STR = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*"; + + IDENTIFIER = RegExp("^" + IDENTIFIER_STR + "$"); + + SIMPLENUM = /^[+-]?\d+$/; + + METHOD_DEF = RegExp("^(?:(" + IDENTIFIER_STR + ")\\.prototype(?:\\.(" + IDENTIFIER_STR + ")|\\[(\"(?:[^\\\\\"\\r\\n]|\\\\.)*\"|'(?:[^\\\\'\\r\\n]|\\\\.)*')\\]|\\[(0x[\\da-fA-F]+|\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\]))|(" + IDENTIFIER_STR + ")$"); + + IS_STRING = /^['"]/; + + utility = function(name) { + var ref; + ref = "__" + name; + Scope.root.assign(ref, UTILITIES[name]()); + return ref; + }; + + multident = function(code, tab) { + code = code.replace(/\n/g, '$&' + tab); + return code.replace(/\s+$/, ''); + }; + +}).call(this); diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/optparse.js b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/optparse.js new file mode 100644 index 00000000..f650fdd1 --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/optparse.js @@ -0,0 +1,138 @@ +// Generated by CoffeeScript 1.6.1 +(function() { + var LONG_FLAG, MULTI_FLAG, OPTIONAL, OptionParser, SHORT_FLAG, buildRule, buildRules, normalizeArguments; + + exports.OptionParser = OptionParser = (function() { + + function OptionParser(rules, banner) { + this.banner = banner; + this.rules = buildRules(rules); + } + + OptionParser.prototype.parse = function(args) { + var arg, i, isOption, matchedRule, options, originalArgs, pos, rule, seenNonOptionArg, skippingArgument, value, _i, _j, _len, _len1, _ref; + options = { + "arguments": [] + }; + skippingArgument = false; + originalArgs = args; + args = normalizeArguments(args); + for (i = _i = 0, _len = args.length; _i < _len; i = ++_i) { + arg = args[i]; + if (skippingArgument) { + skippingArgument = false; + continue; + } + if (arg === '--') { + pos = originalArgs.indexOf('--'); + options["arguments"] = options["arguments"].concat(originalArgs.slice(pos + 1)); + break; + } + isOption = !!(arg.match(LONG_FLAG) || arg.match(SHORT_FLAG)); + seenNonOptionArg = options["arguments"].length > 0; + if (!seenNonOptionArg) { + matchedRule = false; + _ref = this.rules; + for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) { + rule = _ref[_j]; + if (rule.shortFlag === arg || rule.longFlag === arg) { + value = true; + if (rule.hasArgument) { + skippingArgument = true; + value = args[i + 1]; + } + options[rule.name] = rule.isList ? (options[rule.name] || []).concat(value) : value; + matchedRule = true; + break; + } + } + if (isOption && !matchedRule) { + throw new Error("unrecognized option: " + arg); + } + } + if (seenNonOptionArg || !isOption) { + options["arguments"].push(arg); + } + } + return options; + }; + + OptionParser.prototype.help = function() { + var letPart, lines, rule, spaces, _i, _len, _ref; + lines = []; + if (this.banner) { + lines.unshift("" + this.banner + "\n"); + } + _ref = this.rules; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + rule = _ref[_i]; + spaces = 15 - rule.longFlag.length; + spaces = spaces > 0 ? Array(spaces + 1).join(' ') : ''; + letPart = rule.shortFlag ? rule.shortFlag + ', ' : ' '; + lines.push(' ' + letPart + rule.longFlag + spaces + rule.description); + } + return "\n" + (lines.join('\n')) + "\n"; + }; + + return OptionParser; + + })(); + + LONG_FLAG = /^(--\w[\w\-]*)/; + + SHORT_FLAG = /^(-\w)$/; + + MULTI_FLAG = /^-(\w{2,})/; + + OPTIONAL = /\[(\w+(\*?))\]/; + + buildRules = function(rules) { + var tuple, _i, _len, _results; + _results = []; + for (_i = 0, _len = rules.length; _i < _len; _i++) { + tuple = rules[_i]; + if (tuple.length < 3) { + tuple.unshift(null); + } + _results.push(buildRule.apply(null, tuple)); + } + return _results; + }; + + buildRule = function(shortFlag, longFlag, description, options) { + var match; + if (options == null) { + options = {}; + } + match = longFlag.match(OPTIONAL); + longFlag = longFlag.match(LONG_FLAG)[1]; + return { + name: longFlag.substr(2), + shortFlag: shortFlag, + longFlag: longFlag, + description: description, + hasArgument: !!(match && match[1]), + isList: !!(match && match[2]) + }; + }; + + normalizeArguments = function(args) { + var arg, l, match, result, _i, _j, _len, _len1, _ref; + args = args.slice(0); + result = []; + for (_i = 0, _len = args.length; _i < _len; _i++) { + arg = args[_i]; + if (match = arg.match(MULTI_FLAG)) { + _ref = match[1].split(''); + for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) { + l = _ref[_j]; + result.push('-' + l); + } + } else { + result.push(arg); + } + } + return result; + }; + +}).call(this); diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/parser.js b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/parser.js new file mode 100755 index 00000000..dde2e61f --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/parser.js @@ -0,0 +1,608 @@ +/* parser generated by jison 0.4.2 */ +var parser = (function(){ +var parser = {trace: function trace() { }, +yy: {}, +symbols_: {"error":2,"Root":3,"Body":4,"Block":5,"TERMINATOR":6,"Line":7,"Expression":8,"Statement":9,"Return":10,"Comment":11,"STATEMENT":12,"Value":13,"Invocation":14,"Code":15,"Operation":16,"Assign":17,"If":18,"Try":19,"While":20,"For":21,"Switch":22,"Class":23,"Throw":24,"INDENT":25,"OUTDENT":26,"Identifier":27,"IDENTIFIER":28,"AlphaNumeric":29,"NUMBER":30,"STRING":31,"Literal":32,"JS":33,"REGEX":34,"DEBUGGER":35,"UNDEFINED":36,"NULL":37,"BOOL":38,"Assignable":39,"=":40,"AssignObj":41,"ObjAssignable":42,":":43,"ThisProperty":44,"RETURN":45,"HERECOMMENT":46,"PARAM_START":47,"ParamList":48,"PARAM_END":49,"FuncGlyph":50,"->":51,"=>":52,"OptComma":53,",":54,"Param":55,"ParamVar":56,"...":57,"Array":58,"Object":59,"Splat":60,"SimpleAssignable":61,"Accessor":62,"Parenthetical":63,"Range":64,"This":65,".":66,"?.":67,"::":68,"?::":69,"Index":70,"INDEX_START":71,"IndexValue":72,"INDEX_END":73,"INDEX_SOAK":74,"Slice":75,"{":76,"AssignList":77,"}":78,"CLASS":79,"EXTENDS":80,"OptFuncExist":81,"Arguments":82,"SUPER":83,"FUNC_EXIST":84,"CALL_START":85,"CALL_END":86,"ArgList":87,"THIS":88,"@":89,"[":90,"]":91,"RangeDots":92,"..":93,"Arg":94,"SimpleArgs":95,"TRY":96,"Catch":97,"FINALLY":98,"CATCH":99,"THROW":100,"(":101,")":102,"WhileSource":103,"WHILE":104,"WHEN":105,"UNTIL":106,"Loop":107,"LOOP":108,"ForBody":109,"FOR":110,"ForStart":111,"ForSource":112,"ForVariables":113,"OWN":114,"ForValue":115,"FORIN":116,"FOROF":117,"BY":118,"SWITCH":119,"Whens":120,"ELSE":121,"When":122,"LEADING_WHEN":123,"IfBlock":124,"IF":125,"POST_IF":126,"UNARY":127,"-":128,"+":129,"--":130,"++":131,"?":132,"MATH":133,"SHIFT":134,"COMPARE":135,"LOGIC":136,"RELATION":137,"COMPOUND_ASSIGN":138,"$accept":0,"$end":1}, +terminals_: {2:"error",6:"TERMINATOR",12:"STATEMENT",25:"INDENT",26:"OUTDENT",28:"IDENTIFIER",30:"NUMBER",31:"STRING",33:"JS",34:"REGEX",35:"DEBUGGER",36:"UNDEFINED",37:"NULL",38:"BOOL",40:"=",43:":",45:"RETURN",46:"HERECOMMENT",47:"PARAM_START",49:"PARAM_END",51:"->",52:"=>",54:",",57:"...",66:".",67:"?.",68:"::",69:"?::",71:"INDEX_START",73:"INDEX_END",74:"INDEX_SOAK",76:"{",78:"}",79:"CLASS",80:"EXTENDS",83:"SUPER",84:"FUNC_EXIST",85:"CALL_START",86:"CALL_END",88:"THIS",89:"@",90:"[",91:"]",93:"..",96:"TRY",98:"FINALLY",99:"CATCH",100:"THROW",101:"(",102:")",104:"WHILE",105:"WHEN",106:"UNTIL",108:"LOOP",110:"FOR",114:"OWN",116:"FORIN",117:"FOROF",118:"BY",119:"SWITCH",121:"ELSE",123:"LEADING_WHEN",125:"IF",126:"POST_IF",127:"UNARY",128:"-",129:"+",130:"--",131:"++",132:"?",133:"MATH",134:"SHIFT",135:"COMPARE",136:"LOGIC",137:"RELATION",138:"COMPOUND_ASSIGN"}, +productions_: [0,[3,0],[3,1],[3,2],[4,1],[4,3],[4,2],[7,1],[7,1],[9,1],[9,1],[9,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[5,2],[5,3],[27,1],[29,1],[29,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[17,3],[17,4],[17,5],[41,1],[41,3],[41,5],[41,1],[42,1],[42,1],[42,1],[10,2],[10,1],[11,1],[15,5],[15,2],[50,1],[50,1],[53,0],[53,1],[48,0],[48,1],[48,3],[48,4],[48,6],[55,1],[55,2],[55,3],[56,1],[56,1],[56,1],[56,1],[60,2],[61,1],[61,2],[61,2],[61,1],[39,1],[39,1],[39,1],[13,1],[13,1],[13,1],[13,1],[13,1],[62,2],[62,2],[62,2],[62,2],[62,1],[62,1],[70,3],[70,2],[72,1],[72,1],[59,4],[77,0],[77,1],[77,3],[77,4],[77,6],[23,1],[23,2],[23,3],[23,4],[23,2],[23,3],[23,4],[23,5],[14,3],[14,3],[14,1],[14,2],[81,0],[81,1],[82,2],[82,4],[65,1],[65,1],[44,2],[58,2],[58,4],[92,1],[92,1],[64,5],[75,3],[75,2],[75,2],[75,1],[87,1],[87,3],[87,4],[87,4],[87,6],[94,1],[94,1],[95,1],[95,3],[19,2],[19,3],[19,4],[19,5],[97,3],[97,3],[24,2],[63,3],[63,5],[103,2],[103,4],[103,2],[103,4],[20,2],[20,2],[20,2],[20,1],[107,2],[107,2],[21,2],[21,2],[21,2],[109,2],[109,2],[111,2],[111,3],[115,1],[115,1],[115,1],[115,1],[113,1],[113,3],[112,2],[112,2],[112,4],[112,4],[112,4],[112,6],[112,6],[22,5],[22,7],[22,4],[22,6],[120,1],[120,2],[122,3],[122,4],[124,3],[124,5],[18,1],[18,3],[18,3],[18,3],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,5],[16,4],[16,3]], +performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) { + +var $0 = $$.length - 1; +switch (yystate) { +case 1:return this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Block); +break; +case 2:return this.$ = $$[$0]; +break; +case 3:return this.$ = $$[$0-1]; +break; +case 4:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(yy.Block.wrap([$$[$0]])); +break; +case 5:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].push($$[$0])); +break; +case 6:this.$ = $$[$0-1]; +break; +case 7:this.$ = $$[$0]; +break; +case 8:this.$ = $$[$0]; +break; +case 9:this.$ = $$[$0]; +break; +case 10:this.$ = $$[$0]; +break; +case 11:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); +break; +case 12:this.$ = $$[$0]; +break; +case 13:this.$ = $$[$0]; +break; +case 14:this.$ = $$[$0]; +break; +case 15:this.$ = $$[$0]; +break; +case 16:this.$ = $$[$0]; +break; +case 17:this.$ = $$[$0]; +break; +case 18:this.$ = $$[$0]; +break; +case 19:this.$ = $$[$0]; +break; +case 20:this.$ = $$[$0]; +break; +case 21:this.$ = $$[$0]; +break; +case 22:this.$ = $$[$0]; +break; +case 23:this.$ = $$[$0]; +break; +case 24:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Block); +break; +case 25:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-1]); +break; +case 26:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); +break; +case 27:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); +break; +case 28:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); +break; +case 29:this.$ = $$[$0]; +break; +case 30:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); +break; +case 31:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); +break; +case 32:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); +break; +case 33:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Undefined); +break; +case 34:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Null); +break; +case 35:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Bool($$[$0])); +break; +case 36:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Assign($$[$0-2], $$[$0])); +break; +case 37:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Assign($$[$0-3], $$[$0])); +break; +case 38:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Assign($$[$0-4], $$[$0-1])); +break; +case 39:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); +break; +case 40:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Assign(yy.addLocationDataFn(_$[$0-2])(new yy.Value($$[$0-2])), $$[$0], 'object')); +break; +case 41:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Assign(yy.addLocationDataFn(_$[$0-4])(new yy.Value($$[$0-4])), $$[$0-1], 'object')); +break; +case 42:this.$ = $$[$0]; +break; +case 43:this.$ = $$[$0]; +break; +case 44:this.$ = $$[$0]; +break; +case 45:this.$ = $$[$0]; +break; +case 46:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Return($$[$0])); +break; +case 47:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Return); +break; +case 48:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Comment($$[$0])); +break; +case 49:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Code($$[$0-3], $$[$0], $$[$0-1])); +break; +case 50:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Code([], $$[$0], $$[$0-1])); +break; +case 51:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('func'); +break; +case 52:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('boundfunc'); +break; +case 53:this.$ = $$[$0]; +break; +case 54:this.$ = $$[$0]; +break; +case 55:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([]); +break; +case 56:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]); +break; +case 57:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].concat($$[$0])); +break; +case 58:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-3].concat($$[$0])); +break; +case 59:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])($$[$0-5].concat($$[$0-2])); +break; +case 60:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Param($$[$0])); +break; +case 61:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Param($$[$0-1], null, true)); +break; +case 62:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Param($$[$0-2], $$[$0])); +break; +case 63:this.$ = $$[$0]; +break; +case 64:this.$ = $$[$0]; +break; +case 65:this.$ = $$[$0]; +break; +case 66:this.$ = $$[$0]; +break; +case 67:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Splat($$[$0-1])); +break; +case 68:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); +break; +case 69:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0-1].add($$[$0])); +break; +case 70:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Value($$[$0-1], [].concat($$[$0]))); +break; +case 71:this.$ = $$[$0]; +break; +case 72:this.$ = $$[$0]; +break; +case 73:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); +break; +case 74:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); +break; +case 75:this.$ = $$[$0]; +break; +case 76:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); +break; +case 77:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); +break; +case 78:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); +break; +case 79:this.$ = $$[$0]; +break; +case 80:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Access($$[$0])); +break; +case 81:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Access($$[$0], 'soak')); +break; +case 82:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([yy.addLocationDataFn(_$[$0-1])(new yy.Access(new yy.Literal('prototype'))), yy.addLocationDataFn(_$[$0])(new yy.Access($$[$0]))]); +break; +case 83:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([yy.addLocationDataFn(_$[$0-1])(new yy.Access(new yy.Literal('prototype'), 'soak')), yy.addLocationDataFn(_$[$0])(new yy.Access($$[$0]))]); +break; +case 84:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Access(new yy.Literal('prototype'))); +break; +case 85:this.$ = $$[$0]; +break; +case 86:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-1]); +break; +case 87:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(yy.extend($$[$0], { + soak: true + })); +break; +case 88:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Index($$[$0])); +break; +case 89:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Slice($$[$0])); +break; +case 90:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Obj($$[$0-2], $$[$0-3].generated)); +break; +case 91:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([]); +break; +case 92:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]); +break; +case 93:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].concat($$[$0])); +break; +case 94:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-3].concat($$[$0])); +break; +case 95:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])($$[$0-5].concat($$[$0-2])); +break; +case 96:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Class); +break; +case 97:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Class(null, null, $$[$0])); +break; +case 98:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Class(null, $$[$0])); +break; +case 99:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Class(null, $$[$0-1], $$[$0])); +break; +case 100:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Class($$[$0])); +break; +case 101:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Class($$[$0-1], null, $$[$0])); +break; +case 102:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Class($$[$0-2], $$[$0])); +break; +case 103:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Class($$[$0-3], $$[$0-1], $$[$0])); +break; +case 104:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Call($$[$0-2], $$[$0], $$[$0-1])); +break; +case 105:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Call($$[$0-2], $$[$0], $$[$0-1])); +break; +case 106:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Call('super', [new yy.Splat(new yy.Literal('arguments'))])); +break; +case 107:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Call('super', $$[$0])); +break; +case 108:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(false); +break; +case 109:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(true); +break; +case 110:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([]); +break; +case 111:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-2]); +break; +case 112:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value(new yy.Literal('this'))); +break; +case 113:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value(new yy.Literal('this'))); +break; +case 114:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Value(yy.addLocationDataFn(_$[$0-1])(new yy.Literal('this')), [yy.addLocationDataFn(_$[$0])(new yy.Access($$[$0]))], 'this')); +break; +case 115:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Arr([])); +break; +case 116:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Arr($$[$0-2])); +break; +case 117:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('inclusive'); +break; +case 118:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('exclusive'); +break; +case 119:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Range($$[$0-3], $$[$0-1], $$[$0-2])); +break; +case 120:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Range($$[$0-2], $$[$0], $$[$0-1])); +break; +case 121:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Range($$[$0-1], null, $$[$0])); +break; +case 122:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Range(null, $$[$0], $$[$0-1])); +break; +case 123:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Range(null, null, $$[$0])); +break; +case 124:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]); +break; +case 125:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].concat($$[$0])); +break; +case 126:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-3].concat($$[$0])); +break; +case 127:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-2]); +break; +case 128:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])($$[$0-5].concat($$[$0-2])); +break; +case 129:this.$ = $$[$0]; +break; +case 130:this.$ = $$[$0]; +break; +case 131:this.$ = $$[$0]; +break; +case 132:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([].concat($$[$0-2], $$[$0])); +break; +case 133:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Try($$[$0])); +break; +case 134:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Try($$[$0-1], $$[$0][0], $$[$0][1])); +break; +case 135:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Try($$[$0-2], null, null, $$[$0])); +break; +case 136:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Try($$[$0-3], $$[$0-2][0], $$[$0-2][1], $$[$0])); +break; +case 137:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([$$[$0-1], $$[$0]]); +break; +case 138:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([yy.addLocationDataFn(_$[$0-1])(new yy.Value($$[$0-1])), $$[$0]]); +break; +case 139:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Throw($$[$0])); +break; +case 140:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Parens($$[$0-1])); +break; +case 141:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Parens($$[$0-2])); +break; +case 142:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.While($$[$0])); +break; +case 143:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.While($$[$0-2], { + guard: $$[$0] + })); +break; +case 144:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.While($$[$0], { + invert: true + })); +break; +case 145:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.While($$[$0-2], { + invert: true, + guard: $$[$0] + })); +break; +case 146:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0-1].addBody($$[$0])); +break; +case 147:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0].addBody(yy.addLocationDataFn(_$[$0-1])(yy.Block.wrap([$$[$0-1]])))); +break; +case 148:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0].addBody(yy.addLocationDataFn(_$[$0-1])(yy.Block.wrap([$$[$0-1]])))); +break; +case 149:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])($$[$0]); +break; +case 150:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.While(yy.addLocationDataFn(_$[$0-1])(new yy.Literal('true'))).addBody($$[$0])); +break; +case 151:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.While(yy.addLocationDataFn(_$[$0-1])(new yy.Literal('true'))).addBody(yy.addLocationDataFn(_$[$0])(yy.Block.wrap([$$[$0]])))); +break; +case 152:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.For($$[$0-1], $$[$0])); +break; +case 153:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.For($$[$0-1], $$[$0])); +break; +case 154:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.For($$[$0], $$[$0-1])); +break; +case 155:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])({ + source: yy.addLocationDataFn(_$[$0])(new yy.Value($$[$0])) + }); +break; +case 156:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])((function () { + $$[$0].own = $$[$0-1].own; + $$[$0].name = $$[$0-1][0]; + $$[$0].index = $$[$0-1][1]; + return $$[$0]; + }())); +break; +case 157:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0]); +break; +case 158:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])((function () { + $$[$0].own = true; + return $$[$0]; + }())); +break; +case 159:this.$ = $$[$0]; +break; +case 160:this.$ = $$[$0]; +break; +case 161:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); +break; +case 162:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); +break; +case 163:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]); +break; +case 164:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([$$[$0-2], $$[$0]]); +break; +case 165:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])({ + source: $$[$0] + }); +break; +case 166:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])({ + source: $$[$0], + object: true + }); +break; +case 167:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])({ + source: $$[$0-2], + guard: $$[$0] + }); +break; +case 168:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])({ + source: $$[$0-2], + guard: $$[$0], + object: true + }); +break; +case 169:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])({ + source: $$[$0-2], + step: $$[$0] + }); +break; +case 170:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])({ + source: $$[$0-4], + guard: $$[$0-2], + step: $$[$0] + }); +break; +case 171:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])({ + source: $$[$0-4], + step: $$[$0-2], + guard: $$[$0] + }); +break; +case 172:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Switch($$[$0-3], $$[$0-1])); +break; +case 173:this.$ = yy.addLocationDataFn(_$[$0-6], _$[$0])(new yy.Switch($$[$0-5], $$[$0-3], $$[$0-1])); +break; +case 174:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Switch(null, $$[$0-1])); +break; +case 175:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])(new yy.Switch(null, $$[$0-3], $$[$0-1])); +break; +case 176:this.$ = $$[$0]; +break; +case 177:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0-1].concat($$[$0])); +break; +case 178:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([[$$[$0-1], $$[$0]]]); +break; +case 179:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])([[$$[$0-2], $$[$0-1]]]); +break; +case 180:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.If($$[$0-1], $$[$0], { + type: $$[$0-2] + })); +break; +case 181:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])($$[$0-4].addElse(new yy.If($$[$0-1], $$[$0], { + type: $$[$0-2] + }))); +break; +case 182:this.$ = $$[$0]; +break; +case 183:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].addElse($$[$0])); +break; +case 184:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.If($$[$0], yy.addLocationDataFn(_$[$0-2])(yy.Block.wrap([$$[$0-2]])), { + type: $$[$0-1], + statement: true + })); +break; +case 185:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.If($$[$0], yy.addLocationDataFn(_$[$0-2])(yy.Block.wrap([$$[$0-2]])), { + type: $$[$0-1], + statement: true + })); +break; +case 186:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op($$[$0-1], $$[$0])); +break; +case 187:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('-', $$[$0])); +break; +case 188:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('+', $$[$0])); +break; +case 189:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('--', $$[$0])); +break; +case 190:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('++', $$[$0])); +break; +case 191:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('--', $$[$0-1], null, true)); +break; +case 192:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('++', $$[$0-1], null, true)); +break; +case 193:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Existence($$[$0-1])); +break; +case 194:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op('+', $$[$0-2], $$[$0])); +break; +case 195:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op('-', $$[$0-2], $$[$0])); +break; +case 196:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0])); +break; +case 197:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0])); +break; +case 198:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0])); +break; +case 199:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0])); +break; +case 200:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])((function () { + if ($$[$0-1].charAt(0) === '!') { + return new yy.Op($$[$0-1].slice(1), $$[$0-2], $$[$0]).invert(); + } else { + return new yy.Op($$[$0-1], $$[$0-2], $$[$0]); + } + }())); +break; +case 201:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Assign($$[$0-2], $$[$0], $$[$0-1])); +break; +case 202:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Assign($$[$0-4], $$[$0-1], $$[$0-3])); +break; +case 203:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Assign($$[$0-3], $$[$0], $$[$0-2])); +break; +case 204:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Extends($$[$0-2], $$[$0])); +break; +} +}, +table: [{1:[2,1],3:1,4:2,5:3,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,5],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[3]},{1:[2,2],6:[1,74]},{6:[1,75]},{1:[2,4],6:[2,4],26:[2,4],102:[2,4]},{4:77,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[1,76],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,7],6:[2,7],26:[2,7],102:[2,7],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,8],6:[2,8],26:[2,8],102:[2,8],103:90,104:[1,65],106:[1,66],109:91,110:[1,68],111:69,126:[1,89]},{1:[2,12],6:[2,12],25:[2,12],26:[2,12],49:[2,12],54:[2,12],57:[2,12],62:93,66:[1,95],67:[1,96],68:[1,97],69:[1,98],70:99,71:[1,100],73:[2,12],74:[1,101],78:[2,12],81:92,84:[1,94],85:[2,108],86:[2,12],91:[2,12],93:[2,12],102:[2,12],104:[2,12],105:[2,12],106:[2,12],110:[2,12],118:[2,12],126:[2,12],128:[2,12],129:[2,12],132:[2,12],133:[2,12],134:[2,12],135:[2,12],136:[2,12],137:[2,12]},{1:[2,13],6:[2,13],25:[2,13],26:[2,13],49:[2,13],54:[2,13],57:[2,13],62:103,66:[1,95],67:[1,96],68:[1,97],69:[1,98],70:99,71:[1,100],73:[2,13],74:[1,101],78:[2,13],81:102,84:[1,94],85:[2,108],86:[2,13],91:[2,13],93:[2,13],102:[2,13],104:[2,13],105:[2,13],106:[2,13],110:[2,13],118:[2,13],126:[2,13],128:[2,13],129:[2,13],132:[2,13],133:[2,13],134:[2,13],135:[2,13],136:[2,13],137:[2,13]},{1:[2,14],6:[2,14],25:[2,14],26:[2,14],49:[2,14],54:[2,14],57:[2,14],73:[2,14],78:[2,14],86:[2,14],91:[2,14],93:[2,14],102:[2,14],104:[2,14],105:[2,14],106:[2,14],110:[2,14],118:[2,14],126:[2,14],128:[2,14],129:[2,14],132:[2,14],133:[2,14],134:[2,14],135:[2,14],136:[2,14],137:[2,14]},{1:[2,15],6:[2,15],25:[2,15],26:[2,15],49:[2,15],54:[2,15],57:[2,15],73:[2,15],78:[2,15],86:[2,15],91:[2,15],93:[2,15],102:[2,15],104:[2,15],105:[2,15],106:[2,15],110:[2,15],118:[2,15],126:[2,15],128:[2,15],129:[2,15],132:[2,15],133:[2,15],134:[2,15],135:[2,15],136:[2,15],137:[2,15]},{1:[2,16],6:[2,16],25:[2,16],26:[2,16],49:[2,16],54:[2,16],57:[2,16],73:[2,16],78:[2,16],86:[2,16],91:[2,16],93:[2,16],102:[2,16],104:[2,16],105:[2,16],106:[2,16],110:[2,16],118:[2,16],126:[2,16],128:[2,16],129:[2,16],132:[2,16],133:[2,16],134:[2,16],135:[2,16],136:[2,16],137:[2,16]},{1:[2,17],6:[2,17],25:[2,17],26:[2,17],49:[2,17],54:[2,17],57:[2,17],73:[2,17],78:[2,17],86:[2,17],91:[2,17],93:[2,17],102:[2,17],104:[2,17],105:[2,17],106:[2,17],110:[2,17],118:[2,17],126:[2,17],128:[2,17],129:[2,17],132:[2,17],133:[2,17],134:[2,17],135:[2,17],136:[2,17],137:[2,17]},{1:[2,18],6:[2,18],25:[2,18],26:[2,18],49:[2,18],54:[2,18],57:[2,18],73:[2,18],78:[2,18],86:[2,18],91:[2,18],93:[2,18],102:[2,18],104:[2,18],105:[2,18],106:[2,18],110:[2,18],118:[2,18],126:[2,18],128:[2,18],129:[2,18],132:[2,18],133:[2,18],134:[2,18],135:[2,18],136:[2,18],137:[2,18]},{1:[2,19],6:[2,19],25:[2,19],26:[2,19],49:[2,19],54:[2,19],57:[2,19],73:[2,19],78:[2,19],86:[2,19],91:[2,19],93:[2,19],102:[2,19],104:[2,19],105:[2,19],106:[2,19],110:[2,19],118:[2,19],126:[2,19],128:[2,19],129:[2,19],132:[2,19],133:[2,19],134:[2,19],135:[2,19],136:[2,19],137:[2,19]},{1:[2,20],6:[2,20],25:[2,20],26:[2,20],49:[2,20],54:[2,20],57:[2,20],73:[2,20],78:[2,20],86:[2,20],91:[2,20],93:[2,20],102:[2,20],104:[2,20],105:[2,20],106:[2,20],110:[2,20],118:[2,20],126:[2,20],128:[2,20],129:[2,20],132:[2,20],133:[2,20],134:[2,20],135:[2,20],136:[2,20],137:[2,20]},{1:[2,21],6:[2,21],25:[2,21],26:[2,21],49:[2,21],54:[2,21],57:[2,21],73:[2,21],78:[2,21],86:[2,21],91:[2,21],93:[2,21],102:[2,21],104:[2,21],105:[2,21],106:[2,21],110:[2,21],118:[2,21],126:[2,21],128:[2,21],129:[2,21],132:[2,21],133:[2,21],134:[2,21],135:[2,21],136:[2,21],137:[2,21]},{1:[2,22],6:[2,22],25:[2,22],26:[2,22],49:[2,22],54:[2,22],57:[2,22],73:[2,22],78:[2,22],86:[2,22],91:[2,22],93:[2,22],102:[2,22],104:[2,22],105:[2,22],106:[2,22],110:[2,22],118:[2,22],126:[2,22],128:[2,22],129:[2,22],132:[2,22],133:[2,22],134:[2,22],135:[2,22],136:[2,22],137:[2,22]},{1:[2,23],6:[2,23],25:[2,23],26:[2,23],49:[2,23],54:[2,23],57:[2,23],73:[2,23],78:[2,23],86:[2,23],91:[2,23],93:[2,23],102:[2,23],104:[2,23],105:[2,23],106:[2,23],110:[2,23],118:[2,23],126:[2,23],128:[2,23],129:[2,23],132:[2,23],133:[2,23],134:[2,23],135:[2,23],136:[2,23],137:[2,23]},{1:[2,9],6:[2,9],26:[2,9],102:[2,9],104:[2,9],106:[2,9],110:[2,9],126:[2,9]},{1:[2,10],6:[2,10],26:[2,10],102:[2,10],104:[2,10],106:[2,10],110:[2,10],126:[2,10]},{1:[2,11],6:[2,11],26:[2,11],102:[2,11],104:[2,11],106:[2,11],110:[2,11],126:[2,11]},{1:[2,75],6:[2,75],25:[2,75],26:[2,75],40:[1,104],49:[2,75],54:[2,75],57:[2,75],66:[2,75],67:[2,75],68:[2,75],69:[2,75],71:[2,75],73:[2,75],74:[2,75],78:[2,75],84:[2,75],85:[2,75],86:[2,75],91:[2,75],93:[2,75],102:[2,75],104:[2,75],105:[2,75],106:[2,75],110:[2,75],118:[2,75],126:[2,75],128:[2,75],129:[2,75],132:[2,75],133:[2,75],134:[2,75],135:[2,75],136:[2,75],137:[2,75]},{1:[2,76],6:[2,76],25:[2,76],26:[2,76],49:[2,76],54:[2,76],57:[2,76],66:[2,76],67:[2,76],68:[2,76],69:[2,76],71:[2,76],73:[2,76],74:[2,76],78:[2,76],84:[2,76],85:[2,76],86:[2,76],91:[2,76],93:[2,76],102:[2,76],104:[2,76],105:[2,76],106:[2,76],110:[2,76],118:[2,76],126:[2,76],128:[2,76],129:[2,76],132:[2,76],133:[2,76],134:[2,76],135:[2,76],136:[2,76],137:[2,76]},{1:[2,77],6:[2,77],25:[2,77],26:[2,77],49:[2,77],54:[2,77],57:[2,77],66:[2,77],67:[2,77],68:[2,77],69:[2,77],71:[2,77],73:[2,77],74:[2,77],78:[2,77],84:[2,77],85:[2,77],86:[2,77],91:[2,77],93:[2,77],102:[2,77],104:[2,77],105:[2,77],106:[2,77],110:[2,77],118:[2,77],126:[2,77],128:[2,77],129:[2,77],132:[2,77],133:[2,77],134:[2,77],135:[2,77],136:[2,77],137:[2,77]},{1:[2,78],6:[2,78],25:[2,78],26:[2,78],49:[2,78],54:[2,78],57:[2,78],66:[2,78],67:[2,78],68:[2,78],69:[2,78],71:[2,78],73:[2,78],74:[2,78],78:[2,78],84:[2,78],85:[2,78],86:[2,78],91:[2,78],93:[2,78],102:[2,78],104:[2,78],105:[2,78],106:[2,78],110:[2,78],118:[2,78],126:[2,78],128:[2,78],129:[2,78],132:[2,78],133:[2,78],134:[2,78],135:[2,78],136:[2,78],137:[2,78]},{1:[2,79],6:[2,79],25:[2,79],26:[2,79],49:[2,79],54:[2,79],57:[2,79],66:[2,79],67:[2,79],68:[2,79],69:[2,79],71:[2,79],73:[2,79],74:[2,79],78:[2,79],84:[2,79],85:[2,79],86:[2,79],91:[2,79],93:[2,79],102:[2,79],104:[2,79],105:[2,79],106:[2,79],110:[2,79],118:[2,79],126:[2,79],128:[2,79],129:[2,79],132:[2,79],133:[2,79],134:[2,79],135:[2,79],136:[2,79],137:[2,79]},{1:[2,106],6:[2,106],25:[2,106],26:[2,106],49:[2,106],54:[2,106],57:[2,106],66:[2,106],67:[2,106],68:[2,106],69:[2,106],71:[2,106],73:[2,106],74:[2,106],78:[2,106],82:105,84:[2,106],85:[1,106],86:[2,106],91:[2,106],93:[2,106],102:[2,106],104:[2,106],105:[2,106],106:[2,106],110:[2,106],118:[2,106],126:[2,106],128:[2,106],129:[2,106],132:[2,106],133:[2,106],134:[2,106],135:[2,106],136:[2,106],137:[2,106]},{6:[2,55],25:[2,55],27:110,28:[1,73],44:111,48:107,49:[2,55],54:[2,55],55:108,56:109,58:112,59:113,76:[1,70],89:[1,114],90:[1,115]},{5:116,25:[1,5]},{8:117,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:119,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:120,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{13:122,14:123,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:124,44:63,58:47,59:48,61:121,63:25,64:26,65:27,76:[1,70],83:[1,28],88:[1,58],89:[1,59],90:[1,57],101:[1,56]},{13:122,14:123,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:124,44:63,58:47,59:48,61:125,63:25,64:26,65:27,76:[1,70],83:[1,28],88:[1,58],89:[1,59],90:[1,57],101:[1,56]},{1:[2,72],6:[2,72],25:[2,72],26:[2,72],40:[2,72],49:[2,72],54:[2,72],57:[2,72],66:[2,72],67:[2,72],68:[2,72],69:[2,72],71:[2,72],73:[2,72],74:[2,72],78:[2,72],80:[1,129],84:[2,72],85:[2,72],86:[2,72],91:[2,72],93:[2,72],102:[2,72],104:[2,72],105:[2,72],106:[2,72],110:[2,72],118:[2,72],126:[2,72],128:[2,72],129:[2,72],130:[1,126],131:[1,127],132:[2,72],133:[2,72],134:[2,72],135:[2,72],136:[2,72],137:[2,72],138:[1,128]},{1:[2,182],6:[2,182],25:[2,182],26:[2,182],49:[2,182],54:[2,182],57:[2,182],73:[2,182],78:[2,182],86:[2,182],91:[2,182],93:[2,182],102:[2,182],104:[2,182],105:[2,182],106:[2,182],110:[2,182],118:[2,182],121:[1,130],126:[2,182],128:[2,182],129:[2,182],132:[2,182],133:[2,182],134:[2,182],135:[2,182],136:[2,182],137:[2,182]},{5:131,25:[1,5]},{5:132,25:[1,5]},{1:[2,149],6:[2,149],25:[2,149],26:[2,149],49:[2,149],54:[2,149],57:[2,149],73:[2,149],78:[2,149],86:[2,149],91:[2,149],93:[2,149],102:[2,149],104:[2,149],105:[2,149],106:[2,149],110:[2,149],118:[2,149],126:[2,149],128:[2,149],129:[2,149],132:[2,149],133:[2,149],134:[2,149],135:[2,149],136:[2,149],137:[2,149]},{5:133,25:[1,5]},{8:134,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,135],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,96],5:136,6:[2,96],13:122,14:123,25:[1,5],26:[2,96],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:124,44:63,49:[2,96],54:[2,96],57:[2,96],58:47,59:48,61:138,63:25,64:26,65:27,73:[2,96],76:[1,70],78:[2,96],80:[1,137],83:[1,28],86:[2,96],88:[1,58],89:[1,59],90:[1,57],91:[2,96],93:[2,96],101:[1,56],102:[2,96],104:[2,96],105:[2,96],106:[2,96],110:[2,96],118:[2,96],126:[2,96],128:[2,96],129:[2,96],132:[2,96],133:[2,96],134:[2,96],135:[2,96],136:[2,96],137:[2,96]},{8:139,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,47],6:[2,47],8:140,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[2,47],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],102:[2,47],103:39,104:[2,47],106:[2,47],107:40,108:[1,67],109:41,110:[2,47],111:69,119:[1,42],124:37,125:[1,64],126:[2,47],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,48],6:[2,48],25:[2,48],26:[2,48],54:[2,48],78:[2,48],102:[2,48],104:[2,48],106:[2,48],110:[2,48],126:[2,48]},{1:[2,73],6:[2,73],25:[2,73],26:[2,73],40:[2,73],49:[2,73],54:[2,73],57:[2,73],66:[2,73],67:[2,73],68:[2,73],69:[2,73],71:[2,73],73:[2,73],74:[2,73],78:[2,73],84:[2,73],85:[2,73],86:[2,73],91:[2,73],93:[2,73],102:[2,73],104:[2,73],105:[2,73],106:[2,73],110:[2,73],118:[2,73],126:[2,73],128:[2,73],129:[2,73],132:[2,73],133:[2,73],134:[2,73],135:[2,73],136:[2,73],137:[2,73]},{1:[2,74],6:[2,74],25:[2,74],26:[2,74],40:[2,74],49:[2,74],54:[2,74],57:[2,74],66:[2,74],67:[2,74],68:[2,74],69:[2,74],71:[2,74],73:[2,74],74:[2,74],78:[2,74],84:[2,74],85:[2,74],86:[2,74],91:[2,74],93:[2,74],102:[2,74],104:[2,74],105:[2,74],106:[2,74],110:[2,74],118:[2,74],126:[2,74],128:[2,74],129:[2,74],132:[2,74],133:[2,74],134:[2,74],135:[2,74],136:[2,74],137:[2,74]},{1:[2,29],6:[2,29],25:[2,29],26:[2,29],49:[2,29],54:[2,29],57:[2,29],66:[2,29],67:[2,29],68:[2,29],69:[2,29],71:[2,29],73:[2,29],74:[2,29],78:[2,29],84:[2,29],85:[2,29],86:[2,29],91:[2,29],93:[2,29],102:[2,29],104:[2,29],105:[2,29],106:[2,29],110:[2,29],118:[2,29],126:[2,29],128:[2,29],129:[2,29],132:[2,29],133:[2,29],134:[2,29],135:[2,29],136:[2,29],137:[2,29]},{1:[2,30],6:[2,30],25:[2,30],26:[2,30],49:[2,30],54:[2,30],57:[2,30],66:[2,30],67:[2,30],68:[2,30],69:[2,30],71:[2,30],73:[2,30],74:[2,30],78:[2,30],84:[2,30],85:[2,30],86:[2,30],91:[2,30],93:[2,30],102:[2,30],104:[2,30],105:[2,30],106:[2,30],110:[2,30],118:[2,30],126:[2,30],128:[2,30],129:[2,30],132:[2,30],133:[2,30],134:[2,30],135:[2,30],136:[2,30],137:[2,30]},{1:[2,31],6:[2,31],25:[2,31],26:[2,31],49:[2,31],54:[2,31],57:[2,31],66:[2,31],67:[2,31],68:[2,31],69:[2,31],71:[2,31],73:[2,31],74:[2,31],78:[2,31],84:[2,31],85:[2,31],86:[2,31],91:[2,31],93:[2,31],102:[2,31],104:[2,31],105:[2,31],106:[2,31],110:[2,31],118:[2,31],126:[2,31],128:[2,31],129:[2,31],132:[2,31],133:[2,31],134:[2,31],135:[2,31],136:[2,31],137:[2,31]},{1:[2,32],6:[2,32],25:[2,32],26:[2,32],49:[2,32],54:[2,32],57:[2,32],66:[2,32],67:[2,32],68:[2,32],69:[2,32],71:[2,32],73:[2,32],74:[2,32],78:[2,32],84:[2,32],85:[2,32],86:[2,32],91:[2,32],93:[2,32],102:[2,32],104:[2,32],105:[2,32],106:[2,32],110:[2,32],118:[2,32],126:[2,32],128:[2,32],129:[2,32],132:[2,32],133:[2,32],134:[2,32],135:[2,32],136:[2,32],137:[2,32]},{1:[2,33],6:[2,33],25:[2,33],26:[2,33],49:[2,33],54:[2,33],57:[2,33],66:[2,33],67:[2,33],68:[2,33],69:[2,33],71:[2,33],73:[2,33],74:[2,33],78:[2,33],84:[2,33],85:[2,33],86:[2,33],91:[2,33],93:[2,33],102:[2,33],104:[2,33],105:[2,33],106:[2,33],110:[2,33],118:[2,33],126:[2,33],128:[2,33],129:[2,33],132:[2,33],133:[2,33],134:[2,33],135:[2,33],136:[2,33],137:[2,33]},{1:[2,34],6:[2,34],25:[2,34],26:[2,34],49:[2,34],54:[2,34],57:[2,34],66:[2,34],67:[2,34],68:[2,34],69:[2,34],71:[2,34],73:[2,34],74:[2,34],78:[2,34],84:[2,34],85:[2,34],86:[2,34],91:[2,34],93:[2,34],102:[2,34],104:[2,34],105:[2,34],106:[2,34],110:[2,34],118:[2,34],126:[2,34],128:[2,34],129:[2,34],132:[2,34],133:[2,34],134:[2,34],135:[2,34],136:[2,34],137:[2,34]},{1:[2,35],6:[2,35],25:[2,35],26:[2,35],49:[2,35],54:[2,35],57:[2,35],66:[2,35],67:[2,35],68:[2,35],69:[2,35],71:[2,35],73:[2,35],74:[2,35],78:[2,35],84:[2,35],85:[2,35],86:[2,35],91:[2,35],93:[2,35],102:[2,35],104:[2,35],105:[2,35],106:[2,35],110:[2,35],118:[2,35],126:[2,35],128:[2,35],129:[2,35],132:[2,35],133:[2,35],134:[2,35],135:[2,35],136:[2,35],137:[2,35]},{4:141,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,142],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:143,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,147],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:148,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],87:145,88:[1,58],89:[1,59],90:[1,57],91:[1,144],94:146,96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,112],6:[2,112],25:[2,112],26:[2,112],49:[2,112],54:[2,112],57:[2,112],66:[2,112],67:[2,112],68:[2,112],69:[2,112],71:[2,112],73:[2,112],74:[2,112],78:[2,112],84:[2,112],85:[2,112],86:[2,112],91:[2,112],93:[2,112],102:[2,112],104:[2,112],105:[2,112],106:[2,112],110:[2,112],118:[2,112],126:[2,112],128:[2,112],129:[2,112],132:[2,112],133:[2,112],134:[2,112],135:[2,112],136:[2,112],137:[2,112]},{1:[2,113],6:[2,113],25:[2,113],26:[2,113],27:149,28:[1,73],49:[2,113],54:[2,113],57:[2,113],66:[2,113],67:[2,113],68:[2,113],69:[2,113],71:[2,113],73:[2,113],74:[2,113],78:[2,113],84:[2,113],85:[2,113],86:[2,113],91:[2,113],93:[2,113],102:[2,113],104:[2,113],105:[2,113],106:[2,113],110:[2,113],118:[2,113],126:[2,113],128:[2,113],129:[2,113],132:[2,113],133:[2,113],134:[2,113],135:[2,113],136:[2,113],137:[2,113]},{25:[2,51]},{25:[2,52]},{1:[2,68],6:[2,68],25:[2,68],26:[2,68],40:[2,68],49:[2,68],54:[2,68],57:[2,68],66:[2,68],67:[2,68],68:[2,68],69:[2,68],71:[2,68],73:[2,68],74:[2,68],78:[2,68],80:[2,68],84:[2,68],85:[2,68],86:[2,68],91:[2,68],93:[2,68],102:[2,68],104:[2,68],105:[2,68],106:[2,68],110:[2,68],118:[2,68],126:[2,68],128:[2,68],129:[2,68],130:[2,68],131:[2,68],132:[2,68],133:[2,68],134:[2,68],135:[2,68],136:[2,68],137:[2,68],138:[2,68]},{1:[2,71],6:[2,71],25:[2,71],26:[2,71],40:[2,71],49:[2,71],54:[2,71],57:[2,71],66:[2,71],67:[2,71],68:[2,71],69:[2,71],71:[2,71],73:[2,71],74:[2,71],78:[2,71],80:[2,71],84:[2,71],85:[2,71],86:[2,71],91:[2,71],93:[2,71],102:[2,71],104:[2,71],105:[2,71],106:[2,71],110:[2,71],118:[2,71],126:[2,71],128:[2,71],129:[2,71],130:[2,71],131:[2,71],132:[2,71],133:[2,71],134:[2,71],135:[2,71],136:[2,71],137:[2,71],138:[2,71]},{8:150,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:151,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:152,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{5:153,8:154,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,5],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{27:159,28:[1,73],44:160,58:161,59:162,64:155,76:[1,70],89:[1,114],90:[1,57],113:156,114:[1,157],115:158},{112:163,116:[1,164],117:[1,165]},{6:[2,91],11:169,25:[2,91],27:170,28:[1,73],29:171,30:[1,71],31:[1,72],41:167,42:168,44:172,46:[1,46],54:[2,91],77:166,78:[2,91],89:[1,114]},{1:[2,27],6:[2,27],25:[2,27],26:[2,27],43:[2,27],49:[2,27],54:[2,27],57:[2,27],66:[2,27],67:[2,27],68:[2,27],69:[2,27],71:[2,27],73:[2,27],74:[2,27],78:[2,27],84:[2,27],85:[2,27],86:[2,27],91:[2,27],93:[2,27],102:[2,27],104:[2,27],105:[2,27],106:[2,27],110:[2,27],118:[2,27],126:[2,27],128:[2,27],129:[2,27],132:[2,27],133:[2,27],134:[2,27],135:[2,27],136:[2,27],137:[2,27]},{1:[2,28],6:[2,28],25:[2,28],26:[2,28],43:[2,28],49:[2,28],54:[2,28],57:[2,28],66:[2,28],67:[2,28],68:[2,28],69:[2,28],71:[2,28],73:[2,28],74:[2,28],78:[2,28],84:[2,28],85:[2,28],86:[2,28],91:[2,28],93:[2,28],102:[2,28],104:[2,28],105:[2,28],106:[2,28],110:[2,28],118:[2,28],126:[2,28],128:[2,28],129:[2,28],132:[2,28],133:[2,28],134:[2,28],135:[2,28],136:[2,28],137:[2,28]},{1:[2,26],6:[2,26],25:[2,26],26:[2,26],40:[2,26],43:[2,26],49:[2,26],54:[2,26],57:[2,26],66:[2,26],67:[2,26],68:[2,26],69:[2,26],71:[2,26],73:[2,26],74:[2,26],78:[2,26],80:[2,26],84:[2,26],85:[2,26],86:[2,26],91:[2,26],93:[2,26],102:[2,26],104:[2,26],105:[2,26],106:[2,26],110:[2,26],116:[2,26],117:[2,26],118:[2,26],126:[2,26],128:[2,26],129:[2,26],130:[2,26],131:[2,26],132:[2,26],133:[2,26],134:[2,26],135:[2,26],136:[2,26],137:[2,26],138:[2,26]},{1:[2,6],6:[2,6],7:173,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[2,6],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],102:[2,6],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,3]},{1:[2,24],6:[2,24],25:[2,24],26:[2,24],49:[2,24],54:[2,24],57:[2,24],73:[2,24],78:[2,24],86:[2,24],91:[2,24],93:[2,24],98:[2,24],99:[2,24],102:[2,24],104:[2,24],105:[2,24],106:[2,24],110:[2,24],118:[2,24],121:[2,24],123:[2,24],126:[2,24],128:[2,24],129:[2,24],132:[2,24],133:[2,24],134:[2,24],135:[2,24],136:[2,24],137:[2,24]},{6:[1,74],26:[1,174]},{1:[2,193],6:[2,193],25:[2,193],26:[2,193],49:[2,193],54:[2,193],57:[2,193],73:[2,193],78:[2,193],86:[2,193],91:[2,193],93:[2,193],102:[2,193],104:[2,193],105:[2,193],106:[2,193],110:[2,193],118:[2,193],126:[2,193],128:[2,193],129:[2,193],132:[2,193],133:[2,193],134:[2,193],135:[2,193],136:[2,193],137:[2,193]},{8:175,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:176,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:177,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:178,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:179,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:180,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:181,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:182,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,148],6:[2,148],25:[2,148],26:[2,148],49:[2,148],54:[2,148],57:[2,148],73:[2,148],78:[2,148],86:[2,148],91:[2,148],93:[2,148],102:[2,148],104:[2,148],105:[2,148],106:[2,148],110:[2,148],118:[2,148],126:[2,148],128:[2,148],129:[2,148],132:[2,148],133:[2,148],134:[2,148],135:[2,148],136:[2,148],137:[2,148]},{1:[2,153],6:[2,153],25:[2,153],26:[2,153],49:[2,153],54:[2,153],57:[2,153],73:[2,153],78:[2,153],86:[2,153],91:[2,153],93:[2,153],102:[2,153],104:[2,153],105:[2,153],106:[2,153],110:[2,153],118:[2,153],126:[2,153],128:[2,153],129:[2,153],132:[2,153],133:[2,153],134:[2,153],135:[2,153],136:[2,153],137:[2,153]},{8:183,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,147],6:[2,147],25:[2,147],26:[2,147],49:[2,147],54:[2,147],57:[2,147],73:[2,147],78:[2,147],86:[2,147],91:[2,147],93:[2,147],102:[2,147],104:[2,147],105:[2,147],106:[2,147],110:[2,147],118:[2,147],126:[2,147],128:[2,147],129:[2,147],132:[2,147],133:[2,147],134:[2,147],135:[2,147],136:[2,147],137:[2,147]},{1:[2,152],6:[2,152],25:[2,152],26:[2,152],49:[2,152],54:[2,152],57:[2,152],73:[2,152],78:[2,152],86:[2,152],91:[2,152],93:[2,152],102:[2,152],104:[2,152],105:[2,152],106:[2,152],110:[2,152],118:[2,152],126:[2,152],128:[2,152],129:[2,152],132:[2,152],133:[2,152],134:[2,152],135:[2,152],136:[2,152],137:[2,152]},{82:184,85:[1,106]},{1:[2,69],6:[2,69],25:[2,69],26:[2,69],40:[2,69],49:[2,69],54:[2,69],57:[2,69],66:[2,69],67:[2,69],68:[2,69],69:[2,69],71:[2,69],73:[2,69],74:[2,69],78:[2,69],80:[2,69],84:[2,69],85:[2,69],86:[2,69],91:[2,69],93:[2,69],102:[2,69],104:[2,69],105:[2,69],106:[2,69],110:[2,69],118:[2,69],126:[2,69],128:[2,69],129:[2,69],130:[2,69],131:[2,69],132:[2,69],133:[2,69],134:[2,69],135:[2,69],136:[2,69],137:[2,69],138:[2,69]},{85:[2,109]},{27:185,28:[1,73]},{27:186,28:[1,73]},{1:[2,84],6:[2,84],25:[2,84],26:[2,84],27:187,28:[1,73],40:[2,84],49:[2,84],54:[2,84],57:[2,84],66:[2,84],67:[2,84],68:[2,84],69:[2,84],71:[2,84],73:[2,84],74:[2,84],78:[2,84],80:[2,84],84:[2,84],85:[2,84],86:[2,84],91:[2,84],93:[2,84],102:[2,84],104:[2,84],105:[2,84],106:[2,84],110:[2,84],118:[2,84],126:[2,84],128:[2,84],129:[2,84],130:[2,84],131:[2,84],132:[2,84],133:[2,84],134:[2,84],135:[2,84],136:[2,84],137:[2,84],138:[2,84]},{27:188,28:[1,73]},{1:[2,85],6:[2,85],25:[2,85],26:[2,85],40:[2,85],49:[2,85],54:[2,85],57:[2,85],66:[2,85],67:[2,85],68:[2,85],69:[2,85],71:[2,85],73:[2,85],74:[2,85],78:[2,85],80:[2,85],84:[2,85],85:[2,85],86:[2,85],91:[2,85],93:[2,85],102:[2,85],104:[2,85],105:[2,85],106:[2,85],110:[2,85],118:[2,85],126:[2,85],128:[2,85],129:[2,85],130:[2,85],131:[2,85],132:[2,85],133:[2,85],134:[2,85],135:[2,85],136:[2,85],137:[2,85],138:[2,85]},{8:190,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],57:[1,194],58:47,59:48,61:36,63:25,64:26,65:27,72:189,75:191,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],92:192,93:[1,193],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{70:195,71:[1,100],74:[1,101]},{82:196,85:[1,106]},{1:[2,70],6:[2,70],25:[2,70],26:[2,70],40:[2,70],49:[2,70],54:[2,70],57:[2,70],66:[2,70],67:[2,70],68:[2,70],69:[2,70],71:[2,70],73:[2,70],74:[2,70],78:[2,70],80:[2,70],84:[2,70],85:[2,70],86:[2,70],91:[2,70],93:[2,70],102:[2,70],104:[2,70],105:[2,70],106:[2,70],110:[2,70],118:[2,70],126:[2,70],128:[2,70],129:[2,70],130:[2,70],131:[2,70],132:[2,70],133:[2,70],134:[2,70],135:[2,70],136:[2,70],137:[2,70],138:[2,70]},{6:[1,198],8:197,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,199],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,107],6:[2,107],25:[2,107],26:[2,107],49:[2,107],54:[2,107],57:[2,107],66:[2,107],67:[2,107],68:[2,107],69:[2,107],71:[2,107],73:[2,107],74:[2,107],78:[2,107],84:[2,107],85:[2,107],86:[2,107],91:[2,107],93:[2,107],102:[2,107],104:[2,107],105:[2,107],106:[2,107],110:[2,107],118:[2,107],126:[2,107],128:[2,107],129:[2,107],132:[2,107],133:[2,107],134:[2,107],135:[2,107],136:[2,107],137:[2,107]},{8:202,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,147],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:148,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],86:[1,200],87:201,88:[1,58],89:[1,59],90:[1,57],94:146,96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{6:[2,53],25:[2,53],49:[1,203],53:205,54:[1,204]},{6:[2,56],25:[2,56],26:[2,56],49:[2,56],54:[2,56]},{6:[2,60],25:[2,60],26:[2,60],40:[1,207],49:[2,60],54:[2,60],57:[1,206]},{6:[2,63],25:[2,63],26:[2,63],40:[2,63],49:[2,63],54:[2,63],57:[2,63]},{6:[2,64],25:[2,64],26:[2,64],40:[2,64],49:[2,64],54:[2,64],57:[2,64]},{6:[2,65],25:[2,65],26:[2,65],40:[2,65],49:[2,65],54:[2,65],57:[2,65]},{6:[2,66],25:[2,66],26:[2,66],40:[2,66],49:[2,66],54:[2,66],57:[2,66]},{27:149,28:[1,73]},{8:202,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,147],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:148,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],87:145,88:[1,58],89:[1,59],90:[1,57],91:[1,144],94:146,96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,50],6:[2,50],25:[2,50],26:[2,50],49:[2,50],54:[2,50],57:[2,50],73:[2,50],78:[2,50],86:[2,50],91:[2,50],93:[2,50],102:[2,50],104:[2,50],105:[2,50],106:[2,50],110:[2,50],118:[2,50],126:[2,50],128:[2,50],129:[2,50],132:[2,50],133:[2,50],134:[2,50],135:[2,50],136:[2,50],137:[2,50]},{1:[2,186],6:[2,186],25:[2,186],26:[2,186],49:[2,186],54:[2,186],57:[2,186],73:[2,186],78:[2,186],86:[2,186],91:[2,186],93:[2,186],102:[2,186],103:87,104:[2,186],105:[2,186],106:[2,186],109:88,110:[2,186],111:69,118:[2,186],126:[2,186],128:[2,186],129:[2,186],132:[1,78],133:[2,186],134:[2,186],135:[2,186],136:[2,186],137:[2,186]},{103:90,104:[1,65],106:[1,66],109:91,110:[1,68],111:69,126:[1,89]},{1:[2,187],6:[2,187],25:[2,187],26:[2,187],49:[2,187],54:[2,187],57:[2,187],73:[2,187],78:[2,187],86:[2,187],91:[2,187],93:[2,187],102:[2,187],103:87,104:[2,187],105:[2,187],106:[2,187],109:88,110:[2,187],111:69,118:[2,187],126:[2,187],128:[2,187],129:[2,187],132:[1,78],133:[2,187],134:[2,187],135:[2,187],136:[2,187],137:[2,187]},{1:[2,188],6:[2,188],25:[2,188],26:[2,188],49:[2,188],54:[2,188],57:[2,188],73:[2,188],78:[2,188],86:[2,188],91:[2,188],93:[2,188],102:[2,188],103:87,104:[2,188],105:[2,188],106:[2,188],109:88,110:[2,188],111:69,118:[2,188],126:[2,188],128:[2,188],129:[2,188],132:[1,78],133:[2,188],134:[2,188],135:[2,188],136:[2,188],137:[2,188]},{1:[2,189],6:[2,189],25:[2,189],26:[2,189],49:[2,189],54:[2,189],57:[2,189],66:[2,72],67:[2,72],68:[2,72],69:[2,72],71:[2,72],73:[2,189],74:[2,72],78:[2,189],84:[2,72],85:[2,72],86:[2,189],91:[2,189],93:[2,189],102:[2,189],104:[2,189],105:[2,189],106:[2,189],110:[2,189],118:[2,189],126:[2,189],128:[2,189],129:[2,189],132:[2,189],133:[2,189],134:[2,189],135:[2,189],136:[2,189],137:[2,189]},{62:93,66:[1,95],67:[1,96],68:[1,97],69:[1,98],70:99,71:[1,100],74:[1,101],81:92,84:[1,94],85:[2,108]},{62:103,66:[1,95],67:[1,96],68:[1,97],69:[1,98],70:99,71:[1,100],74:[1,101],81:102,84:[1,94],85:[2,108]},{66:[2,75],67:[2,75],68:[2,75],69:[2,75],71:[2,75],74:[2,75],84:[2,75],85:[2,75]},{1:[2,190],6:[2,190],25:[2,190],26:[2,190],49:[2,190],54:[2,190],57:[2,190],66:[2,72],67:[2,72],68:[2,72],69:[2,72],71:[2,72],73:[2,190],74:[2,72],78:[2,190],84:[2,72],85:[2,72],86:[2,190],91:[2,190],93:[2,190],102:[2,190],104:[2,190],105:[2,190],106:[2,190],110:[2,190],118:[2,190],126:[2,190],128:[2,190],129:[2,190],132:[2,190],133:[2,190],134:[2,190],135:[2,190],136:[2,190],137:[2,190]},{1:[2,191],6:[2,191],25:[2,191],26:[2,191],49:[2,191],54:[2,191],57:[2,191],73:[2,191],78:[2,191],86:[2,191],91:[2,191],93:[2,191],102:[2,191],104:[2,191],105:[2,191],106:[2,191],110:[2,191],118:[2,191],126:[2,191],128:[2,191],129:[2,191],132:[2,191],133:[2,191],134:[2,191],135:[2,191],136:[2,191],137:[2,191]},{1:[2,192],6:[2,192],25:[2,192],26:[2,192],49:[2,192],54:[2,192],57:[2,192],73:[2,192],78:[2,192],86:[2,192],91:[2,192],93:[2,192],102:[2,192],104:[2,192],105:[2,192],106:[2,192],110:[2,192],118:[2,192],126:[2,192],128:[2,192],129:[2,192],132:[2,192],133:[2,192],134:[2,192],135:[2,192],136:[2,192],137:[2,192]},{6:[1,210],8:208,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,209],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:211,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{5:212,25:[1,5],125:[1,213]},{1:[2,133],6:[2,133],25:[2,133],26:[2,133],49:[2,133],54:[2,133],57:[2,133],73:[2,133],78:[2,133],86:[2,133],91:[2,133],93:[2,133],97:214,98:[1,215],99:[1,216],102:[2,133],104:[2,133],105:[2,133],106:[2,133],110:[2,133],118:[2,133],126:[2,133],128:[2,133],129:[2,133],132:[2,133],133:[2,133],134:[2,133],135:[2,133],136:[2,133],137:[2,133]},{1:[2,146],6:[2,146],25:[2,146],26:[2,146],49:[2,146],54:[2,146],57:[2,146],73:[2,146],78:[2,146],86:[2,146],91:[2,146],93:[2,146],102:[2,146],104:[2,146],105:[2,146],106:[2,146],110:[2,146],118:[2,146],126:[2,146],128:[2,146],129:[2,146],132:[2,146],133:[2,146],134:[2,146],135:[2,146],136:[2,146],137:[2,146]},{1:[2,154],6:[2,154],25:[2,154],26:[2,154],49:[2,154],54:[2,154],57:[2,154],73:[2,154],78:[2,154],86:[2,154],91:[2,154],93:[2,154],102:[2,154],104:[2,154],105:[2,154],106:[2,154],110:[2,154],118:[2,154],126:[2,154],128:[2,154],129:[2,154],132:[2,154],133:[2,154],134:[2,154],135:[2,154],136:[2,154],137:[2,154]},{25:[1,217],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{120:218,122:219,123:[1,220]},{1:[2,97],6:[2,97],25:[2,97],26:[2,97],49:[2,97],54:[2,97],57:[2,97],73:[2,97],78:[2,97],86:[2,97],91:[2,97],93:[2,97],102:[2,97],104:[2,97],105:[2,97],106:[2,97],110:[2,97],118:[2,97],126:[2,97],128:[2,97],129:[2,97],132:[2,97],133:[2,97],134:[2,97],135:[2,97],136:[2,97],137:[2,97]},{8:221,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,100],5:222,6:[2,100],25:[1,5],26:[2,100],49:[2,100],54:[2,100],57:[2,100],66:[2,72],67:[2,72],68:[2,72],69:[2,72],71:[2,72],73:[2,100],74:[2,72],78:[2,100],80:[1,223],84:[2,72],85:[2,72],86:[2,100],91:[2,100],93:[2,100],102:[2,100],104:[2,100],105:[2,100],106:[2,100],110:[2,100],118:[2,100],126:[2,100],128:[2,100],129:[2,100],132:[2,100],133:[2,100],134:[2,100],135:[2,100],136:[2,100],137:[2,100]},{1:[2,139],6:[2,139],25:[2,139],26:[2,139],49:[2,139],54:[2,139],57:[2,139],73:[2,139],78:[2,139],86:[2,139],91:[2,139],93:[2,139],102:[2,139],103:87,104:[2,139],105:[2,139],106:[2,139],109:88,110:[2,139],111:69,118:[2,139],126:[2,139],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,46],6:[2,46],26:[2,46],102:[2,46],103:87,104:[2,46],106:[2,46],109:88,110:[2,46],111:69,126:[2,46],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{6:[1,74],102:[1,224]},{4:225,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{6:[2,129],25:[2,129],54:[2,129],57:[1,227],91:[2,129],92:226,93:[1,193],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,115],6:[2,115],25:[2,115],26:[2,115],40:[2,115],49:[2,115],54:[2,115],57:[2,115],66:[2,115],67:[2,115],68:[2,115],69:[2,115],71:[2,115],73:[2,115],74:[2,115],78:[2,115],84:[2,115],85:[2,115],86:[2,115],91:[2,115],93:[2,115],102:[2,115],104:[2,115],105:[2,115],106:[2,115],110:[2,115],116:[2,115],117:[2,115],118:[2,115],126:[2,115],128:[2,115],129:[2,115],132:[2,115],133:[2,115],134:[2,115],135:[2,115],136:[2,115],137:[2,115]},{6:[2,53],25:[2,53],53:228,54:[1,229],91:[2,53]},{6:[2,124],25:[2,124],26:[2,124],54:[2,124],86:[2,124],91:[2,124]},{8:202,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,147],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:148,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],87:230,88:[1,58],89:[1,59],90:[1,57],94:146,96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{6:[2,130],25:[2,130],26:[2,130],54:[2,130],86:[2,130],91:[2,130]},{1:[2,114],6:[2,114],25:[2,114],26:[2,114],40:[2,114],43:[2,114],49:[2,114],54:[2,114],57:[2,114],66:[2,114],67:[2,114],68:[2,114],69:[2,114],71:[2,114],73:[2,114],74:[2,114],78:[2,114],80:[2,114],84:[2,114],85:[2,114],86:[2,114],91:[2,114],93:[2,114],102:[2,114],104:[2,114],105:[2,114],106:[2,114],110:[2,114],116:[2,114],117:[2,114],118:[2,114],126:[2,114],128:[2,114],129:[2,114],130:[2,114],131:[2,114],132:[2,114],133:[2,114],134:[2,114],135:[2,114],136:[2,114],137:[2,114],138:[2,114]},{5:231,25:[1,5],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,142],6:[2,142],25:[2,142],26:[2,142],49:[2,142],54:[2,142],57:[2,142],73:[2,142],78:[2,142],86:[2,142],91:[2,142],93:[2,142],102:[2,142],103:87,104:[1,65],105:[1,232],106:[1,66],109:88,110:[1,68],111:69,118:[2,142],126:[2,142],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,144],6:[2,144],25:[2,144],26:[2,144],49:[2,144],54:[2,144],57:[2,144],73:[2,144],78:[2,144],86:[2,144],91:[2,144],93:[2,144],102:[2,144],103:87,104:[1,65],105:[1,233],106:[1,66],109:88,110:[1,68],111:69,118:[2,144],126:[2,144],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,150],6:[2,150],25:[2,150],26:[2,150],49:[2,150],54:[2,150],57:[2,150],73:[2,150],78:[2,150],86:[2,150],91:[2,150],93:[2,150],102:[2,150],104:[2,150],105:[2,150],106:[2,150],110:[2,150],118:[2,150],126:[2,150],128:[2,150],129:[2,150],132:[2,150],133:[2,150],134:[2,150],135:[2,150],136:[2,150],137:[2,150]},{1:[2,151],6:[2,151],25:[2,151],26:[2,151],49:[2,151],54:[2,151],57:[2,151],73:[2,151],78:[2,151],86:[2,151],91:[2,151],93:[2,151],102:[2,151],103:87,104:[1,65],105:[2,151],106:[1,66],109:88,110:[1,68],111:69,118:[2,151],126:[2,151],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,155],6:[2,155],25:[2,155],26:[2,155],49:[2,155],54:[2,155],57:[2,155],73:[2,155],78:[2,155],86:[2,155],91:[2,155],93:[2,155],102:[2,155],104:[2,155],105:[2,155],106:[2,155],110:[2,155],118:[2,155],126:[2,155],128:[2,155],129:[2,155],132:[2,155],133:[2,155],134:[2,155],135:[2,155],136:[2,155],137:[2,155]},{116:[2,157],117:[2,157]},{27:159,28:[1,73],44:160,58:161,59:162,76:[1,70],89:[1,114],90:[1,115],113:234,115:158},{54:[1,235],116:[2,163],117:[2,163]},{54:[2,159],116:[2,159],117:[2,159]},{54:[2,160],116:[2,160],117:[2,160]},{54:[2,161],116:[2,161],117:[2,161]},{54:[2,162],116:[2,162],117:[2,162]},{1:[2,156],6:[2,156],25:[2,156],26:[2,156],49:[2,156],54:[2,156],57:[2,156],73:[2,156],78:[2,156],86:[2,156],91:[2,156],93:[2,156],102:[2,156],104:[2,156],105:[2,156],106:[2,156],110:[2,156],118:[2,156],126:[2,156],128:[2,156],129:[2,156],132:[2,156],133:[2,156],134:[2,156],135:[2,156],136:[2,156],137:[2,156]},{8:236,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:237,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{6:[2,53],25:[2,53],53:238,54:[1,239],78:[2,53]},{6:[2,92],25:[2,92],26:[2,92],54:[2,92],78:[2,92]},{6:[2,39],25:[2,39],26:[2,39],43:[1,240],54:[2,39],78:[2,39]},{6:[2,42],25:[2,42],26:[2,42],54:[2,42],78:[2,42]},{6:[2,43],25:[2,43],26:[2,43],43:[2,43],54:[2,43],78:[2,43]},{6:[2,44],25:[2,44],26:[2,44],43:[2,44],54:[2,44],78:[2,44]},{6:[2,45],25:[2,45],26:[2,45],43:[2,45],54:[2,45],78:[2,45]},{1:[2,5],6:[2,5],26:[2,5],102:[2,5]},{1:[2,25],6:[2,25],25:[2,25],26:[2,25],49:[2,25],54:[2,25],57:[2,25],73:[2,25],78:[2,25],86:[2,25],91:[2,25],93:[2,25],98:[2,25],99:[2,25],102:[2,25],104:[2,25],105:[2,25],106:[2,25],110:[2,25],118:[2,25],121:[2,25],123:[2,25],126:[2,25],128:[2,25],129:[2,25],132:[2,25],133:[2,25],134:[2,25],135:[2,25],136:[2,25],137:[2,25]},{1:[2,194],6:[2,194],25:[2,194],26:[2,194],49:[2,194],54:[2,194],57:[2,194],73:[2,194],78:[2,194],86:[2,194],91:[2,194],93:[2,194],102:[2,194],103:87,104:[2,194],105:[2,194],106:[2,194],109:88,110:[2,194],111:69,118:[2,194],126:[2,194],128:[2,194],129:[2,194],132:[1,78],133:[1,81],134:[2,194],135:[2,194],136:[2,194],137:[2,194]},{1:[2,195],6:[2,195],25:[2,195],26:[2,195],49:[2,195],54:[2,195],57:[2,195],73:[2,195],78:[2,195],86:[2,195],91:[2,195],93:[2,195],102:[2,195],103:87,104:[2,195],105:[2,195],106:[2,195],109:88,110:[2,195],111:69,118:[2,195],126:[2,195],128:[2,195],129:[2,195],132:[1,78],133:[1,81],134:[2,195],135:[2,195],136:[2,195],137:[2,195]},{1:[2,196],6:[2,196],25:[2,196],26:[2,196],49:[2,196],54:[2,196],57:[2,196],73:[2,196],78:[2,196],86:[2,196],91:[2,196],93:[2,196],102:[2,196],103:87,104:[2,196],105:[2,196],106:[2,196],109:88,110:[2,196],111:69,118:[2,196],126:[2,196],128:[2,196],129:[2,196],132:[1,78],133:[2,196],134:[2,196],135:[2,196],136:[2,196],137:[2,196]},{1:[2,197],6:[2,197],25:[2,197],26:[2,197],49:[2,197],54:[2,197],57:[2,197],73:[2,197],78:[2,197],86:[2,197],91:[2,197],93:[2,197],102:[2,197],103:87,104:[2,197],105:[2,197],106:[2,197],109:88,110:[2,197],111:69,118:[2,197],126:[2,197],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[2,197],135:[2,197],136:[2,197],137:[2,197]},{1:[2,198],6:[2,198],25:[2,198],26:[2,198],49:[2,198],54:[2,198],57:[2,198],73:[2,198],78:[2,198],86:[2,198],91:[2,198],93:[2,198],102:[2,198],103:87,104:[2,198],105:[2,198],106:[2,198],109:88,110:[2,198],111:69,118:[2,198],126:[2,198],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[2,198],136:[2,198],137:[1,85]},{1:[2,199],6:[2,199],25:[2,199],26:[2,199],49:[2,199],54:[2,199],57:[2,199],73:[2,199],78:[2,199],86:[2,199],91:[2,199],93:[2,199],102:[2,199],103:87,104:[2,199],105:[2,199],106:[2,199],109:88,110:[2,199],111:69,118:[2,199],126:[2,199],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[2,199],137:[1,85]},{1:[2,200],6:[2,200],25:[2,200],26:[2,200],49:[2,200],54:[2,200],57:[2,200],73:[2,200],78:[2,200],86:[2,200],91:[2,200],93:[2,200],102:[2,200],103:87,104:[2,200],105:[2,200],106:[2,200],109:88,110:[2,200],111:69,118:[2,200],126:[2,200],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[2,200],136:[2,200],137:[2,200]},{1:[2,185],6:[2,185],25:[2,185],26:[2,185],49:[2,185],54:[2,185],57:[2,185],73:[2,185],78:[2,185],86:[2,185],91:[2,185],93:[2,185],102:[2,185],103:87,104:[1,65],105:[2,185],106:[1,66],109:88,110:[1,68],111:69,118:[2,185],126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,184],6:[2,184],25:[2,184],26:[2,184],49:[2,184],54:[2,184],57:[2,184],73:[2,184],78:[2,184],86:[2,184],91:[2,184],93:[2,184],102:[2,184],103:87,104:[1,65],105:[2,184],106:[1,66],109:88,110:[1,68],111:69,118:[2,184],126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,104],6:[2,104],25:[2,104],26:[2,104],49:[2,104],54:[2,104],57:[2,104],66:[2,104],67:[2,104],68:[2,104],69:[2,104],71:[2,104],73:[2,104],74:[2,104],78:[2,104],84:[2,104],85:[2,104],86:[2,104],91:[2,104],93:[2,104],102:[2,104],104:[2,104],105:[2,104],106:[2,104],110:[2,104],118:[2,104],126:[2,104],128:[2,104],129:[2,104],132:[2,104],133:[2,104],134:[2,104],135:[2,104],136:[2,104],137:[2,104]},{1:[2,80],6:[2,80],25:[2,80],26:[2,80],40:[2,80],49:[2,80],54:[2,80],57:[2,80],66:[2,80],67:[2,80],68:[2,80],69:[2,80],71:[2,80],73:[2,80],74:[2,80],78:[2,80],80:[2,80],84:[2,80],85:[2,80],86:[2,80],91:[2,80],93:[2,80],102:[2,80],104:[2,80],105:[2,80],106:[2,80],110:[2,80],118:[2,80],126:[2,80],128:[2,80],129:[2,80],130:[2,80],131:[2,80],132:[2,80],133:[2,80],134:[2,80],135:[2,80],136:[2,80],137:[2,80],138:[2,80]},{1:[2,81],6:[2,81],25:[2,81],26:[2,81],40:[2,81],49:[2,81],54:[2,81],57:[2,81],66:[2,81],67:[2,81],68:[2,81],69:[2,81],71:[2,81],73:[2,81],74:[2,81],78:[2,81],80:[2,81],84:[2,81],85:[2,81],86:[2,81],91:[2,81],93:[2,81],102:[2,81],104:[2,81],105:[2,81],106:[2,81],110:[2,81],118:[2,81],126:[2,81],128:[2,81],129:[2,81],130:[2,81],131:[2,81],132:[2,81],133:[2,81],134:[2,81],135:[2,81],136:[2,81],137:[2,81],138:[2,81]},{1:[2,82],6:[2,82],25:[2,82],26:[2,82],40:[2,82],49:[2,82],54:[2,82],57:[2,82],66:[2,82],67:[2,82],68:[2,82],69:[2,82],71:[2,82],73:[2,82],74:[2,82],78:[2,82],80:[2,82],84:[2,82],85:[2,82],86:[2,82],91:[2,82],93:[2,82],102:[2,82],104:[2,82],105:[2,82],106:[2,82],110:[2,82],118:[2,82],126:[2,82],128:[2,82],129:[2,82],130:[2,82],131:[2,82],132:[2,82],133:[2,82],134:[2,82],135:[2,82],136:[2,82],137:[2,82],138:[2,82]},{1:[2,83],6:[2,83],25:[2,83],26:[2,83],40:[2,83],49:[2,83],54:[2,83],57:[2,83],66:[2,83],67:[2,83],68:[2,83],69:[2,83],71:[2,83],73:[2,83],74:[2,83],78:[2,83],80:[2,83],84:[2,83],85:[2,83],86:[2,83],91:[2,83],93:[2,83],102:[2,83],104:[2,83],105:[2,83],106:[2,83],110:[2,83],118:[2,83],126:[2,83],128:[2,83],129:[2,83],130:[2,83],131:[2,83],132:[2,83],133:[2,83],134:[2,83],135:[2,83],136:[2,83],137:[2,83],138:[2,83]},{73:[1,241]},{57:[1,194],73:[2,88],92:242,93:[1,193],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{73:[2,89]},{8:243,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,73:[2,123],76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{12:[2,117],28:[2,117],30:[2,117],31:[2,117],33:[2,117],34:[2,117],35:[2,117],36:[2,117],37:[2,117],38:[2,117],45:[2,117],46:[2,117],47:[2,117],51:[2,117],52:[2,117],73:[2,117],76:[2,117],79:[2,117],83:[2,117],88:[2,117],89:[2,117],90:[2,117],96:[2,117],100:[2,117],101:[2,117],104:[2,117],106:[2,117],108:[2,117],110:[2,117],119:[2,117],125:[2,117],127:[2,117],128:[2,117],129:[2,117],130:[2,117],131:[2,117]},{12:[2,118],28:[2,118],30:[2,118],31:[2,118],33:[2,118],34:[2,118],35:[2,118],36:[2,118],37:[2,118],38:[2,118],45:[2,118],46:[2,118],47:[2,118],51:[2,118],52:[2,118],73:[2,118],76:[2,118],79:[2,118],83:[2,118],88:[2,118],89:[2,118],90:[2,118],96:[2,118],100:[2,118],101:[2,118],104:[2,118],106:[2,118],108:[2,118],110:[2,118],119:[2,118],125:[2,118],127:[2,118],128:[2,118],129:[2,118],130:[2,118],131:[2,118]},{1:[2,87],6:[2,87],25:[2,87],26:[2,87],40:[2,87],49:[2,87],54:[2,87],57:[2,87],66:[2,87],67:[2,87],68:[2,87],69:[2,87],71:[2,87],73:[2,87],74:[2,87],78:[2,87],80:[2,87],84:[2,87],85:[2,87],86:[2,87],91:[2,87],93:[2,87],102:[2,87],104:[2,87],105:[2,87],106:[2,87],110:[2,87],118:[2,87],126:[2,87],128:[2,87],129:[2,87],130:[2,87],131:[2,87],132:[2,87],133:[2,87],134:[2,87],135:[2,87],136:[2,87],137:[2,87],138:[2,87]},{1:[2,105],6:[2,105],25:[2,105],26:[2,105],49:[2,105],54:[2,105],57:[2,105],66:[2,105],67:[2,105],68:[2,105],69:[2,105],71:[2,105],73:[2,105],74:[2,105],78:[2,105],84:[2,105],85:[2,105],86:[2,105],91:[2,105],93:[2,105],102:[2,105],104:[2,105],105:[2,105],106:[2,105],110:[2,105],118:[2,105],126:[2,105],128:[2,105],129:[2,105],132:[2,105],133:[2,105],134:[2,105],135:[2,105],136:[2,105],137:[2,105]},{1:[2,36],6:[2,36],25:[2,36],26:[2,36],49:[2,36],54:[2,36],57:[2,36],73:[2,36],78:[2,36],86:[2,36],91:[2,36],93:[2,36],102:[2,36],103:87,104:[2,36],105:[2,36],106:[2,36],109:88,110:[2,36],111:69,118:[2,36],126:[2,36],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{8:244,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:245,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,110],6:[2,110],25:[2,110],26:[2,110],49:[2,110],54:[2,110],57:[2,110],66:[2,110],67:[2,110],68:[2,110],69:[2,110],71:[2,110],73:[2,110],74:[2,110],78:[2,110],84:[2,110],85:[2,110],86:[2,110],91:[2,110],93:[2,110],102:[2,110],104:[2,110],105:[2,110],106:[2,110],110:[2,110],118:[2,110],126:[2,110],128:[2,110],129:[2,110],132:[2,110],133:[2,110],134:[2,110],135:[2,110],136:[2,110],137:[2,110]},{6:[2,53],25:[2,53],53:246,54:[1,229],86:[2,53]},{6:[2,129],25:[2,129],26:[2,129],54:[2,129],57:[1,247],86:[2,129],91:[2,129],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{50:248,51:[1,60],52:[1,61]},{6:[2,54],25:[2,54],26:[2,54],27:110,28:[1,73],44:111,55:249,56:109,58:112,59:113,76:[1,70],89:[1,114],90:[1,115]},{6:[1,250],25:[1,251]},{6:[2,61],25:[2,61],26:[2,61],49:[2,61],54:[2,61]},{8:252,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,201],6:[2,201],25:[2,201],26:[2,201],49:[2,201],54:[2,201],57:[2,201],73:[2,201],78:[2,201],86:[2,201],91:[2,201],93:[2,201],102:[2,201],103:87,104:[2,201],105:[2,201],106:[2,201],109:88,110:[2,201],111:69,118:[2,201],126:[2,201],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{8:253,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:254,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,204],6:[2,204],25:[2,204],26:[2,204],49:[2,204],54:[2,204],57:[2,204],73:[2,204],78:[2,204],86:[2,204],91:[2,204],93:[2,204],102:[2,204],103:87,104:[2,204],105:[2,204],106:[2,204],109:88,110:[2,204],111:69,118:[2,204],126:[2,204],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,183],6:[2,183],25:[2,183],26:[2,183],49:[2,183],54:[2,183],57:[2,183],73:[2,183],78:[2,183],86:[2,183],91:[2,183],93:[2,183],102:[2,183],104:[2,183],105:[2,183],106:[2,183],110:[2,183],118:[2,183],126:[2,183],128:[2,183],129:[2,183],132:[2,183],133:[2,183],134:[2,183],135:[2,183],136:[2,183],137:[2,183]},{8:255,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,134],6:[2,134],25:[2,134],26:[2,134],49:[2,134],54:[2,134],57:[2,134],73:[2,134],78:[2,134],86:[2,134],91:[2,134],93:[2,134],98:[1,256],102:[2,134],104:[2,134],105:[2,134],106:[2,134],110:[2,134],118:[2,134],126:[2,134],128:[2,134],129:[2,134],132:[2,134],133:[2,134],134:[2,134],135:[2,134],136:[2,134],137:[2,134]},{5:257,25:[1,5]},{27:258,28:[1,73],59:259,76:[1,70]},{120:260,122:219,123:[1,220]},{26:[1,261],121:[1,262],122:263,123:[1,220]},{26:[2,176],121:[2,176],123:[2,176]},{8:265,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],95:264,96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,98],5:266,6:[2,98],25:[1,5],26:[2,98],49:[2,98],54:[2,98],57:[2,98],73:[2,98],78:[2,98],86:[2,98],91:[2,98],93:[2,98],102:[2,98],103:87,104:[1,65],105:[2,98],106:[1,66],109:88,110:[1,68],111:69,118:[2,98],126:[2,98],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,101],6:[2,101],25:[2,101],26:[2,101],49:[2,101],54:[2,101],57:[2,101],73:[2,101],78:[2,101],86:[2,101],91:[2,101],93:[2,101],102:[2,101],104:[2,101],105:[2,101],106:[2,101],110:[2,101],118:[2,101],126:[2,101],128:[2,101],129:[2,101],132:[2,101],133:[2,101],134:[2,101],135:[2,101],136:[2,101],137:[2,101]},{8:267,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,140],6:[2,140],25:[2,140],26:[2,140],49:[2,140],54:[2,140],57:[2,140],66:[2,140],67:[2,140],68:[2,140],69:[2,140],71:[2,140],73:[2,140],74:[2,140],78:[2,140],84:[2,140],85:[2,140],86:[2,140],91:[2,140],93:[2,140],102:[2,140],104:[2,140],105:[2,140],106:[2,140],110:[2,140],118:[2,140],126:[2,140],128:[2,140],129:[2,140],132:[2,140],133:[2,140],134:[2,140],135:[2,140],136:[2,140],137:[2,140]},{6:[1,74],26:[1,268]},{8:269,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{6:[2,67],12:[2,118],25:[2,67],28:[2,118],30:[2,118],31:[2,118],33:[2,118],34:[2,118],35:[2,118],36:[2,118],37:[2,118],38:[2,118],45:[2,118],46:[2,118],47:[2,118],51:[2,118],52:[2,118],54:[2,67],76:[2,118],79:[2,118],83:[2,118],88:[2,118],89:[2,118],90:[2,118],91:[2,67],96:[2,118],100:[2,118],101:[2,118],104:[2,118],106:[2,118],108:[2,118],110:[2,118],119:[2,118],125:[2,118],127:[2,118],128:[2,118],129:[2,118],130:[2,118],131:[2,118]},{6:[1,271],25:[1,272],91:[1,270]},{6:[2,54],8:202,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[2,54],26:[2,54],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:148,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],86:[2,54],88:[1,58],89:[1,59],90:[1,57],91:[2,54],94:273,96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{6:[2,53],25:[2,53],26:[2,53],53:274,54:[1,229]},{1:[2,180],6:[2,180],25:[2,180],26:[2,180],49:[2,180],54:[2,180],57:[2,180],73:[2,180],78:[2,180],86:[2,180],91:[2,180],93:[2,180],102:[2,180],104:[2,180],105:[2,180],106:[2,180],110:[2,180],118:[2,180],121:[2,180],126:[2,180],128:[2,180],129:[2,180],132:[2,180],133:[2,180],134:[2,180],135:[2,180],136:[2,180],137:[2,180]},{8:275,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:276,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{116:[2,158],117:[2,158]},{27:159,28:[1,73],44:160,58:161,59:162,76:[1,70],89:[1,114],90:[1,115],115:277},{1:[2,165],6:[2,165],25:[2,165],26:[2,165],49:[2,165],54:[2,165],57:[2,165],73:[2,165],78:[2,165],86:[2,165],91:[2,165],93:[2,165],102:[2,165],103:87,104:[2,165],105:[1,278],106:[2,165],109:88,110:[2,165],111:69,118:[1,279],126:[2,165],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,166],6:[2,166],25:[2,166],26:[2,166],49:[2,166],54:[2,166],57:[2,166],73:[2,166],78:[2,166],86:[2,166],91:[2,166],93:[2,166],102:[2,166],103:87,104:[2,166],105:[1,280],106:[2,166],109:88,110:[2,166],111:69,118:[2,166],126:[2,166],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{6:[1,282],25:[1,283],78:[1,281]},{6:[2,54],11:169,25:[2,54],26:[2,54],27:170,28:[1,73],29:171,30:[1,71],31:[1,72],41:284,42:168,44:172,46:[1,46],78:[2,54],89:[1,114]},{8:285,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,286],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,86],6:[2,86],25:[2,86],26:[2,86],40:[2,86],49:[2,86],54:[2,86],57:[2,86],66:[2,86],67:[2,86],68:[2,86],69:[2,86],71:[2,86],73:[2,86],74:[2,86],78:[2,86],80:[2,86],84:[2,86],85:[2,86],86:[2,86],91:[2,86],93:[2,86],102:[2,86],104:[2,86],105:[2,86],106:[2,86],110:[2,86],118:[2,86],126:[2,86],128:[2,86],129:[2,86],130:[2,86],131:[2,86],132:[2,86],133:[2,86],134:[2,86],135:[2,86],136:[2,86],137:[2,86],138:[2,86]},{8:287,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,73:[2,121],76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{73:[2,122],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,37],6:[2,37],25:[2,37],26:[2,37],49:[2,37],54:[2,37],57:[2,37],73:[2,37],78:[2,37],86:[2,37],91:[2,37],93:[2,37],102:[2,37],103:87,104:[2,37],105:[2,37],106:[2,37],109:88,110:[2,37],111:69,118:[2,37],126:[2,37],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{26:[1,288],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{6:[1,271],25:[1,272],86:[1,289]},{6:[2,67],25:[2,67],26:[2,67],54:[2,67],86:[2,67],91:[2,67]},{5:290,25:[1,5]},{6:[2,57],25:[2,57],26:[2,57],49:[2,57],54:[2,57]},{27:110,28:[1,73],44:111,55:291,56:109,58:112,59:113,76:[1,70],89:[1,114],90:[1,115]},{6:[2,55],25:[2,55],26:[2,55],27:110,28:[1,73],44:111,48:292,54:[2,55],55:108,56:109,58:112,59:113,76:[1,70],89:[1,114],90:[1,115]},{6:[2,62],25:[2,62],26:[2,62],49:[2,62],54:[2,62],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{26:[1,293],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,203],6:[2,203],25:[2,203],26:[2,203],49:[2,203],54:[2,203],57:[2,203],73:[2,203],78:[2,203],86:[2,203],91:[2,203],93:[2,203],102:[2,203],103:87,104:[2,203],105:[2,203],106:[2,203],109:88,110:[2,203],111:69,118:[2,203],126:[2,203],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{5:294,25:[1,5],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{5:295,25:[1,5]},{1:[2,135],6:[2,135],25:[2,135],26:[2,135],49:[2,135],54:[2,135],57:[2,135],73:[2,135],78:[2,135],86:[2,135],91:[2,135],93:[2,135],102:[2,135],104:[2,135],105:[2,135],106:[2,135],110:[2,135],118:[2,135],126:[2,135],128:[2,135],129:[2,135],132:[2,135],133:[2,135],134:[2,135],135:[2,135],136:[2,135],137:[2,135]},{5:296,25:[1,5]},{5:297,25:[1,5]},{26:[1,298],121:[1,299],122:263,123:[1,220]},{1:[2,174],6:[2,174],25:[2,174],26:[2,174],49:[2,174],54:[2,174],57:[2,174],73:[2,174],78:[2,174],86:[2,174],91:[2,174],93:[2,174],102:[2,174],104:[2,174],105:[2,174],106:[2,174],110:[2,174],118:[2,174],126:[2,174],128:[2,174],129:[2,174],132:[2,174],133:[2,174],134:[2,174],135:[2,174],136:[2,174],137:[2,174]},{5:300,25:[1,5]},{26:[2,177],121:[2,177],123:[2,177]},{5:301,25:[1,5],54:[1,302]},{25:[2,131],54:[2,131],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,99],6:[2,99],25:[2,99],26:[2,99],49:[2,99],54:[2,99],57:[2,99],73:[2,99],78:[2,99],86:[2,99],91:[2,99],93:[2,99],102:[2,99],104:[2,99],105:[2,99],106:[2,99],110:[2,99],118:[2,99],126:[2,99],128:[2,99],129:[2,99],132:[2,99],133:[2,99],134:[2,99],135:[2,99],136:[2,99],137:[2,99]},{1:[2,102],5:303,6:[2,102],25:[1,5],26:[2,102],49:[2,102],54:[2,102],57:[2,102],73:[2,102],78:[2,102],86:[2,102],91:[2,102],93:[2,102],102:[2,102],103:87,104:[1,65],105:[2,102],106:[1,66],109:88,110:[1,68],111:69,118:[2,102],126:[2,102],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{102:[1,304]},{91:[1,305],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,116],6:[2,116],25:[2,116],26:[2,116],40:[2,116],49:[2,116],54:[2,116],57:[2,116],66:[2,116],67:[2,116],68:[2,116],69:[2,116],71:[2,116],73:[2,116],74:[2,116],78:[2,116],84:[2,116],85:[2,116],86:[2,116],91:[2,116],93:[2,116],102:[2,116],104:[2,116],105:[2,116],106:[2,116],110:[2,116],116:[2,116],117:[2,116],118:[2,116],126:[2,116],128:[2,116],129:[2,116],132:[2,116],133:[2,116],134:[2,116],135:[2,116],136:[2,116],137:[2,116]},{8:202,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:148,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],94:306,96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:202,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,147],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:148,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],87:307,88:[1,58],89:[1,59],90:[1,57],94:146,96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{6:[2,125],25:[2,125],26:[2,125],54:[2,125],86:[2,125],91:[2,125]},{6:[1,271],25:[1,272],26:[1,308]},{1:[2,143],6:[2,143],25:[2,143],26:[2,143],49:[2,143],54:[2,143],57:[2,143],73:[2,143],78:[2,143],86:[2,143],91:[2,143],93:[2,143],102:[2,143],103:87,104:[1,65],105:[2,143],106:[1,66],109:88,110:[1,68],111:69,118:[2,143],126:[2,143],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,145],6:[2,145],25:[2,145],26:[2,145],49:[2,145],54:[2,145],57:[2,145],73:[2,145],78:[2,145],86:[2,145],91:[2,145],93:[2,145],102:[2,145],103:87,104:[1,65],105:[2,145],106:[1,66],109:88,110:[1,68],111:69,118:[2,145],126:[2,145],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{116:[2,164],117:[2,164]},{8:309,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:310,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:311,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,90],6:[2,90],25:[2,90],26:[2,90],40:[2,90],49:[2,90],54:[2,90],57:[2,90],66:[2,90],67:[2,90],68:[2,90],69:[2,90],71:[2,90],73:[2,90],74:[2,90],78:[2,90],84:[2,90],85:[2,90],86:[2,90],91:[2,90],93:[2,90],102:[2,90],104:[2,90],105:[2,90],106:[2,90],110:[2,90],116:[2,90],117:[2,90],118:[2,90],126:[2,90],128:[2,90],129:[2,90],132:[2,90],133:[2,90],134:[2,90],135:[2,90],136:[2,90],137:[2,90]},{11:169,27:170,28:[1,73],29:171,30:[1,71],31:[1,72],41:312,42:168,44:172,46:[1,46],89:[1,114]},{6:[2,91],11:169,25:[2,91],26:[2,91],27:170,28:[1,73],29:171,30:[1,71],31:[1,72],41:167,42:168,44:172,46:[1,46],54:[2,91],77:313,89:[1,114]},{6:[2,93],25:[2,93],26:[2,93],54:[2,93],78:[2,93]},{6:[2,40],25:[2,40],26:[2,40],54:[2,40],78:[2,40],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{8:314,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{73:[2,120],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,38],6:[2,38],25:[2,38],26:[2,38],49:[2,38],54:[2,38],57:[2,38],73:[2,38],78:[2,38],86:[2,38],91:[2,38],93:[2,38],102:[2,38],104:[2,38],105:[2,38],106:[2,38],110:[2,38],118:[2,38],126:[2,38],128:[2,38],129:[2,38],132:[2,38],133:[2,38],134:[2,38],135:[2,38],136:[2,38],137:[2,38]},{1:[2,111],6:[2,111],25:[2,111],26:[2,111],49:[2,111],54:[2,111],57:[2,111],66:[2,111],67:[2,111],68:[2,111],69:[2,111],71:[2,111],73:[2,111],74:[2,111],78:[2,111],84:[2,111],85:[2,111],86:[2,111],91:[2,111],93:[2,111],102:[2,111],104:[2,111],105:[2,111],106:[2,111],110:[2,111],118:[2,111],126:[2,111],128:[2,111],129:[2,111],132:[2,111],133:[2,111],134:[2,111],135:[2,111],136:[2,111],137:[2,111]},{1:[2,49],6:[2,49],25:[2,49],26:[2,49],49:[2,49],54:[2,49],57:[2,49],73:[2,49],78:[2,49],86:[2,49],91:[2,49],93:[2,49],102:[2,49],104:[2,49],105:[2,49],106:[2,49],110:[2,49],118:[2,49],126:[2,49],128:[2,49],129:[2,49],132:[2,49],133:[2,49],134:[2,49],135:[2,49],136:[2,49],137:[2,49]},{6:[2,58],25:[2,58],26:[2,58],49:[2,58],54:[2,58]},{6:[2,53],25:[2,53],26:[2,53],53:315,54:[1,204]},{1:[2,202],6:[2,202],25:[2,202],26:[2,202],49:[2,202],54:[2,202],57:[2,202],73:[2,202],78:[2,202],86:[2,202],91:[2,202],93:[2,202],102:[2,202],104:[2,202],105:[2,202],106:[2,202],110:[2,202],118:[2,202],126:[2,202],128:[2,202],129:[2,202],132:[2,202],133:[2,202],134:[2,202],135:[2,202],136:[2,202],137:[2,202]},{1:[2,181],6:[2,181],25:[2,181],26:[2,181],49:[2,181],54:[2,181],57:[2,181],73:[2,181],78:[2,181],86:[2,181],91:[2,181],93:[2,181],102:[2,181],104:[2,181],105:[2,181],106:[2,181],110:[2,181],118:[2,181],121:[2,181],126:[2,181],128:[2,181],129:[2,181],132:[2,181],133:[2,181],134:[2,181],135:[2,181],136:[2,181],137:[2,181]},{1:[2,136],6:[2,136],25:[2,136],26:[2,136],49:[2,136],54:[2,136],57:[2,136],73:[2,136],78:[2,136],86:[2,136],91:[2,136],93:[2,136],102:[2,136],104:[2,136],105:[2,136],106:[2,136],110:[2,136],118:[2,136],126:[2,136],128:[2,136],129:[2,136],132:[2,136],133:[2,136],134:[2,136],135:[2,136],136:[2,136],137:[2,136]},{1:[2,137],6:[2,137],25:[2,137],26:[2,137],49:[2,137],54:[2,137],57:[2,137],73:[2,137],78:[2,137],86:[2,137],91:[2,137],93:[2,137],98:[2,137],102:[2,137],104:[2,137],105:[2,137],106:[2,137],110:[2,137],118:[2,137],126:[2,137],128:[2,137],129:[2,137],132:[2,137],133:[2,137],134:[2,137],135:[2,137],136:[2,137],137:[2,137]},{1:[2,138],6:[2,138],25:[2,138],26:[2,138],49:[2,138],54:[2,138],57:[2,138],73:[2,138],78:[2,138],86:[2,138],91:[2,138],93:[2,138],98:[2,138],102:[2,138],104:[2,138],105:[2,138],106:[2,138],110:[2,138],118:[2,138],126:[2,138],128:[2,138],129:[2,138],132:[2,138],133:[2,138],134:[2,138],135:[2,138],136:[2,138],137:[2,138]},{1:[2,172],6:[2,172],25:[2,172],26:[2,172],49:[2,172],54:[2,172],57:[2,172],73:[2,172],78:[2,172],86:[2,172],91:[2,172],93:[2,172],102:[2,172],104:[2,172],105:[2,172],106:[2,172],110:[2,172],118:[2,172],126:[2,172],128:[2,172],129:[2,172],132:[2,172],133:[2,172],134:[2,172],135:[2,172],136:[2,172],137:[2,172]},{5:316,25:[1,5]},{26:[1,317]},{6:[1,318],26:[2,178],121:[2,178],123:[2,178]},{8:319,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,103],6:[2,103],25:[2,103],26:[2,103],49:[2,103],54:[2,103],57:[2,103],73:[2,103],78:[2,103],86:[2,103],91:[2,103],93:[2,103],102:[2,103],104:[2,103],105:[2,103],106:[2,103],110:[2,103],118:[2,103],126:[2,103],128:[2,103],129:[2,103],132:[2,103],133:[2,103],134:[2,103],135:[2,103],136:[2,103],137:[2,103]},{1:[2,141],6:[2,141],25:[2,141],26:[2,141],49:[2,141],54:[2,141],57:[2,141],66:[2,141],67:[2,141],68:[2,141],69:[2,141],71:[2,141],73:[2,141],74:[2,141],78:[2,141],84:[2,141],85:[2,141],86:[2,141],91:[2,141],93:[2,141],102:[2,141],104:[2,141],105:[2,141],106:[2,141],110:[2,141],118:[2,141],126:[2,141],128:[2,141],129:[2,141],132:[2,141],133:[2,141],134:[2,141],135:[2,141],136:[2,141],137:[2,141]},{1:[2,119],6:[2,119],25:[2,119],26:[2,119],49:[2,119],54:[2,119],57:[2,119],66:[2,119],67:[2,119],68:[2,119],69:[2,119],71:[2,119],73:[2,119],74:[2,119],78:[2,119],84:[2,119],85:[2,119],86:[2,119],91:[2,119],93:[2,119],102:[2,119],104:[2,119],105:[2,119],106:[2,119],110:[2,119],118:[2,119],126:[2,119],128:[2,119],129:[2,119],132:[2,119],133:[2,119],134:[2,119],135:[2,119],136:[2,119],137:[2,119]},{6:[2,126],25:[2,126],26:[2,126],54:[2,126],86:[2,126],91:[2,126]},{6:[2,53],25:[2,53],26:[2,53],53:320,54:[1,229]},{6:[2,127],25:[2,127],26:[2,127],54:[2,127],86:[2,127],91:[2,127]},{1:[2,167],6:[2,167],25:[2,167],26:[2,167],49:[2,167],54:[2,167],57:[2,167],73:[2,167],78:[2,167],86:[2,167],91:[2,167],93:[2,167],102:[2,167],103:87,104:[2,167],105:[2,167],106:[2,167],109:88,110:[2,167],111:69,118:[1,321],126:[2,167],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,169],6:[2,169],25:[2,169],26:[2,169],49:[2,169],54:[2,169],57:[2,169],73:[2,169],78:[2,169],86:[2,169],91:[2,169],93:[2,169],102:[2,169],103:87,104:[2,169],105:[1,322],106:[2,169],109:88,110:[2,169],111:69,118:[2,169],126:[2,169],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,168],6:[2,168],25:[2,168],26:[2,168],49:[2,168],54:[2,168],57:[2,168],73:[2,168],78:[2,168],86:[2,168],91:[2,168],93:[2,168],102:[2,168],103:87,104:[2,168],105:[2,168],106:[2,168],109:88,110:[2,168],111:69,118:[2,168],126:[2,168],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{6:[2,94],25:[2,94],26:[2,94],54:[2,94],78:[2,94]},{6:[2,53],25:[2,53],26:[2,53],53:323,54:[1,239]},{26:[1,324],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{6:[1,250],25:[1,251],26:[1,325]},{26:[1,326]},{1:[2,175],6:[2,175],25:[2,175],26:[2,175],49:[2,175],54:[2,175],57:[2,175],73:[2,175],78:[2,175],86:[2,175],91:[2,175],93:[2,175],102:[2,175],104:[2,175],105:[2,175],106:[2,175],110:[2,175],118:[2,175],126:[2,175],128:[2,175],129:[2,175],132:[2,175],133:[2,175],134:[2,175],135:[2,175],136:[2,175],137:[2,175]},{26:[2,179],121:[2,179],123:[2,179]},{25:[2,132],54:[2,132],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{6:[1,271],25:[1,272],26:[1,327]},{8:328,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:329,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{6:[1,282],25:[1,283],26:[1,330]},{6:[2,41],25:[2,41],26:[2,41],54:[2,41],78:[2,41]},{6:[2,59],25:[2,59],26:[2,59],49:[2,59],54:[2,59]},{1:[2,173],6:[2,173],25:[2,173],26:[2,173],49:[2,173],54:[2,173],57:[2,173],73:[2,173],78:[2,173],86:[2,173],91:[2,173],93:[2,173],102:[2,173],104:[2,173],105:[2,173],106:[2,173],110:[2,173],118:[2,173],126:[2,173],128:[2,173],129:[2,173],132:[2,173],133:[2,173],134:[2,173],135:[2,173],136:[2,173],137:[2,173]},{6:[2,128],25:[2,128],26:[2,128],54:[2,128],86:[2,128],91:[2,128]},{1:[2,170],6:[2,170],25:[2,170],26:[2,170],49:[2,170],54:[2,170],57:[2,170],73:[2,170],78:[2,170],86:[2,170],91:[2,170],93:[2,170],102:[2,170],103:87,104:[2,170],105:[2,170],106:[2,170],109:88,110:[2,170],111:69,118:[2,170],126:[2,170],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,171],6:[2,171],25:[2,171],26:[2,171],49:[2,171],54:[2,171],57:[2,171],73:[2,171],78:[2,171],86:[2,171],91:[2,171],93:[2,171],102:[2,171],103:87,104:[2,171],105:[2,171],106:[2,171],109:88,110:[2,171],111:69,118:[2,171],126:[2,171],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{6:[2,95],25:[2,95],26:[2,95],54:[2,95],78:[2,95]}], +defaultActions: {60:[2,51],61:[2,52],75:[2,3],94:[2,109],191:[2,89]}, +parseError: function parseError(str, hash) { + throw new Error(str); +}, +parse: function parse(input) { + var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + this.lexer.setInput(input); + this.lexer.yy = this.yy; + this.yy.lexer = this.lexer; + this.yy.parser = this; + if (typeof this.lexer.yylloc == "undefined") + this.lexer.yylloc = {}; + var yyloc = this.lexer.yylloc; + lstack.push(yyloc); + var ranges = this.lexer.options && this.lexer.options.ranges; + if (typeof this.yy.parseError === "function") + this.parseError = this.yy.parseError; + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = self.lexer.lex() || 1; + if (typeof token !== "number") { + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + if (!recovering) { + expected = []; + for (p in table[state]) + if (this.terminals_[p] && p > 2) { + expected.push("'" + this.terminals_[p] + "'"); + } + if (this.lexer.showPosition) { + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; + } else { + errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'"); + } + this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected}); + } + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(this.lexer.yytext); + lstack.push(this.lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = this.lexer.yyleng; + yytext = this.lexer.yytext; + yylineno = this.lexer.yylineno; + yyloc = this.lexer.yylloc; + if (recovering > 0) + recovering--; + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column}; + if (ranges) { + yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]]; + } + r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); + if (typeof r !== "undefined") { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +} +}; +undefined +function Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); +if (typeof require !== 'undefined' && typeof exports !== 'undefined') { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain(args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if (typeof module !== 'undefined' && require.main === module) { + exports.main(process.argv.slice(1)); +} +} \ No newline at end of file diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/repl.js b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/repl.js new file mode 100644 index 00000000..37894a9b --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/repl.js @@ -0,0 +1,104 @@ +// Generated by CoffeeScript 1.6.1 +(function() { + var CoffeeScript, addMultilineHandler, merge, nodeREPL, replDefaults, vm; + + vm = require('vm'); + + nodeREPL = require('repl'); + + CoffeeScript = require('./coffee-script'); + + merge = require('./helpers').merge; + + replDefaults = { + prompt: 'coffee> ', + "eval": function(input, context, filename, cb) { + var js; + input = input.replace(/\uFF00/g, '\n'); + input = input.replace(/(^|[\r\n]+)(\s*)##?(?:[^#\r\n][^\r\n]*|)($|[\r\n])/, '$1$2$3'); + if (/^(\s*|\(\s*\))$/.test(input)) { + return cb(null); + } + try { + js = CoffeeScript.compile("_=(" + input + "\n)", { + filename: filename, + bare: true + }); + return cb(null, vm.runInContext(js, context, filename)); + } catch (err) { + return cb(err); + } + } + }; + + addMultilineHandler = function(repl) { + var inputStream, multiline, nodeLineListener, outputStream, rli; + rli = repl.rli, inputStream = repl.inputStream, outputStream = repl.outputStream; + multiline = { + enabled: false, + initialPrompt: repl.prompt.replace(/^[^> ]*/, function(x) { + return x.replace(/./g, '-'); + }), + prompt: repl.prompt.replace(/^[^> ]*>?/, function(x) { + return x.replace(/./g, '.'); + }), + buffer: '' + }; + nodeLineListener = rli.listeners('line')[0]; + rli.removeListener('line', nodeLineListener); + rli.on('line', function(cmd) { + if (multiline.enabled) { + multiline.buffer += "" + cmd + "\n"; + rli.setPrompt(multiline.prompt); + rli.prompt(true); + } else { + nodeLineListener(cmd); + } + }); + return inputStream.on('keypress', function(char, key) { + if (!(key && key.ctrl && !key.meta && !key.shift && key.name === 'v')) { + return; + } + if (multiline.enabled) { + if (!multiline.buffer.match(/\n/)) { + multiline.enabled = !multiline.enabled; + rli.setPrompt(repl.prompt); + rli.prompt(true); + return; + } + if ((rli.line != null) && !rli.line.match(/^\s*$/)) { + return; + } + multiline.enabled = !multiline.enabled; + rli.line = ''; + rli.cursor = 0; + rli.output.cursorTo(0); + rli.output.clearLine(1); + multiline.buffer = multiline.buffer.replace(/\n/g, '\uFF00'); + rli.emit('line', multiline.buffer); + multiline.buffer = ''; + } else { + multiline.enabled = !multiline.enabled; + rli.setPrompt(multiline.initialPrompt); + rli.prompt(true); + } + }); + }; + + module.exports = { + start: function(opts) { + var repl; + if (opts == null) { + opts = {}; + } + opts = merge(replDefaults, opts); + repl = nodeREPL.start(opts); + repl.on('exit', function() { + return repl.outputStream.write('\n'); + }); + addMultilineHandler(repl); + return repl; + } + }; + +}).call(this); diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/rewriter.js b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/rewriter.js new file mode 100644 index 00000000..b582bb29 --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/rewriter.js @@ -0,0 +1,478 @@ +// Generated by CoffeeScript 1.6.1 +(function() { + var BALANCED_PAIRS, EXPRESSION_CLOSE, EXPRESSION_END, EXPRESSION_START, IMPLICIT_BLOCK, IMPLICIT_CALL, IMPLICIT_END, IMPLICIT_FUNC, IMPLICIT_UNSPACED_CALL, INVERSES, LINEBREAKS, SINGLE_CLOSERS, SINGLE_LINERS, generate, left, rite, _i, _len, _ref, + __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, + __slice = [].slice; + + generate = function(tag, value) { + var tok; + tok = [tag, value]; + tok.generated = true; + return tok; + }; + + exports.Rewriter = (function() { + + function Rewriter() {} + + Rewriter.prototype.rewrite = function(tokens) { + this.tokens = tokens; + this.removeLeadingNewlines(); + this.removeMidExpressionNewlines(); + this.closeOpenCalls(); + this.closeOpenIndexes(); + this.addImplicitIndentation(); + this.tagPostfixConditionals(); + this.addImplicitBracesAndParens(); + this.addLocationDataToGeneratedTokens(); + return this.tokens; + }; + + Rewriter.prototype.scanTokens = function(block) { + var i, token, tokens; + tokens = this.tokens; + i = 0; + while (token = tokens[i]) { + i += block.call(this, token, i, tokens); + } + return true; + }; + + Rewriter.prototype.detectEnd = function(i, condition, action) { + var levels, token, tokens, _ref, _ref1; + tokens = this.tokens; + levels = 0; + while (token = tokens[i]) { + if (levels === 0 && condition.call(this, token, i)) { + return action.call(this, token, i); + } + if (!token || levels < 0) { + return action.call(this, token, i - 1); + } + if (_ref = token[0], __indexOf.call(EXPRESSION_START, _ref) >= 0) { + levels += 1; + } else if (_ref1 = token[0], __indexOf.call(EXPRESSION_END, _ref1) >= 0) { + levels -= 1; + } + i += 1; + } + return i - 1; + }; + + Rewriter.prototype.removeLeadingNewlines = function() { + var i, tag, _i, _len, _ref; + _ref = this.tokens; + for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { + tag = _ref[i][0]; + if (tag !== 'TERMINATOR') { + break; + } + } + if (i) { + return this.tokens.splice(0, i); + } + }; + + Rewriter.prototype.removeMidExpressionNewlines = function() { + return this.scanTokens(function(token, i, tokens) { + var _ref; + if (!(token[0] === 'TERMINATOR' && (_ref = this.tag(i + 1), __indexOf.call(EXPRESSION_CLOSE, _ref) >= 0))) { + return 1; + } + tokens.splice(i, 1); + return 0; + }); + }; + + Rewriter.prototype.closeOpenCalls = function() { + var action, condition; + condition = function(token, i) { + var _ref; + return ((_ref = token[0]) === ')' || _ref === 'CALL_END') || token[0] === 'OUTDENT' && this.tag(i - 1) === ')'; + }; + action = function(token, i) { + return this.tokens[token[0] === 'OUTDENT' ? i - 1 : i][0] = 'CALL_END'; + }; + return this.scanTokens(function(token, i) { + if (token[0] === 'CALL_START') { + this.detectEnd(i + 1, condition, action); + } + return 1; + }); + }; + + Rewriter.prototype.closeOpenIndexes = function() { + var action, condition; + condition = function(token, i) { + var _ref; + return (_ref = token[0]) === ']' || _ref === 'INDEX_END'; + }; + action = function(token, i) { + return token[0] = 'INDEX_END'; + }; + return this.scanTokens(function(token, i) { + if (token[0] === 'INDEX_START') { + this.detectEnd(i + 1, condition, action); + } + return 1; + }); + }; + + Rewriter.prototype.matchTags = function() { + var fuzz, i, j, pattern, _i, _ref, _ref1; + i = arguments[0], pattern = 2 <= arguments.length ? __slice.call(arguments, 1) : []; + fuzz = 0; + for (j = _i = 0, _ref = pattern.length; 0 <= _ref ? _i < _ref : _i > _ref; j = 0 <= _ref ? ++_i : --_i) { + while (this.tag(i + j + fuzz) === 'HERECOMMENT') { + fuzz += 2; + } + if (pattern[j] == null) { + continue; + } + if (typeof pattern[j] === 'string') { + pattern[j] = [pattern[j]]; + } + if (_ref1 = this.tag(i + j + fuzz), __indexOf.call(pattern[j], _ref1) < 0) { + return false; + } + } + return true; + }; + + Rewriter.prototype.looksObjectish = function(j) { + return this.matchTags(j, '@', null, ':') || this.matchTags(j, null, ':'); + }; + + Rewriter.prototype.findTagsBackwards = function(i, tags) { + var backStack, _ref, _ref1, _ref2, _ref3, _ref4, _ref5; + backStack = []; + while (i >= 0 && (backStack.length || (_ref2 = this.tag(i), __indexOf.call(tags, _ref2) < 0) && ((_ref3 = this.tag(i), __indexOf.call(EXPRESSION_START, _ref3) < 0) || this.tokens[i].generated) && (_ref4 = this.tag(i), __indexOf.call(LINEBREAKS, _ref4) < 0))) { + if (_ref = this.tag(i), __indexOf.call(EXPRESSION_END, _ref) >= 0) { + backStack.push(this.tag(i)); + } + if ((_ref1 = this.tag(i), __indexOf.call(EXPRESSION_START, _ref1) >= 0) && backStack.length) { + backStack.pop(); + } + i -= 1; + } + return _ref5 = this.tag(i), __indexOf.call(tags, _ref5) >= 0; + }; + + Rewriter.prototype.addImplicitBracesAndParens = function() { + var stack; + stack = []; + return this.scanTokens(function(token, i, tokens) { + var endImplicitCall, endImplicitObject, forward, inImplicit, inImplicitCall, inImplicitControl, inImplicitObject, nextTag, offset, prevTag, s, sameLine, stackIdx, stackTag, stackTop, startIdx, startImplicitCall, startImplicitObject, startsLine, tag, _ref, _ref1, _ref2, _ref3, _ref4, _ref5; + tag = token[0]; + prevTag = (i > 0 ? tokens[i - 1] : [])[0]; + nextTag = (i < tokens.length - 1 ? tokens[i + 1] : [])[0]; + stackTop = function() { + return stack[stack.length - 1]; + }; + startIdx = i; + forward = function(n) { + return i - startIdx + n; + }; + inImplicit = function() { + var _ref, _ref1; + return (_ref = stackTop()) != null ? (_ref1 = _ref[2]) != null ? _ref1.ours : void 0 : void 0; + }; + inImplicitCall = function() { + var _ref; + return inImplicit() && ((_ref = stackTop()) != null ? _ref[0] : void 0) === '('; + }; + inImplicitObject = function() { + var _ref; + return inImplicit() && ((_ref = stackTop()) != null ? _ref[0] : void 0) === '{'; + }; + inImplicitControl = function() { + var _ref; + return inImplicit && ((_ref = stackTop()) != null ? _ref[0] : void 0) === 'CONTROL'; + }; + startImplicitCall = function(j) { + var idx; + idx = j != null ? j : i; + stack.push([ + '(', idx, { + ours: true + } + ]); + tokens.splice(idx, 0, generate('CALL_START', '(')); + if (j == null) { + return i += 1; + } + }; + endImplicitCall = function() { + stack.pop(); + tokens.splice(i, 0, generate('CALL_END', ')')); + return i += 1; + }; + startImplicitObject = function(j, startsLine) { + var idx; + if (startsLine == null) { + startsLine = true; + } + idx = j != null ? j : i; + stack.push([ + '{', idx, { + sameLine: true, + startsLine: startsLine, + ours: true + } + ]); + tokens.splice(idx, 0, generate('{', generate(new String('{')))); + if (j == null) { + return i += 1; + } + }; + endImplicitObject = function(j) { + j = j != null ? j : i; + stack.pop(); + tokens.splice(j, 0, generate('}', '}')); + return i += 1; + }; + if (inImplicitCall() && (tag === 'IF' || tag === 'TRY' || tag === 'FINALLY' || tag === 'CATCH' || tag === 'CLASS' || tag === 'SWITCH')) { + stack.push([ + 'CONTROL', i, { + ours: true + } + ]); + return forward(1); + } + if (tag === 'INDENT' && inImplicit()) { + if (prevTag !== '=>' && prevTag !== '->' && prevTag !== '[' && prevTag !== '(' && prevTag !== ',' && prevTag !== '{' && prevTag !== 'TRY' && prevTag !== 'ELSE' && prevTag !== '=') { + while (inImplicitCall()) { + endImplicitCall(); + } + } + if (inImplicitControl()) { + stack.pop(); + } + stack.push([tag, i]); + return forward(1); + } + if (__indexOf.call(EXPRESSION_START, tag) >= 0) { + stack.push([tag, i]); + return forward(1); + } + if (__indexOf.call(EXPRESSION_END, tag) >= 0) { + while (inImplicit()) { + if (inImplicitCall()) { + endImplicitCall(); + } else if (inImplicitObject()) { + endImplicitObject(); + } else { + stack.pop(); + } + } + stack.pop(); + } + if ((__indexOf.call(IMPLICIT_FUNC, tag) >= 0 && token.spaced || tag === '?' && i > 0 && !tokens[i - 1].spaced) && (__indexOf.call(IMPLICIT_CALL, nextTag) >= 0 || __indexOf.call(IMPLICIT_UNSPACED_CALL, nextTag) >= 0 && !((_ref = tokens[i + 1]) != null ? _ref.spaced : void 0) && !((_ref1 = tokens[i + 1]) != null ? _ref1.newLine : void 0))) { + if (tag === '?') { + tag = token[0] = 'FUNC_EXIST'; + } + startImplicitCall(i + 1); + return forward(2); + } + if (this.matchTags(i, IMPLICIT_FUNC, 'INDENT', null, ':') && !this.findTagsBackwards(i, ['CLASS', 'EXTENDS', 'IF', 'CATCH', 'SWITCH', 'LEADING_WHEN', 'FOR', 'WHILE', 'UNTIL'])) { + startImplicitCall(i + 1); + stack.push(['INDENT', i + 2]); + return forward(3); + } + if (tag === ':') { + if (this.tag(i - 2) === '@') { + s = i - 2; + } else { + s = i - 1; + } + while (this.tag(s - 2) === 'HERECOMMENT') { + s -= 2; + } + startsLine = s === 0 || (_ref2 = this.tag(s - 1), __indexOf.call(LINEBREAKS, _ref2) >= 0) || tokens[s - 1].newLine; + if (stackTop()) { + _ref3 = stackTop(), stackTag = _ref3[0], stackIdx = _ref3[1]; + if ((stackTag === '{' || stackTag === 'INDENT' && this.tag(stackIdx - 1) === '{') && (startsLine || this.tag(s - 1) === ',' || this.tag(s - 1) === '{')) { + return forward(1); + } + } + startImplicitObject(s, !!startsLine); + return forward(2); + } + if (prevTag === 'OUTDENT' && inImplicitCall() && (tag === '.' || tag === '?.' || tag === '::' || tag === '?::')) { + endImplicitCall(); + return forward(1); + } + if (inImplicitObject() && __indexOf.call(LINEBREAKS, tag) >= 0) { + stackTop()[2].sameLine = false; + } + if (__indexOf.call(IMPLICIT_END, tag) >= 0) { + while (inImplicit()) { + _ref4 = stackTop(), stackTag = _ref4[0], stackIdx = _ref4[1], (_ref5 = _ref4[2], sameLine = _ref5.sameLine, startsLine = _ref5.startsLine); + if (inImplicitCall() && prevTag !== ',') { + endImplicitCall(); + } else if (inImplicitObject() && sameLine && !startsLine) { + endImplicitObject(); + } else if (inImplicitObject() && tag === 'TERMINATOR' && prevTag !== ',' && !(startsLine && this.looksObjectish(i + 1))) { + endImplicitObject(); + } else { + break; + } + } + } + if (tag === ',' && !this.looksObjectish(i + 1) && inImplicitObject() && (nextTag !== 'TERMINATOR' || !this.looksObjectish(i + 2))) { + offset = nextTag === 'OUTDENT' ? 1 : 0; + while (inImplicitObject()) { + endImplicitObject(i + offset); + } + } + return forward(1); + }); + }; + + Rewriter.prototype.addLocationDataToGeneratedTokens = function() { + return this.scanTokens(function(token, i, tokens) { + var last_column, last_line, _ref, _ref1, _ref2; + if (token[2]) { + return 1; + } + if (!(token.generated || token.explicit)) { + return 1; + } + _ref2 = (_ref = (_ref1 = tokens[i - 1]) != null ? _ref1[2] : void 0) != null ? _ref : { + last_line: 0, + last_column: 0 + }, last_line = _ref2.last_line, last_column = _ref2.last_column; + token[2] = { + first_line: last_line, + first_column: last_column, + last_line: last_line, + last_column: last_column + }; + return 1; + }); + }; + + Rewriter.prototype.addImplicitIndentation = function() { + var action, condition, indent, outdent, starter; + starter = indent = outdent = null; + condition = function(token, i) { + var _ref; + return token[1] !== ';' && (_ref = token[0], __indexOf.call(SINGLE_CLOSERS, _ref) >= 0) && !(token[0] === 'ELSE' && (starter !== 'IF' && starter !== 'THEN')); + }; + action = function(token, i) { + return this.tokens.splice((this.tag(i - 1) === ',' ? i - 1 : i), 0, outdent); + }; + return this.scanTokens(function(token, i, tokens) { + var tag, _ref, _ref1; + tag = token[0]; + if (tag === 'TERMINATOR' && this.tag(i + 1) === 'THEN') { + tokens.splice(i, 1); + return 0; + } + if (tag === 'ELSE' && this.tag(i - 1) !== 'OUTDENT') { + tokens.splice.apply(tokens, [i, 0].concat(__slice.call(this.indentation(token)))); + return 2; + } + if (tag === 'CATCH' && ((_ref = this.tag(i + 2)) === 'OUTDENT' || _ref === 'TERMINATOR' || _ref === 'FINALLY')) { + tokens.splice.apply(tokens, [i + 2, 0].concat(__slice.call(this.indentation(token)))); + return 4; + } + if (__indexOf.call(SINGLE_LINERS, tag) >= 0 && this.tag(i + 1) !== 'INDENT' && !(tag === 'ELSE' && this.tag(i + 1) === 'IF')) { + starter = tag; + _ref1 = this.indentation(token, true), indent = _ref1[0], outdent = _ref1[1]; + if (starter === 'THEN') { + indent.fromThen = true; + } + tokens.splice(i + 1, 0, indent); + this.detectEnd(i + 2, condition, action); + if (tag === 'THEN') { + tokens.splice(i, 1); + } + return 1; + } + return 1; + }); + }; + + Rewriter.prototype.tagPostfixConditionals = function() { + var action, condition, original; + original = null; + condition = function(token, i) { + var _ref; + return (_ref = token[0]) === 'TERMINATOR' || _ref === 'INDENT'; + }; + action = function(token, i) { + if (token[0] !== 'INDENT' || (token.generated && !token.fromThen)) { + return original[0] = 'POST_' + original[0]; + } + }; + return this.scanTokens(function(token, i) { + if (token[0] !== 'IF') { + return 1; + } + original = token; + this.detectEnd(i + 1, condition, action); + return 1; + }); + }; + + Rewriter.prototype.indentation = function(token, implicit) { + var indent, outdent; + if (implicit == null) { + implicit = false; + } + indent = ['INDENT', 2]; + outdent = ['OUTDENT', 2]; + if (implicit) { + indent.generated = outdent.generated = true; + } + if (!implicit) { + indent.explicit = outdent.explicit = true; + } + return [indent, outdent]; + }; + + Rewriter.prototype.generate = generate; + + Rewriter.prototype.tag = function(i) { + var _ref; + return (_ref = this.tokens[i]) != null ? _ref[0] : void 0; + }; + + return Rewriter; + + })(); + + BALANCED_PAIRS = [['(', ')'], ['[', ']'], ['{', '}'], ['INDENT', 'OUTDENT'], ['CALL_START', 'CALL_END'], ['PARAM_START', 'PARAM_END'], ['INDEX_START', 'INDEX_END']]; + + exports.INVERSES = INVERSES = {}; + + EXPRESSION_START = []; + + EXPRESSION_END = []; + + for (_i = 0, _len = BALANCED_PAIRS.length; _i < _len; _i++) { + _ref = BALANCED_PAIRS[_i], left = _ref[0], rite = _ref[1]; + EXPRESSION_START.push(INVERSES[rite] = left); + EXPRESSION_END.push(INVERSES[left] = rite); + } + + EXPRESSION_CLOSE = ['CATCH', 'WHEN', 'ELSE', 'FINALLY'].concat(EXPRESSION_END); + + IMPLICIT_FUNC = ['IDENTIFIER', 'SUPER', ')', 'CALL_END', ']', 'INDEX_END', '@', 'THIS']; + + IMPLICIT_CALL = ['IDENTIFIER', 'NUMBER', 'STRING', 'JS', 'REGEX', 'NEW', 'PARAM_START', 'CLASS', 'IF', 'TRY', 'SWITCH', 'THIS', 'BOOL', 'NULL', 'UNDEFINED', 'UNARY', 'SUPER', '@', '->', '=>', '[', '(', '{', '--', '++']; + + IMPLICIT_UNSPACED_CALL = ['+', '-']; + + IMPLICIT_BLOCK = ['->', '=>', '{', '[', ',']; + + IMPLICIT_END = ['POST_IF', 'FOR', 'WHILE', 'UNTIL', 'WHEN', 'BY', 'LOOP', 'TERMINATOR']; + + SINGLE_LINERS = ['ELSE', '->', '=>', 'TRY', 'FINALLY', 'THEN']; + + SINGLE_CLOSERS = ['TERMINATOR', 'CATCH', 'FINALLY', 'ELSE', 'OUTDENT', 'LEADING_WHEN']; + + LINEBREAKS = ['TERMINATOR', 'INDENT', 'OUTDENT']; + +}).call(this); diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/scope.js b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/scope.js new file mode 100644 index 00000000..41281734 --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/scope.js @@ -0,0 +1,147 @@ +// Generated by CoffeeScript 1.6.1 +(function() { + var Scope, extend, last, _ref; + + _ref = require('./helpers'), extend = _ref.extend, last = _ref.last; + + exports.Scope = Scope = (function() { + + Scope.root = null; + + function Scope(parent, expressions, method) { + this.parent = parent; + this.expressions = expressions; + this.method = method; + this.variables = [ + { + name: 'arguments', + type: 'arguments' + } + ]; + this.positions = {}; + if (!this.parent) { + Scope.root = this; + } + } + + Scope.prototype.add = function(name, type, immediate) { + if (this.shared && !immediate) { + return this.parent.add(name, type, immediate); + } + if (Object.prototype.hasOwnProperty.call(this.positions, name)) { + return this.variables[this.positions[name]].type = type; + } else { + return this.positions[name] = this.variables.push({ + name: name, + type: type + }) - 1; + } + }; + + Scope.prototype.namedMethod = function() { + var _ref1; + if (((_ref1 = this.method) != null ? _ref1.name : void 0) || !this.parent) { + return this.method; + } + return this.parent.namedMethod(); + }; + + Scope.prototype.find = function(name) { + if (this.check(name)) { + return true; + } + this.add(name, 'var'); + return false; + }; + + Scope.prototype.parameter = function(name) { + if (this.shared && this.parent.check(name, true)) { + return; + } + return this.add(name, 'param'); + }; + + Scope.prototype.check = function(name) { + var _ref1; + return !!(this.type(name) || ((_ref1 = this.parent) != null ? _ref1.check(name) : void 0)); + }; + + Scope.prototype.temporary = function(name, index) { + if (name.length > 1) { + return '_' + name + (index > 1 ? index - 1 : ''); + } else { + return '_' + (index + parseInt(name, 36)).toString(36).replace(/\d/g, 'a'); + } + }; + + Scope.prototype.type = function(name) { + var v, _i, _len, _ref1; + _ref1 = this.variables; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + v = _ref1[_i]; + if (v.name === name) { + return v.type; + } + } + return null; + }; + + Scope.prototype.freeVariable = function(name, reserve) { + var index, temp; + if (reserve == null) { + reserve = true; + } + index = 0; + while (this.check((temp = this.temporary(name, index)))) { + index++; + } + if (reserve) { + this.add(temp, 'var', true); + } + return temp; + }; + + Scope.prototype.assign = function(name, value) { + this.add(name, { + value: value, + assigned: true + }, true); + return this.hasAssignments = true; + }; + + Scope.prototype.hasDeclarations = function() { + return !!this.declaredVariables().length; + }; + + Scope.prototype.declaredVariables = function() { + var realVars, tempVars, v, _i, _len, _ref1; + realVars = []; + tempVars = []; + _ref1 = this.variables; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + v = _ref1[_i]; + if (v.type === 'var') { + (v.name.charAt(0) === '_' ? tempVars : realVars).push(v.name); + } + } + return realVars.sort().concat(tempVars.sort()); + }; + + Scope.prototype.assignedVariables = function() { + var v, _i, _len, _ref1, _results; + _ref1 = this.variables; + _results = []; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + v = _ref1[_i]; + if (v.type.assigned) { + _results.push("" + v.name + " = " + v.type.value); + } + } + return _results; + }; + + return Scope; + + })(); + +}).call(this); diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/sourcemap.js b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/sourcemap.js new file mode 100644 index 00000000..245da945 --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/lib/coffee-script/sourcemap.js @@ -0,0 +1,237 @@ +// Generated by CoffeeScript 1.6.1 +(function() { + var BASE64_CHARS, LineMapping, MAX_BASE64_VALUE, VLQ_CONTINUATION_BIT, VLQ_SHIFT, VLQ_VALUE_MASK, decodeBase64Char, encodeBase64Char; + + LineMapping = (function() { + + function LineMapping(generatedLine) { + this.generatedLine = generatedLine; + this.columnMap = {}; + this.columnMappings = []; + } + + LineMapping.prototype.addMapping = function(generatedColumn, _arg, options) { + var sourceColumn, sourceLine; + sourceLine = _arg[0], sourceColumn = _arg[1]; + if (options == null) { + options = {}; + } + if (this.columnMap[generatedColumn] && options.noReplace) { + return; + } + this.columnMap[generatedColumn] = { + generatedLine: this.generatedLine, + generatedColumn: generatedColumn, + sourceLine: sourceLine, + sourceColumn: sourceColumn + }; + this.columnMappings.push(this.columnMap[generatedColumn]); + return this.columnMappings.sort(function(a, b) { + return a.generatedColumn - b.generatedColumn; + }); + }; + + LineMapping.prototype.getSourcePosition = function(generatedColumn) { + var answer, columnMapping, lastColumnMapping, _i, _len, _ref; + answer = null; + lastColumnMapping = null; + _ref = this.columnMappings; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + columnMapping = _ref[_i]; + if (columnMapping.generatedColumn > generatedColumn) { + break; + } else { + lastColumnMapping = columnMapping; + } + } + if (lastColumnMapping) { + return answer = [lastColumnMapping.sourceLine, lastColumnMapping.sourceColumn]; + } + }; + + return LineMapping; + + })(); + + exports.SourceMap = (function() { + + function SourceMap() { + this.generatedLines = []; + } + + SourceMap.prototype.addMapping = function(sourceLocation, generatedLocation, options) { + var generatedColumn, generatedLine, lineMapping; + if (options == null) { + options = {}; + } + generatedLine = generatedLocation[0], generatedColumn = generatedLocation[1]; + lineMapping = this.generatedLines[generatedLine]; + if (!lineMapping) { + lineMapping = this.generatedLines[generatedLine] = new LineMapping(generatedLine); + } + return lineMapping.addMapping(generatedColumn, sourceLocation, options); + }; + + SourceMap.prototype.getSourcePosition = function(_arg) { + var answer, generatedColumn, generatedLine, lineMapping; + generatedLine = _arg[0], generatedColumn = _arg[1]; + answer = null; + lineMapping = this.generatedLines[generatedLine]; + if (!lineMapping) { + + } else { + answer = lineMapping.getSourcePosition(generatedColumn); + } + return answer; + }; + + SourceMap.prototype.forEachMapping = function(fn) { + var columnMapping, generatedLineNumber, lineMapping, _i, _len, _ref, _results; + _ref = this.generatedLines; + _results = []; + for (generatedLineNumber = _i = 0, _len = _ref.length; _i < _len; generatedLineNumber = ++_i) { + lineMapping = _ref[generatedLineNumber]; + if (lineMapping) { + _results.push((function() { + var _j, _len1, _ref1, _results1; + _ref1 = lineMapping.columnMappings; + _results1 = []; + for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { + columnMapping = _ref1[_j]; + _results1.push(fn(columnMapping)); + } + return _results1; + })()); + } else { + _results.push(void 0); + } + } + return _results; + }; + + return SourceMap; + + })(); + + exports.generateV3SourceMap = function(sourceMap, sourceFile, generatedFile) { + var answer, lastGeneratedColumnWritten, lastSourceColumnWritten, lastSourceLineWritten, mappings, needComma, writingGeneratedLine; + if (sourceFile == null) { + sourceFile = null; + } + if (generatedFile == null) { + generatedFile = null; + } + writingGeneratedLine = 0; + lastGeneratedColumnWritten = 0; + lastSourceLineWritten = 0; + lastSourceColumnWritten = 0; + needComma = false; + mappings = ""; + sourceMap.forEachMapping(function(mapping) { + while (writingGeneratedLine < mapping.generatedLine) { + lastGeneratedColumnWritten = 0; + needComma = false; + mappings += ";"; + writingGeneratedLine++; + } + if (needComma) { + mappings += ","; + needComma = false; + } + mappings += exports.vlqEncodeValue(mapping.generatedColumn - lastGeneratedColumnWritten); + lastGeneratedColumnWritten = mapping.generatedColumn; + mappings += exports.vlqEncodeValue(0); + mappings += exports.vlqEncodeValue(mapping.sourceLine - lastSourceLineWritten); + lastSourceLineWritten = mapping.sourceLine; + mappings += exports.vlqEncodeValue(mapping.sourceColumn - lastSourceColumnWritten); + lastSourceColumnWritten = mapping.sourceColumn; + return needComma = true; + }); + answer = { + version: 3, + file: generatedFile, + sourceRoot: "", + sources: sourceFile ? [sourceFile] : [], + names: [], + mappings: mappings + }; + return JSON.stringify(answer, null, 2); + }; + + exports.loadV3SourceMap = function(sourceMap) { + return todo(); + }; + + BASE64_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + + MAX_BASE64_VALUE = BASE64_CHARS.length - 1; + + encodeBase64Char = function(value) { + if (value > MAX_BASE64_VALUE) { + throw new Error("Cannot encode value " + value + " > " + MAX_BASE64_VALUE); + } else if (value < 0) { + throw new Error("Cannot encode value " + value + " < 0"); + } + return BASE64_CHARS[value]; + }; + + decodeBase64Char = function(char) { + var value; + value = BASE64_CHARS.indexOf(char); + if (value === -1) { + throw new Error("Invalid Base 64 character: " + char); + } + return value; + }; + + VLQ_SHIFT = 5; + + VLQ_CONTINUATION_BIT = 1 << VLQ_SHIFT; + + VLQ_VALUE_MASK = VLQ_CONTINUATION_BIT - 1; + + exports.vlqEncodeValue = function(value) { + var answer, nextVlqChunk, signBit, valueToEncode; + signBit = value < 0 ? 1 : 0; + valueToEncode = (Math.abs(value) << 1) + signBit; + answer = ""; + while (valueToEncode || !answer) { + nextVlqChunk = valueToEncode & VLQ_VALUE_MASK; + valueToEncode = valueToEncode >> VLQ_SHIFT; + if (valueToEncode) { + nextVlqChunk |= VLQ_CONTINUATION_BIT; + } + answer += encodeBase64Char(nextVlqChunk); + } + return answer; + }; + + exports.vlqDecodeValue = function(str, offset) { + var consumed, continuationShift, done, nextChunkValue, nextVlqChunk, position, signBit, value; + if (offset == null) { + offset = 0; + } + position = offset; + done = false; + value = 0; + continuationShift = 0; + while (!done) { + nextVlqChunk = decodeBase64Char(str[position]); + position += 1; + nextChunkValue = nextVlqChunk & VLQ_VALUE_MASK; + value += nextChunkValue << continuationShift; + if (!(nextVlqChunk & VLQ_CONTINUATION_BIT)) { + done = true; + } + continuationShift += VLQ_SHIFT; + } + consumed = position - offset; + signBit = value & 1; + value = value >> 1; + if (signBit) { + value = -value; + } + return [value, consumed]; + }; + +}).call(this); diff --git a/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/package.json b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/package.json new file mode 100644 index 00000000..e1aea0c9 --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/node_modules/coffee-script/package.json @@ -0,0 +1,57 @@ +{ + "name": "coffee-script", + "description": "Unfancy JavaScript", + "keywords": [ + "javascript", + "language", + "coffeescript", + "compiler" + ], + "author": { + "name": "Jeremy Ashkenas" + }, + "version": "1.6.1", + "licenses": [ + { + "type": "MIT", + "url": "https://raw.github.com/jashkenas/coffee-script/master/LICENSE" + } + ], + "engines": { + "node": ">=0.4.0" + }, + "directories": { + "lib": "./lib/coffee-script" + }, + "main": "./lib/coffee-script/coffee-script", + "bin": { + "coffee": "./bin/coffee", + "cake": "./bin/cake" + }, + "scripts": { + "test": "node ./bin/cake test" + }, + "homepage": "http://coffeescript.org", + "bugs": { + "name": "https://github.com/jashkenas/coffee-script/issues" + }, + "repository": { + "type": "git", + "url": "git://github.com/jashkenas/coffee-script.git" + }, + "devDependencies": { + "uglify-js": "~2.2", + "jison": ">=0.2.0" + }, + "_id": "coffee-script@1.6.1", + "dependencies": {}, + "optionalDependencies": {}, + "_engineSupported": true, + "_npmVersion": "1.1.4", + "_nodeVersion": "v0.6.12", + "_defaultsLoaded": true, + "dist": { + "shasum": "05d88f953bcd2e72d53bff583c9318a9572a386d" + }, + "_from": "coffee-script" +} diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js index ec93727c..f554267f 100644 --- a/wqflask/wqflask/static/new/javascript/show_trait.js +++ b/wqflask/wqflask/static/new/javascript/show_trait.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.4.0 +// Generated by CoffeeScript 1.6.1 (function() { var Stat_Table_Rows, is_number, __hasProp = {}.hasOwnProperty, diff --git a/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js b/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js index 329dcdd9..b309b167 100644 --- a/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js +++ b/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.4.0 +// Generated by CoffeeScript 1.6.1 (function() { var root; diff --git a/wqflask/wqflask/static/new/javascript/stats.js b/wqflask/wqflask/static/new/javascript/stats.js index 4cca0d13..d874995f 100644 --- a/wqflask/wqflask/static/new/javascript/stats.js +++ b/wqflask/wqflask/static/new/javascript/stats.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.4.0 +// Generated by CoffeeScript 1.6.1 (function() { var Stats, bxd_only; diff --git a/wqflask/wqflask/static/new/javascript/thank_you.js b/wqflask/wqflask/static/new/javascript/thank_you.js index 2871dd2d..bffff179 100644 --- a/wqflask/wqflask/static/new/javascript/thank_you.js +++ b/wqflask/wqflask/static/new/javascript/thank_you.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.4.0 +// Generated by CoffeeScript 1.6.1 (function() { $(function() { diff --git a/wqflask/wqflask/static/new/javascript/validation.js b/wqflask/wqflask/static/new/javascript/validation.js index 2ac477b5..275bcaa0 100644 --- a/wqflask/wqflask/static/new/javascript/validation.js +++ b/wqflask/wqflask/static/new/javascript/validation.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.4.0 +// Generated by CoffeeScript 1.6.1 (function() { $(function() { @@ -31,7 +31,7 @@ }; validate_remove_samples = function() { /* - Check if input for the remove samples function is valid and notify the user if not + Check if input for the remove samples function is valid and notify the user if not */ var input; diff --git a/wqflask/wqflask/templates/security/reset_password.html b/wqflask/wqflask/templates/security/reset_password.html index e6fc3f58..76e978cd 100644 --- a/wqflask/wqflask/templates/security/reset_password.html +++ b/wqflask/wqflask/templates/security/reset_password.html @@ -1,3 +1,7 @@ +{% extends "base.html" %} +{% block title %}Reset Password{% endblock %} + +{% block content %} {% from "security/_macros.html" import render_field_with_errors, render_field %} {% include "security/_messages.html" %}

    Reset password

    @@ -7,4 +11,5 @@ {{ render_field_with_errors(reset_password_form.password_confirm) }} {{ render_field(reset_password_form.submit) }} -{% include "security/_menu.html" %} \ No newline at end of file +{% include "security/_menu.html" %} +{% endblock %} \ No newline at end of file diff --git a/wqflask/wqflask/templates/security/send_confirmation.html b/wqflask/wqflask/templates/security/send_confirmation.html index 29a11257..4552c219 100644 --- a/wqflask/wqflask/templates/security/send_confirmation.html +++ b/wqflask/wqflask/templates/security/send_confirmation.html @@ -1,3 +1,7 @@ +{% extends "base.html" %} +{% block title %}Send Confirmation{% endblock %} +{% block content %} + {% from "security/_macros.html" import render_only_errors %} {% include "security/_messages.html" %} @@ -27,3 +31,4 @@ +{% endblock %} \ No newline at end of file diff --git a/wqflask/wqflask/templates/security/thank_you.html b/wqflask/wqflask/templates/security/thank_you.html index dd6c7297..1b8de3e5 100644 --- a/wqflask/wqflask/templates/security/thank_you.html +++ b/wqflask/wqflask/templates/security/thank_you.html @@ -5,4 +5,4 @@

    Thank you for signing in!

    - + \ No newline at end of file diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index bd8f5c86..d57bbaa7 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -96,7 +96,7 @@ def search_page(): else: return render_template("data_sharing.html", **template_vars.__dict__) else: - key = "search_results:v3:" + json.dumps(request.args, sort_keys=True) + key = "search_results:v5:" + json.dumps(request.args, sort_keys=True) print("key is:", pf(key)) with Bench("Loading cache"): result = Redis.get(key) @@ -261,14 +261,12 @@ def sharing_info_page(): template_vars = SharingInfoPage.SharingInfoPage(fd) return template_vars - # Take this out or secure it before going into production @app.route("/get_temp_data") def get_temp_data(): temp_uuid = request.args['key'] return flask.jsonify(temp_data.TempData(temp_uuid).get_all()) - @app.route("/thank_you") def thank_you(): return render_template("security/thank_you.html") -- cgit v1.2.3 From f155e26112f088c908c0654a57a40ff1f8fe23cc Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Thu, 8 Aug 2013 16:23:43 -0500 Subject: Fixed issue where points in marker regression manhattan plot weren't positioned on the x-axis --- .../static/new/javascript/marker_regression.coffee | 20 ++++++++++++++------ .../static/new/javascript/marker_regression.js | 16 ++++++++++++---- 2 files changed, 26 insertions(+), 10 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/static/new/javascript/marker_regression.coffee b/wqflask/wqflask/static/new/javascript/marker_regression.coffee index 2221e030..2892987e 100644 --- a/wqflask/wqflask/static/new/javascript/marker_regression.coffee +++ b/wqflask/wqflask/static/new/javascript/marker_regression.coffee @@ -25,6 +25,8 @@ $ -> #@x_max = d3.max(@x_coords) @x_max = @total_length + console.log("@x_max: ", @x_max) + console.log("@x_buffer: ", @x_buffer) @y_max = d3.max(@y_coords) * 1.2 @svg = @create_svg() @@ -53,6 +55,8 @@ $ -> ### + console.log("@chromosomes: ", @chromosomes) + cumulative_chr_lengths = [] chr_lengths = [] total_length = 0 @@ -61,8 +65,8 @@ $ -> chr_lengths.push(this_length) cumulative_chr_lengths.push(total_length + this_length) total_length += this_length - - #console.log("total length is:", total_length) + + console.log("chr_lengths: ", chr_lengths) return [chr_lengths, cumulative_chr_lengths] @@ -70,16 +74,20 @@ $ -> chr_lengths = [] chr_seen = [] for result in js_data.qtl_results - chr_length = @chromosomes[result.chr] + if result.chr == "X" + chr_length = parseFloat(@chromosomes[20]) + else + chr_length = parseFloat(@chromosomes[result.chr]) if not(result.chr in chr_seen) chr_seen.push(result.chr) chr_lengths.push(chr_length) if result.chr != "1" - @total_length += chr_lengths[chr_lengths.length - 2] + @total_length += parseFloat(chr_lengths[chr_lengths.length - 2]) @x_coords.push(@total_length + parseFloat(result.Mb)) @y_coords.push(result.lod_score) @marker_names.push(result.name) - @total_length += chr_lengths[chr_lengths.length-1] + @total_length += parseFloat(chr_lengths[chr_lengths.length-1]) + #console.log("chr_lengths: ", chr_lengths) show_marker_in_table: (marker_info) -> console.log("in show_marker_in_table") @@ -271,7 +279,7 @@ $ -> .enter() .append("circle") .attr("cx", (d) => - return parseFloat(@x_buffer + ((@plot_width-@x_buffer) * d[0]/@x_max)) + return parseFloat(@x_buffer) + ((parseFloat(@plot_width)-parseFloat(@x_buffer)) * d[0]/parseFloat(@x_max)) ) .attr("cy", (d) => return @plot_height - ((@plot_height-@y_buffer) * d[1]/@y_max) diff --git a/wqflask/wqflask/static/new/javascript/marker_regression.js b/wqflask/wqflask/static/new/javascript/marker_regression.js index a2b2ff57..ffcf1a75 100644 --- a/wqflask/wqflask/static/new/javascript/marker_regression.js +++ b/wqflask/wqflask/static/new/javascript/marker_regression.js @@ -27,6 +27,8 @@ this.x_buffer = this.plot_width / 30; this.y_buffer = this.plot_height / 20; this.x_max = this.total_length; + console.log("@x_max: ", this.x_max); + console.log("@x_buffer: ", this.x_buffer); this.y_max = d3.max(this.y_coords) * 1.2; this.svg = this.create_svg(); this.plot_coordinates = _.zip(this.x_coords, this.y_coords, this.marker_names); @@ -61,6 +63,7 @@ */ var chr_lengths, cumulative_chr_lengths, key, this_length, total_length; + console.log("@chromosomes: ", this.chromosomes); cumulative_chr_lengths = []; chr_lengths = []; total_length = 0; @@ -70,6 +73,7 @@ cumulative_chr_lengths.push(total_length + this_length); total_length += this_length; } + console.log("chr_lengths: ", chr_lengths); return [chr_lengths, cumulative_chr_lengths]; }; @@ -80,19 +84,23 @@ _ref = js_data.qtl_results; for (_i = 0, _len = _ref.length; _i < _len; _i++) { result = _ref[_i]; - chr_length = this.chromosomes[result.chr]; + if (result.chr === "X") { + chr_length = parseFloat(this.chromosomes[20]); + } else { + chr_length = parseFloat(this.chromosomes[result.chr]); + } if (!(_ref1 = result.chr, __indexOf.call(chr_seen, _ref1) >= 0)) { chr_seen.push(result.chr); chr_lengths.push(chr_length); if (result.chr !== "1") { - this.total_length += chr_lengths[chr_lengths.length - 2]; + this.total_length += parseFloat(chr_lengths[chr_lengths.length - 2]); } } this.x_coords.push(this.total_length + parseFloat(result.Mb)); this.y_coords.push(result.lod_score); this.marker_names.push(result.name); } - return this.total_length += chr_lengths[chr_lengths.length - 1]; + return this.total_length += parseFloat(chr_lengths[chr_lengths.length - 1]); }; Manhattan_Plot.prototype.show_marker_in_table = function(marker_info) { @@ -248,7 +256,7 @@ Manhattan_Plot.prototype.add_plot_points = function() { var _this = this; return this.svg.selectAll("circle").data(this.plot_coordinates).enter().append("circle").attr("cx", function(d) { - return parseFloat(_this.x_buffer + ((_this.plot_width - _this.x_buffer) * d[0] / _this.x_max)); + return parseFloat(_this.x_buffer) + ((parseFloat(_this.plot_width) - parseFloat(_this.x_buffer)) * d[0] / parseFloat(_this.x_max)); }).attr("cy", function(d) { return _this.plot_height - ((_this.plot_height - _this.y_buffer) * d[1] / _this.y_max); }).attr("r", 2).attr("id", function(d) { -- cgit v1.2.3 From 6379959af53b2ec595b85ccdc099c6f14adf0381 Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Tue, 13 Aug 2013 18:23:05 -0500 Subject: Added several test files and the file with the class that they import (browser_test.py) --- wqflask/base/data_set.py | 13 +-- wqflask/maintenance/browser_test.py | 60 +++++++++++++ wqflask/maintenance/correlation_matrix_test.py | 117 ++++++++++++++++++++++++ wqflask/maintenance/correlation_test.py | 110 +++++++++++++++++++++++ wqflask/maintenance/marker_regression_test.py | 118 +++++++++++++++++++++++++ wqflask/wqflask/show_trait/show_trait.py | 6 +- 6 files changed, 416 insertions(+), 8 deletions(-) create mode 100644 wqflask/maintenance/browser_test.py create mode 100644 wqflask/maintenance/correlation_matrix_test.py create mode 100644 wqflask/maintenance/correlation_test.py create mode 100644 wqflask/maintenance/marker_regression_test.py (limited to 'wqflask') diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index 017c6052..091433a6 100755 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -168,7 +168,8 @@ class Markers(object): for marker, p_value in itertools.izip(self.markers, p_values): marker['p_value'] = p_value - print("p_value is:", marker['p_value']) + if math.isnan(marker['p_value']): + print("p_value is:", marker['p_value']) marker['lod_score'] = -math.log10(marker['p_value']) #Using -log(p) for the LRS; need to ask Rob how he wants to get LRS from p-values marker['lrs_value'] = -math.log10(marker['p_value']) * 4.61 @@ -436,7 +437,7 @@ class DataSet(object): except TypeError: print("Dataset {} is not yet available in GeneNetwork.".format(self.name)) pass - + def get_trait_data(self): self.samplelist = self.group.samplelist + self.group.parlist + self.group.f1list query = """ @@ -493,12 +494,12 @@ class DataSet(object): if self.type == "Publish": query += """ - WHERE {}XRef.InbredSetId = {}Freeze.InbredSetId + WHERE {}XRef.PublicationId = {}Freeze.Id and {}Freeze.Name = '{}' - and {}.Id = {}XRef.PhenotypeId + and {}.Id = {}XRef.{}Id order by {}.Id - """.format(*mescape(self.type, self.type, self.type, self.name, - dataset_type, self.type, dataset_type )) + """.format(*mescape(self.type, self.type, self.type, self.type, + self.name, dataset_type, self.type, self.type, dataset_type)) else: query += """ WHERE {}XRef.{}FreezeId = {}Freeze.Id diff --git a/wqflask/maintenance/browser_test.py b/wqflask/maintenance/browser_test.py new file mode 100644 index 00000000..ecf8e1ca --- /dev/null +++ b/wqflask/maintenance/browser_test.py @@ -0,0 +1,60 @@ +from __future__ import print_function, division, absolute_import + +from time import sleep + +import selenium +from selenium import webdriver +from selenium.common.exceptions import NoSuchElementException, ElementNotVisibleException +from selenium.webdriver.common.keys import Keys + +class Test(object): + def __init__(self): + self.browser = webdriver.Chrome('/home/gn2/gn2/webtests/chromedriver') + + def get(self, url): + self.browser.get(url) + sleep(5) + self.title() + + def click(self, xpath_selector): + el = self.browser.find_element_by_xpath(xpath_selector) + text = el.text.strip() or el.get_attribute("value").strip() + el.click() + print("clicked:", text) + sleep(2) + + def click_option(self, xpath_selector, option_text): + el = self.browser.find_element_by_xpath(xpath_selector) + for option in el.find_elements_by_tag_name('option'): + if option.text == option_text: + option.click() # select() in earlier versions of webdriver + break + sleep(2) + + def enter_text(self, xpath_selector, text): + el = self.browser.find_element_by_xpath(xpath_selector) + sleep(10) + el.send_keys(text) + sleep(5) + # Just in case things get mangled by JavaScript, etc. we print the text for testing + self.get_text(xpath_selector) + + def get_text(self, xpath_selector): + el = self.browser.find_element_by_xpath(xpath_selector) + text = el.text.strip() or el.get_attribute("value").strip() + print("text:", text) + + def switch_window(self): + self.browser.switch_to_window(self.browser.window_handles[-1]) + sleep(2) + self.title() + sleep(2) + + + def title(self): + print("title:", self.browser.title) + + +#if __name__ == '__main__': +# import doctest +# doctest.testmod() \ No newline at end of file diff --git a/wqflask/maintenance/correlation_matrix_test.py b/wqflask/maintenance/correlation_matrix_test.py new file mode 100644 index 00000000..2983a76b --- /dev/null +++ b/wqflask/maintenance/correlation_matrix_test.py @@ -0,0 +1,117 @@ +""" + +Test Correlation matrix + +>>> test = Test() +>>> test.get("http://genenetwork.org/") +title: GeneNetwork + +Choose the type +>>> test.click_option('''//*[@id="tissue"]''', 'Hippocampus mRNA') + +Enter the Get Any +>>> test.enter_text('''//*[@id="tfor"]''', 'grin2b') +text: grin2b + +Search +>>> test.click('//*[@id="btsearch"]') + +Select the first 4 records +>>> test.click('''/html/body/table/tbody/tr[3]/td/table/tbody/tr/td/form/p/table/tbody/tr[3]/td/div/table/tbody/tr[2]/td/input''') +>>> test.click('''/html/body/table/tbody/tr[3]/td/table/tbody/tr/td/form/p/table/tbody/tr[3]/td/div/table/tbody/tr[3]/td/input''') +>>> test.click('''/html/body/table/tbody/tr[3]/td/table/tbody/tr/td/form/p/table/tbody/tr[3]/td/div/table/tbody/tr[4]/td/input''') +>>> test.click('''/html/body/table/tbody/tr[3]/td/table/tbody/tr/td/form/p/table/tbody/tr[3]/td/div/table/tbody/tr[5]/td/input''') + +>>> sleep(5) + +Add to collection page +>>> test.click('''/html/body/table/tbody/tr[3]/td/table/tbody/tr/td/form/p/table/tbody/tr[1]/td/table/tbody/tr[1]/td[4]/a''') + +>>> sleep(5) + +A new window is created, so we switch to it +>>> test.switch_window() +title: BXD Trait Collection + +Select all records +>>> test.click('''/html/body/table/tbody/tr[3]/td/table/tbody/tr/td/form/table/tbody/tr/td/table/tbody/tr/td/table/tbody/tr/td/a/img''') + +Click Matrix +>>> test.click('''/html/body/table/tbody/tr[3]/td/table/tbody/tr/td/form/table/tbody/tr/td/table/tbody/tr[2]/td/table/tbody/tr/td[2]/a/img''') + +Another new window +>>> test.switch_window() +title: Correlation Matrix + +Sleep a bunch because this can take a while +>>> sleep(10) + +Ensure that the correlation between Trait3 (HC_M2_0606_P::1457003_at) and Trait4 (HC_M2_0606_P::1422223_at) is 0.608 +>>> test.get_text('''/html/body/table/tbody/tr[3]/td/table/tbody/tr/td/form/blockquote/table/tbody/tr[5]/td[5]/a/font''') +text: 0.608 + +""" + +from __future__ import print_function, division, absolute_import + +from time import sleep + +import selenium +from selenium import webdriver +from selenium.common.exceptions import NoSuchElementException, ElementNotVisibleException +from selenium.webdriver.common.keys import Keys + +from browser_test import Test +# +#class Test(object): +# def __init__(self): +# self.browser = webdriver.Chrome('/home/gn2/gn2/webtests/chromedriver') +# +# def get(self, url): +# self.browser.get(url) +# sleep(5) +# self.title() +# +# def click(self, xpath_selector): +# el = self.browser.find_element_by_xpath(xpath_selector) +# #text = el.text.strip() or el.get_attribute("value").strip() +# el.click() +# #print("clicked:", text) +# sleep(2) +# +# def click_option(self, xpath_selector, option_text): +# el = self.browser.find_element_by_xpath(xpath_selector) +# for option in el.find_elements_by_tag_name('option'): +# if option.text == option_text: +# option.click() # select() in earlier versions of webdriver +# break +# sleep(2) +# +# def enter_text(self, xpath_selector, text): +# el = self.browser.find_element_by_xpath(xpath_selector) +# sleep(10) +# el.send_keys(text) +# sleep(5) +# # Just in case things get mangled by JavaScript, etc. we print the text for testing +# self.get_text(xpath_selector) +# +# def get_text(self, xpath_selector): +# el = self.browser.find_element_by_xpath(xpath_selector) +# text = el.text.strip() or el.get_attribute("value").strip() +# print("text:", text) +# +# def switch_window(self): +# self.browser.switch_to_window(self.browser.window_handles[-1]) +# sleep(2) +# self.title() +# sleep(2) +# +# +# def title(self): +# print("title:", self.browser.title) +# +# +# +if __name__ == '__main__': + import doctest + doctest.testmod() diff --git a/wqflask/maintenance/correlation_test.py b/wqflask/maintenance/correlation_test.py new file mode 100644 index 00000000..aaf3f7df --- /dev/null +++ b/wqflask/maintenance/correlation_test.py @@ -0,0 +1,110 @@ +""" +Test calculate correlations + +>>> test = Test() +>>> test.get("http://genenetwork.org") +title: GeneNetwork + +Choose the type +>>> test.click_option('''//*[@id="tissue"]''', 'Hippocampus mRNA') + +Enter the Get Any +>>> test.enter_text('''//*[@id="tfor"]''', 'ssh') +text: ssh + +Search +>>> test.click('//*[@id="btsearch"]') +clicked: Search + +Choose the first result +>>> test.click('''/html/body/table/tbody/tr[3]/td/table/tbody/tr/td/form/p/table/tbody/tr[3]/td/div/table/tbody/tr[2]/td[2]/a''') +clicked: 1455854_a_at + +A new window is created, so we switch to it +>>> test.switch_window() +title: Hippocampus M430v2 BXD 06/06 PDNN : 1455854_a_at: Display Trait + +Click on Calculate Correlations +>>> test.click('''//*[@id="title3"]''') +clicked: Calculate Correlations + +Click on Compute +>>> test.click('''/html/body/table/tbody/tr[3]/td/table/tbody/tr/td/form/p[6]/table/tbody/tr/td/div/div/span/table/tbody/tr/td/input[3]''') +clicked: Compute + +Another new window +>>> test.switch_window() +title: Correlation + +Sleep a bunch because this can take a while +>>> sleep(60) + +Ensure the Sample rho is the exepcted 1.000 because it should be the same record +>>> test.get_text('''/html/body/table/tbody/tr[3]/td/table/tbody/tr/td/form/table/tbody/tr[2]/td/div/table/tbody/tr[2]/td[9]/a''') +text: 1.000 + +""" + +from __future__ import print_function, division, absolute_import + +from time import sleep + + +import selenium +from selenium import webdriver +from selenium.common.exceptions import NoSuchElementException, ElementNotVisibleException +from selenium.webdriver.common.keys import Keys + + +class Test(object): + def __init__(self): + self.browser = webdriver.Chrome('/home/gn2/gn2/webtests/chromedriver') + + def get(self, url): + self.browser.get(url) + sleep(5) + self.title() + + def click(self, xpath_selector): + el = self.browser.find_element_by_xpath(xpath_selector) + text = el.text.strip() or el.get_attribute("value").strip() + el.click() + print("clicked:", text) + sleep(2) + + def click_option(self, xpath_selector, option_text): + el = self.browser.find_element_by_xpath(xpath_selector) + for option in el.find_elements_by_tag_name('option'): + if option.text == option_text: + option.click() # select() in earlier versions of webdriver + break + sleep(2) + + def enter_text(self, xpath_selector, text): + el = self.browser.find_element_by_xpath(xpath_selector) + sleep(10) + el.send_keys(text) + sleep(5) + # Just in case things get mangled by JavaScript, etc. we print the text for testing + self.get_text(xpath_selector) + + def get_text(self, xpath_selector): + el = self.browser.find_element_by_xpath(xpath_selector) + text = el.text.strip() or el.get_attribute("value").strip() + print("text:", text) + + def switch_window(self): + self.browser.switch_to_window(self.browser.window_handles[-1]) + sleep(2) + self.title() + sleep(2) + + + def title(self): + print("title:", self.browser.title) + + + +if __name__ == '__main__': + import doctest + doctest.testmod() diff --git a/wqflask/maintenance/marker_regression_test.py b/wqflask/maintenance/marker_regression_test.py new file mode 100644 index 00000000..f4840bd7 --- /dev/null +++ b/wqflask/maintenance/marker_regression_test.py @@ -0,0 +1,118 @@ +""" +Test calculate correlations + +>>> test = Test() +>>> test.get("http://genenetwork.org") +title: GeneNetwork + +Choose the type +>>> test.click_option('''//*[@id="tissue"]''', 'Liver mRNA') +clicked: Liver mRNA + +Enter the Get Any +>>> test.enter_text('''//*[@id="tfor"]''', 'grin2b') +text: grin2b + +Search +>>> test.click('//*[@id="btsearch"]') +clicked: Search + +Choose the second result +>>> test.click('''/html/body/table/tbody/tr[3]/td/table/tbody/tr/td/form/p/table/tbody/tr[3]/td/div/table/tbody/tr[3]/td[2]/a''') +clicked: 1431700_at_A + +A new window is created, so we switch to it +>>> test.switch_window() +title: GSE16780 UCLA Hybrid MDP Liver Affy HT M430A (Sep11) RMA : 1431700_at_A: Display Trait + +Click on Mapping Tools +>>> test.click('''//*[@id="title4"]''') +clicked: Mapping Tools + +Click on Marker Regression tab +>>> test.click('''/html/body/table/tbody/tr[3]/td/table/tbody/tr/td/form/p[8]/table/tbody/tr/td/div/ul/li[2]/a''') +clicked: Marker Regression + +Click on Compute +>>> test.click('''/html/body/table/tbody/tr[3]/td/table/tbody/tr/td/form/p[8]/table/tbody/tr/td/div/div[2]/span/table/tbody/tr/td/input''') +clicked: Compute + +Another new window +>>> test.switch_window() +title: Genome Association Result + +Sleep a bunch because this can take a while +>>> sleep(60) + +Ensure that the LRS of the top record is the exepcted value +>>> test.get_text('''/html/body/table/tbody/tr[3]/td/table/tbody/tr[4]/td/table/tbody/tr/td/div/table/tbody/tr[2]/td[2]''') +text: 11.511 + +""" + +from __future__ import print_function, division, absolute_import + +from browser_test import Test + +# +#from time import sleep +# +# +#import selenium +#from selenium import webdriver +#from selenium.common.exceptions import NoSuchElementException, ElementNotVisibleException +#from selenium.webdriver.common.keys import Keys +# +# +#class Test(object): +# def __init__(self): +# self.browser = webdriver.Chrome('/home/gn2/gn2/webtests/chromedriver') +# +# def get(self, url): +# self.browser.get(url) +# sleep(5) +# self.title() +# +# def click(self, xpath_selector): +# el = self.browser.find_element_by_xpath(xpath_selector) +# text = el.text.strip() or el.get_attribute("value").strip() +# el.click() +# print("clicked:", text) +# sleep(2) +# +# def click_option(self, xpath_selector, option_text): +# el = self.browser.find_element_by_xpath(xpath_selector) +# for option in el.find_elements_by_tag_name('option'): +# if option.text == option_text: +# option.click() # select() in earlier versions of webdriver +# break +# sleep(2) +# +# def enter_text(self, xpath_selector, text): +# el = self.browser.find_element_by_xpath(xpath_selector) +# sleep(10) +# el.send_keys(text) +# sleep(5) +# # Just in case things get mangled by JavaScript, etc. we print the text for testing +# self.get_text(xpath_selector) +# +# def get_text(self, xpath_selector): +# el = self.browser.find_element_by_xpath(xpath_selector) +# text = el.text.strip() or el.get_attribute("value").strip() +# print("text:", text) +# +# def switch_window(self): +# self.browser.switch_to_window(self.browser.window_handles[-1]) +# sleep(2) +# self.title() +# sleep(2) +# +# +# def title(self): +# print("title:", self.browser.title) + + + +if __name__ == '__main__': + import doctest + doctest.testmod() diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py index 7397c776..b0c96c56 100755 --- a/wqflask/wqflask/show_trait/show_trait.py +++ b/wqflask/wqflask/show_trait/show_trait.py @@ -1204,10 +1204,12 @@ class ShowTrait(object): other_sample_names.append(sample) if other_sample_names: - parent_f1_samples = self.dataset.group.parlist + self.dataset.group.f1list + if self.dataset.group.parlist and self.dataset.group.f1list: + parent_f1_samples = self.dataset.group.parlist + self.dataset.group.f1list other_sample_names.sort() #Sort other samples - other_sample_names = parent_f1_samples + other_sample_names + if parent_f1_samples: + other_sample_names = parent_f1_samples + other_sample_names other_samples = SampleList(dataset=self.dataset, sample_names=other_sample_names, -- cgit v1.2.3
    Read