diff options
Diffstat (limited to 'wqflask')
194 files changed, 4310 insertions, 7379 deletions
diff --git a/wqflask/base/GeneralObject.py b/wqflask/base/GeneralObject.py new file mode 100644 index 00000000..02a1ef06 --- /dev/null +++ b/wqflask/base/GeneralObject.py @@ -0,0 +1,68 @@ +# 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 GeneNetwork Core Team 2010/10/20 + +class GeneralObject: + """ + Base class to define an Object. + a = [Spam(1, 4), Spam(9, 3), Spam(4,6)] + a.sort(lambda x, y: cmp(x.eggs, y.eggs)) + """ + + def __init__(self, *args, **kw): + self.contents = list(args) + for name, value in kw.items(): + setattr(self, name, value) + + def __setitem__(self, key, value): + setattr(self, key, value) + + def __getitem__(self, key): + return getattr(self, key) + + def __getattr__(self, key): + if key in self.__dict__.keys(): + return self.__dict__[key] + else: + return eval("self.__dict__.%s" % key) + + def __len__(self): + return len(self.__dict__) - 1 + + def __str__(self): + s = '' + for key in self.__dict__.keys(): + if key != 'contents': + s += '%s = %s\n' % (key,self.__dict__[key]) + return s + + def __repr__(self): + s = '' + for key in self.__dict__.keys(): + s += '%s = %s\n' % (key,self.__dict__[key]) + return s + + def __cmp__(self,other): + return len(self.__dict__.keys()).__cmp__(len(other.__dict__.keys()))
\ No newline at end of file diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index 68a2a185..4953e728 100755..100644 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -44,6 +44,7 @@ from dbFunction import webqtlDatabaseFunction from utility import webqtlUtil from utility.benchmark import Bench from utility import chunks +from utility.tools import locate, locate_ignore_error from maintenance import get_group_samplelists @@ -54,43 +55,29 @@ from pprint import pformat as pf # Each subclass will add to this DS_NAME_MAP = {} -def create_dataset(dataset_name, dataset_type = None): +def create_dataset(dataset_name, dataset_type = None, get_samplelist = True): if not dataset_type: dataset_type = Dataset_Getter(dataset_name) - #dataset_type = get_dataset_type_from_json(dataset_name) 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 = globals()[dataset_ob] - return dataset_class(dataset_name) - + return dataset_class(dataset_name, get_samplelist) -#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[1] if dataset_type == "Phenotypes": new_type = "Publish" @@ -99,32 +86,28 @@ class Dataset_Types(object): 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) - + if result: print("Cache hit!!!") datasets = pickle.loads(result) - + else: datasets = list() with Bench("Creating DataSets object"): 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(): @@ -133,10 +116,10 @@ def create_datasets_list(): #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 @@ -157,31 +140,30 @@ def mescape(*items): class Markers(object): """Todo: Build in cacheing so it saves us reading the same file more than once""" def __init__(self, name): - json_data_fh = open(os.path.join(webqtlConfig.NEWGENODIR + name + '.json')) + json_data_fh = open(locate(name + '.json','genotype/json')) try: markers = json.load(json_data_fh) except: markers = [] - + for marker in markers: if (marker['chr'] != "X") and (marker['chr'] != "Y"): marker['chr'] = int(marker['chr']) - print("Mb:", marker['Mb']) marker['Mb'] = float(marker['Mb']) - + self.markers = markers #print("self.markers:", self.markers) - - + + def add_pvalues(self, p_values): print("length of self.markers:", len(self.markers)) print("length of p_values:", len(p_values)) - + if type(p_values) is list: # THIS IS only needed for the case when we are limiting the number of p-values calculated #if len(self.markers) > len(p_values): # self.markers = self.markers[:len(p_values)] - + for marker, p_value in itertools.izip(self.markers, p_values): if not p_value: continue @@ -214,18 +196,11 @@ class Markers(object): #self.markers.remove(marker) #del self.markers[i] self.markers = filtered_markers - - - #for i, marker in enumerate(self.markers): - # if not 'p_value' in marker: - # #print("self.markers[i]", self.markers[i]) - # del self.markers[i] - # #self.markers.remove(self.markers[i]) class HumanMarkers(Markers): - + def __init__(self, name, specified_markers = []): - marker_data_fh = open(os.path.join(webqtlConfig.PYLMM_PATH + name + '.bim')) + marker_data_fh = open(locate('genotype') + '/' + name + '.bim') self.markers = [] for line in marker_data_fh: splat = line.strip().split() @@ -244,54 +219,36 @@ class HumanMarkers(Markers): marker['name'] = splat[1] marker['Mb'] = float(splat[3]) / 1000000 self.markers.append(marker) - + #print("markers is: ", pf(self.markers)) def add_pvalues(self, p_values): - #for marker, p_value in itertools.izip(self.markers, p_values): - # if marker['Mb'] <= 0 and marker['chr'] == 0: - # continue - # marker['p_value'] = 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 - - #print("p_values2:", pf(p_values)) super(HumanMarkers, self).add_pvalues(p_values) - - #with Bench("deleting markers"): - # markers = [] - # for marker in self.markers: - # if not marker['Mb'] <= 0 and not marker['chr'] == 0: - # markers.append(marker) - # self.markers = markers - - + class DatasetGroup(object): """ Each group has multiple datasets; each species has multiple groups. - + For example, Mouse has multiple groups (BXD, BXA, etc), and each group has multiple datasets associated with it. - + """ def __init__(self, dataset): """This sets self.group and self.group_id""" - print("DATASET NAME2:", dataset.name) + #print("DATASET NAME2:", dataset.name) self.name, self.id = g.db.execute(dataset.query_for_group).fetchone() if self.name == 'BXD300': self.name = "BXD" - + self.f1list = None self.parlist = None self.get_f1_parent_strains() #print("parents/f1s: {}:{}".format(self.parlist, self.f1list)) - + self.species = webqtlDatabaseFunction.retrieve_species(self.name) - + self.incparentsf1 = False self.allsamples = None self._datasets = None @@ -302,7 +259,7 @@ class DatasetGroup(object): def get_markers(self): #print("self.species is:", self.species) if self.species == "human": - marker_class = HumanMarkers + marker_class = HumanMarkers else: marker_class = Markers @@ -311,12 +268,6 @@ class DatasetGroup(object): def datasets(self): key = "group_dataset_menu:v2:" + self.name print("key is2:", key) - #with Bench("Loading cache"): - # result = Redis.get(key) - #if result: - # self._datasets = pickle.loads(result) - # return self._datasets - dataset_menu = [] print("[tape4] webqtlConfig.PUBLICTHRESH:", webqtlConfig.PUBLICTHRESH) print("[tape4] type webqtlConfig.PUBLICTHRESH:", type(webqtlConfig.PUBLICTHRESH)) @@ -356,7 +307,7 @@ class DatasetGroup(object): dataset_menu.append(dict(tissue=None, datasets=[(dataset, dataset_short)])) else: dataset_sub_menu = [item[1:] for item in dataset] - + tissue_already_exists = False tissue_position = None for i, tissue_dict in enumerate(dataset_menu): @@ -366,7 +317,7 @@ class DatasetGroup(object): break if tissue_already_exists: - print("dataset_menu:", dataset_menu[i]['datasets']) + #print("dataset_menu:", dataset_menu[i]['datasets']) dataset_menu[i]['datasets'].append((dataset, dataset_short)) else: dataset_menu.append(dict(tissue=tissue_name, @@ -384,7 +335,7 @@ class DatasetGroup(object): f1, f12, maternal, paternal = webqtlUtil.ParInfo[self.name] except KeyError: f1 = f12 = maternal = paternal = None - + if f1 and f12: self.f1list = [f1, f12] if maternal and paternal: @@ -392,32 +343,28 @@ class DatasetGroup(object): def get_samplelist(self): key = "samplelist:v2:" + self.name - print("key is:", key) - with Bench("Loading cache"): - result = Redis.get(key) + #print("key is:", key) + #with Bench("Loading cache"): + result = Redis.get(key) if result: - print("Sample List Cache hit!!!") - print("Before unjsonifying {}: {}".format(type(result), 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) + #print(" type: ", type(self.samplelist)) + #print(" self.samplelist: ", self.samplelist) else: print("Cache not hit") - from utility.tools import plink_command - PLINK_PATH,PLINK_COMMAND = plink_command() - - geno_file_path = webqtlConfig.GENODIR+self.name+".geno" - plink_file_path = PLINK_PATH+"/"+self.name+".fam" - - if os.path.isfile(plink_file_path): - self.samplelist = get_group_samplelists.get_samplelist("plink", plink_file_path) - elif os.path.isfile(geno_file_path): - self.samplelist = get_group_samplelists.get_samplelist("geno", geno_file_path) + genotype_fn = locate_ignore_error(self.name+".geno",'genotype') + mapping_fn = locate_ignore_error(self.name+".fam",'mapping') + if mapping_fn: + self.samplelist = get_group_samplelists.get_samplelist("plink", mapping_fn) + elif genotype_fn: + self.samplelist = get_group_samplelists.get_samplelist("geno", genotype_fn) else: self.samplelist = None - print("after get_samplelist") + print("Sample list: ",self.samplelist) Redis.set(key, json.dumps(self.samplelist)) Redis.expire(key, 60*5) @@ -429,30 +376,14 @@ class DatasetGroup(object): def read_genotype_file(self): '''Read genotype from .geno file instead of database''' - #if self.group == 'BXD300': - # self.group = 'BXD' - # - #assert self.group, "self.group needs to be set" - #genotype_1 is Dataset Object without parents and f1 #genotype_2 is Dataset Object with parents and f1 (not for intercross) genotype_1 = reaper.Dataset() # reaper barfs on unicode filenames, so here we ensure it's a string - full_filename = str(os.path.join(webqtlConfig.GENODIR, self.name + '.geno')) - 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!") + full_filename = str(locate(self.name+'.geno','genotype')) + genotype_1.read(full_filename) if genotype_1.type == "group" and self.parlist: genotype_2 = genotype_1.add(Mat=self.parlist[0], Pat=self.parlist[1]) #, F1=_f1) @@ -461,39 +392,15 @@ class DatasetGroup(object): #determine default genotype object if self.incparentsf1 and genotype_1.type != "intercross": - #self.genotype = genotype_2 genotype = genotype_2 else: self.incparentsf1 = 0 - #self.genotype = genotype_1 genotype = genotype_1 - #self.samplelist = list(self.genotype.prgy) self.samplelist = list(genotype.prgy) - - return genotype - -#class DataSets(object): -# """Builds a list of DataSets""" -# -# def __init__(self): -# self.datasets = list() -# - - - #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) + return genotype -#ds = DataSets() -#print("[orange] ds:", ds.datasets) class DataSet(object): """ @@ -502,7 +409,7 @@ class DataSet(object): """ - def __init__(self, name): + def __init__(self, name, get_samplelist = True): assert name, "Need a name" self.name = name @@ -510,49 +417,28 @@ class DataSet(object): self.shortname = None self.fullname = None self.type = None + self.data_scale = None #ZS: For example log2 self.setup() self.check_confidentiality() self.retrieve_other_names() - + self.group = DatasetGroup(self) # sets self.group and self.group_id and gets genotype - self.group.get_samplelist() + if get_samplelist == True: + self.group.get_samplelist() self.species = species.TheSpecies(self) - print("TESTING!!!") - def get_desc(self): """Gets overridden later, at least for Temp...used by trait's get_given_name""" return None - - #@staticmethod - #def get_by_trait_id(trait_id): - # """Gets the dataset object given the trait id""" - # - # - # - # name = g.db.execute(""" SELECT - # - # """) - # - # return DataSet(name) # Delete this eventually @property def riset(): Weve_Renamed_This_As_Group - - - #@property - #def group(self): - # if not self._group: - # self.get_group() - # - # return self._group - def retrieve_other_names(self): """ @@ -562,7 +448,7 @@ class DataSet(object): This is not meant to retrieve the data set info if no name at all is passed. """ - + try: if self.type == "ProbeSet": query_args = tuple(escape(x) for x in ( @@ -571,8 +457,8 @@ class DataSet(object): self.name, self.name)) - self.id, self.name, self.fullname, self.shortname, self.tissue = g.db.execute(""" - SELECT ProbeSetFreeze.Id, ProbeSetFreeze.Name, ProbeSetFreeze.FullName, ProbeSetFreeze.ShortName, Tissue.Name + self.id, self.name, self.fullname, self.shortname, self.data_scale, self.tissue = g.db.execute(""" + SELECT ProbeSetFreeze.Id, ProbeSetFreeze.Name, ProbeSetFreeze.FullName, ProbeSetFreeze.ShortName, ProbeSetFreeze.DataScale, Tissue.Name FROM ProbeSetFreeze, ProbeFreeze, Tissue WHERE ProbeSetFreeze.public > %s AND ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id AND @@ -598,17 +484,17 @@ class DataSet(object): except TypeError: print("Dataset {} is not yet available in GeneNetwork.".format(self.name)) pass - + def get_trait_data(self, sample_list=None): if sample_list: self.samplelist = sample_list else: self.samplelist = self.group.samplelist - + if self.group.parlist != None and self.group.f1list != None: if (self.group.parlist + self.group.f1list) in self.samplelist: self.samplelist += self.group.parlist + self.group.f1list - + query = """ SELECT Strain.Name, Strain.Id FROM Strain, Species WHERE Strain.Name IN {} @@ -625,21 +511,6 @@ class DataSet(object): 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) - if self.type == "Publish": dataset_type = "Phenotype" else: @@ -660,7 +531,7 @@ class DataSet(object): left join {}Data as T{} on T{}.Id = {}XRef.DataId and T{}.StrainId={}\n """.format(*mescape(self.type, item, item, self.type, item, item)) - + if self.type == "Publish": query += """ WHERE {}XRef.InbredSetId = {}Freeze.InbredSetId @@ -677,16 +548,16 @@ class DataSet(object): order by {}.Id """.format(*mescape(self.type, self.type, self.type, self.type, self.name, dataset_type, self.type, self.type, dataset_type)) - + #print("trait data query: ", query) - + results = g.db.execute(query).fetchall() #print("query results:", results) 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): @@ -699,9 +570,9 @@ class PhenotypeDataSet(DataSet): DS_NAME_MAP['Publish'] = 'PhenotypeDataSet' def setup(self): - - print("IS A PHENOTYPEDATASET") - + + #print("IS A PHENOTYPEDATASET") + # Fields in the database table self.search_fields = ['Phenotype.Post_publication_description', 'Phenotype.Pre_publication_description', @@ -772,26 +643,26 @@ class PhenotypeDataSet(DataSet): def get_trait_info(self, trait_list, species = ''): for this_trait in trait_list: - + if not this_trait.haveinfo: 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: this_trait.description_display = "" continue # for now - + if not webqtlUtil.hasAccessToConfidentialPhenotypeTrait( privilege=self.privilege, userName=self.userName, authorized_users=this_trait.authorized_users): - + description = this_trait.pre_publication_description - + if len(description) > 0: this_trait.description_display = description.strip() else: @@ -836,11 +707,11 @@ class PhenotypeDataSet(DataSet): this_trait.LRS_score_repr = LRS_score_repr = '%3.1f' % this_trait.lrs this_trait.LRS_score_value = LRS_score_value = this_trait.lrs this_trait.LRS_location_repr = LRS_location_repr = 'Chr%s: %.6f' % (LRS_Chr, float(LRS_Mb)) - + def retrieve_sample_data(self, trait): query = """ SELECT - Strain.Name, PublishData.value, PublishSE.error, NStrain.count + Strain.Name, PublishData.value, PublishSE.error, NStrain.count, Strain.Name2 FROM (PublishData, Strain, PublishXRef, PublishFreeze) left join PublishSE on @@ -894,7 +765,7 @@ class GenotypeDataSet(DataSet): def check_confidentiality(self): return geno_mrna_confidentiality(self) - + def get_trait_list(self): query = """ select Geno.Name @@ -928,11 +799,11 @@ class GenotypeDataSet(DataSet): this_trait.location_repr = 'Chr%s: %.6f' % (this_trait.chr, float(this_trait.mb) ) this_trait.location_value = trait_location_value - + def retrieve_sample_data(self, trait): query = """ SELECT - Strain.Name, GenoData.value, GenoSE.error, GenoData.Id + Strain.Name, GenoData.value, GenoSE.error, GenoData.Id, Sample.Name2 FROM (GenoData, GenoFreeze, Strain, Geno, GenoXRef) left join GenoSE on @@ -1020,7 +891,7 @@ class MrnaAssayDataSet(DataSet): def check_confidentiality(self): return geno_mrna_confidentiality(self) - + def get_trait_list_1(self): query = """ select ProbeSet.Name @@ -1029,86 +900,14 @@ class MrnaAssayDataSet(DataSet): and ProbeSetFreezeId = {} """.format(escape(str(self.id))) results = g.db.execute(query).fetchall() - #print("After get_trait_list query") trait_data = {} for trait in results: - print("Retrieving sample_data for ", trait[0]) trait_data[trait[0]] = self.retrieve_sample_data(trait[0]) - #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_info(self, trait_list=None, species=''): - # Note: setting trait_list to [] is probably not a great idea. + # Note: setting trait_list to [] is probably not a great idea. if not trait_list: trait_list = [] @@ -1171,7 +970,7 @@ class MrnaAssayDataSet(DataSet): #print("query is:", pf(query)) result = g.db.execute(query).fetchone() - + mean = result[0] if result else 0 if mean: @@ -1192,28 +991,15 @@ class MrnaAssayDataSet(DataSet): Geno.SpeciesId = Species.Id """.format(species, this_trait.locus) result = g.db.execute(query).fetchone() - + if result: - #if result[0] and result[1]: - # lrs_chr = result[0] - # lrs_mb = result[1] lrs_chr, lrs_mb = result #XZ: LRS_location_value is used for sorting lrs_location_value = self.convert_location_to_value(lrs_chr, lrs_mb) - - #try: - # lrs_location_value = int(lrs_chr)*1000 + float(lrs_mb) - #except: - # if lrs_chr.upper() == 'X': - # lrs_location_value = 20*1000 + float(lrs_mb) - # else: - # lrs_location_value = (ord(str(LRS_chr).upper()[0])*1000 + - # float(lrs_mb)) - this_trait.LRS_score_repr = '%3.1f' % this_trait.lrs this_trait.LRS_score_value = this_trait.lrs this_trait.LRS_location_repr = 'Chr%s: %.6f' % (lrs_chr, float(lrs_mb)) - + def convert_location_to_value(self, chromosome, mb): try: @@ -1224,7 +1010,7 @@ class MrnaAssayDataSet(DataSet): else: location_value = (ord(str(chromosome).upper()[0])*1000 + float(mb)) - + return location_value def get_sequence(self): @@ -1241,11 +1027,11 @@ class MrnaAssayDataSet(DataSet): """ % (escape(self.name), escape(self.dataset.name)) results = g.db.execute(query).fetchone() return results[0] - + def retrieve_sample_data(self, trait): query = """ SELECT - Strain.Name, ProbeSetData.value, ProbeSetSE.error, ProbeSetData.Id + Strain.Name, ProbeSetData.value, ProbeSetSE.error, ProbeSetData.Id, Strain.Name2 FROM (ProbeSetData, ProbeSetFreeze, Strain, ProbeSet, ProbeSetXRef) left join ProbeSetSE on @@ -1262,8 +1048,8 @@ class MrnaAssayDataSet(DataSet): results = g.db.execute(query).fetchall() #print("RETRIEVED RESULTS HERE:", results) return results - - + + def retrieve_genes(self, column_name): query = """ select ProbeSet.Name, ProbeSet.%s @@ -1272,37 +1058,8 @@ class MrnaAssayDataSet(DataSet): ProbeSetXRef.ProbeSetId=ProbeSet.Id; """ % (column_name, escape(str(self.id))) results = g.db.execute(query).fetchall() - - return dict(results) - #def retrieve_gene_symbols(self): - # query = """ - # select ProbeSet.Name, ProbeSet.Symbol, ProbeSet.GeneId - # from ProbeSet,ProbeSetXRef - # where ProbeSetXRef.ProbeSetFreezeId = %s and - # ProbeSetXRef.ProbeSetId=ProbeSet.Id; - # """ % (self.id) - # results = g.db.execute(query).fetchall() - # symbol_dict = {} - # for item in results: - # symbol_dict[item[0]] = item[1] - # return symbol_dict - # - #def retrieve_gene_ids(self): - # query = """ - # select ProbeSet.Name, ProbeSet.GeneId - # from ProbeSet,ProbeSetXRef - # where ProbeSetXRef.ProbeSetFreezeId = %s and - # ProbeSetXRef.ProbeSetId=ProbeSet.Id; - # """ % (self.id) - # return process_and_run_query(query) - # results = g.db.execute(query).fetchall() - # symbol_dict = {} - # for item in results: - # symbol_dict[item[0]] = item[1] - # return symbol_dict - - + return dict(results) class TempDataSet(DataSet): @@ -1324,8 +1081,8 @@ class TempDataSet(DataSet): self.id = 1 self.fullname = 'Temporary Storage' self.shortname = 'Temp' - - + + @staticmethod def handle_pca(desc): if 'PCA' in desc: @@ -1334,13 +1091,13 @@ class TempDataSet(DataSet): else: desc = desc[:desc.index('entered')].strip() return desc - + def get_desc(self): g.db.execute('SELECT description FROM Temp WHERE Name=%s', self.name) desc = g.db.fetchone()[0] desc = self.handle_pca(desc) - return desc - + return desc + def get_group(self): self.cursor.execute(""" SELECT @@ -1353,7 +1110,7 @@ class TempDataSet(DataSet): """, self.name) self.group, self.group_id = self.cursor.fetchone() #return self.group - + def retrieve_sample_data(self, trait): query = """ SELECT @@ -1367,7 +1124,7 @@ class TempDataSet(DataSet): Order BY Strain.Name """ % escape(trait.name) - + results = g.db.execute(query).fetchall() diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index ff80795c..a71d8157 100755..100644 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -2,7 +2,7 @@ from __future__ import absolute_import, division, print_function import string import resource - +import codecs from htmlgen import HTMLgen2 as HT @@ -31,16 +31,16 @@ class GeneralTrait(object): """ - def __init__(self, get_qtl_info=False, **kw): + def __init__(self, get_qtl_info=False, get_sample_info=True, **kw): # xor assertion assert bool(kw.get('dataset')) != bool(kw.get('dataset_name')), "Needs dataset ob. or name"; if kw.get('dataset_name'): self.dataset = create_dataset(kw.get('dataset_name')) - print(" in GeneralTrait created dataset:", self.dataset) + #print(" in GeneralTrait created dataset:", self.dataset) else: self.dataset = kw.get('dataset') self.name = kw.get('name') # Trait ID, ProbeSet ID, Published ID, etc. - print("THE NAME IS:", self.name) + #print("THE NAME IS:", self.name) self.cellid = kw.get('cellid') self.identification = kw.get('identification', 'un-named trait') self.haveinfo = kw.get('haveinfo', False) @@ -67,7 +67,8 @@ class GeneralTrait(object): # Todo: These two lines are necessary most of the time, but perhaps not all of the time # So we could add a simple if statement to short-circuit this if necessary self.retrieve_info(get_qtl_info=get_qtl_info) - self.retrieve_sample_data() + if get_sample_info != False: + self.retrieve_sample_data() def jsonable(self): @@ -179,13 +180,15 @@ class GeneralTrait(object): samples = [] vals = [] the_vars = [] + sample_aliases = [] for sample_name, sample_data in self.data.items(): if sample_data.value != None: if not include_variance or sample_data.variance != None: samples.append(sample_name) vals.append(sample_data.value) the_vars.append(sample_data.variance) - return samples, vals, the_vars + sample_aliases.append(sample_data.name2) + return samples, vals, the_vars, sample_aliases # @@ -220,32 +223,6 @@ class GeneralTrait(object): if samplelist == None: samplelist = [] - #assert self.dataset - - #if self.cellid: - # #Probe Data - # query = ''' - # SELECT - # Strain.Name, ProbeData.value, ProbeSE.error, ProbeData.Id - # FROM - # (ProbeData, ProbeFreeze, ProbeSetFreeze, ProbeXRef, - # Strain, Probe, ProbeSet) - # left join ProbeSE on - # (ProbeSE.DataId = ProbeData.Id AND ProbeSE.StrainId = ProbeData.StrainId) - # WHERE - # Probe.Name = '%s' AND ProbeSet.Name = '%s' AND - # Probe.ProbeSetId = ProbeSet.Id AND - # ProbeXRef.ProbeId = Probe.Id AND - # ProbeXRef.ProbeFreezeId = ProbeFreeze.Id AND - # ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id AND - # ProbeSetFreeze.Name = '%s' AND - # ProbeXRef.DataId = ProbeData.Id AND - # ProbeData.StrainId = Strain.Id - # Order BY - # Strain.Name - # ''' % (self.cellid, self.name, self.dataset.name) - # - #else: results = self.dataset.retrieve_sample_data(self.name) # Todo: is this necessary? If not remove @@ -255,19 +232,10 @@ class GeneralTrait(object): if results: for item in results: - name, value, variance, num_cases = item + name, value, variance, num_cases, name2 = item if not samplelist or (samplelist and name in samplelist): self.data[name] = webqtlCaseData(*item) #name, value, variance, num_cases) - #def keys(self): - # return self.__dict__.keys() - # - #def has_key(self, key): - # return self.__dict__.has_key(key) - # - #def items(self): - # return self.__dict__.items() - def retrieve_info(self, get_qtl_info=False): assert self.dataset, "Dataset doesn't exist" if self.dataset.type == 'Publish': @@ -290,10 +258,10 @@ class GeneralTrait(object): PublishXRef.InbredSetId = PublishFreeze.InbredSetId AND PublishFreeze.Id = %s """ % (self.name, self.dataset.id) - - print("query is:", query) trait_info = g.db.execute(query).fetchone() + + #XZ, 05/08/2009: Xiaodong add this block to use ProbeSet.Id to find the probeset instead of just using ProbeSet.Name #XZ, 05/08/2009: to avoid the problem of same probeset name from different platforms. elif self.dataset.type == 'ProbeSet': @@ -328,7 +296,6 @@ class GeneralTrait(object): escape(self.dataset.name), escape(self.name)) trait_info = g.db.execute(query).fetchone() - #print("trait_info is: ", pf(trait_info)) else: #Temp type query = """SELECT %s FROM %s WHERE Name = %s""" trait_info = g.db.execute(query, @@ -339,54 +306,118 @@ 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])) holder = trait_info[i] if isinstance(trait_info[i], basestring): holder = unicode(trait_info[i], "utf8", "ignore") setattr(self, field, holder) - + if self.dataset.type == 'Publish': self.confidential = 0 if self.pre_publication_description and not self.pubmed_id: self.confidential = 1 + + description = self.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 self.confidential: + self.description_display = "" + + #if not webqtlUtil.hasAccessToConfidentialPhenotypeTrait( + # privilege=self.dataset.privilege, + # userName=self.dataset.userName, + # authorized_users=self.authorized_users): + # + # description = self.pre_publication_description + + if description: + self.description_display = description.strip() + else: + self.description_display = "" - self.homologeneid = None - - #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. - #XZ: The geneid values in database should be cleaned up. - #try: - # float(self.geneid) - # geneidIsNumber = True - #except ValueError: - # geneidIsNumber = False - - #if geneidIsNumber: - - - query = """ - SELECT - HomologeneId - FROM - Homologene, Species, InbredSet - WHERE - Homologene.GeneId =%s AND - InbredSet.Name = '%s' AND - InbredSet.SpeciesId = Species.Id AND - Species.TaxonomyId = Homologene.TaxonomyId - """ % (escape(str(self.geneid)), escape(self.dataset.group.name)) - result = g.db.execute(query).fetchone() - #else: - # result = None + if not self.year.isdigit(): + self.pubmed_text = "N/A" + else: + self.pubmed_text = self.year - if result: - self.homologeneid = result[0] + if self.pubmed_id: + self.pubmed_link = webqtlConfig.PUBMEDLINK_URL % self.pubmed_id + + + self.homologeneid = None + if self.dataset.type == 'ProbeSet' and self.dataset.group: + if 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. + #XZ: The geneid values in database should be cleaned up. + #try: + # float(self.geneid) + # geneidIsNumber = True + #except ValueError: + # geneidIsNumber = False + #if geneidIsNumber: + query = """ + SELECT + HomologeneId + FROM + Homologene, Species, InbredSet + WHERE + Homologene.GeneId =%s AND + InbredSet.Name = '%s' AND + InbredSet.SpeciesId = Species.Id AND + Species.TaxonomyId = Homologene.TaxonomyId + """ % (escape(str(self.geneid)), escape(self.dataset.group.name)) + result = g.db.execute(query).fetchone() + #else: + # result = None + + if result: + self.homologeneid = result[0] + + description_string = unicode(str(self.description).strip(codecs.BOM_UTF8), 'utf-8') + target_string = unicode(str(self.probe_target_description).strip(codecs.BOM_UTF8), 'utf-8') + + if len(description_string) > 1 and description_string != 'None': + description_display = description_string + else: + description_display = self.symbol + + if (len(description_display) > 1 and description_display != 'N/A' and + len(target_string) > 1 and target_string != 'None'): + description_display = description_display + '; ' + target_string.strip() + + # Save it for the jinja2 template + self.description_display = description_display + + #XZ: trait_location_value is used for sorting + trait_location_repr = 'N/A' + trait_location_value = 1000000 + + if self.chr and self.mb: + #Checks if the chromosome number can be cast to an int (i.e. isn't "X" or "Y") + #This is so we can convert the location to a number used for sorting + trait_location_value = convert_location_to_value(self.chr, self.mb) + #try: + # trait_location_value = int(self.chr)*1000 + self.mb + #except ValueError: + # if self.chr.upper() == 'X': + # trait_location_value = 20*1000 + self.mb + # else: + # trait_location_value = (ord(str(self.chr).upper()[0])*1000 + + # self.mb) + + #ZS: Put this in function currently called "convert_location_to_value" + self.location_repr = 'Chr%s: %.6f' % (self.chr, float(self.mb)) + self.location_value = trait_location_value + if get_qtl_info: + #LRS and its location + self.LRS_score_repr = "N/A" + self.LRS_score_value = 0 + self.LRS_location_repr = "N/A" + self.LRS_location_value = 1000000 if self.dataset.type == 'ProbeSet' and not self.cellid: query = """ SELECT @@ -399,12 +430,8 @@ class GeneralTrait(object): ProbeSetXRef.ProbeSetFreezeId ={} """.format(self.name, self.dataset.id) trait_qtl = g.db.execute(query).fetchone() - #self.cursor.execute(query) - #trait_qtl = self.cursor.fetchone() if trait_qtl: - print("trait_qtl:", trait_qtl) self.locus, self.lrs, self.pvalue, self.mean, self.additive= trait_qtl - print("self.locus:", self.locus) if self.locus: query = """ select Geno.Chr, Geno.Mb from Geno, Species @@ -417,9 +444,9 @@ class GeneralTrait(object): self.locus_chr = result[0] self.locus_mb = result[1] else: - self.locus = self.locus_chr = self.locus_mb = "" + self.locus = self.locus_chr = self.locus_mb = self.additive = "" else: - self.locus = self.locus_chr = self.locus_mb = "" + self.locus = self.locus_chr = self.locus_mb = self.additive = "" else: self.locus = self.locus_chr = self.locus_mb = self.lrs = self.pvalue = self.mean = self.additive = "" @@ -437,8 +464,38 @@ class GeneralTrait(object): """, (self.name, self.dataset.id)).fetchone() if trait_qtl: self.locus, self.lrs, self.additive = trait_qtl + if self.locus: + query = """ + select Geno.Chr, Geno.Mb from Geno, Species + where Species.Name = '{}' and + Geno.Name = '{}' and + Geno.SpeciesId = Species.Id + """.format(self.dataset.group.species, self.locus) + result = g.db.execute(query).fetchone() + if result: + self.locus_chr = result[0] + self.locus_mb = result[1] + else: + self.locus = self.locus_chr = self.locus_mb = self.additive = "" + else: + self.locus = self.locus_chr = self.locus_mb = self.additive = "" else: self.locus = self.lrs = self.additive = "" + + if (self.dataset.type == 'Publish' or self.dataset.type == "ProbeSet") and self.locus_chr != "" and self.locus_mb != "": + #XZ: LRS_location_value is used for sorting + try: + LRS_location_value = int(self.locus_chr)*1000 + float(self.locus_mb) + except: + if self.locus_chr.upper() == 'X': + LRS_location_value = 20*1000 + float(self.locus_mb) + else: + LRS_location_value = ord(str(self.locus_chr).upper()[0])*1000 + float(self.locus_mb) + + self.LRS_location_repr = LRS_location_repr = 'Chr%s: %.6f' % (self.locus_chr, float(self.locus_mb)) + if self.lrs != "": + self.LRS_score_repr = LRS_score_repr = '%3.1f' % self.lrs + self.LRS_score_value = LRS_score_value = self.lrs else: raise KeyError, `self.name`+' information is not found in the database.' @@ -646,7 +703,17 @@ class GeneralTrait(object): ZValue = ZValue*sqrt(self.overlap-3) self.p_value = 2.0*(1.0 - reaper.normp(abs(ZValue))) - +def convert_location_to_value(chromosome, mb): + try: + location_value = int(chromosome)*1000 + float(mb) + except ValueError: + if chromosome.upper() == 'X': + location_value = 20*1000 + float(mb) + else: + location_value = (ord(str(chromosome).upper()[0])*1000 + + float(mb)) + + return location_value @app.route("/trait/get_sample_data") def get_sample_data(): diff --git a/wqflask/base/webqtlCaseData.py b/wqflask/base/webqtlCaseData.py index 42763aed..99a34866 100755 --- a/wqflask/base/webqtlCaseData.py +++ b/wqflask/base/webqtlCaseData.py @@ -29,8 +29,9 @@ print("Mr. Mojo Risin 2") class webqtlCaseData(object): """one case data in one trait""" - def __init__(self, name, value=None, variance=None, num_cases=None): + def __init__(self, name, value=None, variance=None, num_cases=None, name2=None): self.name = name + self.name2 = name2 # Other name (for traits like BXD65a) self.value = value # Trait Value self.variance = variance # Trait Variance self.num_cases = num_cases # Number of individuals/cases diff --git a/wqflask/base/webqtlConfig.py b/wqflask/base/webqtlConfig.py index 3eaeb56e..f6140ac3 100755..100644 --- a/wqflask/base/webqtlConfig.py +++ b/wqflask/base/webqtlConfig.py @@ -1,7 +1,15 @@ #########################################' # Environment Variables - public +# +# Note: much of this needs to handled by the settings/environment +# scripts. But rather than migrating everything in one go, we'll +# take it a step at a time. First the hard coded paths get replaced +# with those in utility/tools.py +# ######################################### +from utility.tools import valid_path, mk_dir, assert_dir, flat_files, TEMPDIR + #Debug Level #1 for debug, mod python will reload import each time DEBUG = 1 @@ -48,30 +56,28 @@ UCSC_RUDI_TRACK_URL = " http://genome.cse.ucsc.edu/cgi-bin/hgTracks?org=%s&db=%s GENOMEBROWSER_URL="http://ucscbrowser.genenetwork.org/cgi-bin/hgTracks?clade=mammal&org=Mouse&db=mm9&position=%s&hgt.suggest=&pix=800&Submit=submit" ENSEMBLETRANSCRIPT_URL="http://useast.ensembl.org/Mus_musculus/Lucene/Details?species=Mus_musculus;idx=Transcript;end=1;q=%s" +# The following paths are no longer in use! +# HTMLPATH is replaced by GENODIR +# IMGDIR is replaced by GENERATED_IMAGE_DIR + +# Temporary storage: +TMPDIR = mk_dir(TEMPDIR+'/gn2/') +CACHEDIR = mk_dir(TEMPDIR+'/cache/') +# We can no longer write into the git tree: +GENERATED_IMAGE_DIR = mk_dir(TMPDIR+'/generated/') +GENERATED_TEXT_DIR = mk_dir(TMPDIR+'/generated_text/') + +# Flat file directories +GENODIR = flat_files('genotype')+'/' +JSON_GENODIR = flat_files('genotype/json')+'/' +if not valid_path(JSON_GENODIR): + # fall back on old location (move the dir, FIXME) + JSON_GENODIR = flat_files('json') +assert_dir(GENODIR) -GNROOT = "/home/zas1024/gene/" # Will remove this and dependent items later -SECUREDIR = GNROOT + 'secure/' -COMMON_LIB = GNROOT + 'support/admin' -HTMLPATH = GNROOT + 'genotype_files/' -PYLMM_PATH = '/home/zas1024/plink_gemma/' -SNP_PATH = '/home/zas1024/snps/' -IMGDIR = GNROOT + '/wqflask/wqflask/static/output/' -IMAGESPATH = HTMLPATH + 'images/' -UPLOADPATH = IMAGESPATH + 'upload/' -TMPDIR = '/home/zas1024/tmp/' # Will remove this and dependent items later -GENODIR = HTMLPATH + 'genotypes/' -NEWGENODIR = HTMLPATH + 'new_genotypes/' -GENO_ARCHIVE_DIR = GENODIR + 'archive/' -TEXTDIR = HTMLPATH + 'ProbeSetFreeze_DataMatrix/' -CMDLINEDIR = HTMLPATH + 'webqtl/cmdLine/' -ChangableHtmlPath = GNROOT + 'web/' - -SITENAME = 'GN' PORTADDR = "http://50.16.251.170" -BASEHREF = '<base href="http://50.16.251.170/">' + INFOPAGEHREF = '/dbdoc/%s.html' -GLOSSARYFILE = "/glossary.html" CGIDIR = '/webqtl/' #XZ: The variable name 'CGIDIR' should be changed to 'PYTHONDIR' SCRIPTFILE = 'main.py' -REFRESHSTR = '<meta http-equiv="refresh" content="5;url=%s' + SCRIPTFILE +'?sid=%s">' -REFRESHDIR = '%s' + SCRIPTFILE +'?sid=%s' + diff --git a/wqflask/base/webqtlFormData.py b/wqflask/base/webqtlFormData.py index 44fdcc3f..10251756 100755 --- a/wqflask/base/webqtlFormData.py +++ b/wqflask/base/webqtlFormData.py @@ -157,7 +157,7 @@ class webqtlFormData(object): self.genotype_1 = reaper.Dataset() - full_filename = os.path.join(webqtlConfig.GENODIR, self.group + '.geno') + full_filename = locate(self.group + '.geno','genotype') # reaper barfs on unicode filenames, so here we ensure it's a string full_filename = str(full_filename) diff --git a/wqflask/basicStatistics/BasicStatisticsFunctions.py b/wqflask/basicStatistics/BasicStatisticsFunctions.py index 74784853..e748a822 100755 --- a/wqflask/basicStatistics/BasicStatisticsFunctions.py +++ b/wqflask/basicStatistics/BasicStatisticsFunctions.py @@ -118,7 +118,7 @@ def plotNormalProbability(vals=None, RISet='', title=None, showstrains=0, specia Plot.plotXY(c, dataZ, dataX, dataLabel = dataLabel, XLabel='Expected Z score', connectdot=0, YLabel='Trait value', title=title, specialCases=specialStrains, showLabel = showLabel) filename= webqtlUtil.genRandStr("nP_") - c.save(webqtlConfig.IMGDIR+filename, format='gif') + c.save(webqtlConfig.GENERATED_IMAGE_DIR+filename, format='gif') img=HT.Image('/image/'+filename+'.gif',border=0) @@ -145,7 +145,7 @@ def plotBoxPlot(vals): Plot.plotBoxPlot(canvas, XXX, offset=(xLeftOffset, xRightOffset, yTopOffset, yBottomOffset), XLabel= "Trait") filename= webqtlUtil.genRandStr("Box_") - canvas.save(webqtlConfig.IMGDIR+filename, format='gif') + canvas.save(webqtlConfig.GENERATED_IMAGE_DIR+filename, format='gif') img=HT.Image('/image/'+filename+'.gif',border=0) plotLink = HT.Span("More about ", HT.Href(text="Box Plots", url="http://davidmlane.com/hyperstat/A37797.html", target="_blank", Class="fs13")) @@ -201,7 +201,7 @@ def plotBarGraph(identification='', RISet='', vals=None, type="name"): Plot.plotBarText(c, tvals, tnames, variance=tvars, YLabel='Value', title=title, sLabel = sLabel, barSpace = sw) filename= webqtlUtil.genRandStr("Bar_") - c.save(webqtlConfig.IMGDIR+filename, format='gif') + c.save(webqtlConfig.GENERATED_IMAGE_DIR+filename, format='gif') img=HT.Image('/image/'+filename+'.gif',border=0) return img diff --git a/wqflask/maintenance/gen_select_dataset.py b/wqflask/maintenance/gen_select_dataset.py index e080050e..489d291f 100755 --- a/wqflask/maintenance/gen_select_dataset.py +++ b/wqflask/maintenance/gen_select_dataset.py @@ -36,8 +36,7 @@ from __future__ import print_function, division #print("cdict is:", cdict) import sys -sys.path.append("/home/zas1024/") -import zach_settings +import zach_settings # no hard code paths! import MySQLdb diff --git a/wqflask/maintenance/get_group_samplelists.py b/wqflask/maintenance/get_group_samplelists.py index b8397b47..a9059fad 100755 --- a/wqflask/maintenance/get_group_samplelists.py +++ b/wqflask/maintenance/get_group_samplelists.py @@ -6,7 +6,6 @@ import gzip from base import webqtlConfig - def process_genofiles(geno_dir=webqtlConfig.GENODIR): print("Yabba") #sys.exit("Dabba") @@ -54,4 +53,4 @@ def get_samplelist_from_plink(genofilename): line = line.split(" ") samplelist.append(line[0]) - return samplelist
\ No newline at end of file + return samplelist diff --git a/wqflask/runserver.py b/wqflask/runserver.py index 59ebf0d4..e4392b3f 100755 --- a/wqflask/runserver.py +++ b/wqflask/runserver.py @@ -25,8 +25,8 @@ file_handler = logging.FileHandler(app.config['LOGFILE']) file_handler.setLevel(logging.DEBUG) app.logger.addHandler(file_handler) -import logging_tree -logging_tree.printout() +# import logging_tree +# logging_tree.printout() app.run(host='0.0.0.0', port=app.config['SERVER_PORT'], diff --git a/wqflask/secure_server.py b/wqflask/secure_server.py deleted file mode 100755 index fc258578..00000000 --- a/wqflask/secure_server.py +++ /dev/null @@ -1,75 +0,0 @@ -from __future__ import absolute_import, division, print_function - -import time -import sys - -from wqflask import app - -from flask import Flask, render_template - -import redis -Redis = redis.StrictRedis() - -# Setup mail -#from flask.ext.mail import Mail -#mail = Mail(app) - -from wqflask.model import * - -# Create a user to test with -##@app.before_first_request -#def create_user(): -# db.create_all() -# 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) -app.logger.addHandler(file_handler) - -import logging_tree -logging_tree.printout() - -#import sys -#print("At startup, path is:", sys.path) - -from werkzeug.contrib.fixers import ProxyFix -app.wsgi_app = ProxyFix(app.wsgi_app) - -#print("app.config is:", app.config) - - - -def check_send_mail_running(): - """Ensure send_mail.py is running before we start the site - - It would be really easy to accidentally run the site - without our mail program running - This will make sure our mail program is running...or at least recently run... - - """ - error_msg = "Make sure your are running send_mail.py" - send_mail_ping = Redis.get("send_mail:ping") - print("send_mail_ping is:", send_mail_ping) - if not send_mail_ping: - sys.exit(error_msg) - - last_ping = time.time() - float(send_mail_ping) - if not (0 < last_ping < 100): - sys.exit(error_msg) - - - print("send_mail.py seems to be running...") - - -if __name__ == '__main__': - #create_user() - - check_send_mail_running() - - app.run(host='0.0.0.0', - port=5002, - use_debugger=True, - threaded=True, - use_reloader=True) diff --git a/wqflask/utility/Plot.py b/wqflask/utility/Plot.py index 51a57a6d..444c71c9 100755..100644 --- a/wqflask/utility/Plot.py +++ b/wqflask/utility/Plot.py @@ -24,10 +24,9 @@ # # Last updated by GeneNetwork Core Team 2010/10/20 -#import piddle as pid - from __future__ import print_function +import piddle as pid from pprint import pformat as pf print("Lysol") @@ -478,181 +477,181 @@ def plotSecurity(canvas, text="12345"): # parameter: data is either object returned by reaper permutation function (called by MarkerRegressionPage.py) # or the first object returned by direct (pair-scan) permu function (called by DirectPlotPage.py) -#def plotBar(canvas, data, barColor=pid.blue, axesColor=pid.black, labelColor=pid.black, XLabel=None, YLabel=None, title=None, offset= (60, 20, 40, 40), zoom = 1): -# -# xLeftOffset, xRightOffset, yTopOffset, yBottomOffset = offset -# -# plotWidth = canvas.size[0] - xLeftOffset - xRightOffset -# plotHeight = canvas.size[1] - yTopOffset - yBottomOffset -# if plotHeight<=0 or plotWidth<=0: -# return -# -# if len(data) < 2: -# return -# -# max_D = max(data) -# min_D = min(data) -# #add by NL 06-20-2011: fix the error: when max_D is infinite, log function in detScale will go wrong -# if max_D == float('inf') or max_D>webqtlConfig.MAXLRS: -# max_D=webqtlConfig.MAXLRS #maximum LRS value -# -# xLow, xTop, stepX = detScale(min_D, max_D) -# -# #reduce data -# step = ceil((xTop-xLow)/50.0) -# j = xLow -# dataXY = [] -# Count = [] -# while j <= xTop: -# dataXY.append(j) -# Count.append(0) -# j += step -# -# for i, item in enumerate(data): -# if item == float('inf') or item>webqtlConfig.MAXLRS: -# item = webqtlConfig.MAXLRS #maximum LRS value -# j = int((item-xLow)/step) -# Count[j] += 1 -# -# yLow, yTop, stepY=detScale(0,max(Count)) -# -# #draw data -# xScale = plotWidth/(xTop-xLow) -# yScale = plotHeight/(yTop-yLow) -# barWidth = xScale*step -# -# for i, count in enumerate(Count): -# if count: -# xc = (dataXY[i]-xLow)*xScale+xLeftOffset -# yc =-(count-yLow)*yScale+yTopOffset+plotHeight -# canvas.drawRect(xc+2,yc,xc+barWidth-2,yTopOffset+plotHeight,edgeColor=barColor,fillColor=barColor) -# -# #draw drawing region -# canvas.drawRect(xLeftOffset, yTopOffset, xLeftOffset+plotWidth, yTopOffset+plotHeight) -# -# #draw scale -# scaleFont=pid.Font(ttf="cour",size=11,bold=1) -# x=xLow -# for i in range(stepX+1): -# xc=xLeftOffset+(x-xLow)*xScale -# canvas.drawLine(xc,yTopOffset+plotHeight,xc,yTopOffset+plotHeight+5, color=axesColor) -# strX = cformat(d=x, rank=0) -# canvas.drawString(strX,xc-canvas.stringWidth(strX,font=scaleFont)/2,yTopOffset+plotHeight+14,font=scaleFont) -# x+= (xTop - xLow)/stepX -# -# y=yLow -# for i in range(stepY+1): -# yc=yTopOffset+plotHeight-(y-yLow)*yScale -# canvas.drawLine(xLeftOffset,yc,xLeftOffset-5,yc, color=axesColor) -# strY = "%d" %y -# canvas.drawString(strY,xLeftOffset-canvas.stringWidth(strY,font=scaleFont)-6,yc+5,font=scaleFont) -# y+= (yTop - yLow)/stepY -# -# #draw label -# labelFont=pid.Font(ttf="tahoma",size=17,bold=0) -# if XLabel: -# canvas.drawString(XLabel,xLeftOffset+(plotWidth-canvas.stringWidth(XLabel,font=labelFont))/2.0, -# yTopOffset+plotHeight+yBottomOffset-10,font=labelFont,color=labelColor) -# -# if YLabel: -# canvas.drawString(YLabel, 19, yTopOffset+plotHeight-(plotHeight-canvas.stringWidth(YLabel,font=labelFont))/2.0, -# font=labelFont,color=labelColor,angle=90) -# -# labelFont=pid.Font(ttf="verdana",size=16,bold=0) -# if title: -# canvas.drawString(title,xLeftOffset+(plotWidth-canvas.stringWidth(title,font=labelFont))/2.0, -# 20,font=labelFont,color=labelColor) -# -#def plotBarText(canvas, data, label, variance=None, barColor=pid.blue, axesColor=pid.black, labelColor=pid.black, XLabel=None, YLabel=None, title=None, sLabel = None, offset= (80, 20, 40, 100), barSpace = 2, zoom = 1): -# xLeftOffset, xRightOffset, yTopOffset, yBottomOffset = offset -# plotWidth = canvas.size[0] - xLeftOffset - xRightOffset -# plotHeight = canvas.size[1] - yTopOffset - yBottomOffset -# if plotHeight<=0 or plotWidth<=0: -# return -# -# NNN = len(data) -# if NNN < 2 or NNN != len(label): -# return -# if variance and len(variance)!=NNN: -# variance = [] -# -# Y2 = data[:] -# if variance: -# for i in range(NNN): -# if variance[i]: -# Y2 += [data[i]-variance[i]] -# -# #Y axis -# YLow, YTop, stepY = detScale(min(Y2), max(Y2)) -# YScale = plotHeight/(YTop - YLow) -# -# if YLow < 0 and YTop > 0: -# drawZero = 1 -# else: -# drawZero = 0 -# -# #X axis -# X = range(NNN) -# Xll= 0 -# Xur= NNN-1 -# -# -# if drawZero: -# YZero = yTopOffset+plotHeight-YScale*(0-YLow) -# canvas.drawLine(xLeftOffset, YZero, xLeftOffset+plotWidth, YZero) -# else: -# YZero = yTopOffset+plotHeight -# #draw data -# spaceWidth = barSpace -# if spaceWidth < 1: -# spaceWidth = 1 -# barWidth = int((plotWidth - (NNN-1.0)*spaceWidth)/NNN) -# -# xc= xLeftOffset -# scaleFont=pid.Font(ttf="verdana",size=11,bold=0) -# for i in range(NNN): -# yc = yTopOffset+plotHeight-(data[i]-YLow)*YScale -# canvas.drawRect(xc,YZero,xc+barWidth-1, yc, edgeColor=barColor,fillColor=barColor) -# if variance and variance[i]: -# varlen = variance[i]*YScale -# if yc-varlen < yTopOffset: -# topYd = yTopOffset -# else: -# topYd = yc-varlen -# canvas.drawLine(xc+barWidth/2-2,yc-varlen,xc+barWidth/2+2,yc-varlen,color=pid.red) -# canvas.drawLine(xc+barWidth/2,yc+varlen,xc+barWidth/2,topYd,color=pid.red) -# canvas.drawLine(xc+barWidth/2-2,yc+varlen,xc+barWidth/2+2,yc+varlen,color=pid.red) -# strX = label[i] -# canvas.drawString(strX,xc+barWidth/2.0+2,yTopOffset+plotHeight+2+canvas.stringWidth(strX,font=scaleFont),font=scaleFont,angle=90) -# xc += barWidth + spaceWidth -# -# #draw drawing region -# canvas.drawRect(xLeftOffset, yTopOffset, xLeftOffset+plotWidth, yTopOffset+plotHeight) -# -# #draw Y scale -# scaleFont=pid.Font(ttf="cour",size=16,bold=1) -# y=YLow -# for i in range(stepY+1): -# yc=yTopOffset+plotHeight-(y-YLow)*YScale -# canvas.drawLine(xLeftOffset,yc,xLeftOffset-5,yc, color=axesColor) -# strY = cformat(d=y, rank=0) -# canvas.drawString(strY,xLeftOffset-canvas.stringWidth(strY,font=scaleFont)-6,yc+5,font=scaleFont) -# y+= (YTop - YLow)/stepY -# -# #draw label -# labelFont=pid.Font(ttf="verdana",size=17,bold=0) -# if XLabel: -# canvas.drawString(XLabel,xLeftOffset+(plotWidth-canvas.stringWidth(XLabel,font=labelFont))/2.0,yTopOffset+plotHeight+65,font=labelFont,color=labelColor) -# -# if YLabel: -# canvas.drawString(YLabel,xLeftOffset-50, yTopOffset+plotHeight-(plotHeight-canvas.stringWidth(YLabel,font=labelFont))/2.0,font=labelFont,color=labelColor,angle=90) -# -# labelFont=pid.Font(ttf="verdana",size=18,bold=0) -# if title: -# canvas.drawString(title,xLeftOffset,yTopOffset-15,font=labelFont,color=labelColor) -# -# return -# +def plotBar(canvas, data, barColor=pid.blue, axesColor=pid.black, labelColor=pid.black, XLabel=None, YLabel=None, title=None, offset= (60, 20, 40, 40), zoom = 1): + xLeftOffset, xRightOffset, yTopOffset, yBottomOffset = offset + + plotWidth = canvas.size[0] - xLeftOffset - xRightOffset + plotHeight = canvas.size[1] - yTopOffset - yBottomOffset + if plotHeight<=0 or plotWidth<=0: + return + + if len(data) < 2: + return + + max_D = max(data) + min_D = min(data) + #add by NL 06-20-2011: fix the error: when max_D is infinite, log function in detScale will go wrong + if max_D == float('inf') or max_D>webqtlConfig.MAXLRS: + max_D=webqtlConfig.MAXLRS #maximum LRS value + + xLow, xTop, stepX = detScale(min_D, max_D) + + #reduce data + #ZS: Used to determine number of bins for permutation output + step = ceil((xTop-xLow)/50.0) + j = xLow + dataXY = [] + Count = [] + while j <= xTop: + dataXY.append(j) + Count.append(0) + j += step + + for i, item in enumerate(data): + if item == float('inf') or item>webqtlConfig.MAXLRS: + item = webqtlConfig.MAXLRS #maximum LRS value + j = int((item-xLow)/step) + Count[j] += 1 + + yLow, yTop, stepY=detScale(0,max(Count)) + + #draw data + xScale = plotWidth/(xTop-xLow) + yScale = plotHeight/(yTop-yLow) + barWidth = xScale*step + + for i, count in enumerate(Count): + if count: + xc = (dataXY[i]-xLow)*xScale+xLeftOffset + yc =-(count-yLow)*yScale+yTopOffset+plotHeight + canvas.drawRect(xc+2,yc,xc+barWidth-2,yTopOffset+plotHeight,edgeColor=barColor,fillColor=barColor) + + #draw drawing region + canvas.drawRect(xLeftOffset, yTopOffset, xLeftOffset+plotWidth, yTopOffset+plotHeight) + + #draw scale + scaleFont=pid.Font(ttf="cour",size=11,bold=1) + x=xLow + for i in range(int(stepX)+1): + xc=xLeftOffset+(x-xLow)*xScale + canvas.drawLine(xc,yTopOffset+plotHeight,xc,yTopOffset+plotHeight+5, color=axesColor) + strX = cformat(d=x, rank=0) + canvas.drawString(strX,xc-canvas.stringWidth(strX,font=scaleFont)/2,yTopOffset+plotHeight+14,font=scaleFont) + x+= (xTop - xLow)/stepX + + y=yLow + for i in range(int(stepY)+1): + yc=yTopOffset+plotHeight-(y-yLow)*yScale + canvas.drawLine(xLeftOffset,yc,xLeftOffset-5,yc, color=axesColor) + strY = "%d" %y + canvas.drawString(strY,xLeftOffset-canvas.stringWidth(strY,font=scaleFont)-6,yc+5,font=scaleFont) + y+= (yTop - yLow)/stepY + + #draw label + labelFont=pid.Font(ttf="tahoma",size=17,bold=0) + if XLabel: + canvas.drawString(XLabel,xLeftOffset+(plotWidth-canvas.stringWidth(XLabel,font=labelFont))/2.0, + yTopOffset+plotHeight+yBottomOffset-10,font=labelFont,color=labelColor) + + if YLabel: + canvas.drawString(YLabel, 19, yTopOffset+plotHeight-(plotHeight-canvas.stringWidth(YLabel,font=labelFont))/2.0, + font=labelFont,color=labelColor,angle=90) + + labelFont=pid.Font(ttf="verdana",size=16,bold=0) + if title: + canvas.drawString(title,xLeftOffset+(plotWidth-canvas.stringWidth(title,font=labelFont))/2.0, + 20,font=labelFont,color=labelColor) + +def plotBarText(canvas, data, label, variance=None, barColor=pid.blue, axesColor=pid.black, labelColor=pid.black, XLabel=None, YLabel=None, title=None, sLabel = None, offset= (80, 20, 40, 100), barSpace = 2, zoom = 1): + xLeftOffset, xRightOffset, yTopOffset, yBottomOffset = offset + plotWidth = canvas.size[0] - xLeftOffset - xRightOffset + plotHeight = canvas.size[1] - yTopOffset - yBottomOffset + if plotHeight<=0 or plotWidth<=0: + return + + NNN = len(data) + if NNN < 2 or NNN != len(label): + return + if variance and len(variance)!=NNN: + variance = [] + + Y2 = data[:] + if variance: + for i in range(NNN): + if variance[i]: + Y2 += [data[i]-variance[i]] + + #Y axis + YLow, YTop, stepY = detScale(min(Y2), max(Y2)) + YScale = plotHeight/(YTop - YLow) + + if YLow < 0 and YTop > 0: + drawZero = 1 + else: + drawZero = 0 + + #X axis + X = range(NNN) + Xll= 0 + Xur= NNN-1 + + + if drawZero: + YZero = yTopOffset+plotHeight-YScale*(0-YLow) + canvas.drawLine(xLeftOffset, YZero, xLeftOffset+plotWidth, YZero) + else: + YZero = yTopOffset+plotHeight + #draw data + spaceWidth = barSpace + if spaceWidth < 1: + spaceWidth = 1 + barWidth = int((plotWidth - (NNN-1.0)*spaceWidth)/NNN) + + xc= xLeftOffset + scaleFont=pid.Font(ttf="verdana",size=11,bold=0) + for i in range(NNN): + yc = yTopOffset+plotHeight-(data[i]-YLow)*YScale + canvas.drawRect(xc,YZero,xc+barWidth-1, yc, edgeColor=barColor,fillColor=barColor) + if variance and variance[i]: + varlen = variance[i]*YScale + if yc-varlen < yTopOffset: + topYd = yTopOffset + else: + topYd = yc-varlen + canvas.drawLine(xc+barWidth/2-2,yc-varlen,xc+barWidth/2+2,yc-varlen,color=pid.red) + canvas.drawLine(xc+barWidth/2,yc+varlen,xc+barWidth/2,topYd,color=pid.red) + canvas.drawLine(xc+barWidth/2-2,yc+varlen,xc+barWidth/2+2,yc+varlen,color=pid.red) + strX = label[i] + canvas.drawString(strX,xc+barWidth/2.0+2,yTopOffset+plotHeight+2+canvas.stringWidth(strX,font=scaleFont),font=scaleFont,angle=90) + xc += barWidth + spaceWidth + + #draw drawing region + canvas.drawRect(xLeftOffset, yTopOffset, xLeftOffset+plotWidth, yTopOffset+plotHeight) + + #draw Y scale + scaleFont=pid.Font(ttf="cour",size=16,bold=1) + y=YLow + for i in range(stepY+1): + yc=yTopOffset+plotHeight-(y-YLow)*YScale + canvas.drawLine(xLeftOffset,yc,xLeftOffset-5,yc, color=axesColor) + strY = cformat(d=y, rank=0) + canvas.drawString(strY,xLeftOffset-canvas.stringWidth(strY,font=scaleFont)-6,yc+5,font=scaleFont) + y+= (YTop - YLow)/stepY + + #draw label + labelFont=pid.Font(ttf="verdana",size=17,bold=0) + if XLabel: + canvas.drawString(XLabel,xLeftOffset+(plotWidth-canvas.stringWidth(XLabel,font=labelFont))/2.0,yTopOffset+plotHeight+65,font=labelFont,color=labelColor) + + if YLabel: + canvas.drawString(YLabel,xLeftOffset-50, yTopOffset+plotHeight-(plotHeight-canvas.stringWidth(YLabel,font=labelFont))/2.0,font=labelFont,color=labelColor,angle=90) + + labelFont=pid.Font(ttf="verdana",size=18,bold=0) + if title: + canvas.drawString(title,xLeftOffset,yTopOffset-15,font=labelFont,color=labelColor) + + return + #def plotXY(canvas, dataX, dataY, rank=0, dataLabel=[], plotColor = pid.black, axesColor=pid.black, labelColor=pid.black, lineSize="thin", lineColor=pid.grey, idFont="arial", idColor=pid.blue, idSize="14", symbolColor=pid.black, symbolType="circle", filled="yes", symbolSize="tiny", XLabel=None, YLabel=None, title=None, fitcurve=None, connectdot=1, displayR=None, loadingPlot = 0, offset= (80, 20, 40, 60), zoom = 1, specialCases=[], showLabel = 1, bufferSpace = 15): # 'displayR : correlation scatter plot, loadings : loading plot' # diff --git a/wqflask/utility/external.py b/wqflask/utility/external.py new file mode 100644 index 00000000..50afea08 --- /dev/null +++ b/wqflask/utility/external.py @@ -0,0 +1,9 @@ +# Call external program + +import os +import sys +import subprocess + +def shell(command): + if subprocess.call(command, shell=True) != 0: + raise Exception("ERROR: failed on "+command) diff --git a/wqflask/utility/genofile_parser.py b/wqflask/utility/genofile_parser.py new file mode 100644 index 00000000..67b84dc9 --- /dev/null +++ b/wqflask/utility/genofile_parser.py @@ -0,0 +1,100 @@ +# CTL analysis for GN2 +# Author / Maintainer: Danny Arends <Danny.Arends@gmail.com> + +from __future__ import print_function, division, absolute_import +import sys +import os +import glob +import traceback +import gzip + + +import simplejson as json + +from pprint import pformat as pf + +class Marker(object): + def __init__(self): + self.name = None + self.chr = None + self.cM = None + self.Mb = None + self.genotypes = [] + + +class ConvertGenoFile(object): + + def __init__(self, input_file): + self.mb_exists = False + self.cm_exists = False + self.markers = [] + + self.latest_row_pos = None + self.latest_col_pos = None + + self.latest_row_value = None + self.latest_col_value = None + self.input_fh = open(input_file) + print("!!!!!!!!!!!!!!!!PARSER!!!!!!!!!!!!!!!!!!") + self.haplotype_notation = { + '@mat': "1", + '@pat': "2", + '@het': "-999", + '@unk': "-999" + } + self.configurations = {} + + def process_rows(self): + for self.latest_row_pos, row in enumerate(self.input_fh): + self.latest_row_value = row + # Take care of headers + if not row.strip(): + continue + if row.startswith('#'): + continue + if row.startswith('Chr'): + if 'Mb' in row.split(): + self.mb_exists = True + if 'cM' in row.split(): + self.cm_exists = True + skip = 2 + self.cm_exists + self.mb_exists + self.individuals = row.split()[skip:] + continue + if row.startswith('@'): + key, _separater, value = row.partition(':') + key = key.strip() + value = value.strip() + if key in self.haplotype_notation: + self.configurations[value] = self.haplotype_notation[key] + continue + if not len(self.configurations): + raise EmptyConfigurations + yield row + + def process_csv(self): + for row_count, row in enumerate(self.process_rows()): + row_items = row.split("\t") + + this_marker = Marker() + this_marker.name = row_items[1] + this_marker.chr = row_items[0] + if self.cm_exists and self.mb_exists: + this_marker.cM = row_items[2] + this_marker.Mb = row_items[3] + genotypes = row_items[4:] + elif self.cm_exists: + this_marker.cM = row_items[2] + genotypes = row_items[3:] + elif self.mb_exists: + this_marker.Mb = row_items[2] + genotypes = row_items[3:] + else: + genotypes = row_items[2:] + for item_count, genotype in enumerate(genotypes): + if genotype.upper().strip() in self.configurations: + this_marker.genotypes.append(self.configurations[genotype.upper().strip()]) + else: + print("WARNING:", genotype.upper()) + this_marker.genotypes.append("NA") + self.markers.append(this_marker.__dict__) + diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py index b8a41f60..dd8c4a1e 100644 --- a/wqflask/utility/tools.py +++ b/wqflask/utility/tools.py @@ -1,84 +1,137 @@ # Tools/paths finder resolves external paths from settings and/or environment # variables -# -# Currently supported: -# -# PYLMM_PATH finds the root of the git repository of the pylmm_gn2 tool import os import sys from wqflask import app -def get_setting(id,default,guess,get_valid_path): - """ - Resolve a setting from the environment or the global settings in app.config +def get_setting(command_id,guess=None): + """Resolve a setting from the environment or the global settings in + app.config, with get_valid_path is a function checking whether the + path points to an expected directory and returns the full path to + the binary command + + guess = os.environ.get('HOME')+'/pylmm' + get_setting('PYLMM_PATH',guess) + + first tries the environment variable in +id+, next gets the Flask + app setting for the same +id+ and finally does an educated + +guess+. + + In all, the environment overrides the others, next is the flask + setting, then the guess. A valid path to the binary command is + returned. If none is resolved an exception is thrown. + + Note that we do not use the system path. This is on purpose + because it will mess up controlled (reproducible) deployment. The + proper way is to either use the GNU Guix defaults as listed in + etc/default_settings.py or override them yourself by creating a + different settings.py file (or setting the environment). + """ + def value(command): + if command: + sys.stderr.write("Found path "+command+"\n") + return command + else: + return None + # ---- Check whether environment exists - path = get_valid_path(os.environ.get(id)) - # ---- Check whether setting exists - setting = app.config.get(id) - if not path: - path = get_valid_path(setting) - # ---- Check whether default exists - if not path: - path = get_valid_path(default) - # ---- Guess directory - if not path: - if not setting: - setting = guess - path = get_valid_path(guess) - if not path: - raise Exception(id+' '+setting+' path unknown or faulty (update settings.py?). '+id+' should point to the root of the git repository') - - return path - -def pylmm_command(default=None): + sys.stderr.write("Looking for "+command_id+"\n") + command = value(os.environ.get(command_id)) + if not command: + # ---- Check whether setting exists in app + command = value(app.config.get(command_id)) + if not command: + command = value(guess) + if not command: + raise Exception(command_id+' path unknown or faulty (update settings.py?). '+command_id+' should point to the path') + return command + +def valid_bin(bin): + if os.path.islink(bin) or valid_file(bin): + return bin + return None + +def valid_file(fn): + if os.path.isfile(fn): + return fn + return None + +def valid_path(dir): + if os.path.isdir(dir): + return dir + return None + +def pylmm_command(guess=None): + return valid_bin(get_setting("PYLMM_COMMAND",guess)) + +def gemma_command(guess=None): + return valid_bin(get_setting("GEMMA_COMMAND",guess)) + +def plink_command(guess=None): + return valid_bin(get_setting("PLINK_COMMAND",guess)) + +def flat_files(subdir=None): + base = get_setting("GENENETWORK_FILES") + if subdir: + return assert_dir(base+"/"+subdir) + return assert_dir(base) + +def assert_dir(dir): + if not valid_path(dir): + raise Exception("ERROR: can not find directory "+dir) + return dir + +def mk_dir(dir): + if not valid_path(dir): + os.makedirs(dir) + return assert_dir(dir) + +def locate(name, subdir=None): """ - Return the path to the repository and the python command to call + Locate a static flat file in the GENENETWORK_FILES environment. + + This function throws an error when the file is not found. """ - def get_valid_path(path): - """Test for a valid repository""" - if path: - sys.stderr.write("Trying PYLMM_PATH in "+path+"\n") - if path and os.path.isfile(path+'/pylmm_gn2/lmm.py'): - return path + base = get_setting("GENENETWORK_FILES") + if subdir: + base = base+"/"+subdir + if valid_path(base): + lookfor = base + "/" + name + if valid_file(lookfor): + print("Found: file "+lookfor+"\n") + return lookfor else: - None + raise Exception("Can not locate "+lookfor) + if subdir: sys.stderr.write(subdir) + raise Exception("Can not locate "+name+" in "+base) - guess = os.environ.get('HOME')+'/pylmm_gn2' - path = get_setting('PYLMM_PATH',default,guess,get_valid_path) - pylmm_command = 'python '+path+'/pylmm_gn2/lmm.py' - return path,pylmm_command - -def plink_command(default=None): +def locate_ignore_error(name, subdir=None): """ - Return the path to the repository and the python command to call + Locate a static flat file in the GENENETWORK_FILES environment. + + This function does not throw an error when the file is not found + but returns None. """ - def get_valid_path(path): - """Test for a valid repository""" - if path: - sys.stderr.write("Trying PLINK_PATH in "+path+"\n") - if path and os.path.isfile(path+'/plink'): - return path - else: - None - - guess = os.environ.get('HOME')+'/plink_gemma' - path = get_setting('PLINK_PATH',default,guess,get_valid_path) - plink_command = path+'/plink' - return path,plink_command - -def gemma_command(default=None): - def get_valid_path(path): - """Test for a valid repository""" - if path: - sys.stderr.write("Trying PLINK_PATH in "+path+"\n") - if path and os.path.isfile(path+'/plink'): - return path - else: - None + base = get_setting("GENENETWORK_FILES") + if subdir: + base = base+"/"+subdir + if valid_path(base): + lookfor = base + "/" + name + if valid_file(lookfor): + print("Found: file "+name+"\n") + return lookfor + sys.stderr.write("WARNING: file "+name+" not found\n") + return None + +def tempdir(): + return valid_path(get_setting("TEMPDIR","/tmp")) - guess = os.environ.get('HOME')+'/plink' - path = get_setting('PLINK_PATH',default,guess,get_valid_path) - gemma_command = path+'/gemma' - return path, gemma_command
\ No newline at end of file + +# Cached values +PYLMM_COMMAND = pylmm_command() +GEMMA_COMMAND = gemma_command() +PLINK_COMMAND = plink_command() +FLAT_FILES = flat_files() +TEMPDIR = tempdir() diff --git a/wqflask/utility/webqtlUtil.py b/wqflask/utility/webqtlUtil.py index f842dde0..1108614b 100755 --- a/wqflask/utility/webqtlUtil.py +++ b/wqflask/utility/webqtlUtil.py @@ -509,7 +509,7 @@ def calCorrelationRank(xVals,yVals,N): j = 0 for i in range(len(xVals)): - if xVals[i]!= None and yVals[i]!= None: + if (xVals[i]!= None and yVals[i]!= None) and (xVals[i] != "None" and yVals[i] != "None"): XX.append((j,xVals[i])) YY.append((j,yVals[i])) j = j+1 diff --git a/wqflask/wqflask/collect.py b/wqflask/wqflask/collect.py index 750f4757..9227d641 100755..100644 --- a/wqflask/wqflask/collect.py +++ b/wqflask/wqflask/collect.py @@ -15,7 +15,7 @@ import urlparse import simplejson as json -from sqlalchemy import orm +#from sqlalchemy import orm #from redis import StrictRedis import redis @@ -243,8 +243,6 @@ def list_collections(): ) except: return redirect(url_for('view_collection')) - #return render_template("collections/view_anonymous.html", - # params = params) @app.route("/collections/remove", methods=('POST',)) diff --git a/wqflask/wqflask/correlation/show_corr_results.py b/wqflask/wqflask/correlation/show_corr_results.py index 98596ca4..c1ad1c84 100755..100644 --- a/wqflask/wqflask/correlation/show_corr_results.py +++ b/wqflask/wqflask/correlation/show_corr_results.py @@ -50,6 +50,7 @@ from dbFunction import webqtlDatabaseFunction import utility.webqtlUtil #this is for parallel computing only. from wqflask.correlation import correlation_functions from utility.benchmark import Bench +import utility.webqtlUtil from MySQLdb import escape_string as escape @@ -159,6 +160,9 @@ class CorrelationResults(object): self.correlation_data = {} + db_filename = self.getFileName(target_db_name = self.target_dataset.name) + cache_available = db_filename in os.listdir(webqtlConfig.GENERATED_TEXT_DIR) + if self.corr_type == "tissue": self.trait_symbol_dict = self.dataset.retrieve_genes("Symbol") @@ -174,9 +178,25 @@ class CorrelationResults(object): self.get_sample_r_and_p_values(trait, self.target_dataset.trait_data[trait]) elif self.corr_type == "sample": - # print("self.target_dataset.trait_data: %d" % len(self.target_dataset.trait_data)) - for trait, values in self.target_dataset.trait_data.iteritems(): - self.get_sample_r_and_p_values(trait, values) + if self.dataset.type == "ProbeSet" and cache_available: + dataset_file = open(webqtlConfig.GENERATED_TEXT_DIR+db_filename,'r') + + #XZ, 01/08/2009: read the first line + line = dataset_file.readline() + dataset_strains = webqtlUtil.readLineCSV(line)[1:] + + self.this_trait_vals = [] + for item in dataset_strains: + if item in self.sample_data: + self.this_trait_vals.append(self.sample_data[item]) + else: + self.this_trait_vals.append("None") + num_overlap = len(self.this_trait_vals) + + self.do_parallel_correlation(db_filename, num_overlap) + else: + for trait, values in self.target_dataset.trait_data.iteritems(): + self.get_sample_r_and_p_values(trait, values) self.correlation_data = collections.OrderedDict(sorted(self.correlation_data.items(), key=lambda t: -abs(t[1][0]))) @@ -190,7 +210,7 @@ class CorrelationResults(object): range_chr_as_int = order_id for _trait_counter, trait in enumerate(self.correlation_data.keys()[:self.return_number]): - trait_object = GeneralTrait(dataset=self.target_dataset, name=trait, get_qtl_info=True) + trait_object = GeneralTrait(dataset=self.target_dataset, name=trait, get_qtl_info=True, get_sample_info=False) if self.dataset.type == "ProbeSet" or self.dataset.type == "Geno": #ZS: Convert trait chromosome to an int for the location range option @@ -308,7 +328,7 @@ class CorrelationResults(object): #traitList = self.correlate() - #_log.info("Done doing correlation calculation") + #print("Done doing correlation calculation") ############################################################################################################################################ @@ -521,27 +541,126 @@ class CorrelationResults(object): """ - # print("len(self.sample_data):", len(self.sample_data)) - - this_trait_vals = [] + self.this_trait_vals = [] target_vals = [] for index, sample in enumerate(self.target_dataset.samplelist): if sample in self.sample_data: sample_value = self.sample_data[sample] target_sample_value = target_samples[index] - this_trait_vals.append(sample_value) + self.this_trait_vals.append(sample_value) target_vals.append(target_sample_value) - this_trait_vals, target_vals, num_overlap = corr_result_helpers.normalize_values( - this_trait_vals, target_vals) + self.this_trait_vals, target_vals, num_overlap = corr_result_helpers.normalize_values(self.this_trait_vals, target_vals) #ZS: 2015 could add biweight correlation, see http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3465711/ if self.corr_method == 'pearson': - sample_r, sample_p = scipy.stats.pearsonr(this_trait_vals, target_vals) + sample_r, sample_p = scipy.stats.pearsonr(self.this_trait_vals, target_vals) else: - sample_r, sample_p = scipy.stats.spearmanr(this_trait_vals, target_vals) + sample_r, sample_p = scipy.stats.spearmanr(self.this_trait_vals, target_vals) - self.correlation_data[trait] = [sample_r, sample_p, num_overlap] + if num_overlap > 5: + self.correlation_data[trait] = [sample_r, sample_p, num_overlap] + + + """ + correlations = [] + + #XZ: Use the fast method only for probeset dataset, and this dataset must have been created. + #XZ: Otherwise, use original method + #print("Entering correlation") + + #db_filename = self.getFileName(target_db_name=self.target_db_name) + # + #cache_available = db_filename in os.listdir(webqtlConfig.GENERATED_TEXT_DIR) + + # If the cache file exists, do a cached correlation for probeset data + if self.dataset.type == "ProbeSet": +# if self.method in [METHOD_SAMPLE_PEARSON, METHOD_SAMPLE_RANK] and cache_available: +# traits = do_parallel_correlation() +# +# else: + + traits = self.get_traits(self.vals) + + for trait in traits: + trait.calculate_correlation(vals, self.method) + + self.record_count = len(traits) #ZS: This isn't a good way to get this value, so I need to change it later + + #XZ, 3/31/2010: Theoretically, we should create one function 'comTissueCorr' + #to compare each trait by their tissue corr p values. + #But because the tissue corr p values are generated by permutation test, + #the top ones always have p value 0. So comparing p values actually does nothing. + #In addition, for the tissue data in our database, the N is always the same. + #So it's safe to compare with tissue corr statistic value. + #That's the same as literature corr. + #if self.method in [METHOD_LIT, METHOD_TISSUE_PEARSON, METHOD_TISSUE_RANK] and self.gene_id: + # traits.sort(webqtlUtil.cmpLitCorr) + #else: + #if self.method in TISSUE_METHODS: + # sort(traits, key=lambda A: math.fabs(A.tissue_corr)) + #elif self.method == METHOD_LIT: + # traits.sort(traits, key=lambda A: math.fabs(A.lit_corr)) + #else: + traits = sortTraitCorrelations(traits, self.method) + + # Strip to the top N correlations + traits = traits[:min(self.returnNumber, len(traits))] + + addLiteratureCorr = False + addTissueCorr = False + + trait_list = [] + for trait in traits: + db_trait = webqtlTrait(db=self.db, name=trait.name, cursor=self.cursor) + db_trait.retrieveInfo( QTL='Yes' ) + + db_trait.Name = trait.name + db_trait.corr = trait.correlation + db_trait.nOverlap = trait.overlap + db_trait.corrPValue = trait.p_value + + # NL, 07/19/2010 + # js function changed, add a new parameter rankOrder for js function 'showTissueCorrPlot' + db_trait.RANK_ORDER = self.RANK_ORDERS[self.method] + + #XZ, 26/09/2008: Method is 4 or 5. Have fetched tissue corr, but no literature correlation yet. + if self.method in TISSUE_METHODS: + db_trait.tissueCorr = trait.tissue_corr + db_trait.tissuePValue = trait.p_tissue + addTissueCorr = True + + + #XZ, 26/09/2008: Method is 3, Have fetched literature corr, but no tissue corr yet. + elif self.method == METHOD_LIT: + db_trait.LCorr = trait.lit_corr + db_trait.mouse_geneid = self.translateToMouseGeneID(self.species, db_trait.geneid) + addLiteratureCorr = True + + #XZ, 26/09/2008: Method is 1 or 2. Have NOT fetched literature corr and tissue corr yet. + # Phenotype data will not have geneid, and neither will some probes + # we need to handle this because we will get an attribute error + else: + if self.input_trait_mouse_gene_id and self.db.type=="ProbeSet": + addLiteratureCorr = True + if self.trait_symbol and self.db.type=="ProbeSet": + addTissueCorr = True + + trait_list.append(db_trait) + + if addLiteratureCorr: + trait_list = self.getLiteratureCorrelationByList(self.input_trait_mouse_gene_id, + self.species, trait_list) + if addTissueCorr: + trait_list = self.getTissueCorrelationByList( + primaryTraitSymbol = self.trait_symbol, + traitList = trait_list, + TissueProbeSetFreezeId = TISSUE_MOUSE_DB, + method=self.method) + + return trait_list + """ + def do_tissue_corr_for_all_traits_2(self): """Comments Possibly Out of Date!!!!! @@ -670,51 +789,17 @@ class CorrelationResults(object): # except: return False - def get_all_dataset_data(self): - - """ - SELECT ProbeSet.Name, T128.value, T129.value, T130.value, T131.value, T132.value, T134.value, T135.value, T138.value, T139.value, T140.value, T141.value, T142.value, T144 - .value, T145.value, T147.value, T148.value, T149.value, T487.value, T919.value, T920.value, T922.value - FROM (ProbeSet, ProbeSetXRef, ProbeSetFreeze) - left join ProbeSetData as T128 on T128.Id = ProbeSetXRef.DataId and T128.StrainId=128 - left join ProbeSetData as T129 on T129.Id = ProbeSetXRef.DataId and T129.StrainId=129 - left join ProbeSetData as T130 on T130.Id = ProbeSetXRef.DataId and T130.StrainId=130 - left join ProbeSetData as T131 on T131.Id = ProbeSetXRef.DataId and T131.StrainId=131 - left join ProbeSetData as T132 on T132.Id = ProbeSetXRef.DataId and T132.StrainId=132 - left join ProbeSetData as T134 on T134.Id = ProbeSetXRef.DataId and T134.StrainId=134 - left join ProbeSetData as T135 on T135.Id = ProbeSetXRef.DataId and T135.StrainId=135 - left join ProbeSetData as T138 on T138.Id = ProbeSetXRef.DataId and T138.StrainId=138 - left join ProbeSetData as T139 on T139.Id = ProbeSetXRef.DataId and T139.StrainId=139 - left join ProbeSetData as T140 on T140.Id = ProbeSetXRef.DataId and T140.StrainId=140 - left join ProbeSetData as T141 on T141.Id = ProbeSetXRef.DataId and T141.StrainId=141 - left join ProbeSetData as T142 on T142.Id = ProbeSetXRef.DataId and T142.StrainId=142 - left join ProbeSetData as T144 on T144.Id = ProbeSetXRef.DataId and T144.StrainId=144 - left join ProbeSetData as T145 on T145.Id = ProbeSetXRef.DataId and T145.StrainId=145 - left join ProbeSetData as T147 on T147.Id = ProbeSetXRef.DataId and T147.StrainId=147 - left join ProbeSetData as T148 on T148.Id = ProbeSetXRef.DataId and T148.StrainId=148 - left join ProbeSetData as T149 on T149.Id = ProbeSetXRef.DataId and T149.StrainId=149 - left join ProbeSetData as T487 on T487.Id = ProbeSetXRef.DataId and T487.StrainId=487 - left join ProbeSetData as T919 on T919.Id = ProbeSetXRef.DataId and T919.StrainId=919 - left join ProbeSetData as T920 on T920.Id = ProbeSetXRef.DataId and T920.StrainId=920 - left join ProbeSetData as T922 on T922.Id = ProbeSetXRef.DataId and T922.StrainId=922 - WHERE ProbeSetXRef.ProbeSetFreezeId = ProbeSetFreeze.Id and - ProbeSetFreeze.Name = 'HC_M2_0606_P' and - ProbeSet.Id = ProbeSetXRef.ProbeSetId order by ProbeSet.Id - """ - def process_samples(self, start_vars, sample_names, excluded_samples=None): if not excluded_samples: excluded_samples = () for sample in sample_names: if sample not in excluded_samples: - value = start_vars['value:' + sample] - if value.strip().lower() == 'x': - self.sample_data[str(sample)] = None - else: - self.sample_data[str(sample)] = float(value) - - + # print("Looking for",sample,"in",start_vars) + value = start_vars.get('value:' + sample) + if value: + if not value.strip().lower() == 'x': + self.sample_data[str(sample)] = float(value) ##XZ, 12/16/2008: the input geneid is of mouse type #def checkForLitInfo(self,geneId): @@ -942,7 +1027,7 @@ class CorrelationResults(object): use_tissue_corr = True DatabaseFileName = self.getFileName( target_db_name=self.target_db_name ) - datasetFile = open(webqtlConfig.TEXTDIR+DatabaseFileName,'r') + datasetFile = open(webqtlConfig.CACHEDIR+DatabaseFileName,'r') #XZ, 01/08/2009: read the first line line = datasetFile.readline() @@ -990,59 +1075,7 @@ class CorrelationResults(object): totalTraits = len(traits) #XZ, 09/18/2008: total trait number return traits - - - def do_parallel_correlation(self): - _log.info("Invoking parallel computing") - input_line_list = datasetFile.readlines() - _log.info("Read lines from the file") - all_line_number = len(input_line_list) - - step = 1000 - job_number = math.ceil( float(all_line_number)/step ) - - job_input_lists = [] - - _log.info("Configuring jobs") - - for job_index in range( int(job_number) ): - starti = job_index*step - endi = min((job_index+1)*step, all_line_number) - - one_job_input_list = [] - - for i in range( starti, endi ): - one_job_input_list.append( input_line_list[i] ) - - job_input_lists.append( one_job_input_list ) - - _log.info("Creating pp servers") - - ppservers = () - # Creates jobserver with automatically detected number of workers - job_server = pp.Server(ppservers=ppservers) - - _log.info("Done creating servers") - - jobs = [] - results = [] - - _log.info("Starting parallel computation, submitting jobs") - for one_job_input_list in job_input_lists: #pay attention to modules from outside - jobs.append( job_server.submit(func=compute_corr, args=(nnCorr, _newvals, one_job_input_list, self.method), depfuncs=(), modules=("utility.webqtlUtil",)) ) - _log.info("Done submitting jobs") - - for one_job in jobs: - one_result = one_job() - results.append( one_result ) - - _log.info("Acquiring results") - - for one_result in results: - for one_traitinfo in one_result: - allcorrelations.append( one_traitinfo ) - - _log.info("Appending the results") + def calculate_corr_for_all_tissues(self, tissue_dataset_id=None): symbol_corr_dict = {} @@ -1067,10 +1100,7 @@ class CorrelationResults(object): # SymbolValueDict) return (symbolCorrDict, symbolPvalueDict) - datasetFile.close() - totalTraits = len(allcorrelations) - _log.info("Done correlating using the fast method") - + def correlate(self): self.correlation_data = collections.defaultdict(list) @@ -1085,107 +1115,254 @@ class CorrelationResults(object): values_2.append(target_value) correlation = calCorrelation(values_1, values_2) self.correlation_data[trait] = correlation + + def getFileName(self, target_db_name): ### dcrowell August 2008 + """Returns the name of the reference database file with which correlations are calculated. + Takes argument cursor which is a cursor object of any instance of a subclass of templatePage + Used by correlationPage""" + + dataset_id = str(self.target_dataset.id) + dataset_fullname = self.target_dataset.fullname.replace(' ','_') + dataset_fullname = dataset_fullname.replace('/','_') + FileName = 'ProbeSetFreezeId_' + dataset_id + '_FullName_' + dataset_fullname + '.txt' - """ - correlations = [] - - #XZ: Use the fast method only for probeset dataset, and this dataset must have been created. - #XZ: Otherwise, use original method - #_log.info("Entering correlation") - - #db_filename = self.getFileName(target_db_name=self.target_db_name) - # - #cache_available = db_filename in os.listdir(webqtlConfig.TEXTDIR) - - # If the cache file exists, do a cached correlation for probeset data - if self.dataset.type == "ProbeSet": -# if self.method in [METHOD_SAMPLE_PEARSON, METHOD_SAMPLE_RANK] and cache_available: -# traits = do_parallel_correlation() -# -# else: + return FileName + + def do_parallel_correlation(self, db_filename, num_overlap): + + #XZ, 01/14/2009: This method is for parallel computing only. + #XZ: It is supposed to be called when "Genetic Correlation, Pearson's r" (method 1) + #XZ: or "Genetic Correlation, Spearman's rho" (method 2) is selected + def compute_corr(input_nnCorr, input_trait, input_list, corr_method): + + import math + import reaper + + def calCorrelation(dbdata,userdata,N): + X = [] + Y = [] + for i in range(N): + if (dbdata[i] != None and userdata[i] != None) and (dbdata[i] != "None" and userdata[i] != "None"): + X.append(float(dbdata[i])) + Y.append(float(userdata[i])) + NN = len(X) + if NN <6: + return (0.0,NN) + sx = reduce(lambda x,y:x+y,X,0.0) + sy = reduce(lambda x,y:x+y,Y,0.0) + meanx = sx/NN + meany = sy/NN + xyd = 0.0 + sxd = 0.0 + syd = 0.0 + for i in range(NN): + xyd += (X[i] - meanx)*(Y[i]-meany) + sxd += (X[i] - meanx)*(X[i] - meanx) + syd += (Y[i] - meany)*(Y[i] - meany) + try: + corr = xyd/(math.sqrt(sxd)*math.sqrt(syd)) + except: + corr = 0 + return (corr,NN) + + def calCorrelationRank(xVals,yVals,N): + """ + Calculated Spearman Ranked Correlation. The algorithm works + by setting all tied ranks to the average of those ranks (for + example, if ranks 5-10 all have the same value, each will be set + to rank 7.5). + """ + + XX = [] + YY = [] + j = 0 + + for i in range(len(xVals)): + if (xVals[i]!= None and yVals[i]!= None) and (xVals[i] != "None" and yVals[i] != "None"): + XX.append((j,float(xVals[i]))) + YY.append((j,float(yVals[i]))) + j = j+1 + + NN = len(XX) + if NN <6: + return (0.0,NN) + XX.sort(cmpOrder2) + YY.sort(cmpOrder2) + X = [0]*NN + Y = [0]*NN + + j = 1 + rank = 0.0 + t = 0.0 + sx = 0.0 + + while j < NN: + + if XX[j][1] != XX[j-1][1]: + X[XX[j-1][0]] = j + j = j+1 - traits = self.get_traits(self.vals) + else: + jt = j+1 + ji = j + for jt in range(j+1, NN): + if (XX[jt][1] != XX[j-1][1]): + break + rank = 0.5*(j+jt) + for ji in range(j-1, jt): + X[XX[ji][0]] = rank + t = jt-j + sx = sx + (t*t*t-t) + if (jt == NN-1): + if (XX[jt][1] == XX[j-1][1]): + X[XX[NN-1][0]] = rank + j = jt+1 + + if j == NN: + if X[XX[NN-1][0]] == 0: + X[XX[NN-1][0]] = NN + + j = 1 + rank = 0.0 + t = 0.0 + sy = 0.0 + + while j < NN: + + if YY[j][1] != YY[j-1][1]: + Y[YY[j-1][0]] = j + j = j+1 + else: + jt = j+1 + ji = j + for jt in range(j+1, NN): + if (YY[jt][1] != YY[j-1][1]): + break + rank = 0.5*(j+jt) + for ji in range(j-1, jt): + Y[YY[ji][0]] = rank + t = jt - j + sy = sy + (t*t*t-t) + if (jt == NN-1): + if (YY[jt][1] == YY[j-1][1]): + Y[YY[NN-1][0]] = rank + j = jt+1 + + if j == NN: + if Y[YY[NN-1][0]] == 0: + Y[YY[NN-1][0]] = NN + + D = 0.0 + + for i in range(NN): + D += (X[i]-Y[i])*(X[i]-Y[i]) + + fac = (1.0 -sx/(NN*NN*NN-NN))*(1.0-sy/(NN*NN*NN-NN)) + + return ((1-(6.0/(NN*NN*NN-NN))*(D+(sx+sy)/12.0))/math.sqrt(fac),NN) + + # allcorrelations = [] + + correlation_data = {} + for i, line in enumerate(input_list): + if i == 0: + continue + tokens = line.split('","') + tokens[-1] = tokens[-1][:-2] #remove the last " + tokens[0] = tokens[0][1:] #remove the first " + + traitdataName = tokens[0] + database_trait = tokens[1:] + + #print("database_trait:", database_trait) + + #ZS: 2015 could add biweight correlation, see http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3465711/ + # if corr_method == 'pearson': + # sample_r, sample_p = scipy.stats.pearsonr(input_trait, database_trait) + # else: + # sample_r, sample_p = scipy.stats.spearmanr(input_trait, database_trait) + + if corr_method == "pearson": #XZ: Pearson's r + sample_r, nOverlap = calCorrelation(input_trait, database_trait, input_nnCorr) + else: #XZ: Spearman's rho + sample_r, nOverlap = calCorrelationRank(input_trait, database_trait, input_nnCorr) + + #XZ: calculate corrPValue + if nOverlap < 3: + sample_p = 1.0 + else: + if abs(sample_r) >= 1.0: + sample_p = 0.0 + else: + z_value = 0.5*math.log((1.0+sample_r)/(1.0-sample_r)) + z_value = z_value*math.sqrt(nOverlap-3) + sample_p = 2.0*(1.0 - reaper.normp(abs(z_value))) + + correlation_data[traitdataName] = [sample_r, sample_p, nOverlap] + + # traitinfo = [traitdataName, sample_r, nOverlap] + # allcorrelations.append(traitinfo) - for trait in traits: - trait.calculate_correlation(vals, self.method) + return correlation_data + # return allcorrelations + + + datasetFile = open(webqtlConfig.GENERATED_TEXT_DIR+db_filename,'r') + + print("Invoking parallel computing") + input_line_list = datasetFile.readlines() + print("Read lines from the file") + all_line_number = len(input_line_list) - self.record_count = len(traits) #ZS: This isn't a good way to get this value, so I need to change it later + step = 1000 + job_number = math.ceil( float(all_line_number)/step ) - #XZ, 3/31/2010: Theoretically, we should create one function 'comTissueCorr' - #to compare each trait by their tissue corr p values. - #But because the tissue corr p values are generated by permutation test, - #the top ones always have p value 0. So comparing p values actually does nothing. - #In addition, for the tissue data in our database, the N is always the same. - #So it's safe to compare with tissue corr statistic value. - #That's the same as literature corr. - #if self.method in [METHOD_LIT, METHOD_TISSUE_PEARSON, METHOD_TISSUE_RANK] and self.gene_id: - # traits.sort(webqtlUtil.cmpLitCorr) - #else: - #if self.method in TISSUE_METHODS: - # sort(traits, key=lambda A: math.fabs(A.tissue_corr)) - #elif self.method == METHOD_LIT: - # traits.sort(traits, key=lambda A: math.fabs(A.lit_corr)) - #else: - traits = sortTraitCorrelations(traits, self.method) - - # Strip to the top N correlations - traits = traits[:min(self.returnNumber, len(traits))] + print("JOB NUMBER", job_number) + + job_input_lists = [] - addLiteratureCorr = False - addTissueCorr = False + print("Configuring jobs") - trait_list = [] - for trait in traits: - db_trait = webqtlTrait(db=self.db, name=trait.name, cursor=self.cursor) - db_trait.retrieveInfo( QTL='Yes' ) + for job_index in range( int(job_number) ): + starti = job_index*step + endi = min((job_index+1)*step, all_line_number) - db_trait.Name = trait.name - db_trait.corr = trait.correlation - db_trait.nOverlap = trait.overlap - db_trait.corrPValue = trait.p_value + one_job_input_list = [] - # NL, 07/19/2010 - # js function changed, add a new parameter rankOrder for js function 'showTissueCorrPlot' - db_trait.RANK_ORDER = self.RANK_ORDERS[self.method] + for i in range( starti, endi ): + one_job_input_list.append( input_line_list[i] ) - #XZ, 26/09/2008: Method is 4 or 5. Have fetched tissue corr, but no literature correlation yet. - if self.method in TISSUE_METHODS: - db_trait.tissueCorr = trait.tissue_corr - db_trait.tissuePValue = trait.p_tissue - addTissueCorr = True + job_input_lists.append( one_job_input_list ) + print("Creating pp servers") - #XZ, 26/09/2008: Method is 3, Have fetched literature corr, but no tissue corr yet. - elif self.method == METHOD_LIT: - db_trait.LCorr = trait.lit_corr - db_trait.mouse_geneid = self.translateToMouseGeneID(self.species, db_trait.geneid) - addLiteratureCorr = True + ppservers = () + # Creates jobserver with automatically detected number of workers + job_server = pp.Server(ppservers=ppservers) - #XZ, 26/09/2008: Method is 1 or 2. Have NOT fetched literature corr and tissue corr yet. - # Phenotype data will not have geneid, and neither will some probes - # we need to handle this because we will get an attribute error - else: - if self.input_trait_mouse_gene_id and self.db.type=="ProbeSet": - addLiteratureCorr = True - if self.trait_symbol and self.db.type=="ProbeSet": - addTissueCorr = True + print("Done creating servers") - trait_list.append(db_trait) + jobs = [] + results = [] - if addLiteratureCorr: - trait_list = self.getLiteratureCorrelationByList(self.input_trait_mouse_gene_id, - self.species, trait_list) - if addTissueCorr: - trait_list = self.getTissueCorrelationByList( - primaryTraitSymbol = self.trait_symbol, - traitList = trait_list, - TissueProbeSetFreezeId = TISSUE_MOUSE_DB, - method=self.method) + print("Starting parallel computation, submitting jobs") + for one_job_input_list in job_input_lists: #pay attention to modules from outside + jobs.append( job_server.submit(func=compute_corr, args=(num_overlap, self.this_trait_vals, one_job_input_list, self.corr_method), depfuncs=(), modules=("webqtlUtil",)) ) + print("Done submitting jobs") - return trait_list - """ + for one_job in jobs: + one_result = one_job() + self.correlation_data.update(one_result) + # one_result = one_job() + # results.append( one_result ) + #print("CORRELATION DATA:", self.correlation_data) + + # print("Acquiring results") + # for one_result in results: + # for one_traitinfo in one_result: + # allcorrelations.append( one_traitinfo ) diff --git a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py index 6bc0ef77..f74e655d 100755 --- a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py +++ b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py @@ -43,7 +43,6 @@ from pprint import pformat as pf from htmlgen import HTMLgen2 as HT import reaper -from base import webqtlConfig from utility.THCell import THCell from utility.TDCell import TDCell from base.trait import GeneralTrait diff --git a/wqflask/wqflask/ctl/__init__.py b/wqflask/wqflask/ctl/__init__.py new file mode 100755 index 00000000..e69de29b --- /dev/null +++ b/wqflask/wqflask/ctl/__init__.py diff --git a/wqflask/wqflask/ctl/ctl_analysis.py b/wqflask/wqflask/ctl/ctl_analysis.py new file mode 100644 index 00000000..7a42b2f8 --- /dev/null +++ b/wqflask/wqflask/ctl/ctl_analysis.py @@ -0,0 +1,194 @@ +# CTL analysis for GN2 +# Author / Maintainer: Danny Arends <Danny.Arends@gmail.com> +import sys +from numpy import * +import scipy as sp # SciPy +import rpy2.robjects as ro # R Objects +import rpy2.rinterface as ri + +from base.webqtlConfig import GENERATED_IMAGE_DIR +from utility import webqtlUtil # Random number for the image +from utility import genofile_parser # genofile_parser + +import base64 +import array +import csv +import itertools + +from base import data_set +from base import trait as TRAIT + +from utility import helper_functions +from utility.tools import locate + +from rpy2.robjects.packages import importr +utils = importr("utils") + +## Get pointers to some common R functions +r_library = ro.r["library"] # Map the library function +r_options = ro.r["options"] # Map the options function +r_read_csv = ro.r["read.csv"] # Map the read.csv function +r_dim = ro.r["dim"] # Map the dim function +r_c = ro.r["c"] # Map the c function +r_t = ro.r["t"] # Map the t function +r_cat = ro.r["cat"] # Map the cat function +r_paste = ro.r["paste"] # Map the paste function +r_unlist = ro.r["unlist"] # Map the unlist function +r_head = ro.r["head"] # Map the unlist function +r_unique = ro.r["unique"] # Map the unique function +r_length = ro.r["length"] # Map the length function +r_unlist = ro.r["unlist"] # Map the unlist function +r_list = ro.r.list # Map the list function +r_matrix = ro.r.matrix # Map the matrix function +r_seq = ro.r["seq"] # Map the seq function +r_table = ro.r["table"] # Map the table function +r_names = ro.r["names"] # Map the names function +r_sink = ro.r["sink"] # Map the sink function +r_is_NA = ro.r["is.na"] # Map the is.na function +r_file = ro.r["file"] # Map the file function +r_png = ro.r["png"] # Map the png function for plotting +r_dev_off = ro.r["dev.off"] # Map the dev.off function +r_save_image = ro.r["save.image"] # Map the save.image function +r_class = ro.r["class"] # Map the class function +r_save = ro.r["save"] # Map the save function +r_write_table = ro.r["write.table"] # Map the write.table function +r_read_table = ro.r["read.table"] # Map the read.table function +r_as_data_frame = ro.r["as.data.frame"] # Map the write.table function +r_data_frame = ro.r["data.frame"] # Map the write.table function +r_as_numeric = ro.r["as.numeric"] # Map the write.table function + +class CTL(object): + def __init__(self): + print("Initialization of CTL") + #log = r_file("/tmp/genenetwork_ctl.log", open = "wt") + #r_sink(log) # Uncomment the r_sink() commands to log output from stdout/stderr to a file + #r_sink(log, type = "message") + r_library("ctl") # Load CTL - Should only be done once, since it is quite expensive + r_options(stringsAsFactors = False) + print("Initialization of CTL done, package loaded in R session") + self.r_CTLscan = ro.r["CTLscan"] # Map the CTLscan function + self.r_CTLsignificant = ro.r["CTLsignificant"] # Map the CTLsignificant function + self.r_lineplot = ro.r["ctl.lineplot"] # Map the ctl.lineplot function + self.r_CTLsignificant = ro.r["CTLsignificant"] # Map the CTLsignificant function + self.r_CTLnetwork = ro.r["CTLnetwork"] # Map the CTLnetwork function + self.r_CTLprofiles = ro.r["CTLprofiles"] # Map the CTLprofiles function + self.r_plotCTLobject = ro.r["plot.CTLobject"] # Map the CTLsignificant function + print("Obtained pointers to CTL functions") + + def run_analysis(self, requestform): + print("Starting CTL analysis on dataset") + self.trait_db_list = [trait.strip() for trait in requestform['trait_list'].split(',')] + self.trait_db_list = [x for x in self.trait_db_list if x] + + print("strategy:", requestform.get("strategy")) + strategy = requestform.get("strategy") + + print("nperm:", requestform.get("nperm")) + nperm = int(requestform.get("nperm")) + + print("parametric:", requestform.get("parametric")) + parametric = bool(requestform.get("parametric")) + + print("significance:", requestform.get("significance")) + significance = float(requestform.get("significance")) + + # Get the name of the .geno file belonging to the first phenotype + datasetname = self.trait_db_list[0].split(":")[1] + dataset = data_set.create_dataset(datasetname) + + genofilelocation = locate(dataset.group.name + ".geno", "genotype") + parser = genofile_parser.ConvertGenoFile(genofilelocation) + parser.process_csv() + + # Create a genotype matrix + individuals = parser.individuals + markers = [] + markernames = [] + for marker in parser.markers: + markernames.append(marker["name"]) + markers.append(marker["genotypes"]) + + genotypes = list(itertools.chain(*markers)) + print(len(genotypes) / len(individuals), "==", len(parser.markers)) + + rGeno = r_t(ro.r.matrix(r_unlist(genotypes), nrow=len(markernames), ncol=len(individuals), dimnames = r_list(markernames, individuals), byrow=True)) + + # Create a phenotype matrix + traits = [] + for trait in self.trait_db_list: + print("retrieving data for", trait) + if trait != "": + ts = trait.split(':') + gt = TRAIT.GeneralTrait(name = ts[0], dataset_name = ts[1]) + gt.retrieve_sample_data(individuals) + for ind in individuals: + if ind in gt.data.keys(): + traits.append(gt.data[ind].value) + else: + traits.append("-999") + + rPheno = r_t(ro.r.matrix(r_as_numeric(r_unlist(traits)), nrow=len(self.trait_db_list), ncol=len(individuals), dimnames = r_list(self.trait_db_list, individuals), byrow=True)) + + # Use a data frame to store the objects + rPheno = r_data_frame(rPheno) + rGeno = r_data_frame(rGeno) + + # Debug: Print the genotype and phenotype files to disk + #r_write_table(rGeno, "~/outputGN/geno.csv") + #r_write_table(rPheno, "~/outputGN/pheno.csv") + + # Perform the CTL scan + res = self.r_CTLscan(rGeno, rPheno, strategy = strategy, nperm = nperm, parametric = parametric, ncores = 6) + + # Get significant interactions + significant = self.r_CTLsignificant(res, significance = significance) + + # Create an image for output + self.results = {} + self.results['imgurl1'] = webqtlUtil.genRandStr("CTLline_") + ".png" + self.results['imgloc1'] = GENERATED_IMAGE_DIR + self.results['imgurl1'] + + self.results['ctlresult'] = significant + self.results['requestform'] = requestform # Store the user specified parameters for the output page + + # Create the lineplot + r_png(self.results['imgloc1'], width=1000, height=600, type='cairo-png') + self.r_lineplot(res, significance = significance) + r_dev_off() + + n = 2 + for trait in self.trait_db_list: + # Create the QTL like CTL plots + self.results['imgurl' + str(n)] = webqtlUtil.genRandStr("CTL_") + ".png" + self.results['imgloc' + str(n)] = GENERATED_IMAGE_DIR + self.results['imgurl' + str(n)] + r_png(self.results['imgloc' + str(n)], width=1000, height=600, type='cairo-png') + self.r_plotCTLobject(res, (n-1), significance = significance, main='Phenotype ' + trait) + r_dev_off() + n = n + 1 + + # Flush any output from R + sys.stdout.flush() + + def loadImage(self, path, name): + print("pre-loading imgage results:", self.results[path]) + imgfile = open(self.results[path], 'rb') + imgdata = imgfile.read() + imgB64 = imgdata.encode("base64") + bytesarray = array.array('B', imgB64) + self.results[name] = bytesarray + + def render_image(self, results): + self.loadImage("imgloc1", "imgdata1") + n = 2 + for trait in self.trait_db_list: + self.loadImage("imgloc" + str(n), "imgdata" + str(n)) + n = n + 1 + + def process_results(self, results): + print("Processing CTL output") + template_vars = {} + template_vars["results"] = self.results + self.render_image(self.results) + sys.stdout.flush() + return(dict(template_vars)) + diff --git a/wqflask/wqflask/database.py b/wqflask/wqflask/database.py index 159c5d6c..2f544d44 100755 --- a/wqflask/wqflask/database.py +++ b/wqflask/wqflask/database.py @@ -24,8 +24,9 @@ def init_db(): # you will have to import them first before calling init_db() #import yourapplication.models import wqflask.model - print("Creating all..") + print("database.py: Creating all model metadata..") Base.metadata.create_all(bind=engine) - print("Done creating all...") + print("database.py: Done creating all model metadata...") + print("Point your browser at http://localhost:5003/") init_db() diff --git a/wqflask/wqflask/do_search.py b/wqflask/wqflask/do_search.py index a6f9c949..0e2dd27a 100755 --- a/wqflask/wqflask/do_search.py +++ b/wqflask/wqflask/do_search.py @@ -171,6 +171,7 @@ class MrnaAssaySearch(DoSearch): WHERE %s and ProbeSet.Id = ProbeSetXRef.ProbeSetId and ProbeSetXRef.ProbeSetFreezeId = %s + ORDER BY ProbeSet.symbol ASC """ % (escape(from_clause), where_clause, escape(str(self.dataset.id)))) @@ -192,6 +193,7 @@ class MrnaAssaySearch(DoSearch): WHERE %s and ProbeSet.Id = ProbeSetXRef.ProbeSetId and ProbeSetXRef.ProbeSetFreezeId = %s + ORDER BY ProbeSet.symbol ASC """ % (escape(from_clause), where_clause, escape(str(self.dataset.id)))) @@ -205,7 +207,7 @@ class MrnaAssaySearch(DoSearch): print("Running ProbeSetSearch") where_clause = self.get_where_clause() - query = self.base_query + "WHERE " + where_clause + query = self.base_query + "WHERE " + where_clause + "ORDER BY ProbeSet.symbol ASC" #print("final query is:", pf(query)) diff --git a/wqflask/wqflask/gsearch.py b/wqflask/wqflask/gsearch.py index cb42980c..4cd3874c 100755..100644 --- a/wqflask/wqflask/gsearch.py +++ b/wqflask/wqflask/gsearch.py @@ -5,88 +5,90 @@ from base.data_set import create_dataset from base.trait import GeneralTrait from dbFunction import webqtlDatabaseFunction +from utility.benchmark import Bench + class GSearch(object): - def __init__(self, kw): - self.type = kw['type'] - self.terms = kw['terms'] - if self.type == "gene": - sql = """ - SELECT - Species.`Name` AS species_name, - InbredSet.`Name` AS inbredset_name, - Tissue.`Name` AS tissue_name, - ProbeSetFreeze.Name AS probesetfreeze_name, - ProbeSet.Name AS probeset_name, - ProbeSet.Symbol AS probeset_symbol, - ProbeSet.`description` AS probeset_description, - ProbeSet.Chr AS chr, - ProbeSet.Mb AS mb, - ProbeSetXRef.Mean AS mean, - ProbeSetXRef.LRS AS lrs, - ProbeSetXRef.`Locus` AS locus, - ProbeSetXRef.`pValue` AS pvalue, - ProbeSetXRef.`additive` AS additive - FROM Species, InbredSet, ProbeSetXRef, ProbeSet, ProbeFreeze, ProbeSetFreeze, Tissue - WHERE InbredSet.`SpeciesId`=Species.`Id` - AND ProbeFreeze.InbredSetId=InbredSet.`Id` - AND ProbeFreeze.`TissueId`=Tissue.`Id` - AND ProbeSetFreeze.ProbeFreezeId=ProbeFreeze.Id - AND ( MATCH (ProbeSet.Name,ProbeSet.description,ProbeSet.symbol,alias,GenbankId, UniGeneId, Probe_Target_Description) AGAINST ('%s' IN BOOLEAN MODE) ) - AND ProbeSet.Id = ProbeSetXRef.ProbeSetId - AND ProbeSetXRef.ProbeSetFreezeId=ProbeSetFreeze.Id - AND ProbeSetFreeze.public > 0 - ORDER BY species_name, inbredset_name, tissue_name, probesetfreeze_name, probeset_name - LIMIT 5000 - """ % (self.terms) - re = g.db.execute(sql).fetchall() - self.trait_list = [] - for line in re: - dataset = create_dataset(line[3], "ProbeSet") - trait_id = line[4] - this_trait = GeneralTrait(dataset=dataset, name=trait_id, get_qtl_info=True) - self.trait_list.append(this_trait) - species = webqtlDatabaseFunction.retrieve_species(dataset.group.name) - dataset.get_trait_info([this_trait], species) + def __init__(self, kw): + self.type = kw['type'] + self.terms = kw['terms'] + if self.type == "gene": + sql = """ + SELECT + Species.`Name` AS species_name, + InbredSet.`Name` AS inbredset_name, + Tissue.`Name` AS tissue_name, + ProbeSetFreeze.Name AS probesetfreeze_name, + ProbeSet.Name AS probeset_name, + ProbeSet.Symbol AS probeset_symbol, + ProbeSet.`description` AS probeset_description, + ProbeSet.Chr AS chr, + ProbeSet.Mb AS mb, + ProbeSetXRef.Mean AS mean, + ProbeSetXRef.LRS AS lrs, + ProbeSetXRef.`Locus` AS locus, + ProbeSetXRef.`pValue` AS pvalue, + ProbeSetXRef.`additive` AS additive + FROM Species, InbredSet, ProbeSetXRef, ProbeSet, ProbeFreeze, ProbeSetFreeze, Tissue + WHERE InbredSet.`SpeciesId`=Species.`Id` + AND ProbeFreeze.InbredSetId=InbredSet.`Id` + AND ProbeFreeze.`TissueId`=Tissue.`Id` + AND ProbeSetFreeze.ProbeFreezeId=ProbeFreeze.Id + AND ( MATCH (ProbeSet.Name,ProbeSet.description,ProbeSet.symbol,alias,GenbankId, UniGeneId, Probe_Target_Description) AGAINST ('%s' IN BOOLEAN MODE) ) + AND ProbeSet.Id = ProbeSetXRef.ProbeSetId + AND ProbeSetXRef.ProbeSetFreezeId=ProbeSetFreeze.Id + AND ProbeSetFreeze.public > 0 + ORDER BY species_name, inbredset_name, tissue_name, probesetfreeze_name, probeset_name + LIMIT 6000 + """ % (self.terms) + with Bench("Running query"): + re = g.db.execute(sql).fetchall() + self.trait_list = [] + with Bench("Creating trait objects"): + for line in re: + dataset = create_dataset(line[3], "ProbeSet", get_samplelist=False) + trait_id = line[4] + #with Bench("Building trait object"): + this_trait = GeneralTrait(dataset=dataset, name=trait_id, get_qtl_info=True, get_sample_info=False) + self.trait_list.append(this_trait) - elif self.type == "phenotype": - sql = """ - SELECT - Species.`Name`, - InbredSet.`Name`, - PublishFreeze.`Name`, - PublishXRef.`Id`, - Phenotype.`Post_publication_description`, - Publication.`Authors`, - Publication.`Year`, - PublishXRef.`LRS`, - PublishXRef.`Locus`, - PublishXRef.`additive` - FROM Species,InbredSet,PublishFreeze,PublishXRef,Phenotype,Publication - WHERE PublishXRef.`InbredSetId`=InbredSet.`Id` - AND PublishFreeze.`InbredSetId`=InbredSet.`Id` - AND InbredSet.`SpeciesId`=Species.`Id` - AND PublishXRef.`PhenotypeId`=Phenotype.`Id` - AND PublishXRef.`PublicationId`=Publication.`Id` - AND (Phenotype.Post_publication_description REGEXP "[[:<:]]%s[[:>:]]" - OR Phenotype.Pre_publication_description REGEXP "[[:<:]]%s[[:>:]]" - OR Phenotype.Pre_publication_abbreviation REGEXP "[[:<:]]%s[[:>:]]" - OR Phenotype.Post_publication_abbreviation REGEXP "[[:<:]]%s[[:>:]]" - OR Phenotype.Lab_code REGEXP "[[:<:]]%s[[:>:]]" - OR Publication.PubMed_ID REGEXP "[[:<:]]%s[[:>:]]" - OR Publication.Abstract REGEXP "[[:<:]]%s[[:>:]]" - OR Publication.Title REGEXP "[[:<:]]%s[[:>:]]" - OR Publication.Authors REGEXP "[[:<:]]%s[[:>:]]" - OR PublishXRef.Id REGEXP "[[:<:]]%s[[:>:]]") - ORDER BY Species.`Name`, InbredSet.`Name`, PublishXRef.`Id` - LIMIT 5000 - """ % (self.terms, self.terms, self.terms, self.terms, self.terms, self.terms, self.terms, self.terms, self.terms, self.terms) - re = g.db.execute(sql).fetchall() - self.trait_list = [] - for line in re: - dataset = create_dataset(line[2], "Publish") - trait_id = line[3] - this_trait = GeneralTrait(dataset=dataset, name=trait_id, get_qtl_info=True) - self.trait_list.append(this_trait) - species = webqtlDatabaseFunction.retrieve_species(dataset.group.name) - dataset.get_trait_info([this_trait], species) + elif self.type == "phenotype": + sql = """ + SELECT + Species.`Name`, + InbredSet.`Name`, + PublishFreeze.`Name`, + PublishXRef.`Id`, + Phenotype.`Post_publication_description`, + Publication.`Authors`, + Publication.`Year`, + PublishXRef.`LRS`, + PublishXRef.`Locus`, + PublishXRef.`additive` + FROM Species,InbredSet,PublishFreeze,PublishXRef,Phenotype,Publication + WHERE PublishXRef.`InbredSetId`=InbredSet.`Id` + AND PublishFreeze.`InbredSetId`=InbredSet.`Id` + AND InbredSet.`SpeciesId`=Species.`Id` + AND PublishXRef.`PhenotypeId`=Phenotype.`Id` + AND PublishXRef.`PublicationId`=Publication.`Id` + AND (Phenotype.Post_publication_description REGEXP "[[:<:]]%s[[:>:]]" + OR Phenotype.Pre_publication_description REGEXP "[[:<:]]%s[[:>:]]" + OR Phenotype.Pre_publication_abbreviation REGEXP "[[:<:]]%s[[:>:]]" + OR Phenotype.Post_publication_abbreviation REGEXP "[[:<:]]%s[[:>:]]" + OR Phenotype.Lab_code REGEXP "[[:<:]]%s[[:>:]]" + OR Publication.PubMed_ID REGEXP "[[:<:]]%s[[:>:]]" + OR Publication.Abstract REGEXP "[[:<:]]%s[[:>:]]" + OR Publication.Title REGEXP "[[:<:]]%s[[:>:]]" + OR Publication.Authors REGEXP "[[:<:]]%s[[:>:]]" + OR PublishXRef.Id REGEXP "[[:<:]]%s[[:>:]]") + ORDER BY Species.`Name`, InbredSet.`Name`, PublishXRef.`Id` + LIMIT 6000 + """ % (self.terms, self.terms, self.terms, self.terms, self.terms, self.terms, self.terms, self.terms, self.terms, self.terms) + re = g.db.execute(sql).fetchall() + self.trait_list = [] + with Bench("Creating trait objects"): + for line in re: + dataset = create_dataset(line[2], "Publish") + trait_id = line[3] + this_trait = GeneralTrait(dataset=dataset, name=trait_id, get_qtl_info=True, get_sample_info=False) + self.trait_list.append(this_trait) diff --git a/wqflask/wqflask/heatmap/heatmap.py b/wqflask/wqflask/heatmap/heatmap.py index 40f518f0..19c330eb 100644 --- a/wqflask/wqflask/heatmap/heatmap.py +++ b/wqflask/wqflask/heatmap/heatmap.py @@ -26,13 +26,12 @@ import reaper from base.trait import GeneralTrait from base import data_set from base import species -from base import webqtlConfig -from utility import webqtlUtil # from wqflask.my_pylmm.pyLMM import lmm # from wqflask.my_pylmm.pyLMM import input from utility import helper_functions from utility import Plot, Bunch from utility import temp_data +from utility.tools import PYLMM_COMMAND from MySQLdb import escape_string as escape @@ -137,7 +136,7 @@ class Heatmap(object): this_trait = trait_db[0] #this_db = trait_db[1] genotype = self.dataset.group.read_genotype_file() - samples, values, variances = this_trait.export_informative() + samples, values, variances, sample_aliases = this_trait.export_informative() trimmed_samples = [] trimmed_values = [] @@ -214,7 +213,7 @@ class Heatmap(object): #Redis.expire(key, 60*60) #print("before printing command") # - #command = 'python /home/zas1024/gene/wqflask/wqflask/my_pylmm/pyLMM/lmm.py --key {} --species {}'.format(key, + #command = 'python lmm.py --key {} --species {}'.format(key, # "other") #print("command is:", command) #print("after printing command") @@ -273,7 +272,7 @@ class Heatmap(object): Redis.expire(key, 60*60) print("before printing command") - command = 'python /home/zas1024/gene/wqflask/wqflask/my_pylmm/pyLMM/lmm.py --key {} --species {}'.format(key, + command = PYLMM_COMMAND+' --key {} --species {}'.format(key, "other") print("command is:", command) print("after printing command") diff --git a/wqflask/wqflask/interval_analyst/GeneUtil.py b/wqflask/wqflask/interval_analyst/GeneUtil.py index 43008ecf..a8a48786 100755..100644 --- a/wqflask/wqflask/interval_analyst/GeneUtil.py +++ b/wqflask/wqflask/interval_analyst/GeneUtil.py @@ -1,46 +1,24 @@ -# 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 GeneNetwork Core Team 2010/10/20 +from __future__ import absolute_import, print_function, division import string +from flask import Flask, g + #Just return a list of dictionaries #each dictionary contains sub-dictionary -def loadGenes(cursor, chrName, diffCol, startMb, endMb, webqtlDb =None, species='mouse'): - #cursor.execute("desc GeneList") - #results = cursor.fetchall() - #fetchFields = map(lambda X:X[0], results) +def loadGenes(chrName, diffCol, startMb, endMb, webqtlDb =None, species='mouse'): fetchFields = ['SpeciesId', 'Id', 'GeneSymbol', 'GeneDescription', 'Chromosome', 'TxStart', 'TxEnd', 'Strand', 'GeneID', 'NM_ID', 'kgID', 'GenBankID', 'UnigenID', 'ProteinID', 'AlignID', 'exonCount', 'exonStarts', 'exonEnds', 'cdsStart', 'cdsEnd'] ##List All Species in the Gene Table speciesDict = {} - cursor.execute("select Species.Name, GeneList.SpeciesId from Species, GeneList where \ - GeneList.SpeciesId = Species.Id group by GeneList.SpeciesId") - results = cursor.fetchall() + results = g.db.execute(""" + SELECT Species.Name, GeneList.SpeciesId + FROM Species, GeneList + WHERE GeneList.SpeciesId = Species.Id + GROUP BY GeneList.SpeciesId""").fetchall() + for item in results: speciesDict[item[0]] = item[1] @@ -49,14 +27,17 @@ def loadGenes(cursor, chrName, diffCol, startMb, endMb, webqtlDb =None, species= otherSpecies = map(lambda X: [X, speciesDict[X]], speciesDict.keys()) otherSpecies.remove([species, speciesId]) - cursor.execute("""SELECT %s from GeneList - where - SpeciesId = %d AND Chromosome = '%s' AND - ((TxStart > %f and TxStart <= %f) OR (TxEnd > %f and TxEnd <= %f)) - order by txStart - """ - % (string.join(fetchFields, ", "), speciesId, chrName, startMb, endMb, startMb, endMb)) - results = cursor.fetchall() + results = g.db.execute(""" + SELECT %s FROM GeneList + WHERE SpeciesId = %d AND + Chromosome = '%s' AND + ((TxStart > %f and TxStart <= %f) OR (TxEnd > %f and TxEnd <= %f)) + ORDER BY txStart + """ % (string.join(fetchFields, ", "), + speciesId, chrName, + startMb, endMb, + startMb, endMb)).fetchall() + GeneList = [] if results: @@ -66,14 +47,13 @@ def loadGenes(cursor, chrName, diffCol, startMb, endMb, webqtlDb =None, species= newdict[item] = result[j] #count SNPs if possible if diffCol and species=='mouse': - cursor.execute(""" - select - count(*) from BXDSnpPosition - where - Chr = '%s' AND Mb >= %2.6f AND Mb < %2.6f AND - StrainId1 = %d AND StrainId2 = %d - """ % (chrName, newdict["TxStart"], newdict["TxEnd"], diffCol[0], diffCol[1])) - newdict["snpCount"] = cursor.fetchone()[0] + newdict["snpCount"] = g.db.execute(""" + SELECT count(*) + FROM BXDSnpPosition + WHERE Chr = '%s' AND + Mb >= %2.6f AND Mb < %2.6f AND + StrainId1 = %d AND StrainId2 = %d + """ % (chrName, newdict["TxStart"], newdict["TxEnd"], diffCol[0], diffCol[1])).fetchone()[0] newdict["snpDensity"] = newdict["snpCount"]/(newdict["TxEnd"]-newdict["TxStart"])/1000.0 else: newdict["snpDensity"] = newdict["snpCount"] = 0 @@ -88,24 +68,24 @@ def loadGenes(cursor, chrName, diffCol, startMb, endMb, webqtlDb =None, species= othSpec, othSpecId = item newdict2 = {} - cursor.execute("SELECT %s from GeneList where SpeciesId = %d and geneSymbol= '%s' limit 1" % - (string.join(fetchFields, ", "), othSpecId, newdict["GeneSymbol"])) - resultsOther = cursor.fetchone() + resultsOther = g.db.execute("SELECT %s FROM GeneList WHERE SpeciesId = %d AND geneSymbol= '%s' LIMIT 1" % (string.join(fetchFields, ", "), + othSpecId, + newdict["GeneSymbol"])).fetchone() + if resultsOther: for j, item in enumerate(fetchFields): newdict2[item] = resultsOther[j] #count SNPs if possible, could be a separate function if diffCol and othSpec == 'mouse': - cursor.execute(""" - select - count(*) from BXDSnpPosition - where - Chr = '%s' AND Mb >= %2.6f AND Mb < %2.6f AND - StrainId1 = %d AND StrainId2 = %d - """ % (chrName, newdict["TxStart"], newdict["TxEnd"], diffCol[0], diffCol[1])) + newdict2["snpCount"] = g.db.execute(""" + SELECT count(*) + FROM BXDSnpPosition + WHERE Chr = '%s' AND + Mb >= %2.6f AND Mb < %2.6f AND + StrainId1 = %d AND StrainId2 = %d + """ % (chrName, newdict["TxStart"], newdict["TxEnd"], diffCol[0], diffCol[1])).fetchone()[0] - newdict2["snpCount"] = cursor.fetchone()[0] newdict2["snpDensity"] = newdict2["snpCount"]/(newdict2["TxEnd"]-newdict2["TxStart"])/1000.0 else: newdict2["snpDensity"] = newdict2["snpCount"] = 0 diff --git a/wqflask/wqflask/interval_analyst/IntervalAnalystPage.py b/wqflask/wqflask/interval_analyst/IntervalAnalystPage.py index ec9aa29c..f45ec0c4 100755 --- a/wqflask/wqflask/interval_analyst/IntervalAnalystPage.py +++ b/wqflask/wqflask/interval_analyst/IntervalAnalystPage.py @@ -45,40 +45,40 @@ class IntervalAnalystPage(templatePage): #A dictionary that lets us map the html form names "txStart_mm6" -> "Mb Start (mm8)" #the first item is the short name (column headers) and the second item is the long name (dropdown list) # [short name, long name, category] - columnNames = {"GeneSymbol" : ["Gene", "Gene Name", 'gene'], + columnNames = {"GeneSymbol" : ["Gene", "Gene Name", 'gene'], "GeneDescription" : ["Description", "Gene Description", 'species'], - 'GeneNeighborsCount' : ["Neighbors", "Gene Neighbors", 'gene'], - 'GeneNeighborsRange' : ["Neighborhood", "Gene Neighborhood (Mb)", 'gene'], - 'GeneNeighborsDensity' : ["Gene Density", "Gene Density (Neighbors/Mb)", 'gene'], + 'GeneNeighborsCount' : ["Neighbors", "Gene Neighbors", 'gene'], + 'GeneNeighborsRange' : ["Neighborhood", "Gene Neighborhood (Mb)", 'gene'], + 'GeneNeighborsDensity' : ["Gene Density", "Gene Density (Neighbors/Mb)", 'gene'], "ProteinID" : ["Prot ID", "Protein ID", 'protein'], - "Chromosome" : ["Chr", "Chromosome", 'species'], - "TxStart" : ["Start", "Mb Start", 'species'], - "TxEnd" : ["End", "Mb End", 'species'], - "GeneLength" : ["Length", "Kb Length", 'species'], - "cdsStart" : ["CDS Start", "Mb CDS Start", 'species'], + "Chromosome" : ["Chr", "Chromosome", 'species'], + "TxStart" : ["Start", "Mb Start", 'species'], + "TxEnd" : ["End", "Mb End", 'species'], + "GeneLength" : ["Length", "Kb Length", 'species'], + "cdsStart" : ["CDS Start", "Mb CDS Start", 'species'], "cdsEnd" : ["CDS End", "Mb CDS End", 'species'], - "exonCount" : ["Num Exons", "Exon Count", 'species'], - "exonStarts" : ["Exon Starts", "Exon Starts", 'species'], - "exonEnds" : ["Exon Ends", "Exon Ends", 'species'], - "Strand" : ["Strand", "Strand", 'species'], + "exonCount" : ["Num Exons", "Exon Count", 'species'], + "exonStarts" : ["Exon Starts", "Exon Starts", 'species'], + "exonEnds" : ["Exon Ends", "Exon Ends", 'species'], + "Strand" : ["Strand", "Strand", 'species'], "GeneID" : ["Gene ID", "Gene ID", 'species'], - "GenBankID" : ["GenBank", "GenBank ID", 'species'], + "GenBankID" : ["GenBank", "GenBank ID", 'species'], "UnigenID" : ["Unigen", "Unigen ID", 'species'], - "NM_ID" : ["NM ID", "NM ID", 'species'], + "NM_ID" : ["NM ID", "NM ID", 'species'], "kgID" : ["kg ID", "kg ID", 'species'], - "snpCount" : ["SNPs", "SNP Count", 'species'], - "snpDensity" : ["SNP Density", "SNP Density", 'species'], - "lrs" : ["LRS", "Likelihood Ratio Statistic", 'misc'], - "lod" : ["LOD", "Likelihood Odds Ratio", 'misc'], - "pearson" : ["Pearson", "Pearson Product Moment", 'misc'], - "literature" : ["Lit Corr", "Literature Correlation", 'misc'], + "snpCount" : ["SNPs", "SNP Count", 'species'], + "snpDensity" : ["SNP Density", "SNP Density", 'species'], + "lrs" : ["LRS", "Likelihood Ratio Statistic", 'misc'], + "lod" : ["LOD", "Likelihood Odds Ratio", 'misc'], + "pearson" : ["Pearson", "Pearson Product Moment", 'misc'], + "literature" : ["Lit Corr", "Literature Correlation", 'misc'], } ###Species Freeze speciesFreeze = {'mouse':'mm9', 'rat':'rn3', 'human':'hg19'} for key in speciesFreeze.keys(): speciesFreeze[speciesFreeze[key]] = key - + def __init__(self, fd): templatePage.__init__(self, fd) @@ -86,7 +86,7 @@ class IntervalAnalystPage(templatePage): fd.formdata['remote_ip'] = fd.remote_ip if not self.openMysql(): return - + self.species = fd.formdata.getvalue("species", "mouse") try: self.startMb = float(fd.formdata.getvalue("startMb")) @@ -96,7 +96,7 @@ class IntervalAnalystPage(templatePage): self.endMb = float(fd.formdata.getvalue("endMb")) except: self.endMb = self.startMb + 10 - + self.Chr = fd.formdata.getvalue("chromosome", "1") self.xls = fd.formdata.getvalue("xls", "1") try: @@ -107,38 +107,38 @@ class IntervalAnalystPage(templatePage): self.diffColDefault = self.diffCol = [] if self.species != 'mouse': self.diffColDefault = [2, 3]#default is B6 and D2 for other species - + controlFrm, dispFields = self.genControlForm(fd) geneTable, filename = self.genGeneTable(fd, dispFields) - + infoTD = HT.TD(width=400, valign= "top") - infoTD.append(HT.Paragraph("Interval Analyst : Chr %s" % self.Chr, Class="title"), - HT.Strong("Species : "), self.species.title(), HT.BR(), - HT.Strong("Database : "), "UCSC %s" % self.speciesFreeze[self.species], HT.BR(), - HT.Strong("Range : "), "%2.6f Mb - %2.6f Mb" % (self.startMb, self.endMb), HT.BR(), + infoTD.append(HT.Paragraph("Interval Analyst : Chr %s" % self.Chr, Class="title"), + HT.Strong("Species : "), self.species.title(), HT.BR(), + HT.Strong("Database : "), "UCSC %s" % self.speciesFreeze[self.species], HT.BR(), + HT.Strong("Range : "), "%2.6f Mb - %2.6f Mb" % (self.startMb, self.endMb), HT.BR(), ) if filename: infoTD.append(HT.BR(), HT.BR(), HT.Href(text="Download", url = "/tmp/" + filename, Class="normalsize") , " output in MS excel format.") - + mainTable = HT.TableLite(HT.TR(infoTD, HT.TD(controlFrm, Class="doubleBorder", width=400), HT.TD(" ", width="")), cellpadding=10) mainTable.append(HT.TR(HT.TD(geneTable, colspan=3))) self.dict['body'] = HT.TD(mainTable) self.dict['title'] = "Interval Analyst" - + def genGeneTable(self, fd, dispFields): filename = "" if self.xls: #import pyXLWriter as xl filename = "IntAn_Chr%s_%2.6f-%2.6f" % (self.Chr, self.startMb, self.endMb) filename += ".xls" - + # Create a new Excel workbook workbook = xl.Writer(os.path.join(webqtlConfig.TMPDIR, filename)) worksheet = workbook.add_worksheet() titleStyle = workbook.add_format(align = 'left', bold = 0, size=18, border = 1, border_color="gray") headingStyle = workbook.add_format(align = 'center', bold = 1, size=13, fg_color = 0x1E, color="white", border = 1, border_color="gray") - + ##Write title Info worksheet.write([0, 0], "GeneNetwork Interval Analyst Table", titleStyle) worksheet.write([1, 0], "%s%s" % (webqtlConfig.PORTADDR, os.path.join(webqtlConfig.CGIDIR, self._scriptfile))) @@ -148,12 +148,12 @@ class IntervalAnalystPage(templatePage): worksheet.write([4, 0], "Search by : %s" % fd.formdata['remote_ip']) worksheet.write([5, 0], "view region : Chr %s %2.6f - %2.6f Mb" % (self.Chr, self.startMb, self.endMb)) nTitleRow = 7 - + geneTable = HT.TableLite(Class="collap", cellpadding=5) headerRow = HT.TR(HT.TD(" ", Class="fs13 fwb ffl b1 cw cbrb", width="1")) if self.xls: worksheet.write([nTitleRow, 0], "Index", headingStyle) - + for ncol, column in enumerate(dispFields): if len(column) == 1: headerRow.append(HT.TD(self.columnNames[column[0]][0], Class="fs13 fwb ffl b1 cw cbrb", NOWRAP=1,align="Center")) @@ -162,24 +162,24 @@ class IntervalAnalystPage(templatePage): worksheet.write([nTitleRow, ncol+1], colTitle, headingStyle) worksheet.set_column([ncol+1, ncol+1], 2*len(colTitle)) else: - headerRow.append(HT.TD(self.columnNames[column[0]][0], HT.BR(), " (%s)" % self.speciesFreeze[column[1]], + headerRow.append(HT.TD(self.columnNames[column[0]][0], HT.BR(), " (%s)" % self.speciesFreeze[column[1]], Class="fs13 fwb ffl b1 cw cbrb", NOWRAP=1, align="Center")) if self.xls: colTitle = self.columnNames[column[0]][0] + " (%s)" % self.speciesFreeze[column[1]] worksheet.write([nTitleRow, ncol+1], colTitle, headingStyle) worksheet.set_column([ncol+1, ncol+1], 2*len(colTitle)) - #headerRow.append(HT.TD(self.columnNames[column[0]][0], HT.BR(), - # "(%s %s)" % (column[1].title(), self.speciesFreeze[column[1]]), + #headerRow.append(HT.TD(self.columnNames[column[0]][0], HT.BR(), + # "(%s %s)" % (column[1].title(), self.speciesFreeze[column[1]]), # Class="colorBlue", NOWRAP=1, align="Center")) geneTable.append(headerRow) - + geneCol = GeneUtil.loadGenes(self.cursor, self.Chr, self.diffColDefault, self.startMb, self.endMb, species=self.species) for gIndex, theGO in enumerate(geneCol): geneRow = HT.TR(HT.TD(gIndex+1, Class="fs12 fwn b1", align="right")) if self.xls: nTitleRow += 1 worksheet.write([nTitleRow, 0], gIndex + 1) - + for ncol, column in enumerate(dispFields): if len(column) == 1 or column[1]== self.species: keyValue = "" @@ -196,17 +196,17 @@ class IntervalAnalystPage(templatePage): curGO = theGO[subGO] if theGO[subGO].has_key(fieldName): keyValue = theGO[subGO][fieldName] - + if self.xls: worksheet.write([nTitleRow, ncol+1], keyValue) geneRow.append(self.formatTD(keyValue, fieldName, curSpecies, curGO)) - + geneTable.append(geneRow) - + if self.xls: workbook.close() return geneTable, filename - + def formatTD(self, keyValue, fieldName, Species, theGO): if keyValue is None: keyValue = "" @@ -219,7 +219,7 @@ class IntervalAnalystPage(templatePage): keyValue = "" return HT.TD(keyValue, Class="fs12 fwn b1", width=300) elif fieldName in ("GeneSymbol"): - webqtlLink = HT.Href("./%s?cmd=sch&gene=%s&alias=1&species=%s" % (webqtlConfig.SCRIPTFILE, keyValue, Species), + webqtlLink = HT.Href("./%s?cmd=sch&gene=%s&alias=1&species=%s" % (webqtlConfig.SCRIPTFILE, keyValue, Species), HT.Image("/images/webqtl_search.gif", border=0, valign="top"), target="_blank") if theGO['GeneID']: geneSymbolLink = HT.Href(webqtlConfig.NCBI_LOCUSID % theGO['GeneID'], keyValue, Class="normalsize", target="_blank") @@ -236,8 +236,8 @@ class IntervalAnalystPage(templatePage): return HT.TD(keyValue, Class="fs12 fwn b1",align="right") elif fieldName in ("snpCount"): if keyValue: - snpString = HT.Href(url="%s&chr=%s&start=%s&end=%s&geneName=%s&s1=%d&s2=%d" % (os.path.join(webqtlConfig.CGIDIR, 'main.py?FormID=snpBrowser'), - theGO["Chromosome"], theGO["TxStart"], theGO["TxEnd"], theGO["GeneSymbol"], self.diffColDefault[0], self.diffColDefault[1]), + snpString = HT.Href(url="%s&chr=%s&start=%s&end=%s&geneName=%s&s1=%d&s2=%d" % (os.path.join(webqtlConfig.CGIDIR, 'main.py?FormID=snpBrowser'), + theGO["Chromosome"], theGO["TxStart"], theGO["TxEnd"], theGO["GeneSymbol"], self.diffColDefault[0], self.diffColDefault[1]), text=theGO["snpCount"], target="_blank", Class="normalsize") else: snpString = keyValue @@ -252,13 +252,13 @@ class IntervalAnalystPage(templatePage): return HT.TD(keyValue, Class="fs12 fwn b1",NOWRAP=1) else: return HT.TD(keyValue, Class="fs12 fwn b1",NOWRAP=1,align="right") - + def genControlForm(self, fd): ##desc GeneList self.cursor.execute("Desc GeneList") GeneListFields = self.cursor.fetchall() GeneListFields = map(lambda X: X[0], GeneListFields) - + #group columns by category--used for creating the dropdown list of possible columns categories = {} for item in self.columnNames.keys(): @@ -267,7 +267,7 @@ class IntervalAnalystPage(templatePage): categories[category[-1]] = [item ] else: categories[category[-1]] = categories[category[-1]]+[item] - + ##List All Species in the Gene Table speciesDict = {} self.cursor.execute("select Species.Name, GeneList.SpeciesId from Species, GeneList where \ @@ -292,34 +292,34 @@ class IntervalAnalystPage(templatePage): pass AppliedField.append(item2) categories[specName] = AppliedField - + categoriesOrder += ['misc'] - + ############################################################ ## Create the list of possible columns for the dropdown list ############################################################ allColumnsList = HT.Select(name="allColumns", Class="snpBrowserDropBox") - + for category in categoriesOrder: allFields = categories[category] if allFields: geneOpt = HT.Optgroup(label=category.title()) for item in allFields: if category in self.speciesFreeze.keys(): - geneOpt.append(("%s (%s %s)" % (self.columnNames[item][1], category.title(), self.speciesFreeze[category]), + geneOpt.append(("%s (%s %s)" % (self.columnNames[item][1], category.title(), self.speciesFreeze[category]), "%s__%s" % (item, self.speciesFreeze[category]))) else: geneOpt.append((self.columnNames[item][1], item)) geneOpt.sort() allColumnsList.append(geneOpt) - + ###################################### ## Create the list of selected columns ###################################### - + #cols contains the value of all the selected columns submitCols = cols = fd.formdata.getvalue("columns", "default") - + if cols == "default": if self.species=="mouse": #these are the same columns that are shown on intervalPage.py cols = ['GeneSymbol', 'GeneDescription', 'Chromosome', 'TxStart', 'Strand', 'GeneLength', 'GeneID', 'NM_ID', 'snpCount', 'snpDensity'] @@ -331,12 +331,12 @@ class IntervalAnalystPage(templatePage): else: if type(cols)==type(""): cols = [cols] - + colsLst = [] dispFields = [] for column in cols: if submitCols == "default" and column not in ('GeneSymbol') and (column in GeneListFields or column in speciesField): - colsLst.append(("%s (%s %s)" % (self.columnNames[column][1], self.species.title(), self.speciesFreeze[self.species]), + colsLst.append(("%s (%s %s)" % (self.columnNames[column][1], self.species.title(), self.speciesFreeze[self.species]), "%s__%s" % (column, self.speciesFreeze[self.species]))) dispFields.append([column, self.species]) else: @@ -346,17 +346,17 @@ class IntervalAnalystPage(templatePage): dispFields.append([column]) else: thisSpecies = self.speciesFreeze[column2[1]] - colsLst.append(("%s (%s %s)" % (self.columnNames[column2[0]][1], thisSpecies.title(), column2[1]), + colsLst.append(("%s (%s %s)" % (self.columnNames[column2[0]][1], thisSpecies.title(), column2[1]), column)) dispFields.append((column2[0], thisSpecies)) selectedColumnsList = HT.Select(name="columns", Class="snpBrowserSelectBox", multiple="true", data=colsLst, size=6) - + ########################## ## Create the columns form - ########################## + ########################## columnsForm = HT.Form(name="columnsForm", submit=HT.Input(type='hidden'), cgi=os.path.join(webqtlConfig.CGIDIR, self._scriptfile), enctype="multipart/form-data") columnsForm.append(HT.Input(type="hidden", name="fromdatabase", value= fd.formdata.getvalue("fromdatabase", "unknown"))) - columnsForm.append(HT.Input(type="hidden", name="species", value=self.species)) + columnsForm.append(HT.Input(type="hidden", name="species", value=self.species)) if self.diffCol: columnsForm.append(HT.Input(type="hidden", name="s1", value=self.diffCol[0])) columnsForm.append(HT.Input(type="hidden", name="s2", value=self.diffCol[1])) @@ -366,8 +366,8 @@ class IntervalAnalystPage(templatePage): removeButton = HT.Input(type="button", name="remove", value="Remove", Class="button", onClick="removeFromList(this.form.columns.selectedIndex, this.form.columns)") upButton = HT.Input(type="button", name="up", value="Up", Class="button", onClick="swapOptions(this.form.columns.selectedIndex, this.form.columns.selectedIndex-1, this.form.columns)") downButton = HT.Input(type="button", name="down", value="Down", Class="button", onClick="swapOptions(this.form.columns.selectedIndex, this.form.columns.selectedIndex+1, this.form.columns)") - clearButton = HT.Input(type="button", name="clear", value="Clear", Class="button", onClick="deleteAllElements(this.form.columns)") - submitButton = HT.Input(type="submit", value="Refresh", Class="button", onClick="selectAllElements(this.form.columns)") + clearButton = HT.Input(type="button", name="clear", value="Clear", Class="button", onClick="deleteAllElements(this.form.columns)") + submitButton = HT.Input(type="submit", value="Refresh", Class="button", onClick="selectAllElements(this.form.columns)") selectChrBox = HT.Select(name="chromosome") self.cursor.execute(""" @@ -375,11 +375,11 @@ class IntervalAnalystPage(templatePage): Chr_Length.Name, Length from Chr_Length, Species where Chr_Length.SpeciesId = Species.Id AND - Species.Name = '%s' + Species.Name = '%s' Order by Chr_Length.OrderId """ % self.species) - + results = self.cursor.fetchall() for chrInfo in results: selectChrBox.append((chrInfo[0], chrInfo[0])) @@ -401,5 +401,5 @@ class IntervalAnalystPage(templatePage): #columnsForm.append(HT.Input(type="hidden", name="sort", value=diffCol), # HT.Input(type="hidden", name="identification", value=identification), # HT.Input(type="hidden", name="traitInfo", value=traitInfo)) - + return columnsForm, dispFields diff --git a/wqflask/wqflask/marker_regression/MarkerRegressionPage.py b/wqflask/wqflask/marker_regression/MarkerRegressionPage.py index d02d80b3..4c3391e5 100755 --- a/wqflask/wqflask/marker_regression/MarkerRegressionPage.py +++ b/wqflask/wqflask/marker_regression/MarkerRegressionPage.py @@ -72,7 +72,7 @@ class MarkerRegressionPage(templatePage): #automatically generate pheno txt file for PLINK self.genPhenoTxtFileForPlink(phenoFileName=plinkOutputFileName,RISetName=fd.RISet,probesetName=probesetName, valueDict=allTraitValueDict) # os.system full path is required for input and output files; specify missing value is -9999 - plink_command = '%splink/plink --noweb --ped %splink/%s.ped --no-fid --no-parents --no-sex --no-pheno --map %splink/%s.map --pheno %s/%s.txt --pheno-name %s --missing-phenotype -9999 --out %s%s --assoc ' % (webqtlConfig.HTMLPATH, webqtlConfig.HTMLPATH, fd.RISet, webqtlConfig.HTMLPATH, fd.RISet, webqtlConfig.TMPDIR, plinkOutputFileName, probesetName, webqtlConfig.TMPDIR, plinkOutputFileName) + plink_command = '%splink/plink --noweb --ped %splink/%s.ped --no-fid --no-parents --no-sex --no-pheno --map %splink/%s.map --pheno %s/%s.txt --pheno-name %s --missing-phenotype -9999 --out %s%s --assoc ' % (webqtlConfig.GENODIR, webqtlConfig.GENODIR, fd.RISet, webqtlConfig.GENODIR, fd.RISet, webqtlConfig.TMPDIR, plinkOutputFileName, probesetName, webqtlConfig.TMPDIR, plinkOutputFileName) os.system(plink_command) @@ -140,7 +140,7 @@ class MarkerRegressionPage(templatePage): intCanvas = pid.PILCanvas(size=(self.graphWidth,self.graphHeight)) gifmap = self.plotIntMappingForPLINK(fd, intCanvas, startMb = self.startMb, endMb = self.endMb, plinkResultDict=plinkResultDict) - intCanvas.save(os.path.join(webqtlConfig.IMGDIR, filename), format='png') + intCanvas.save(os.path.join(webqtlConfig.GENERATED_IMAGE_DIR, filename), format='png') intImg=HT.Image('/image/'+filename+'.png', border=0, usemap='#WebQTLImageMap') TD_LR = HT.TR(HT.TD(HT.Blockquote(gifmap,intImg, HT.P()), bgColor='#eeeeee', height = 200)) @@ -249,7 +249,7 @@ class MarkerRegressionPage(templatePage): intCanvas = pid.PILCanvas(size=(self.graphWidth,self.graphHeight)) gifmap = self.plotIntMapping(fd, intCanvas, startMb = self.startMb, endMb = self.endMb, showLocusForm= "") filename= webqtlUtil.genRandStr("Itvl_") - intCanvas.save(os.path.join(webqtlConfig.IMGDIR, filename), format='png') + intCanvas.save(os.path.join(webqtlConfig.GENERATED_IMAGE_DIR, filename), format='png') intImg=HT.Image('/image/'+filename+'.png', border=0, usemap='#WebQTLImageMap') ################################################################ @@ -458,7 +458,7 @@ class MarkerRegressionPage(templatePage): #plotBar(myCanvas,10,10,390,290,LRSArray,XLabel='LRS',YLabel='Frequency',title=' Histogram of Permutation Test',identification=fd.identification) Plot.plotBar(myCanvas, LRSArray,XLabel='LRS',YLabel='Frequency',title=' Histogram of Permutation Test') filename= webqtlUtil.genRandStr("Reg_") - myCanvas.save(webqtlConfig.IMGDIR+filename, format='gif') + myCanvas.save(webqtlConfig.GENERATED_IMAGE_DIR+filename, format='gif') img=HT.Image('/image/'+filename+'.gif',border=0,alt='Histogram of Permutation Test') if fd.suggestive == None: @@ -1597,7 +1597,7 @@ class MarkerRegressionPage(templatePage): # get strain name from ped file in order def getStrainNameFromPedFile(self, RISetName=''): - pedFileopen= open("%splink/%s.ped"%(webqtlConfig.HTMLPATH, RISetName),"r") + pedFileopen= open("%splink/%s.ped"%(webqtlConfig.GENODIR, RISetName),"r") line =pedFileopen.readline() strainNameList=[] diff --git a/wqflask/wqflask/marker_regression/gemma_mapping.py b/wqflask/wqflask/marker_regression/gemma_mapping.py index 997b692d..caea5802 100644 --- a/wqflask/wqflask/marker_regression/gemma_mapping.py +++ b/wqflask/wqflask/marker_regression/gemma_mapping.py @@ -1,9 +1,7 @@ import os from base import webqtlConfig -from utility.tools import gemma_command - -GEMMA_PATH,GEMMA_COMMAND = gemma_command() +from utility.tools import GEMMA_COMMAND def run_gemma(this_dataset, samples, vals): """Generates p-values for each marker using GEMMA""" @@ -12,8 +10,11 @@ def run_gemma(this_dataset, samples, vals): gen_pheno_txt_file(this_dataset, samples, vals) - os.chdir(GEMMA_PATH) + # Don't do this! + # os.chdir("{}gemma".format(webqtlConfig.GENODIR)) + # use GEMMA_RUN in the next one, create a unique temp file + gemma_command = GEMMA_COMMAND + ' -bfile %s/%s -k %s/output/%s.cXX.txt -lmm 1 -o %s_output' % (GEMMA_PATH, this_dataset.group.name, GEMMA_PATH, @@ -45,5 +46,5 @@ def parse_gemma_output(this_dataset): included_markers.append(line.split("\t")[1]) p_values.append(float(line.split("\t")[10])) - print("p_values: ", p_values) - return included_markers, p_values
\ No newline at end of file + #print("p_values: ", p_values) + return included_markers, p_values diff --git a/wqflask/wqflask/marker_regression/marker_regression.py b/wqflask/wqflask/marker_regression/marker_regression.py index 5377201b..26da95b9 100755..100644 --- a/wqflask/wqflask/marker_regression/marker_regression.py +++ b/wqflask/wqflask/marker_regression/marker_regression.py @@ -18,6 +18,7 @@ import numpy as np from scipy import linalg import cPickle as pickle +import itertools import simplejson as json @@ -29,21 +30,16 @@ from flask import Flask, g from base.trait import GeneralTrait from base import data_set from base import species -from base import webqtlConfig from utility import webqtlUtil -#from wqflask.marker_regression import qtl_reaper_mapping -#from wqflask.marker_regression import plink_mapping -from wqflask.marker_regression import gemma_mapping -#from wqflask.marker_regression import rqtl_mapping from utility import helper_functions from utility import Plot, Bunch from utility import temp_data from utility.benchmark import Bench -from utility.tools import pylmm_command, plink_command, gemma_command +from wqflask.marker_regression import gemma_mapping -PYLMM_PATH,PYLMM_COMMAND = pylmm_command() -PLINK_PATH,PLINK_COMMAND = plink_command() -GEMMA_PATH,GEMMA_COMMAND = gemma_command() +from utility.tools import locate, locate_ignore_error, PYLMM_COMMAND, GEMMA_COMMAND, PLINK_COMMAND, TEMPDIR +from utility.external import shell +from base.webqtlConfig import TMPDIR, GENERATED_TEXT_DIR class MarkerRegression(object): @@ -60,14 +56,24 @@ class MarkerRegression(object): self.samples = [] # Want only ones with values self.vals = [] - + + #for sample in self.this_trait.data.keys(): for sample in self.dataset.group.samplelist: - value = start_vars['value:' + sample] - self.samples.append(str(sample)) - self.vals.append(value) + in_trait_data = False + for item in self.this_trait.data: + if self.this_trait.data[item].name2 == sample: + value = start_vars['value:' + self.this_trait.data[item].name] + self.samples.append(self.this_trait.data[item].name) + self.vals.append(value) + in_trait_data = True + break + if not in_trait_data: + value = start_vars['value:' + sample] + self.samples.append(sample) + self.vals.append(value) self.mapping_method = start_vars['method'] - if start_vars['manhattan_plot'] == "true": + if start_vars['manhattan_plot'] == "True": self.manhattan_plot = True else: self.manhattan_plot = False @@ -79,54 +85,120 @@ class MarkerRegression(object): self.score_type = "LRS" #ZS: LRS or LOD self.mapping_scale = "physic" self.num_perm = 0 - + self.perm_output = [] + self.bootstrap_results = [] + #ZS: This is passed to GN1 code for single chr mapping - self.selected_chr = -1 + self.selected_chr = -1 if "selected_chr" in start_vars: - self.selected_chr = int(start_vars['selected_chr']) + if int(start_vars['selected_chr']) != -1: #ZS: Needs to be -1 if showing full map; there's probably a better way to fix this + self.selected_chr = int(start_vars['selected_chr']) + 1 + else: + self.selected_chr = int(start_vars['selected_chr']) + if "startMb" in start_vars: + self.startMb = start_vars['startMb'] + if "endMb" in start_vars: + self.endMb = start_vars['endMb'] + if "graphWidth" in start_vars: + self.graphWidth = start_vars['graphWidth'] + if "lrsMax" in start_vars: + self.lrsMax = start_vars['lrsMax'] + if "haplotypeAnalystCheck" in start_vars: + self.haplotypeAnalystCheck = start_vars['haplotypeAnalystCheck'] + if "startMb" in start_vars: #ZS: This is to ensure showGenes, Legend, etc are checked the first time you open the mapping page, since startMb will only not be set during the first load + if "permCheck" in start_vars: + self.permCheck = "ON" + else: + self.permCheck = False + self.num_perm = int(start_vars['num_perm']) + + self.LRSCheck = start_vars['LRSCheck'] + + if "showSNP" in start_vars: + self.showSNP = start_vars['showSNP'] + else: + self.showSNP = False + + if "showGenes" in start_vars: + self.showGenes = start_vars['showGenes'] + else: + self.showGenes = False + + if "viewLegend" in start_vars: + self.viewLegend = start_vars['viewLegend'] + else: + self.viewLegend = False + else: + try: + if int(start_vars['num_perm']) > 0: + self.num_perm = int(start_vars['num_perm']) + except: + self.num_perm = 0 + + self.LRSCheck = self.score_type + if self.num_perm > 0: + self.permCheck = "ON" + else: + self.permCheck = False + self.showSNP = "ON" + self.showGenes = "ON" + self.viewLegend = "ON" self.dataset.group.get_markers() if self.mapping_method == "gemma": - self.score_type = "LRS" - included_markers, p_values = gemma_mapping.run_gemma(self.dataset, self.samples, self.vals) - self.dataset.group.get_specified_markers(markers = included_markers) - self.dataset.group.markers.add_pvalues(p_values) - results = self.dataset.group.markers.markers + self.score_type = "LOD" + self.manhattan_plot = True + with Bench("Running GEMMA"): + included_markers, p_values = gemma_mapping.run_gemma(self.dataset, self.samples, self.vals) + with Bench("Getting markers from csv"): + marker_obs = get_markers_from_csv(included_markers, p_values, self.dataset.group.name) + results = marker_obs elif self.mapping_method == "rqtl_plink": results = self.run_rqtl_plink() elif self.mapping_method == "rqtl_geno": self.score_type = "LOD" self.mapping_scale = "morgan" - if start_vars['num_perm'] == "": - self.num_perm = 0 - else: - self.num_perm = start_vars['num_perm'] - self.control = start_vars['control_marker'] + self.control_marker = start_vars['control_marker'] self.do_control = start_vars['do_control'] self.method = start_vars['mapmethod_rqtl_geno'] self.model = start_vars['mapmodel_rqtl_geno'] - if start_vars['pair_scan'] == "true": self.pair_scan = True - results = self.run_rqtl_geno() - elif self.mapping_method == "reaper": - if start_vars['num_perm'] == "": - self.num_perm = 0 + elif self.mapping_method == "reaper": + if "startMb" in start_vars: #ZS: Check if first time page loaded, so it can default to ON + if "additiveCheck" in start_vars: + self.additiveCheck = start_vars['additiveCheck'] + else: + self.additiveCheck = False + + if "bootCheck" in start_vars: + self.bootCheck = "ON" + else: + self.bootCheck = False + self.num_bootstrap = int(start_vars['num_bootstrap']) else: - self.num_perm = int(start_vars['num_perm']) - self.additive = False - self.control = start_vars['control_marker'] + self.additiveCheck = "ON" + try: + if int(start_vars['num_bootstrap']) > 0: + self.bootCheck = "ON" + self.num_bootstrap = int(start_vars['num_bootstrap']) + else: + self.bootCheck = False + self.num_bootstrap = 0 + except: + self.bootCheck = False + self.num_bootstrap = 0 + + self.control_marker = start_vars['control_marker'] self.do_control = start_vars['do_control'] results = self.gen_reaper_results() elif self.mapping_method == "plink": results = self.run_plink() elif self.mapping_method == "pylmm": print("RUNNING PYLMM") - self.num_perm = start_vars['num_perm'] - if self.num_perm != "": - if int(self.num_perm) > 0: - self.run_permutations(str(temp_uuid)) + if self.num_perm > 0: + self.run_permutations(str(temp_uuid)) results = self.gen_data(str(temp_uuid)) else: print("RUNNING NOTHING") @@ -141,6 +213,9 @@ class MarkerRegression(object): if 'lod_score' in marker.keys(): self.qtl_results.append(marker) + + self.trimmed_markers = results + for qtl in enumerate(self.qtl_results): self.json_data['chr1'].append(str(qtl['chr1'])) self.json_data['chr2'].append(str(qtl['chr2'])) @@ -154,7 +229,7 @@ class MarkerRegression(object): maf = self.maf, manhattan_plot = self.manhattan_plot, mapping_scale = self.mapping_scale, - qtl_results = self.qtl_results, + qtl_results = self.qtl_results ) else: @@ -168,6 +243,8 @@ class MarkerRegression(object): if ('lod_score' in marker.keys()) or ('lrs_value' in marker.keys()): self.qtl_results.append(marker) + self.trimmed_markers = trim_markers_for_table(results) + self.json_data['chr'] = [] self.json_data['pos'] = [] self.json_data['lod.hk'] = [] @@ -181,7 +258,7 @@ class MarkerRegression(object): #if index<40: # print("lod score is:", qtl['lod_score']) if qtl['chr'] == highest_chr and highest_chr != "X" and highest_chr != "X/Y": - print("changing to X") + #print("changing to X") self.json_data['chr'].append("X") else: self.json_data['chr'].append(str(qtl['chr'])) @@ -212,6 +289,8 @@ class MarkerRegression(object): mapping_scale = self.mapping_scale, chromosomes = chromosome_mb_lengths, qtl_results = self.qtl_results, + num_perm = self.num_perm, + perm_results = self.perm_output, ) @@ -226,29 +305,21 @@ class MarkerRegression(object): self.dataset.group.name, self.dataset.group.name, self.dataset.group.name) - print("gemma_command:" + gemma_command) + #print("gemma_command:" + gemma_command) os.system(gemma_command) included_markers, p_values = self.parse_gemma_output() self.dataset.group.get_specified_markers(markers = included_markers) - - #for marker in self.dataset.group.markers.markers: - # if marker['name'] not in included_markers: - # print("marker:", marker) - # self.dataset.group.markers.markers.remove(marker) - # #del self.dataset.group.markers.markers[marker] - self.dataset.group.markers.add_pvalues(p_values) - return self.dataset.group.markers.markers - def parse_gemma_output(self): included_markers = [] p_values = [] - with open("/home/zas1024/gene/web/gemma/output/{}_output.assoc.txt".format(self.dataset.group.name)) as output_file: + # Use a temporary file name here! + with open(webqtlConfig.GENERATED_TEXT_DIR+"/{}_output.assoc.txt".format(self.dataset.group.name)) as output_file: for line in output_file: if line.startswith("chr"): continue @@ -261,46 +332,24 @@ class MarkerRegression(object): def gen_pheno_txt_file(self): """Generates phenotype file for GEMMA""" - - #with open("/home/zas1024/gene/web/gemma/tmp_pheno/{}.txt".format(filename), "w") as outfile: - # for sample, i in enumerate(self.samples): - # print("sample:" + str(i)) - # print("self.vals[i]:" + str(self.vals[sample])) - # outfile.write(str(i) + "\t" + str(self.vals[sample]) + "\n") - - with open("/home/zas1024/gene/web/gemma/{}.fam".format(self.dataset.group.name), "w") as outfile: + with open(webqtlConfig.GENERATED_TEXT_DIR+"{}.fam".format(self.dataset.group.name), "w") as outfile: for i, sample in enumerate(self.samples): outfile.write(str(sample) + " " + str(sample) + " 0 0 0 " + str(self.vals[i]) + "\n") - - #def gen_plink_for_gemma(self, filename): - # - # make_bed = "/home/zas1024/plink/plink --file /home/zas1024/plink/%s --noweb --no-fid --no-parents --no-sex --no-pheno --pheno %s%s.txt --out %s%s --make-bed" % (webqtlConfig.HTMLPATH, - # webqtlConfig.HTMLPATH, - # self.dataset.group.name, - # webqtlConfig.TMPDIR, - # filename, - # webqtlConfig.TMPDIR, - # filename) - # - # def run_rqtl_plink(self): - os.chdir("/home/zas1024/plink") + # os.chdir("") never do this inside a webserver!! output_filename = webqtlUtil.genRandStr("%s_%s_"%(self.dataset.group.name, self.this_trait.name)) self.gen_pheno_txt_file_plink(pheno_filename = output_filename) - rqtl_command = './plink --noweb --ped %s.ped --no-fid --no-parents --no-sex --no-pheno --map %s.map --pheno %s/%s.txt --pheno-name %s --maf %s --missing-phenotype -9999 --out %s%s --assoc ' % (self.dataset.group.name, self.dataset.group.name, webqtlConfig.TMPDIR, plink_output_filename, self.this_trait.name, self.maf, webqtlConfig.TMPDIR, plink_output_filename) + rqtl_command = './plink --noweb --ped %s.ped --no-fid --no-parents --no-sex --no-pheno --map %s.map --pheno %s/%s.txt --pheno-name %s --maf %s --missing-phenotype -9999 --out %s%s --assoc ' % (self.dataset.group.name, self.dataset.group.name, TMPDIR, plink_output_filename, self.this_trait.name, self.maf, TMPDIR, plink_output_filename) os.system(rqtl_command) count, p_values = self.parse_rqtl_output(plink_output_filename) def geno_to_rqtl_function(self): # TODO: Need to figure out why some genofiles have the wrong format and don't convert properly - print("Adding some custom helper functions to the R environment") - - ro.r(""" trim <- function( x ) { gsub("(^[[:space:]]+|[[:space:]]+$)", "", x) } @@ -332,8 +381,6 @@ class MarkerRegression(object): """ % (self.dataset.group.name + ".geno")) def run_rqtl_geno(self): - print("Calling R/qtl") - self.geno_to_rqtl_function() ## Get pointers to some common R functions @@ -342,7 +389,7 @@ class MarkerRegression(object): r_sum = ro.r["sum"] # Map the sum function plot = ro.r["plot"] # Map the plot function postscript = ro.r["postscript"] # Map the postscript function - png = ro.r["png"] # Map the png function + png = ro.r["png"] # Map the png function dev_off = ro.r["dev.off"] # Map the device off function print(r_library("qtl")) # Load R/qtl @@ -353,12 +400,13 @@ class MarkerRegression(object): calc_genoprob = ro.r["calc.genoprob"] # Map the calc.genoprob function read_cross = ro.r["read.cross"] # Map the read.cross function write_cross = ro.r["write.cross"] # Map the write.cross function - GENOtoCSVR = ro.r["GENOtoCSVR"] # Map the GENOtoCSVR function + GENOtoCSVR = ro.r["GENOtoCSVR"] # Map the local GENOtoCSVR function - genofilelocation = webqtlConfig.HTMLPATH + "genotypes/" + self.dataset.group.name + ".geno" - crossfilelocation = webqtlConfig.HTMLPATH + "genotypes/" + self.dataset.group.name + ".cross" + crossname = self.dataset.group.name + genofilelocation = locate(crossname + ".geno", "genotype") + crossfilelocation = TMPDIR + crossname + ".cross" - print("Conversion of geno to cross at location:", genofilelocation, " to ", crossfilelocation) + #print("Conversion of geno to cross at location:", genofilelocation, " to ", crossfilelocation) cross_object = GENOtoCSVR(genofilelocation, crossfilelocation) # TODO: Add the SEX if that is available @@ -380,10 +428,10 @@ class MarkerRegression(object): else: print("No covariates"); result_data_frame = scantwo(cross_object, pheno = "the_pheno", model=self.model, method=self.method, n_cluster = 16) - print("Pair scan results:", result_data_frame) + #print("Pair scan results:", result_data_frame) self.pair_scan_filename = webqtlUtil.genRandStr("scantwo_") + ".png" - png(file=webqtlConfig.TMPDIR+self.pair_scan_filename) + png(file=TEMPDIR+self.pair_scan_filename) plot(result_data_frame) dev_off() @@ -395,11 +443,11 @@ class MarkerRegression(object): else: print("No covariates"); result_data_frame = scanone(cross_object, pheno = "the_pheno", model=self.model, method=self.method) - if int(self.num_perm) > 0: # Do permutation (if requested by user) + if self.num_perm > 0 and self.permCheck == "ON": # Do permutation (if requested by user) if self.do_control == "true": - perm_data_frame = scanone(cross_object, pheno_col = "the_pheno", addcovar = covar, n_perm = int(self.num_perm), model=self.model, method=self.method) + perm_data_frame = scanone(cross_object, pheno_col = "the_pheno", addcovar = covar, n_perm = self.num_perm, model=self.model, method=self.method) else: - perm_data_frame = scanone(cross_object, pheno_col = "the_pheno", n_perm = int(self.num_perm), model=self.model, method=self.method) + perm_data_frame = scanone(cross_object, pheno_col = "the_pheno", n_perm = self.num_perm, model=self.model, method=self.method) self.process_rqtl_perm_results(perm_data_frame) # Functions that sets the thresholds for the webinterface @@ -413,15 +461,15 @@ class MarkerRegression(object): def create_covariates(self, cross): ro.globalenv["the_cross"] = cross ro.r('genotypes <- pull.geno(the_cross)') # Get the genotype matrix - userinputS = self.control.replace(" ", "").split(",") # TODO: sanitize user input, Never Ever trust a user + userinputS = self.control_marker.replace(" ", "").split(",") # TODO: sanitize user input, Never Ever trust a user covariate_names = ', '.join('"{0}"'.format(w) for w in userinputS) - print("Marker names of selected covariates:", covariate_names) + #print("Marker names of selected covariates:", covariate_names) ro.r('covnames <- c(' + covariate_names + ')') ro.r('covInGeno <- which(covnames %in% colnames(genotypes))') ro.r('covnames <- covnames[covInGeno]') ro.r("cat('covnames (purged): ', covnames,'\n')") ro.r('covariates <- genotypes[,covnames]') # Get the covariate matrix by using the marker name as index to the genotype file - print("R/qtl matrix of covariates:", ro.r["covariates"]) + #print("R/qtl matrix of covariates:", ro.r["covariates"]) return ro.r["covariates"] def sanitize_rqtl_phenotype(self): @@ -445,7 +493,7 @@ class MarkerRegression(object): result = result[1] output = [tuple([result[j][i] for j in range(result.ncol)]) for i in range(result.nrow)] - print("R/qtl scantwo output:", output) + #print("R/qtl scantwo output:", output) for i, line in enumerate(result.iter_row()): marker = {} @@ -455,7 +503,7 @@ class MarkerRegression(object): marker['chr2'] = int(output[i][2]) pair_scan_results.append(marker) - print("pair_scan_results:", pair_scan_results) + #print("pair_scan_results:", pair_scan_results) return pair_scan_results @@ -463,7 +511,7 @@ class MarkerRegression(object): qtl_results = [] output = [tuple([result[j][i] for j in range(result.ncol)]) for i in range(result.nrow)] - print("R/qtl scanone output:", output) + #print("R/qtl scanone output:", output) for i, line in enumerate(result.iter_row()): marker = {} @@ -477,10 +525,11 @@ class MarkerRegression(object): def process_rqtl_perm_results(self, results): perm_vals = [] - for line in str(results).split("\n")[1:(int(self.num_perm)+1)]: - print("R/qtl permutation line:", line.split()) + for line in str(results).split("\n")[1:(self.num_perm+1)]: + #print("R/qtl permutation line:", line.split()) perm_vals.append(float(line.split()[1])) + self.perm_output = perm_vals self.suggestive = np.percentile(np.array(perm_vals), 67) self.significant = np.percentile(np.array(perm_vals), 95) @@ -492,7 +541,7 @@ class MarkerRegression(object): self.gen_pheno_txt_file_plink(pheno_filename = plink_output_filename) - plink_command = PLINK_COMMAND + ' --noweb --ped %s/%s.ped --no-fid --no-parents --no-sex --no-pheno --map %s/%s.map --pheno %s%s.txt --pheno-name %s --maf %s --missing-phenotype -9999 --out %s%s --assoc ' % (PLINK_PATH, self.dataset.group.name, PLINK_PATH, self.dataset.group.name, webqtlConfig.TMPDIR, plink_output_filename, self.this_trait.name, self.maf, webqtlConfig.TMPDIR, plink_output_filename) + plink_command = PLINK_COMMAND + ' --noweb --ped %s/%s.ped --no-fid --no-parents --no-sex --no-pheno --map %s/%s.map --pheno %s%s.txt --pheno-name %s --maf %s --missing-phenotype -9999 --out %s%s --assoc ' % (PLINK_PATH, self.dataset.group.name, PLINK_PATH, self.dataset.group.name, TMPDIR, plink_output_filename, self.this_trait.name, self.maf, TMPDIR, plink_output_filename) print("plink_command:", plink_command) os.system(plink_command) @@ -514,7 +563,7 @@ class MarkerRegression(object): def gen_pheno_txt_file_plink(self, pheno_filename = ''): ped_sample_list = self.get_samples_from_ped_file() - output_file = open("%s%s.txt" % (webqtlConfig.TMPDIR, pheno_filename), "wb") + output_file = open("%s%s.txt" % (TMPDIR, pheno_filename), "wb") header = 'FID\tIID\t%s\n' % self.this_trait.name output_file.write(header) @@ -549,7 +598,7 @@ class MarkerRegression(object): def gen_pheno_txt_file_rqtl(self, pheno_filename = ''): ped_sample_list = self.get_samples_from_ped_file() - output_file = open("%s%s.txt" % (webqtlConfig.TMPDIR, pheno_filename), "wb") + output_file = open("%s%s.txt" % (TMPDIR, pheno_filename), "wb") header = 'FID\tIID\t%s\n' % self.this_trait.name output_file.write(header) @@ -602,41 +651,73 @@ class MarkerRegression(object): def gen_reaper_results(self): genotype = self.dataset.group.read_genotype_file() - samples, values, variances = self.this_trait.export_informative() - + if self.manhattan_plot != True: + genotype = genotype.addinterval() + + samples, values, variances, sample_aliases = self.this_trait.export_informative() + trimmed_samples = [] trimmed_values = [] for i in range(0, len(samples)): - if samples[i] in self.dataset.group.samplelist: - trimmed_samples.append(samples[i]) + if self.this_trait.data[samples[i]].name2 in self.dataset.group.samplelist: + trimmed_samples.append(sample_aliases[i]) trimmed_values.append(values[i]) + + #print("THE SAMPLES:", trimmed_samples) - self.lrs_array = genotype.permutation(strains = trimmed_samples, - trait = trimmed_values, - nperm= self.num_perm) - - self.suggestive = self.lrs_array[int(self.num_perm*0.37-1)] - self.significant = self.lrs_array[int(self.num_perm*0.95-1)] + if self.num_perm < 100: + self.suggestive = 0 + self.significant = 0 + else: + self.perm_output = genotype.permutation(strains = trimmed_samples, trait = trimmed_values, nperm=self.num_perm) + self.suggestive = self.perm_output[int(self.num_perm*0.37-1)] + self.significant = self.perm_output[int(self.num_perm*0.95-1)] + self.highly_significant = self.perm_output[int(self.num_perm*0.99-1)] + self.json_data['suggestive'] = self.suggestive self.json_data['significant'] = self.significant - print("samples:", trimmed_samples) - - if self.control != "" and self.do_control == "true": - print("CONTROL IS:", self.control) + if self.control_marker != "" and self.do_control == "true": reaper_results = genotype.regression(strains = trimmed_samples, - trait = trimmed_values, - control = str(self.control)) + trait = trimmed_values, + control = str(self.control_marker)) + if self.bootCheck: + control_geno = [] + control_geno2 = [] + _FIND = 0 + for _chr in genotype: + for _locus in _chr: + if _locus.name == self.control_marker: + control_geno2 = _locus.genotype + _FIND = 1 + break + if _FIND: + break + if control_geno2: + _prgy = list(genotype.prgy) + for _strain in trimmed_samples: + _idx = _prgy.index(_strain) + control_geno.append(control_geno2[_idx]) + + self.bootstrap_results = genotype.bootstrap(strains = trimmed_samples, + trait = trimmed_values, + control = control_geno, + nboot = self.num_bootstrap) else: reaper_results = genotype.regression(strains = trimmed_samples, - trait = trimmed_values) + trait = trimmed_values) + + if self.bootCheck: + self.bootstrap_results = genotype.bootstrap(strains = trimmed_samples, + trait = trimmed_values, + nboot = self.num_bootstrap) self.json_data['chr'] = [] self.json_data['pos'] = [] self.json_data['lod.hk'] = [] self.json_data['markernames'] = [] - if self.additive: - self.json_data['additive'] = [] + #if self.additive: + # self.json_data['additive'] = [] #Need to convert the QTL objects that qtl reaper returns into a json serializable dictionary qtl_results = [] @@ -650,8 +731,8 @@ class MarkerRegression(object): self.json_data['pos'].append(reaper_locus.Mb) self.json_data['lod.hk'].append(qtl.lrs) self.json_data['markernames'].append(reaper_locus.name) - if self.additive: - self.json_data['additive'].append(qtl.additive) + #if self.additive: + # self.json_data['additive'].append(qtl.additive) locus = {"name":reaper_locus.name, "chr":reaper_locus.chr, "cM":reaper_locus.cM, "Mb":reaper_locus.Mb} qtl = {"lrs_value": qtl.lrs, "chr":converted_chr, "Mb":reaper_locus.Mb, "cM":reaper_locus.cM, "name":reaper_locus.name, "additive":qtl.additive, "dominance":qtl.dominance} @@ -665,7 +746,7 @@ class MarkerRegression(object): threshold_p_value = 0.01 - result_fp = open("%s%s.qassoc"% (webqtlConfig.TMPDIR, output_filename), "rb") + result_fp = open("%s%s.qassoc"% (TMPDIR, output_filename), "rb") header_line = result_fp.readline()# read header line line = result_fp.readline() @@ -741,9 +822,9 @@ class MarkerRegression(object): top_lod_scores = [] - print("self.num_perm:", self.num_perm) + #print("self.num_perm:", self.num_perm) - for permutation in range(int(self.num_perm)): + for permutation in range(self.num_perm): pheno_vector = np.array([val == "x" and np.nan or float(val) for val in self.vals]) np.random.shuffle(pheno_vector) @@ -775,9 +856,7 @@ class MarkerRegression(object): Redis.expire(key, 60*60) command = PYLMM_COMMAND+' --key {} --species {}'.format(key,"other") - - os.system(command) - + shell(command) json_results = Redis.blpop("pylmm:results:" + temp_uuid, 45*60) results = json.loads(json_results[1]) @@ -788,10 +867,10 @@ class MarkerRegression(object): if p_value < lowest_p_value: lowest_p_value = p_value - print("lowest_p_value:", lowest_p_value) + #print("lowest_p_value:", lowest_p_value) top_lod_scores.append(-math.log10(lowest_p_value)) - print("top_lod_scores:", top_lod_scores) + #print("top_lod_scores:", top_lod_scores) self.suggestive = np.percentile(top_lod_scores, 67) self.significant = np.percentile(top_lod_scores, 95) @@ -852,12 +931,11 @@ class MarkerRegression(object): Redis.expire(key, 60*60) print("before printing command") - command = PYLMM_COMMAND + ' --key {} --species {}'.format(key, - "other") + command = PYLMM_COMMAND + ' --key {} --species {}'.format(key, "other") print("command is:", command) print("after printing command") - os.system(command) + shell(command) #t_stats, p_values = lmm.run(key) #lmm.run(key) @@ -894,8 +972,7 @@ class MarkerRegression(object): #def gen_human_results(self, pheno_vector, tempdata): def gen_human_results(self, pheno_vector, key, temp_uuid): - file_base = os.path.join(webqtlConfig.PYLMM_PATH, self.dataset.group.name) - print("file_base:", file_base) + file_base = locate(self.dataset.group.name,"mapping") plink_input = input.plink(file_base, type='b') input_file_name = os.path.join(webqtlConfig.SNP_PATH, self.dataset.group.name + ".snps.gz") @@ -987,7 +1064,11 @@ class MarkerRegression(object): return trimmed_genotype_data def create_snp_iterator_file(group): - plink_file_base = os.path.join(webqtlConfig.PYLMM_PATH, group) + """ + This function is only called by main below + """ + raise Exception("Paths are undefined here") + plink_file_base = os.path.join(TMPDIR, group) plink_input = input.plink(plink_file_base, type='b') data = dict(plink_input = list(plink_input), @@ -1004,12 +1085,47 @@ def create_snp_iterator_file(group): with gzip.open(snp_file_base, "wb") as fh: pickle.dump(data, fh, pickle.HIGHEST_PROTOCOL) -#if __name__ == '__main__': -# import cPickle as pickle -# import gzip -# create_snp_iterator_file("HLC") +def trim_markers_for_table(markers): + num_markers = len(markers) + + if 'lod_score' in markers[0].keys(): + sorted_markers = sorted(markers, key=lambda k: k['lod_score'], reverse=True) + else: + sorted_markers = sorted(markers, key=lambda k: k['lrs_value'], reverse=True) + + #ZS: So we end up with a list of just 200 markers + if len(sorted_markers) >= 200: + trimming_factor = 200 / len(sorted_markers) + trimmed_sorted_markers = sorted_markers[:int(len(sorted_markers) * trimming_factor)] + return trimmed_sorted_markers + else: + return sorted_markers + + +def get_markers_from_csv(included_markers, p_values, group_name): + marker_data_fh = open(os.path.join(webqtlConfig.PYLMM_PATH + group_name + '_markers.csv')) + markers = [] + for marker_name, p_value in itertools.izip(included_markers, p_values): + if not p_value or len(included_markers) < 1: + continue + for line in marker_data_fh: + splat = line.strip().split() + if splat[0] == marker_name: + marker = {} + marker['name'] = splat[0] + marker['chr'] = int(splat[1]) + marker['Mb'] = float(splat[2]) + marker['p_value'] = p_value + if math.isnan(marker['p_value']) or (marker['p_value'] <= 0): + marker['lod_score'] = 0 + marker['lrs_value'] = 0 + else: + marker['lod_score'] = -math.log10(marker['p_value']) + marker['lrs_value'] = -math.log10(marker['p_value']) * 4.61 + markers.append(marker) + break + + return markers if __name__ == '__main__': import cPickle as pickle - import gzip - create_snp_iterator_file("HLC") diff --git a/wqflask/wqflask/marker_regression/marker_regression_gn1.py b/wqflask/wqflask/marker_regression/marker_regression_gn1.py index a7b5fad3..4460c06d 100644 --- a/wqflask/wqflask/marker_regression/marker_regression_gn1.py +++ b/wqflask/wqflask/marker_regression/marker_regression_gn1.py @@ -24,7 +24,6 @@ # # Last updated by Zach 12/14/2010 - import time import string from math import * @@ -37,22 +36,13 @@ from flask import Flask, g from htmlgen import HTMLgen2 as HT - -from utility import helper_functions -from utility import Plot from base import webqtlConfig -#from intervalAnalyst import GeneUtil -#from base.webqtlTrait import webqtlTrait -#from base.templatePage import templatePage +from base.GeneralObject import GeneralObject from utility import webqtlUtil -#from utility.THCell import THCell -#from utility.TDCell import TDCell -#from dbFunction import webqtlDatabaseFunction -#from base.GeneralObject import GeneralObject - -#import logging -#logging.basicConfig(filename="/tmp/gn_leiyan.log", level=logging.INFO) -#_log = logging.getLogger("gn\web\webqtl\intervalMapping\IntervalMappingPage.py") +from utility import helper_functions +from utility import Plot +from wqflask.interval_analyst import GeneUtil +from base.webqtlConfig import TMPDIR, GENERATED_TEXT_DIR, GENERATED_IMAGE_DIR ######################################### # Inteval Mapping Plot Page @@ -122,10 +112,10 @@ class MarkerRegression(object): SIGNIFICANT_WIDTH = 5 SUGGESTIVE_WIDTH = 5 ADDITIVE_COLOR_POSITIVE = pid.green - ADDITIVE_COLOR_NEGATIVE = pid.red + ADDITIVE_COLOR_NEGATIVE = pid.orange ADDITIVE_COLOR = ADDITIVE_COLOR_POSITIVE DOMINANCE_COLOR_POSITIVE = pid.darkviolet - DOMINANCE_COLOR_NEGATIVE = pid.orange + DOMINANCE_COLOR_NEGATIVE = pid.red ## BEGIN HaplotypeAnalyst HAPLOTYPE_POSITIVE = pid.green @@ -179,14 +169,15 @@ class MarkerRegression(object): self.species = start_vars['species'] #Needing for form submission when doing single chr mapping or remapping after changing options - self.vals = start_vars['vals'] - self.mapping_method = start_vars['mapping_method'] + self.vals = start_vars['vals'] + self.mapping_method = start_vars['mapping_method'] if self.mapping_method == "rqtl_geno": self.mapmethod_rqtl_geno = start_vars['method'] self.mapmodel_rqtl_geno = start_vars['model'] self.pair_scan = start_vars['pair_scan'] self.js_data = start_vars['js_data'] + self.trimmed_markers = start_vars['trimmed_markers'] #Top markers to display in table #ZS: Think I can just get all this from dataset object now #RISet and Species @@ -203,42 +194,57 @@ class MarkerRegression(object): # #self.species = webqtlDatabaseFunction.retrieveSpecies(cursor=self.cursor, RISet=fd.RISet) - if self.dataset.species == "rat": + if self.dataset.group.species == "rat": self._ucscDb = "rn3" - elif self.dataset.species == "mouse": + elif self.dataset.group.species == "mouse": self._ucscDb = "mm9" else: self._ucscDb = "" + ##################################### # Options ##################################### #Mapping options - self.plotScale = start_vars['mapping_scale'] - #self.plotScale = fd.formdata.getvalue('scale', 'physic') - #if self.plotScale == 'physic' and not fd.genotype.Mbmap: #ZS: Not sure where "Mbmap" is stored, if at all; should be fine without this though - # self.plotScale = 'morgan' - if start_vars['num_perm'] != "": + if start_vars['mapping_scale'] != "": + self.plotScale = start_vars['mapping_scale'] + else: + self.plotScale = "physic" + + if 'permCheck' in start_vars.keys(): + self.permChecked = start_vars['permCheck'] + else: + self.permChecked = False + if start_vars['num_perm'] > 0: self.nperm = int(start_vars['num_perm']) + if self.permChecked: + self.perm_output = start_vars['perm_output'] + self.suggestive = start_vars['suggestive'] + self.significant = start_vars['significant'] else: self.nperm = 0 - if (start_vars['num_perm'] == "") or (start_vars['num_perm'] < 1): - self.permChecked = False + + if 'bootCheck' in start_vars.keys(): + self.bootChecked = start_vars['bootCheck'] + else: + self.bootChecked = False + if 'num_bootstrap' in start_vars.keys(): + self.nboot = int(start_vars['num_bootstrap']) else: - self.permChecked = True - #self.permChecked = fd.formdata.getvalue('permCheck', True) - self.bootChecked = False #ZS: For now setting to False, I'll add this option later once rest of figure works - #self.bootChecked = fd.formdata.getvalue('bootCheck', '') + self.nboot = 0 + if 'bootstrap_results' in start_vars.keys(): + self.bootResult = start_vars['bootstrap_results'] + else: + self.bootResult = [] + if 'do_control' in start_vars.keys(): self.doControl = start_vars['do_control'] else: self.doControl = "false" - if 'control' in start_vars.keys(): - self.controlLocus = start_vars['control'] + if 'control_marker' in start_vars.keys(): + self.controlLocus = start_vars['control_marker'] else: self.controlLocus = "" - - #self.controlLocus = fd.formdata.getvalue('controlLocus', '') #try: self.selectedChr = int(start_vars['selected_chr']) @@ -257,46 +263,59 @@ class MarkerRegression(object): #Darwing Options try: - if self.selectedChr > -1: - self.graphWidth = min(self.GRAPH_MAX_WIDTH, self.GRAPH_MIN_WIDTH) - else: - self.graphWidth = min(self.GRAPH_MAX_WIDTH, self.MULT_GRAPH_MIN_WIDTH) + if self.selectedChr > -1: + self.graphWidth = min(self.GRAPH_MAX_WIDTH, max(self.GRAPH_MIN_WIDTH, int(start_vars['graphWidth']))) + else: + self.graphWidth = min(self.GRAPH_MAX_WIDTH, max(self.MULT_GRAPH_MIN_WIDTH, int(start_vars['graphWidth']))) except: - if self.selectedChr > -1: - self.graphWidth = self.GRAPH_DEFAULT_WIDTH - else: - self.graphWidth = self.MULT_GRAPH_DEFAULT_WIDTH - - #try: - # if self.selectedChr > -1: - # self.graphWidth = min(self.GRAPH_MAX_WIDTH, max(self.GRAPH_MIN_WIDTH, int(fd.formdata.getvalue('graphWidth')))) - # else: - # self.graphWidth = min(self.GRAPH_MAX_WIDTH, max(self.MULT_GRAPH_MIN_WIDTH, int(fd.formdata.getvalue('graphWidth')))) - #except: - # if self.selectedChr > -1: - # self.graphWidth = self.GRAPH_DEFAULT_WIDTH - # else: - # self.graphWidth = self.MULT_GRAPH_DEFAULT_WIDTH + if self.selectedChr > -1: + self.graphWidth = self.GRAPH_DEFAULT_WIDTH + else: + self.graphWidth = self.MULT_GRAPH_DEFAULT_WIDTH ## BEGIN HaplotypeAnalyst #self.haplotypeAnalystChecked = fd.formdata.getvalue('haplotypeAnalystCheck') - self.haplotypeAnalystChecked = False + if 'haplotypeAnalystCheck' in start_vars.keys(): + self.haplotypeAnalystChecked = start_vars['haplotypeAnalystCheck'] + else: + self.haplotypeAnalystChecked = False ## END HaplotypeAnalyst - self.graphHeight = self.GRAPH_DEFAULT_HEIGHT - self.additiveChecked = False + self.manhattan_plot = start_vars['manhattan_plot'] self.dominanceChecked = False - self.LRS_LOD = start_vars['score_type'] + self.LRS_LOD = start_vars['LRSCheck'] self.cutoff = start_vars['cutoff'] - self.intervalAnalystChecked = False - self.legendChecked = False - self.geneChecked = False - self.SNPChecked = False + self.intervalAnalystChecked = True self.draw2X = False - self.lrsMax = 0 - self.startMb = -1 - self.endMb = -1 + if 'additiveCheck' in start_vars.keys(): + self.additiveChecked = start_vars['additiveCheck'] + else: + self.additiveChecked = False + if 'viewLegend' in start_vars.keys(): + self.legendChecked = start_vars['viewLegend'] + else: + self.legendChecked = False + if 'showSNP' in start_vars.keys(): + self.SNPChecked = start_vars['showSNP'] + else: + self.SNPChecked = False + if 'showGenes' in start_vars.keys(): + self.geneChecked = start_vars['showGenes'] + else: + self.geneChecked = False + try: + self.startMb = float(start_vars['startMb']) + except: + self.startMb = -1 + try: + self.endMb = float(start_vars['endMb']) + except: + self.endMb = -1 + try: + self.lrsMax = float(start_vars['lrsMax']) + except: + self.lrsMax = 0 #self.additiveChecked = fd.formdata.getvalue('additiveCheck') #self.dominanceChecked = fd.formdata.getvalue('dominanceCheck') @@ -335,7 +354,7 @@ class MarkerRegression(object): self.ChrList.append((indChr.name, i)) - + self.ChrLengthMbList = g.db.execute(""" Select Length from Chr_Length, InbredSet @@ -411,20 +430,21 @@ class MarkerRegression(object): ## BEGIN HaplotypeAnalyst ## count the amount of individuals to be plotted, and increase self.graphHeight - #if self.haplotypeAnalystChecked and self.selectedChr > -1: - # thisTrait = self.traitList[0] - # _strains, _vals, _vars = thisTrait.exportInformative() - # smd=[] - # for ii, _val in enumerate(_vals): - # temp = GeneralObject(name=_strains[ii], value=_val) - # smd.append(temp) - # bxdlist=list(self.genotype.prgy) - # for j,_geno in enumerate (self.genotype[0][1].genotype): - # for item in smd: - # if item.name == bxdlist[j]: - # self.NR_INDIVIDUALS = self.NR_INDIVIDUALS + 1 -## default: - # self.graphHeight = self.graphHeight + 2 * (self.NR_INDIVIDUALS+10) * self.EACH_GENE_HEIGHT + if self.haplotypeAnalystChecked and self.selectedChr > -1: + #thisTrait = self.traitList[0] + thisTrait = self.this_trait + _strains, _vals, _vars = thisTrait.export_informative() + smd=[] + for ii, _val in enumerate(_vals): + temp = GeneralObject(name=_strains[ii], value=_val) + smd.append(temp) + samplelist = list(self.genotype.prgy) + for j,_geno in enumerate (self.genotype[0][1].genotype): + for item in smd: + if item.name == samplelist[j]: + self.NR_INDIVIDUALS = self.NR_INDIVIDUALS + 1 +# default: + self.graphHeight = self.graphHeight + 2 * (self.NR_INDIVIDUALS+10) * self.EACH_GENE_HEIGHT ## for paper: # #self.graphHeight = self.graphHeight + 1 * self.NR_INDIVIDUALS * self.EACH_GENE_HEIGHT - 180 ## END HaplotypeAnalyst @@ -475,53 +495,45 @@ class MarkerRegression(object): ################################################################ # GeneCollection goes here ################################################################ - if self.plotScale == 'physic': + if self.plotScale == 'physic' and self.selectedChr != -1: #StartMb or EndMb if self.startMb < 0 or self.endMb < 0: self.startMb = 0 - self.endMb = self.ChrLengthMbList[self.selectedChr] + self.endMb = self.ChrLengthMbList[self.selectedChr - 1] geneTable = "" - #if self.plotScale == 'physic' and self.selectedChr > -1 and (self.intervalAnalystChecked or self.geneChecked): - # chrName = self.genotype[0].name - # # Draw the genes for this chromosome / region of this chromosome - # if self.traitList and self.traitList[0] and len(self.traitList) == 1 and self.dataset.name: - # webqtldatabase = self.dataset.name - # #webqtldatabase = self.traitList[0].db.name - # else: - # webqtldatabase = None - # - # self.geneCol = None - # - # if self.species == "mouse": - # self.geneCol = GeneUtil.loadGenes(self.cursor, chrName, self.diffCol, self.startMb, self.endMb, webqtldatabase, "mouse") - # elif self.species == "rat": - # self.geneCol = GeneUtil.loadGenes(self.cursor, chrName, self.diffCol, self.startMb, self.endMb, webqtldatabase, "rat") - # else: - # self.geneCol = None - # - # if self.geneCol and self.intervalAnalystChecked: - # ####################################################################### - # #Nick use GENEID as RefGene to get Literature Correlation Informations# - # #For Interval Mapping, Literature Correlation isn't useful, so skip it# - # #through set GENEID is None # - # ####################################################################### - # - # #GENEID = fd.formdata.getvalue('GeneId') or None - # GENEID = None - # - # geneTableContainer = HT.Div(Id="sortable") #Div to hold table - # geneTable = self.geneTable(self.geneCol,GENEID) - # geneTableContainer.append(geneTable) - # - # mainfmName = webqtlUtil.genRandStr("fm_") - # tableForm = HT.Form(cgi=os.path.join(webqtlConfig.CGIDIR, webqtlConfig.SCRIPTFILE), enctype='multipart/form-data', name=mainfmName, submit=HT.Input(type='hidden')) - # tableForm.append(HT.Input(name='FormID', value='', type='hidden')) - # tableForm.append(geneTableContainer) - # - #else: self.geneCol = None + if self.plotScale == 'physic' and self.selectedChr > -1 and (self.intervalAnalystChecked or self.geneChecked): + chrName = self.selectedChr + # Draw the genes for this chromosome / region of this chromosome + webqtldatabase = self.dataset.name + + if self.dataset.group.species == "mouse": + self.geneCol = GeneUtil.loadGenes(chrName, self.diffCol, self.startMb, self.endMb, webqtldatabase, "mouse") + elif self.dataset.group.species == "rat": + self.geneCol = GeneUtil.loadGenes(chrName, self.diffCol, self.startMb, self.endMb, webqtldatabase, "rat") + + if self.geneCol and self.intervalAnalystChecked: + ####################################################################### + #Nick use GENEID as RefGene to get Literature Correlation Informations# + #For Interval Mapping, Literature Correlation isn't useful, so skip it# + #through set GENEID is None # + ####################################################################### + + #GENEID = fd.formdata.getvalue('GeneId') or None + GENEID = None + + geneTableContainer = HT.Div(Id="sortable") #Div to hold table + self.geneTable(self.geneCol, GENEID) + #geneTable = self.geneTable(self.geneCol, GENEID) + #geneTableContainer.append(geneTable) + + #mainfmName = webqtlUtil.genRandStr("fm_") + #tableForm = HT.Form(cgi=os.path.join(webqtlConfig.CGIDIR, webqtlConfig.SCRIPTFILE), enctype='multipart/form-data', name=mainfmName, submit=HT.Input(type='hidden')) + #tableForm.append(HT.Input(name='FormID', value='', type='hidden')) + #tableForm.append(geneTableContainer) + ################################################################ # Plots goes here @@ -530,23 +542,23 @@ class MarkerRegression(object): # showLocusForm = webqtlUtil.genRandStr("fm_") #else: showLocusForm = "" - intCanvas = pid.PILCanvas(size=(self.graphWidth,self.graphHeight)) - gifmap = self.plotIntMapping(intCanvas, startMb = self.startMb, endMb = self.endMb, showLocusForm= showLocusForm) + intCanvas = pid.PILCanvas(size=(self.graphWidth, self.graphHeight)) + gifmap = self.plotIntMapping(intCanvas, startMb = self.startMb, endMb = self.endMb, showLocusForm= showLocusForm) self.gifmap = gifmap.__str__() #print("GIFMAP:", gifmap.__str__()) self.filename= webqtlUtil.genRandStr("Itvl_") - intCanvas.save(os.path.join(webqtlConfig.IMGDIR, self.filename), format='jpeg') + intCanvas.save(os.path.join(webqtlConfig.GENERATED_IMAGE_DIR, self.filename), format='jpeg') intImg=HT.Image('/image/'+self.filename+'.png', border=0, usemap='#WebQTLImageMap') #Scales plot differently for high resolution if self.draw2X: intCanvasX2 = pid.PILCanvas(size=(self.graphWidth*2,self.graphHeight*2)) gifmapX2 = self.plotIntMapping(intCanvasX2, startMb = self.startMb, endMb = self.endMb, showLocusForm= showLocusForm, zoom=2) - intCanvasX2.save(os.path.join(webqtlConfig.IMGDIR, self.filename+"X2"), format='png') + intCanvasX2.save(os.path.join(webqtlConfig.GENERATED_IMAGE_DIR, self.filename+"X2"), format='png') #DLintImgX2=HT.Href(text='Download',url = '/image/'+self.filename+'X2.png', Class='smallsize', target='_blank') - + #textUrl = self.writeQTL2Text(fd, self.filename) ################################################################ @@ -576,28 +588,28 @@ class MarkerRegression(object): showLocusForm.append(intImg) else: showLocusForm = intImg - - if self.permChecked and not self.multipleInterval and 0<self.nperm: - perm_histogram = self.drawPermutationHistogram() - perm_text_file = self.permutationTextFile() + + if self.permChecked and self.nperm > 0 and not self.multipleInterval and 0 < self.nperm: + self.perm_filename = self.drawPermutationHistogram() + #perm_text_file = self.permutationTextFile() ################################################################ # footnote goes here ################################################################ btminfo = HT.Paragraph(Id="smallsize") #Small('More information about this graph is available here.') - if (self.additiveChecked): - btminfo.append(HT.BR(), 'A positive additive coefficient (', HT.Font('green', color='green'), ' line) indicates that %s alleles increase trait values. In contrast, a negative additive coefficient (' % fd.ppolar, HT.Font('red', color='red'), ' line) indicates that %s alleles increase trait values.' % fd.mpolar) + #if (self.additiveChecked): + # btminfo.append(HT.BR(), 'A positive additive coefficient (', HT.Font('green', color='green'), ' line) indicates that %s alleles increase trait values. In contrast, a negative additive coefficient (' % fd.ppolar, HT.Font('red', color='red'), ' line) indicates that %s alleles increase trait values.' % fd.mpolar) if self.traitList and self.traitList[0].dataset and self.traitList[0].dataset.type == 'Geno': btminfo.append(HT.BR(), 'Mapping using genotype data as a trait will result in infinity LRS at one locus. In order to display the result properly, all LRSs higher than 100 are capped at 100.') - if self.permChecked and not self.multipleInterval and 0<self.nperm: - TD_LR = HT.TD(HT.Blockquote(gifmap, showLocusForm, HT.P(), btminfo, HT.P(), perm_histogram, HT.P(), perm_text_file), bgColor='#eeeeee', height = 200) - #TD_LR = HT.TD(HT.Blockquote(topTable), HT.Blockquote(gifmap, showLocusForm, HT.P(), btminfo, HT.P(), perm_histogram, HT.P(), perm_text_file), bgColor='#eeeeee', height = 200) - else: - TD_LR = HT.TD(HT.Blockquote(gifmap, showLocusForm, HT.P(), btminfo), bgColor='#eeeeee', height = 200) - #TD_LR = HT.TD(HT.Blockquote(topTable), HT.Blockquote(gifmap, showLocusForm, HT.P(), btminfo, HT.P(), perm_histogram, HT.P(), perm_text_file), bgColor='#eeeeee', height = 200) + #if self.permChecked and not self.multipleInterval and 0 < self.nperm: + # TD_LR = HT.TD(HT.Blockquote(gifmap, showLocusForm, HT.P(), btminfo, HT.P(), perm_histogram, HT.P(), perm_text_file), bgColor='#eeeeee', height = 200) + # #TD_LR = HT.TD(HT.Blockquote(topTable), HT.Blockquote(gifmap, showLocusForm, HT.P(), btminfo, HT.P(), perm_histogram, HT.P(), perm_text_file), bgColor='#eeeeee', height = 200) + #else: + TD_LR = HT.TD(HT.Blockquote(gifmap, showLocusForm, HT.P(), btminfo), bgColor='#eeeeee', height = 200) + #TD_LR = HT.TD(HT.Blockquote(topTable), HT.Blockquote(gifmap, showLocusForm, HT.P(), btminfo, HT.P(), perm_histogram, HT.P(), perm_text_file), bgColor='#eeeeee', height = 200) if geneTable: @@ -646,7 +658,7 @@ class MarkerRegression(object): TD_LR.append(HT.Blockquote(tableForm)) self.body = TD_LR - + #self.dict['body'] = TD_LR #self.dict['title'] = "Mapping" @@ -662,12 +674,12 @@ class MarkerRegression(object): fpText.write("Source: WebQTL, The GeneNetwork (%s)\n" % webqtlConfig.PORTADDR) # - fpText.write("Site: %s\n" % webqtlConfig.SITENAME) + fpText.write("Site: GN\n") fpText.write("Page: Map Viewer\n") fpText.write(time.strftime("Date and Time (US Center): %b %d, %Y at %I.%M %p\n", time.localtime())) fpText.write("Trait ID: %s\n" % self.this_trait.name) fpText.write("Suggestive LRS = %0.2f\n" % self.suggestive) - fpText.write("Significant LRS = %0.2f\n" % self.significance) + fpText.write("Significant LRS = %0.2f\n" % self.significant) """ if self.this_trait.symbol and self.this_trait.chr and self.this_trait.mb: writeSymbol, writeChromosome, writeMb = self.this_trait.symbol, self.this_trait.chr, self.this_trait.mb @@ -704,7 +716,7 @@ class MarkerRegression(object): else: lrs_lod = marker['lod_score'] - P_value = self.calculatePValue(lrs_lod, self.LRSArray) + P_value = self.calculatePValue(lrs_lod, self.perm_output) #if _dominance: # fpText.write("%s\t%s\t%2.3f\t%s\t%2.3f\t%2.3f\t%2.3f\t%2.3f\n" %(qtlresult.locus.chr, \ @@ -789,8 +801,8 @@ class MarkerRegression(object): plotXScale = self.drawGraphBackground(canvas, gifmap, offset=newoffset, zoom= zoom, startMb=startMb, endMb = endMb) #draw bootstap - #if self.bootChecked and not self.multipleInterval: - # self.drawBootStrapResult(canvas, fd.nboot, drawAreaHeight, plotXScale, offset=newoffset) + if self.bootChecked and not self.multipleInterval: + self.drawBootStrapResult(canvas, self.nboot, drawAreaHeight, plotXScale, offset=newoffset) # Draw clickable region and gene band if selected if self.plotScale == 'physic' and self.selectedChr > -1: @@ -812,7 +824,7 @@ class MarkerRegression(object): if self.multipleInterval: self.drawMultiTraitName(fd, canvas, gifmap, showLocusForm, offset=newoffset) elif self.legendChecked: - self.drawLegendPanel(fd, canvas, offset=newoffset, zoom = zoom) + self.drawLegendPanel(canvas, offset=newoffset, zoom = zoom) else: pass @@ -837,16 +849,30 @@ class MarkerRegression(object): BootCoord = [] i = 0 startX = xLeftOffset - for j, _chr in enumerate(self.genotype): - BootCoord.append( []) - for _locus in _chr: - if self.plotScale == 'physic': - Xc = startX + (_locus.Mb-self.startMb)*plotXScale - else: - Xc = startX + (_locus.cM-_chr[0].cM)*plotXScale - BootCoord[-1].append([Xc, self.bootResult[i]]) - i += 1 - startX += (self.ChrLengthDistList[j] + self.GraphInterval)*plotXScale + + if self.selectedChr == -1: #ZS: If viewing full genome/all chromosomes + for j, _chr in enumerate(self.genotype): + BootCoord.append( []) + for _locus in _chr: + if self.plotScale == 'physic': + Xc = startX + (_locus.Mb-self.startMb)*plotXScale + else: + Xc = startX + (_locus.cM-_chr[0].cM)*plotXScale + BootCoord[-1].append([Xc, self.bootResult[i]]) + i += 1 + startX += (self.ChrLengthDistList[j] + self.GraphInterval)*plotXScale + else: + for j, _chr in enumerate(self.genotype): + if _chr.name == self.ChrList[self.selectedChr][0]: + BootCoord.append( []) + for _locus in _chr: + if _chr.name == self.ChrList[self.selectedChr][0]: + if self.plotScale == 'physic': + Xc = startX + (_locus.Mb-self.startMb)*plotXScale + else: + Xc = startX + (_locus.cM-_chr[0].cM)*plotXScale + BootCoord[-1].append([Xc, self.bootResult[i]]) + i += 1 #reduce bootResult if self.selectedChr > -1: @@ -1018,14 +1044,14 @@ class MarkerRegression(object): SNPCounts = [] while startMb<endMb: - self.cursor.execute(""" + snp_count = g.db.execute(""" select count(*) from BXDSnpPosition where Chr = '%s' AND Mb >= %2.6f AND Mb < %2.6f AND StrainId1 = %d AND StrainId2 = %d - """ % (chrName, startMb, startMb+stepMb, strainId1, strainId2)) - SNPCounts.append(self.cursor.fetchone()[0]) + """ % (chrName, startMb, startMb+stepMb, strainId1, strainId2)).fetchone()[0] + SNPCounts.append(snp_count) startMb += stepMb if (len(SNPCounts) > 0): @@ -1070,7 +1096,7 @@ class MarkerRegression(object): gifmap.areas.append(Areas) - def drawLegendPanel(self, fd, canvas, offset= (40, 120, 80, 10), zoom = 1, locLocation= None): + def drawLegendPanel(self, canvas, offset= (40, 120, 80, 10), zoom = 1, locLocation= None): xLeftOffset, xRightOffset, yTopOffset, yBottomOffset = offset plotWidth = canvas.size[0] - xLeftOffset - xRightOffset plotHeight = canvas.size[1] - yTopOffset - yBottomOffset @@ -1079,7 +1105,6 @@ class MarkerRegression(object): if zoom == 2: fontZoom = 1.5 - labelFont=pid.Font(ttf="trebuc",size=12*fontZoom, bold=1) startPosY = 15 stepPosY = 12*fontZoom @@ -1109,7 +1134,7 @@ class MarkerRegression(object): canvas.drawLine(startPosX+54,startPosY,startPosX+67,startPosY,color=self.HAPLOTYPE_RECOMBINATION, width=4) canvas.drawString('Haplotypes (Pat, Mat, Het, Unk)',startPosX+76,startPosY+5,font=labelFont,color=pid.black) - if self.permChecked: + if self.permChecked and self.nperm > 0: startPosY += stepPosY startPosX = xLeftOffset canvas.drawLine(startPosX, startPosY, startPosX + 32, startPosY, color=self.SIGNIFICANT_COLOR, width=self.SIGNIFICANT_WIDTH) @@ -1117,24 +1142,22 @@ class MarkerRegression(object): lod = 1 if self.LRS_LOD == 'LOD': lod = self.LODFACTOR - canvas.drawString('Significant %s = %2.2f' % (self.LRS_LOD, self.significance/lod),xLeftOffset+42,startPosY +5,font=labelFont,color=pid.black) - canvas.drawString('Suggestive %s = %2.2f' % (self.LRS_LOD, self.suggestive/lod),xLeftOffset+42,startPosY + 5 +stepPosY,font=labelFont,color=pid.black) - - + canvas.drawString('Significant %s = %2.2f' % (self.LRS_LOD, self.significant),xLeftOffset+42,startPosY +5,font=labelFont,color=pid.black) + canvas.drawString('Suggestive %s = %2.2f' % (self.LRS_LOD, self.suggestive),xLeftOffset+42,startPosY + 5 +stepPosY,font=labelFont,color=pid.black) labelFont=pid.Font(ttf="verdana",size=12*fontZoom) labelColor = pid.black if self.selectedChr == -1: - string1 = 'Mapping for Dataset: %s, mapping on All Chromosomes' % fd.RISet + string1 = 'Mapping for Dataset: %s, mapping on All Chromosomes' % self.dataset.group.name else: - string1 = 'Mapping for Dataset: %s, mapping on Chromosome %s' % (fd.RISet,self.genotype[0].name) - if self.controlLocus: + string1 = 'Mapping for Dataset: %s, mapping on Chromosome %s' % (self.dataset.group.name, self.ChrList[self.selectedChr][0]) + if self.controlLocus and self.doControl != "false": string2 = 'Using %s as control' % self.controlLocus else: string2 = 'Using Haldane mapping function with no control for other QTLs' d = 4+ max(canvas.stringWidth(string1,font=labelFont),canvas.stringWidth(string2,font=labelFont)) - if fd.identification: - identification = "Trait ID: %s" % fd.identification + if self.this_trait.name: + identification = "Trait ID: %s : %s" % (self.dataset.fullname, self.this_trait.name) canvas.drawString(identification,canvas.size[0] - xRightOffset-d,20*fontZoom,font=labelFont,color=labelColor) canvas.drawString(string1,canvas.size[0] - xRightOffset-d,35*fontZoom,font=labelFont,color=labelColor) @@ -1160,7 +1183,7 @@ class MarkerRegression(object): for gIndex, theGO in enumerate(self.geneCol): geneNCBILink = 'http://www.ncbi.nlm.nih.gov/gene?term=%s' - if self.species == "mouse": + if self.dataset.group.species == "mouse": txStart = theGO["TxStart"] txEnd = theGO["TxEnd"] geneLength = (txEnd - txStart)*1000.0 @@ -1219,7 +1242,7 @@ class MarkerRegression(object): # NL: 06-02-2011 Rob required to change this link for gene related HREF=geneNCBILink %geneSymbol - elif self.species == "rat": + elif self.dataset.group.species == "rat": exonStarts = [] exonEnds = [] txStart = theGO["TxStart"] @@ -1271,7 +1294,11 @@ class MarkerRegression(object): canvas.drawLine(geneStartPix, geneYLocation + self.EACH_GENE_HEIGHT/2*zoom, geneEndPix, geneYLocation + self.EACH_GENE_HEIGHT/2*zoom, color=outlineColor, width=1) #draw the arrows - for xCoord in range(0, geneEndPix-geneStartPix): + if geneEndPix - geneStartPix < 1: + genePixRange = 1 + else: + genePixRange = int(geneEndPix - geneStartPix) + for xCoord in range(0, genePixRange): if (xCoord % self.EACH_GENE_ARROW_SPACING == 0 and xCoord + self.EACH_GENE_ARROW_SPACING < geneEndPix-geneStartPix) or xCoord == 0: if strand == "+": @@ -1351,7 +1378,6 @@ class MarkerRegression(object): if self.plotScale != 'physic' or self.selectedChr == -1 or not self.geneCol: return - fpText = open(os.path.join(webqtlConfig.TMPDIR, "hallo") + '.txt','wb') clickableRegionLabelFont=pid.Font(ttf="verdana", size=9, bold=0) @@ -1367,18 +1393,21 @@ class MarkerRegression(object): exprdrawn = 0 - thisTrait = self.traitList[0] - _strains, _vals, _vars = thisTrait.exportInformative() + #thisTrait = self.traitList[0] + thisTrait = self.this_trait + _strains, _vals, _vars = thisTrait.export_informative() smd=[] for ii, _val in enumerate(_vals): - temp = GeneralObject(name=_strains[ii], value=_val) - smd.append(temp) + if _strains[ii] in self.dataset.group.samplelist: + temp = GeneralObject(name=_strains[ii], value=_val) + smd.append(temp) + smd.sort(lambda A, B: cmp(A.value, B.value)) smd.reverse() - bxdlist=list(self.genotype.prgy) + samplelist = list(self.genotype.prgy) oldgeneEndPix = -1 #Initializing plotRight, error before @@ -1477,7 +1506,7 @@ class MarkerRegression(object): plotbxd=0 for item in smd: - if item.name == bxdlist[j]: + if item.name == samplelist[j]: plotbxd=1 if (plotbxd == 1): @@ -1485,7 +1514,7 @@ class MarkerRegression(object): counter = 0 for item in smd: counter = counter + 1 - if item.name == bxdlist[j]: + if item.name == samplelist[j]: ind = counter maxind=max(ind,maxind) @@ -1508,7 +1537,7 @@ class MarkerRegression(object): COORDS = "%d, %d, %d, %d" %(geneStartPix, geneYLocation+ind*self.EACH_GENE_HEIGHT, geneEndPix+1, (geneYLocation + ind*self.EACH_GENE_HEIGHT)) - TITLE = "Strain: %s, marker (%s) \n Position %2.3f Mb." % (bxdlist[j], self.genotype[0][i].name, float(txStart)) + TITLE = "Strain: %s, marker (%s) \n Position %2.3f Mb." % (samplelist[j], self.genotype[0][i].name, float(txStart)) HREF = '' gifmap.areas.append(HT.Area(shape='rect',coords=COORDS,href=HREF, title=TITLE)) @@ -1529,11 +1558,11 @@ class MarkerRegression(object): else: lastGene = 0 - for j,_geno in enumerate (self.genotype[0][1].genotype): + for j, _geno in enumerate (self.genotype[0][1].genotype): plotbxd=0 for item in smd: - if item.name == bxdlist[j]: + if item.name == samplelist[j]: plotbxd=1 if (plotbxd == 1): @@ -1543,12 +1572,12 @@ class MarkerRegression(object): expr = 0 for item in smd: counter = counter + 1 - if item.name == bxdlist[j]: + if item.name == samplelist[j]: ind = counter expr = item.value # Place where font is hardcoded - canvas.drawString("%s" % (bxdlist[j]), (xLeftOffset + plotWidth + 10) , geneYLocation+8+2*ind*self.EACH_GENE_HEIGHT*zoom, font=pid.Font(ttf="verdana", size=12, bold=0), color=pid.black) + canvas.drawString("%s" % (samplelist[j]), (xLeftOffset + plotWidth + 10) , geneYLocation+8+2*ind*self.EACH_GENE_HEIGHT*zoom, font=pid.Font(ttf="verdana", size=12, bold=0), color=pid.black) canvas.drawString("%2.2f" % (expr), (xLeftOffset + plotWidth + 60) , geneYLocation+8+2*ind*self.EACH_GENE_HEIGHT*zoom, font=pid.Font(ttf="verdana", size=12, bold=0), color=pid.black) fpText.close() @@ -1582,43 +1611,43 @@ class MarkerRegression(object): currentChromosome = self.genotype[0].name i = 0 - + paddingTop = yTopOffset ucscPaddingTop = paddingTop + self.WEBQTL_BAND_HEIGHT + self.BAND_SPACING ensemblPaddingTop = ucscPaddingTop + self.UCSC_BAND_HEIGHT + self.BAND_SPACING - + if zoom == 1: for pixel in range(xLeftOffset, xLeftOffset + plotWidth, pixelStep): - + calBase = self.kONE_MILLION*(startMb + (endMb-startMb)*(pixel-xLeftOffset-0.0)/plotWidth) - + xBrowse1 = pixel xBrowse2 = min(xLeftOffset + plotWidth, (pixel + pixelStep - 1)) - + WEBQTL_COORDS = "%d, %d, %d, %d" % (xBrowse1, paddingTop, xBrowse2, (paddingTop+self.WEBQTL_BAND_HEIGHT)) bandWidth = xBrowse2 - xBrowse1 - WEBQTL_HREF = "javascript:centerIntervalMapOnRange2('%s', %f, %f, document.changeViewForm)" % (currentChromosome, max(0, (calBase-webqtlZoomWidth))/1000000.0, (calBase+webqtlZoomWidth)/1000000.0) - + WEBQTL_HREF = "javascript:rangeView('%s', %f, %f)" % (self.selectedChr - 1, max(0, (calBase-webqtlZoomWidth))/1000000.0, (calBase+webqtlZoomWidth)/1000000.0) + WEBQTL_TITLE = "Click to view this section of the genome in WebQTL" gifmap.areas.append(HT.Area(shape='rect',coords=WEBQTL_COORDS,href=WEBQTL_HREF, title=WEBQTL_TITLE)) canvas.drawRect(xBrowse1, paddingTop, xBrowse2, (paddingTop + self.WEBQTL_BAND_HEIGHT), edgeColor=self.CLICKABLE_WEBQTL_REGION_COLOR, fillColor=self.CLICKABLE_WEBQTL_REGION_COLOR) canvas.drawLine(xBrowse1, paddingTop, xBrowse1, (paddingTop + self.WEBQTL_BAND_HEIGHT), color=self.CLICKABLE_WEBQTL_REGION_OUTLINE_COLOR) - + UCSC_COORDS = "%d, %d, %d, %d" %(xBrowse1, ucscPaddingTop, xBrowse2, (ucscPaddingTop+self.UCSC_BAND_HEIGHT)) - if self.species == "mouse": - UCSC_HREF = "http://genome.ucsc.edu/cgi-bin/hgTracks?db=%s&position=chr%s:%d-%d&hgt.customText=%s/snp/chr%s" % (self._ucscDb, currentChromosome, max(0, calBase-flankingWidthInBases), calBase+flankingWidthInBases, webqtlConfig.PORTADDR, currentChromosome) + if self.dataset.group.species == "mouse": + UCSC_HREF = "http://genome.ucsc.edu/cgi-bin/hgTracks?db=%s&position=chr%s:%d-%d&hgt.customText=%s/snp/chr%s" % (self._ucscDb, self.selectedChr, max(0, calBase-flankingWidthInBases), calBase+flankingWidthInBases, webqtlConfig.PORTADDR, self.selectedChr) else: - UCSC_HREF = "http://genome.ucsc.edu/cgi-bin/hgTracks?db=%s&position=chr%s:%d-%d" % (self._ucscDb, currentChromosome, max(0, calBase-flankingWidthInBases), calBase+flankingWidthInBases) + UCSC_HREF = "http://genome.ucsc.edu/cgi-bin/hgTracks?db=%s&position=chr%s:%d-%d" % (self._ucscDb, self.selectedChr, max(0, calBase-flankingWidthInBases), calBase+flankingWidthInBases) UCSC_TITLE = "Click to view this section of the genome in the UCSC Genome Browser" gifmap.areas.append(HT.Area(shape='rect',coords=UCSC_COORDS,href=UCSC_HREF, title=UCSC_TITLE)) canvas.drawRect(xBrowse1, ucscPaddingTop, xBrowse2, (ucscPaddingTop+self.UCSC_BAND_HEIGHT), edgeColor=self.CLICKABLE_UCSC_REGION_COLOR, fillColor=self.CLICKABLE_UCSC_REGION_COLOR) canvas.drawLine(xBrowse1, ucscPaddingTop, xBrowse1, (ucscPaddingTop+self.UCSC_BAND_HEIGHT), color=self.CLICKABLE_UCSC_REGION_OUTLINE_COLOR) - + ENSEMBL_COORDS = "%d, %d, %d, %d" %(xBrowse1, ensemblPaddingTop, xBrowse2, (ensemblPaddingTop+self.ENSEMBL_BAND_HEIGHT)) - if self.species == "mouse": - ENSEMBL_HREF = "http://www.ensembl.org/Mus_musculus/contigview?highlight=&chr=%s&vc_start=%d&vc_end=%d&x=35&y=12" % (currentChromosome, max(0, calBase-flankingWidthInBases), calBase+flankingWidthInBases) + if self.dataset.group.species == "mouse": + ENSEMBL_HREF = "http://www.ensembl.org/Mus_musculus/contigview?highlight=&chr=%s&vc_start=%d&vc_end=%d&x=35&y=12" % (self.selectedChr, max(0, calBase-flankingWidthInBases), calBase+flankingWidthInBases) else: - ENSEMBL_HREF = "http://www.ensembl.org/Rattus_norvegicus/contigview?chr=%s&start=%d&end=%d" % (currentChromosome, max(0, calBase-flankingWidthInBases), calBase+flankingWidthInBases) + ENSEMBL_HREF = "http://www.ensembl.org/Rattus_norvegicus/contigview?chr=%s&start=%d&end=%d" % (self.selectedChr, max(0, calBase-flankingWidthInBases), calBase+flankingWidthInBases) ENSEMBL_TITLE = "Click to view this section of the genome in the Ensembl Genome Browser" gifmap.areas.append(HT.Area(shape='rect',coords=ENSEMBL_COORDS,href=ENSEMBL_HREF, title=ENSEMBL_TITLE)) canvas.drawRect(xBrowse1, ensemblPaddingTop, xBrowse2, (ensemblPaddingTop+self.ENSEMBL_BAND_HEIGHT), edgeColor=self.CLICKABLE_ENSEMBL_REGION_COLOR, fillColor=self.CLICKABLE_ENSEMBL_REGION_COLOR) @@ -1632,8 +1661,8 @@ class MarkerRegression(object): #draw the gray text chrFont = pid.Font(ttf="verdana", size=26*zoom, bold=1) traitFont = pid.Font(ttf="verdana", size=14, bold=0) - chrX = xLeftOffset + plotWidth - 2 - canvas.stringWidth("Chr %s" % currentChromosome, font=chrFont) - canvas.drawString("Chr %s" % currentChromosome, chrX, ensemblPaddingTop-5, font=chrFont, color=pid.gray) + chrX = xLeftOffset + plotWidth - 2 - canvas.stringWidth("Chr %s" % self.ChrList[self.selectedChr][0], font=chrFont) + canvas.drawString("Chr %s" % self.ChrList[self.selectedChr][0], chrX, ensemblPaddingTop-5, font=chrFont, color=pid.gray) traitX = chrX - 28 - canvas.stringWidth("database", font=traitFont) # end of drawBrowserClickableRegions else: @@ -1728,7 +1757,9 @@ class MarkerRegression(object): ChrAInfo = [] preLpos = -1 distinctCount = 0.0 - if len(self.genotype) > 1: + + #if len(self.genotype) > 1: + if self.selectedChr == -1: #ZS: If viewing full genome/all chromosomes for i, _chr in enumerate(self.genotype): thisChr = [] Locus0CM = _chr[0].cM @@ -1751,15 +1782,16 @@ class MarkerRegression(object): ChrAInfo.append(thisChr) else: for i, _chr in enumerate(self.genotype): - thisChr = [] - Locus0CM = _chr[0].cM - for _locus in _chr: - if _locus.name != ' - ': - if _locus.cM != preLpos: - distinctCount += 1 - preLpos = _locus.cM - thisChr.append([_locus.name, _locus.cM-Locus0CM]) - ChrAInfo.append(thisChr) + if _chr.name == self.ChrList[self.selectedChr][0]: + thisChr = [] + Locus0CM = _chr[0].cM + for _locus in _chr: + if _locus.name != ' - ': + if _locus.cM != preLpos: + distinctCount += 1 + preLpos = _locus.cM + thisChr.append([_locus.name, _locus.cM-Locus0CM]) + ChrAInfo.append(thisChr) stepA = (plotWidth+0.0)/distinctCount @@ -1768,8 +1800,8 @@ class MarkerRegression(object): offsetA = -stepA lineColor = pid.lightblue startPosX = xLeftOffset + for j, ChrInfo in enumerate(ChrAInfo): - if ChrInfo == self.selectedChr: preLpos = -1 for i, item in enumerate(ChrInfo): Lname,Lpos = item @@ -1801,7 +1833,7 @@ class MarkerRegression(object): xLeftOffset+offsetA,yZero+40+Zorder*(LRectWidth+3)+LRectWidth) HREF="/show_trait?trait_id=%s&dataset=%s" % (Lname, self.dataset.group.name+"Geno") #HREF="javascript:showDatabase3('%s','%s','%s','');" % (showLocusForm,fd.RISet+"Geno", Lname) - Areas=HT.Area(shape='rect',coords=COORDS,href=HREF, title="Locus : " + Lname) + Areas=HT.Area(shape='rect', coords=COORDS, href=HREF, target="_blank", title="Locus : " + Lname) gifmap.areas.append(Areas) ##piddle bug if j == 0: @@ -1827,44 +1859,66 @@ class MarkerRegression(object): #draw the LRS scale #We first determine whether or not we are using a sliding scale. - #If so, we need to compute the maximum LRS value to determine where the max y-value should be, and call this LRSMax. - #LRSTop is then defined to be above the LRSMax by enough to add one additional LRSScale increment. - #if we are using a set-scale, then we set LRSTop to be the user's value, and LRSMax doesn't matter. + #If so, we need to compute the maximum LRS value to determine where the max y-value should be, and call this LRS_LOD_Max. + #LRSTop is then defined to be above the LRS_LOD_Max by enough to add one additional LRSScale increment. + #if we are using a set-scale, then we set LRSTop to be the user's value, and LRS_LOD_Max doesn't matter. - if self.LRS_LOD == 'LOD': - lodm = self.LODFACTOR - else: - lodm = 1.0 - + #ZS: I'm not sure what this if statement is supposed to do. It appears to work correctly for both LOD and LRS if I just set lodm to 1.0 + # if self.LRS_LOD == 'LRS': + # lodm = self.LODFACTOR + # else: + # lodm = 1.0 + + #ZS: This is a mess, but I don't know a better way to account for different mapping methods returning results in different formats + the option to change between LRS and LOD if self.lrsMax <= 0: #sliding scale if "lrs_value" in self.qtlresults[0]: - LRSMax = max([result['lrs_value'] for result in self.qtlresults]) - #LRSMax = max(map(max, self.qtlresults)).lrs_value - else: - LRSMax = max([result['lod_score'] for result in self.qtlresults]) - #LRSMax = max(map(max, self.qtlresults)).lod_score + LRS_LOD_Max = max([result['lrs_value'] for result in self.qtlresults]) + if self.LRS_LOD == "LOD": + LRS_LOD_Max = LRS_LOD_Max / self.LODFACTOR + if self.permChecked and self.nperm > 0 and not self.multipleInterval: + self.significant = min(self.significant / self.LODFACTOR, webqtlConfig.MAXLRS) + self.suggestive = min(self.suggestive / self.LODFACTOR, webqtlConfig.MAXLRS) + else: + if self.permChecked and self.nperm > 0 and not self.multipleInterval: + self.significant = min(self.significant, webqtlConfig.MAXLRS) + self.suggestive = min(self.suggestive, webqtlConfig.MAXLRS) + else: + pass + else: + LRS_LOD_Max = max([result['lod_score'] for result in self.qtlresults]) + if self.LRS_LOD == "LRS": + LRS_LOD_Max = LRS_LOD_Max * self.LODFACTOR + if self.permChecked and self.nperm > 0 and not self.multipleInterval: + self.significant = min(self.significant * self.LODFACTOR, webqtlConfig.MAXLRS) + self.suggestive = min(self.suggestive * self.LODFACTOR, webqtlConfig.MAXLRS) + else: + if self.permChecked and self.nperm > 0 and not self.multipleInterval: + self.significant = min(self.significant, webqtlConfig.MAXLRS) + self.suggestive = min(self.suggestive, webqtlConfig.MAXLRS) + else: + pass + + if self.permChecked and self.nperm > 0 and not self.multipleInterval: + LRS_LOD_Max = max(self.significant, LRS_LOD_Max) + #genotype trait will give infinite LRS - LRSMax = min(LRSMax, webqtlConfig.MAXLRS) - if self.permChecked and not self.multipleInterval: - self.significance = min(self.significance, webqtlConfig.MAXLRS) - self.suggestive = min(self.suggestive, webqtlConfig.MAXLRS) - LRSMax = max(self.significance, LRSMax) + LRS_LOD_Max = min(LRS_LOD_Max, webqtlConfig.MAXLRS) else: - LRSMax = self.lrsMax*lodm + LRS_LOD_Max = self.lrsMax - if LRSMax/lodm > 100: + if LRS_LOD_Max > 100: LRSScale = 20.0 - elif LRSMax/lodm > 20: + elif LRS_LOD_Max > 20: LRSScale = 5.0 - elif LRSMax/lodm > 7.5: + elif LRS_LOD_Max > 7.5: LRSScale = 2.5 else: LRSScale = 1.0 - LRSAxisList = Plot.frange(LRSScale, LRSMax/lodm, LRSScale) + LRSAxisList = Plot.frange(LRSScale, LRS_LOD_Max, LRSScale) #make sure the user's value appears on the y-axis - #update by NL 6-21-2011: round the LOD value to 100 when LRSMax is equal to 460 - LRSAxisList.append(round(LRSMax/lodm)) + #update by NL 6-21-2011: round the LOD value to 100 when LRS_LOD_Max is equal to 460 + LRSAxisList.append(round(LRS_LOD_Max)) #draw the "LRS" or "LOD" string to the left of the axis LRSScaleFont=pid.Font(ttf="verdana", size=16*zoom, bold=0) @@ -1875,53 +1929,66 @@ class MarkerRegression(object): yZero - 150 - 300*(zoom - 1), font=LRSLODFont, color=pid.black, angle=90) for item in LRSAxisList: - if LRSMax == 0.0: - LRSMax = 0.000001 - yLRS = yZero - (item*lodm/LRSMax) * LRSHeightThresh + if LRS_LOD_Max == 0.0: + LRS_LOD_Max = 0.000001 + yLRS = yZero - (item/LRS_LOD_Max) * LRSHeightThresh canvas.drawLine(xLeftOffset, yLRS, xLeftOffset - 4, yLRS, color=self.LRS_COLOR, width=1*zoom) scaleStr = "%2.1f" % item #Draw the LRS/LOD Y axis label canvas.drawString(scaleStr, xLeftOffset-4-canvas.stringWidth(scaleStr, font=LRSScaleFont)-5, yLRS+3, font=LRSScaleFont, color=self.LRS_COLOR) - - #"Significant" and "Suggestive" Drawing Routine - # ======= Draw the thick lines for "Significant" and "Suggestive" ===== (crowell: I tried to make the SNPs draw over these lines, but piddle wouldn't have it...) - if self.permChecked and not self.multipleInterval: - significantY = yZero - self.significance*LRSHeightThresh/LRSMax - suggestiveY = yZero - self.suggestive*LRSHeightThresh/LRSMax + if self.permChecked and self.nperm > 0 and not self.multipleInterval: + significantY = yZero - self.significant*LRSHeightThresh/LRS_LOD_Max + suggestiveY = yZero - self.suggestive*LRSHeightThresh/LRS_LOD_Max startPosX = xLeftOffset - for i, _chr in enumerate(self.genotype): - rightEdge = int(startPosX + self.ChrLengthDistList[i]*plotXScale - self.SUGGESTIVE_WIDTH/1.5) - canvas.drawLine(startPosX+self.SUGGESTIVE_WIDTH/1.5, suggestiveY, rightEdge, suggestiveY, color=self.SUGGESTIVE_COLOR, + + #"Significant" and "Suggestive" Drawing Routine + # ======= Draw the thick lines for "Significant" and "Suggestive" ===== (crowell: I tried to make the SNPs draw over these lines, but piddle wouldn't have it...) + + #ZS: I don't know if what I did here with this inner function is clever or overly complicated, but it's the only way I could think of to avoid duplicating the code inside this function + def add_suggestive_significant_lines_and_legend(start_pos_x, chr_length_dist): + rightEdge = int(start_pos_x + chr_length_dist*plotXScale - self.SUGGESTIVE_WIDTH/1.5) + canvas.drawLine(start_pos_x+self.SUGGESTIVE_WIDTH/1.5, suggestiveY, rightEdge, suggestiveY, color=self.SUGGESTIVE_COLOR, width=self.SUGGESTIVE_WIDTH*zoom, clipX=(xLeftOffset, xLeftOffset + plotWidth-2)) - canvas.drawLine(startPosX+self.SUGGESTIVE_WIDTH/1.5, significantY, rightEdge, significantY, color=self.SIGNIFICANT_COLOR, + canvas.drawLine(start_pos_x+self.SUGGESTIVE_WIDTH/1.5, significantY, rightEdge, significantY, color=self.SIGNIFICANT_COLOR, width=self.SIGNIFICANT_WIDTH*zoom, clipX=(xLeftOffset, xLeftOffset + plotWidth-2)) - sugg_coords = "%d, %d, %d, %d" % (startPosX, suggestiveY-2, rightEdge + 2*zoom, suggestiveY+2) - sig_coords = "%d, %d, %d, %d" % (startPosX, significantY-2, rightEdge + 2*zoom, significantY+2) + sugg_coords = "%d, %d, %d, %d" % (start_pos_x, suggestiveY-2, rightEdge + 2*zoom, suggestiveY+2) + sig_coords = "%d, %d, %d, %d" % (start_pos_x, significantY-2, rightEdge + 2*zoom, significantY+2) if self.LRS_LOD == 'LRS': sugg_title = "Suggestive LRS = %0.2f" % self.suggestive - sig_title = "Significant LRS = %0.2f" % self.significance + sig_title = "Significant LRS = %0.2f" % self.significant else: sugg_title = "Suggestive LOD = %0.2f" % (self.suggestive/4.61) - sig_title = "Significant LOD = %0.2f" % (self.significance/4.61) + sig_title = "Significant LOD = %0.2f" % (self.significant/4.61) Areas1 = HT.Area(shape='rect',coords=sugg_coords,title=sugg_title) Areas2 = HT.Area(shape='rect',coords=sig_coords,title=sig_title) gifmap.areas.append(Areas1) gifmap.areas.append(Areas2) - startPosX += (self.ChrLengthDistList[i]+self.GraphInterval)*plotXScale + start_pos_x += (chr_length_dist+self.GraphInterval)*plotXScale + return start_pos_x + for i, _chr in enumerate(self.genotype): + if self.selectedChr != -1: + if _chr.name == self.ChrList[self.selectedChr][0]: + startPosX = add_suggestive_significant_lines_and_legend(startPosX, self.ChrLengthDistList[0]) + break + else: + continue + else: + startPosX = add_suggestive_significant_lines_and_legend(startPosX, self.ChrLengthDistList[i]) if self.multipleInterval: lrsEdgeWidth = 1 else: - #additiveMax = max(map(lambda X : abs(X.additive), self.qtlresults[0])) + if self.additiveChecked: + additiveMax = max(map(lambda X : abs(X['additive']), self.qtlresults)) #if INTERCROSS: # dominanceMax = max(map(lambda X : abs(X.dominance), self.qtlresults[0])) #else: # dominanceMax = -1 lrsEdgeWidth = 2 - + if zoom == 2: lrsEdgeWidth = 2 * lrsEdgeWidth @@ -1931,6 +1998,7 @@ class MarkerRegression(object): previous_chr = 1 previous_chr_as_int = 0 + lineWidth = 1 oldStartPosX = 0 startPosX = xLeftOffset for i, qtlresult in enumerate(self.qtlresults): @@ -1939,63 +2007,9 @@ class MarkerRegression(object): thisLRSColor = self.colorCollection[0] if qtlresult['chr'] != previous_chr and self.selectedChr == -1: - previous_chr = qtlresult['chr'] - previous_chr_as_int += 1 - - newStartPosX = (self.ChrLengthDistList[previous_chr_as_int - 1]+self.GraphInterval)*plotXScale - if newStartPosX != oldStartPosX: - startPosX += newStartPosX - oldStartPosX = newStartPosX - - #startPosX += (self.ChrLengthDistList[j]+self.GraphInterval)*plotXScale - - #for j, _chr in enumerate(self.genotype): - if self.selectedChr == -1 or qtlresult['chr'] == self.selectedChr: - #LRSCoordXY = [] - #AdditiveCoordXY = [] - #DominanceCoordXY = [] - #for k, _locus in enumerate(_chr): - if 1 == 1: - Xc = startPosX + (qtlresult['Mb']-startMb)*plotXScale - #if self.plotScale == 'physic': - #Xc = startPosX + (_locus.Mb-startMb)*plotXScale - #Xc = startPosX + (qtlresult['Mb']-startMb)*plotXScale - #else: - #Xc = startPosX + (_locus.cM-_chr[0].cM)*plotXScale - #Xc = startPosX + (qtlresult['cM']-qtlresult[0]['cM'])*plotXScale - - # updated by NL 06-18-2011: - # fix the over limit LRS graph issue since genotype trait may give infinite LRS; - # for any lrs is over than 460(LRS max in this system), it will be reset to 460 - if self.LRS_LOD == "LRS": - if qtlresult['lrs_value'] > 460 or qtlresult['lrs_value']=='inf': - Yc = yZero - webqtlConfig.MAXLRS*LRSHeightThresh/LRSMax - else: - Yc = yZero - qtlresult['lrs_value']*LRSHeightThresh/LRSMax - else: - if qtlresult['lod_score'] > 100 or qtlresult['lod_score']=='inf': - Yc = yZero - webqtlConfig.MAXLRS*LRSHeightThresh/LRSMax - else: - Yc = yZero - qtlresult['lod_score']*LRSHeightThresh/LRSMax - #if qtlresult['lrs_value'] > 460 or qtlresult['lrs_value']=='inf': - #if self.qtlresults[j]['lrs_value'] > 460 or self.qtlresults[j]['lrs_value']=='inf': - # Yc = yZero - webqtlConfig.MAXLRS*LRSHeightThresh/LRSMax - #else: - # Yc = yZero - qtlresult['lrs_value']*LRSHeightThresh/LRSMax + if self.manhattan_plot != True: + canvas.drawPolygon(LRSCoordXY,edgeColor=thisLRSColor,closed=0, edgeWidth=lrsEdgeWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) - LRSCoordXY.append((Xc, Yc)) - #if not self.multipleInterval and self.additiveChecked: - # if additiveMax == 0.0: - # additiveMax = 0.000001 - # Yc = yZero - qtlresult[m].additive*AdditiveHeightThresh/additiveMax - # AdditiveCoordXY.append((Xc, Yc)) - #if not self.multipleInterval and INTERCROSS and self.additiveChecked: - # Yc = yZero - qtlresult[m].dominance*DominanceHeightThresh/dominanceMax - # DominanceCoordXY.append((Xc, Yc)) - m += 1 - #canvas.drawPolygon(LRSCoordXY,edgeColor=thisLRSColor,closed=0, edgeWidth=lrsEdgeWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) - - lineWidth = 1 if not self.multipleInterval and self.additiveChecked: plusColor = self.ADDITIVE_COLOR_POSITIVE minusColor = self.ADDITIVE_COLOR_NEGATIVE @@ -2025,38 +2039,144 @@ class MarkerRegression(object): canvas.drawLine(Xc0, Yc0, Xc, Yc, color=plusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) else: canvas.drawLine(Xc0, yZero - (Yc0-yZero), Xc, yZero - (Yc-yZero), color=minusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) - if not self.multipleInterval and INTERCROSS and self.dominanceChecked: - plusColor = self.DOMINANCE_COLOR_POSITIVE - minusColor = self.DOMINANCE_COLOR_NEGATIVE - for k, aPoint in enumerate(DominanceCoordXY): - if k > 0: - Xc0, Yc0 = DominanceCoordXY[k-1] - Xc, Yc = aPoint - if (Yc0-yZero)*(Yc-yZero) < 0: - if Xc == Xc0: #genotype , locus distance is 0 - Xcm = Xc - else: - Xcm = (yZero-Yc0)/((Yc-Yc0)/(Xc-Xc0)) +Xc0 - if Yc0 < yZero: - canvas.drawLine(Xc0, Yc0, Xcm, yZero, color=plusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) - canvas.drawLine(Xcm, yZero, Xc, yZero-(Yc-yZero), color=minusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) - else: - canvas.drawLine(Xc0, yZero - (Yc0-yZero), Xcm, yZero, color=minusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) - canvas.drawLine(Xcm, yZero, Xc, Yc, color=plusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) - elif (Yc0-yZero)*(Yc-yZero) > 0: - if Yc < yZero: - canvas.drawLine(Xc0, Yc0, Xc, Yc, color=plusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) - else: - canvas.drawLine(Xc0, yZero - (Yc0-yZero), Xc, yZero - (Yc-yZero), color=minusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) - else: - minYc = min(Yc-yZero, Yc0-yZero) - if minYc < 0: - canvas.drawLine(Xc0, Yc0, Xc, Yc, color=plusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) - else: - canvas.drawLine(Xc0, yZero - (Yc0-yZero), Xc, yZero - (Yc-yZero), color=minusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) - - canvas.drawPolygon(LRSCoordXY,edgeColor=thisLRSColor,closed=0, edgeWidth=lrsEdgeWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) + LRSCoordXY = [] + AdditiveCoordXY = [] + previous_chr = qtlresult['chr'] + previous_chr_as_int += 1 + + newStartPosX = (self.ChrLengthDistList[previous_chr_as_int - 1]+self.GraphInterval)*plotXScale + if newStartPosX != oldStartPosX: + startPosX += newStartPosX + oldStartPosX = newStartPosX + + #startPosX += (self.ChrLengthDistList[j]+self.GraphInterval)*plotXScale + + #for j, _chr in enumerate(self.genotype): + #ZS: This is beause the chromosome value stored in qtlresult['chr'] can be (for example) either X or 20 depending upon the mapping method/scale used + if self.plotScale == "physic": + this_chr = str(self.ChrList[self.selectedChr][0]) + else: + this_chr = str(self.ChrList[self.selectedChr][1]+1) + if self.selectedChr == -1 or str(qtlresult['chr']) == this_chr: + #AdditiveCoordXY = [] + #DominanceCoordXY = [] + #for k, _locus in enumerate(_chr): + Xc = startPosX + (qtlresult['Mb']-startMb)*plotXScale + #if self.plotScale == 'physic': + #Xc = startPosX + (_locus.Mb-startMb)*plotXScale + #Xc = startPosX + (qtlresult['Mb']-startMb)*plotXScale + #else: + #Xc = startPosX + (_locus.cM-_chr[0].cM)*plotXScale + #Xc = startPosX + (qtlresult['cM']-qtlresult[0]['cM'])*plotXScale + + # updated by NL 06-18-2011: + # fix the over limit LRS graph issue since genotype trait may give infinite LRS; + # for any lrs is over than 460(LRS max in this system), it will be reset to 460 + if 'lrs_value' in qtlresult: + if self.LRS_LOD == "LOD": + if qtlresult['lrs_value'] > 460 or qtlresult['lrs_value']=='inf': + Yc = yZero - webqtlConfig.MAXLRS*LRSHeightThresh/(LRS_LOD_Max*self.LODFACTOR) + else: + Yc = yZero - qtlresult['lrs_value']*LRSHeightThresh/(LRS_LOD_Max*self.LODFACTOR) + else: + if qtlresult['lrs_value'] > 460 or qtlresult['lrs_value']=='inf': + Yc = yZero - webqtlConfig.MAXLRS*LRSHeightThresh/LRS_LOD_Max + else: + Yc = yZero - qtlresult['lrs_value']*LRSHeightThresh/LRS_LOD_Max + else: + if qtlresult['lod_score'] > 100 or qtlresult['lod_score']=='inf': + Yc = yZero - webqtlConfig.MAXLRS*LRSHeightThresh/LRS_LOD_Max + else: + if self.LRS_LOD == "LRS": + Yc = yZero - qtlresult['lod_score']*self.LODFACTOR*LRSHeightThresh/LRS_LOD_Max + else: + Yc = yZero - qtlresult['lod_score']*LRSHeightThresh/LRS_LOD_Max + #if qtlresult['lrs_value'] > 460 or qtlresult['lrs_value']=='inf': + #if self.qtlresults[j]['lrs_value'] > 460 or self.qtlresults[j]['lrs_value']=='inf': + # Yc = yZero - webqtlConfig.MAXLRS*LRSHeightThresh/LRS_LOD_Max + #else: + # Yc = yZero - qtlresult['lrs_value']*LRSHeightThresh/LRS_LOD_Max + + if self.manhattan_plot == True: + canvas.drawEllipse(Xc-1, Yc-1, Xc+1, Yc+1, fillColor=pid.black) + else: + LRSCoordXY.append((Xc, Yc)) + + if not self.multipleInterval and self.additiveChecked: + if additiveMax == 0.0: + additiveMax = 0.000001 + Yc = yZero - qtlresult['additive']*AdditiveHeightThresh/additiveMax + AdditiveCoordXY.append((Xc, Yc)) + # if not self.multipleInterval and INTERCROSS and self.additiveChecked: + # Yc = yZero - qtlresult['dominance']*DominanceHeightThresh/dominanceMax + # DominanceCoordXY.append((Xc, Yc)) + m += 1 + #canvas.drawPolygon(LRSCoordXY,edgeColor=thisLRSColor,closed=0, edgeWidth=lrsEdgeWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) + + if self.manhattan_plot != True: + canvas.drawPolygon(LRSCoordXY,edgeColor=thisLRSColor,closed=0, edgeWidth=lrsEdgeWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) + + if not self.multipleInterval and self.additiveChecked: + plusColor = self.ADDITIVE_COLOR_POSITIVE + minusColor = self.ADDITIVE_COLOR_NEGATIVE + for k, aPoint in enumerate(AdditiveCoordXY): + if k > 0: + Xc0, Yc0 = AdditiveCoordXY[k-1] + Xc, Yc = aPoint + if (Yc0-yZero)*(Yc-yZero) < 0: + if Xc == Xc0: #genotype , locus distance is 0 + Xcm = Xc + else: + Xcm = (yZero-Yc0)/((Yc-Yc0)/(Xc-Xc0)) +Xc0 + if Yc0 < yZero: + canvas.drawLine(Xc0, Yc0, Xcm, yZero, color=plusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) + canvas.drawLine(Xcm, yZero, Xc, yZero-(Yc-yZero), color=minusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) + else: + canvas.drawLine(Xc0, yZero - (Yc0-yZero), Xcm, yZero, color=minusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) + canvas.drawLine(Xcm, yZero, Xc, Yc, color=plusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) + elif (Yc0-yZero)*(Yc-yZero) > 0: + if Yc < yZero: + canvas.drawLine(Xc0, Yc0, Xc, Yc, color=plusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) + else: + canvas.drawLine(Xc0, yZero - (Yc0-yZero), Xc, yZero - (Yc-yZero), color=minusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) + else: + minYc = min(Yc-yZero, Yc0-yZero) + if minYc < 0: + canvas.drawLine(Xc0, Yc0, Xc, Yc, color=plusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) + else: + canvas.drawLine(Xc0, yZero - (Yc0-yZero), Xc, yZero - (Yc-yZero), color=minusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) + + if not self.multipleInterval and INTERCROSS and self.dominanceChecked: + plusColor = self.DOMINANCE_COLOR_POSITIVE + minusColor = self.DOMINANCE_COLOR_NEGATIVE + for k, aPoint in enumerate(DominanceCoordXY): + if k > 0: + Xc0, Yc0 = DominanceCoordXY[k-1] + Xc, Yc = aPoint + if (Yc0-yZero)*(Yc-yZero) < 0: + if Xc == Xc0: #genotype , locus distance is 0 + Xcm = Xc + else: + Xcm = (yZero-Yc0)/((Yc-Yc0)/(Xc-Xc0)) +Xc0 + if Yc0 < yZero: + canvas.drawLine(Xc0, Yc0, Xcm, yZero, color=plusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) + canvas.drawLine(Xcm, yZero, Xc, yZero-(Yc-yZero), color=minusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) + else: + canvas.drawLine(Xc0, yZero - (Yc0-yZero), Xcm, yZero, color=minusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) + canvas.drawLine(Xcm, yZero, Xc, Yc, color=plusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) + elif (Yc0-yZero)*(Yc-yZero) > 0: + if Yc < yZero: + canvas.drawLine(Xc0, Yc0, Xc, Yc, color=plusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) + else: + canvas.drawLine(Xc0, yZero - (Yc0-yZero), Xc, yZero - (Yc-yZero), color=minusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) + else: + minYc = min(Yc-yZero, Yc0-yZero) + if minYc < 0: + canvas.drawLine(Xc0, Yc0, Xc, Yc, color=plusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) + else: + canvas.drawLine(Xc0, yZero - (Yc0-yZero), Xc, yZero - (Yc-yZero), color=minusColor, width=lineWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) + ###draw additive scale if not self.multipleInterval and self.additiveChecked: @@ -2092,7 +2212,7 @@ class MarkerRegression(object): if zoom == 2: fontZoom = 1.5 yTopOffset += 30 - + #calculate plot scale if self.plotScale != 'physic': self.ChrLengthDistList = self.ChrLengthCMList @@ -2113,7 +2233,7 @@ class MarkerRegression(object): canvas.drawRect(startPix, yTopOffset, min(startPix+spacingAmt, xLeftOffset+plotWidth), \ yBottom, edgeColor=theBackColor, fillColor=theBackColor) - drawRegionDistance = self.ChrLengthDistList[self.selectedChr] + drawRegionDistance = self.ChrLengthDistList[self.ChrList[self.selectedChr][1]] self.ChrLengthDistList = [drawRegionDistance] if self.plotScale == 'physic': plotXScale = plotWidth / (endMb-startMb) @@ -2166,17 +2286,17 @@ class MarkerRegression(object): if self.multipleInterval: self.suggestive = 0 - self.significance = 0 + self.significant = 0 if self.selectedChr > -1: self.genotype.chromosome = [self.genotype[self.selectedChr]] else: #single interval mapping try: self.suggestive = float(fd.formdata.getvalue('permSuggestive')) - self.significance = float(fd.formdata.getvalue('permSignificance')) + self.significant = float(fd.formdata.getvalue('permSignificance')) except: self.suggestive = None - self.significance = None + self.significant = None _strains, _vals, _vars = self.traitList[0].exportInformative(weightedRegression) @@ -2207,21 +2327,21 @@ class MarkerRegression(object): return "The control marker you selected is not in the genofile." if weightedRegression: - self.LRSArray = self.genotype.permutation(strains = _strains, trait = _vals, + self.perm_output = self.genotype.permutation(strains = _strains, trait = _vals, variance = _vars, nperm=self.nperm) else: - self.LRSArray = self.genotype.permutation(strains = _strains, trait = _vals, + self.perm_output = self.genotype.permutation(strains = _strains, trait = _vals, nperm=self.nperm) - if self.significance and self.suggestive: + if self.significant and self.suggestive: pass else: if self.nperm < 100: self.suggestive = 0 - self.significance = 0 + self.significant = 0 else: - self.suggestive = self.LRSArray[int(self.nperm*0.37-1)] - self.significance = self.LRSArray[int(self.nperm*0.95-1)] + self.suggestive = self.perm_output[int(self.nperm*0.37-1)] + self.significant = self.perm_output[int(self.nperm*0.95-1)] #calculating bootstrap #from now on, genotype could only contain a single chromosome @@ -2392,7 +2512,7 @@ class MarkerRegression(object): controlsForm.append(controlsTable) controlsForm.append(HT.Input(name="permSuggestive", value=self.suggestive, type="hidden")) - controlsForm.append(HT.Input(name="permSignificance", value=self.significance, type="hidden")) + controlsForm.append(HT.Input(name="permSignificance", value=self.significant, type="hidden")) ## BEGIN HaplotypeAnalyst #### haplotypeAnalystCheck added below ## END HaplotypeAnalyst @@ -2453,157 +2573,193 @@ class MarkerRegression(object): # Permutation Graph ######################################### myCanvas = pid.PILCanvas(size=(400,300)) - #plotBar(myCanvas,10,10,390,290,LRSArray,XLabel='LRS',YLabel='Frequency',title=' Histogram of Permutation Test',identification=fd.identification) - Plot.plotBar(myCanvas, self.LRSArray,XLabel='LRS',YLabel='Frequency',title=' Histogram of Permutation Test') + if 'lod_score' in self.qtlresults[0] and self.LRS_LOD == "LRS": + perm_output = [value*4.16 for value in self.perm_output] + elif 'lod_score' not in self.qtlresults[0] and self.LRS_LOD == "LOD": + perm_output = [value/4.16 for value in self.perm_output] + else: + perm_output = self.perm_output + + Plot.plotBar(myCanvas, perm_output, XLabel=self.LRS_LOD, YLabel='Frequency', title=' Histogram of Permutation Test') filename= webqtlUtil.genRandStr("Reg_") - myCanvas.save(webqtlConfig.IMGDIR+filename, format='gif') - img=HT.Image('/image/'+filename+'.gif',border=0,alt='Histogram of Permutation Test') + myCanvas.save(GENERATED_IMAGE_DIR+filename, format='gif') + return filename - self.suggestive = self.LRSArray[int(self.nperm*0.37-1)] - self.significant = self.LRSArray[int(self.nperm*0.95-1)] - self.highlysignificant = self.LRSArray[int(self.nperm*0.99-1)] + # img=HT.Image('/image/'+filename+'.gif',border=0,alt='Histogram of Permutation Test') - permutationHeading = HT.Paragraph('Histogram of Permutation Test') - permutationHeading.__setattr__("class","title") + # self.suggestive = self.perm_output[int(self.nperm*0.37-1)] + # self.significant = self.perm_output[int(self.nperm*0.95-1)] + # self.highlysignificant = self.perm_output[int(self.nperm*0.99-1)] + + # permutationHeading = HT.Paragraph('Histogram of Permutation Test') + # permutationHeading.__setattr__("class","title") + + # permutation = HT.TableLite() + # permutation.append(HT.TR(HT.TD(img)), + # HT.TR(HT.TD('')), + # HT.TR(HT.TD('Total of %d permutations'%self.nperm))) + + # return permutation - permutation = HT.TableLite() - permutation.append(HT.TR(HT.TD(img)), - HT.TR(HT.TD('')), - HT.TR(HT.TD('Total of %d permutations'%self.nperm))) - - return permutation - def permutationTextFile(self): filename= webqtlUtil.genRandStr("Reg_") fpText = open('%s.txt' % (webqtlConfig.TMPDIR+filename), 'wb') fpText.write('Suggestive LRS (p = 0.63) = %3.2f\n'%self.suggestive) fpText.write('Significant LRS (p = 0.05) = %3.2f\n'%self.significant) fpText.write('Highly Significant LRS (p = 0.01) = %3.2f\n\n'%self.highlysignificant) - fpText.write('%s Permutations\n\n' % str(len(self.LRSArray))) + fpText.write('%s Permutations\n\n' % str(len(self.perm_output))) LRSInfo =HT.Paragraph(' Suggestive LRS = %3.2f\n'%self.suggestive, HT.BR(), ' Significant LRS =%3.2f\n'%self.significant, HT.BR(), ' Highly Significant LRS =%3.2f\n' % self.highlysignificant) - - for lrs_value in self.LRSArray: + + for lrs_value in self.perm_output: fpText.write(str(lrs_value) + "\n") - + textUrl = HT.Href(text = 'Download Permutation Results', url= '/tmp/'+filename+'.txt', target = "_blank", Class='fs12 fwn') - + return textUrl def geneTable(self, geneCol, refGene=None): #SNPLink = 0 #Not sure what this is used for - if self.species == 'mouse' or self.species == 'rat': + if self.dataset.group.species == 'mouse' or self.dataset.group.species == 'rat': + #gene_tblobj = {} + self.gene_table_header = self.getGeneTableHeader(refGene=None) + self.gene_table_body = self.getGeneTableBody(geneCol, refGene=None) + #gene_tblobj["header"] = self.getGeneTableHeader(refGene=None) + #gene_tblobj["body"] = self.getGeneTableBody(geneCol, refGene=None) - gene_tblobj = {} - gene_tblobj["header"] = self.getGeneTableHeader(refGene=None) - gene_tblobj["body"] = self.getGeneTableBody(geneCol, refGene=None) + #sortby = self.getSortByValue() - sortby = self.getSortByValue() + #filename= webqtlUtil.genRandStr("Mapping_") - filename= webqtlUtil.genRandStr("Mapping_") - - objfile = open('%s.obj' % (webqtlConfig.TMPDIR+filename), 'wb') - cPickle.dump(gene_tblobj, objfile) - objfile.close() - - gene_table = webqtlUtil.genTableObj(tblobj=gene_tblobj, file=filename, sortby=sortby, tableID="sortable", addIndex="0") + #objfile = open('%s.obj' % (webqtlConfig.TMPDIR+filename), 'wb') + #cPickle.dump(gene_tblobj, objfile) + #objfile.close() + #gene_table = webqtlUtil.genTableObj(tblobj=gene_tblobj, file=filename, sortby=sortby, tableID="sortable", addIndex="0") else: - gene_table = "" + self.gene_table_header = None + self.gene_table_body = None + #gene_table = "" - return gene_table - - def getLiteratureCorrelation(cursor,geneId1=None,geneId2=None): - if not geneId1 or not geneId2: - return None - if geneId1 == geneId2: - return 1.0 - geneId1 = str(geneId1) - geneId2 = str(geneId2) - lCorr = None - try: - query = 'SELECT Value FROM LCorrRamin3 WHERE GeneId1 = %s and GeneId2 = %s' - for x,y in [(geneId1,geneId2),(geneId2,geneId1)]: - cursor.execute(query,(x,y)) - lCorr = cursor.fetchone() - if lCorr: - lCorr = lCorr[0] - break - except: raise #lCorr = None - return lCorr + #return gene_table def getGeneTableHeader(self, refGene=None): gene_tblobj_header = [] + + gene_table_header_list = [] col_class = "fs14 fwb ffl b1 cw cbrb" - if self.species == "mouse": + if self.dataset.group.species == "mouse": if refGene: - gene_tblobj_header = [[THCell(HT.TD('Index', HT.BR(), HT.BR(), align='left', width=50, Class=col_class), text="index", idx=0), - THCell(HT.TD('Symbol', HT.BR(), HT.BR(), align='left', width=100, Class=col_class), text="symbol", idx=1), - THCell(HT.TD('Mb Start',HT.BR(),'(mm9)', align='left', width=100, Class=col_class), text="mb_start_mm9", idx=2), - THCell(HT.TD('Length (Kb)', HT.BR(), HT.BR(), align='left', width=100, Class=col_class), text="length", idx=3), - THCell(HT.TD('SNP',HT.BR(),'Count', align='left', width=47, Class=col_class), text="snp_count", idx=4), - THCell(HT.TD('SNP',HT.BR(),'Density', align='left', width=78, Class=col_class), text="snp_density", idx=5), - THCell(HT.TD('Avg',HT.BR(),'Expr', HT.BR(), HT.BR(), align='left', width=44, Class=col_class), sort=0, idx=6), - THCell(HT.TD('Human',HT.BR(),'Chr', align='left', width=60, Class=col_class), text="human_chr", idx=7), - THCell(HT.TD('Mb Start',HT.BR(),'(hg19)', align='left', width=100, Class=col_class), text="mb_start_hg19", idx=8), - THCell(HT.TD('Literature',HT.BR(),'Correlation', align='left', width=100, Class=col_class), text="lit_corr", idx=9), - THCell(HT.TD('Gene Description', HT.BR(), HT.BR(), align='left', width=290, Class=col_class), text="description", idx=10), - THCell(HT.TD('PolymiRTS',HT.BR(),'Database', HT.BR(), HT.Href(url='http://compbio.uthsc.edu/miRSNP/', text='>>', target="_blank", Class="normalsize"), - align='left', width=100, Class=col_class), sort=0, idx=11), - THCell(HT.TD('Gene Weaver', HT.BR(), 'Info Content', HT.BR(), HT.Href(url='http://geneweaver.org/', text='>>', target="_blank", Class="normalsize"), - align='left', width=110, Class=col_class), sort=0, idx=12), - ]] + gene_table_header_list = ["Index", + "Symbol", + "Mb Start", + "Length (Kb)", + "SNP Count", + "SNP Density", + "Avg Expr", + "Human Chr", + "Mb Start (hg19)", + "Literature Correlation", + "Gene Description", + "PolymiRTS Database" + HT.Href(url='http://compbio.uthsc.edu/miRSNP/', text='>>', target="_blank").__str__(), + "Gene Weaver Info Content" + HT.Href(url='http://geneweaver.org/', text='>>', target="_blank").__str__()] + + # gene_tblobj_header = [[THCell(HT.TD('Index', HT.BR(), HT.BR(), align='left', width=50, Class=col_class), text="index", idx=0), + # THCell(HT.TD('Symbol', HT.BR(), HT.BR(), align='left', width=100, Class=col_class), text="symbol", idx=1), + # THCell(HT.TD('Mb Start',HT.BR(),'(mm9)', align='left', width=100, Class=col_class), text="mb_start_mm9", idx=2), + # THCell(HT.TD('Length (Kb)', HT.BR(), HT.BR(), align='left', width=100, Class=col_class), text="length", idx=3), + # THCell(HT.TD('SNP',HT.BR(),'Count', align='left', width=47, Class=col_class), text="snp_count", idx=4), + # THCell(HT.TD('SNP',HT.BR(),'Density', align='left', width=78, Class=col_class), text="snp_density", idx=5), + # THCell(HT.TD('Avg',HT.BR(),'Expr', HT.BR(), HT.BR(), align='left', width=44, Class=col_class), sort=0, idx=6), + # THCell(HT.TD('Human',HT.BR(),'Chr', align='left', width=60, Class=col_class), text="human_chr", idx=7), + # THCell(HT.TD('Mb Start',HT.BR(),'(hg19)', align='left', width=100, Class=col_class), text="mb_start_hg19", idx=8), + # THCell(HT.TD('Literature',HT.BR(),'Correlation', align='left', width=100, Class=col_class), text="lit_corr", idx=9), + # THCell(HT.TD('Gene Description', HT.BR(), HT.BR(), align='left', width=290, Class=col_class), text="description", idx=10), + # THCell(HT.TD('PolymiRTS',HT.BR(),'Database', HT.BR(), HT.Href(url='http://compbio.uthsc.edu/miRSNP/', text='>>', target="_blank", Class="normalsize"), + # align='left', width=100, Class=col_class), sort=0, idx=11), + # THCell(HT.TD('Gene Weaver', HT.BR(), 'Info Content', HT.BR(), HT.Href(url='http://geneweaver.org/', text='>>', target="_blank", Class="normalsize"), + # align='left', width=110, Class=col_class), sort=0, idx=12), + # ]] else: - gene_tblobj_header = [[THCell(HT.TD('Index', HT.BR(), HT.BR(), align='left', width=50, Class=col_class), text="index", idx=0), - THCell(HT.TD('Symbol', HT.BR(), HT.BR(), align='left', width=100, Class=col_class), text="symbol", idx=1), - THCell(HT.TD('Mb Start',HT.BR(),'(mm9)', align='left', width=100, Class=col_class), text="mb_start_mm9", idx=2), - THCell(HT.TD('Length (Kb)', HT.BR(), HT.BR(), align='left', width=100, Class=col_class), text="length", idx=3), - THCell(HT.TD('SNP',HT.BR(),'Count', align='left', width=47, Class=col_class), text="snp_count", idx=4), - THCell(HT.TD('SNP',HT.BR(),'Density', align='left', width=78, Class=col_class), text="snp_density", idx=5), - THCell(HT.TD('Avg',HT.BR(),'Expr', HT.BR(), HT.BR(), align='left', width=44, Class=col_class), sort=0, idx=6), - THCell(HT.TD('Human',HT.BR(),'Chr', align='left', width=60, Class=col_class), text="human_chr", idx=7), - THCell(HT.TD('Mb Start',HT.BR(),'(hg19)', align='left', width=100, Class=col_class), text="mb_start_hg19", idx=8), - THCell(HT.TD('Gene Description', HT.BR(), HT.BR(), align='left', width=290, Class=col_class), text="description", idx=9), - THCell(HT.TD('PolymiRTS',HT.BR(),'Database', HT.BR(), HT.Href(url='http://compbio.uthsc.edu/miRSNP/', text='>>', target="_blank", Class="normalsize"), - align='left', width=100, Class=col_class), sort=0, idx=10), - THCell(HT.TD('Gene Weaver', HT.BR(), 'Info Content', HT.BR(), HT.Href(url='http://geneweaver.org/', text='>>', target="_blank", Class="normalsize"), - align='left', width=110, Class=col_class), sort=0, idx=11), - ]] - - elif self.species == "rat": - - gene_tblobj_header = [[THCell(HT.TD('Index', HT.BR(), HT.BR(), align='left', width=50, Class=col_class), text="index", idx=0), - THCell(HT.TD('Symbol', HT.BR(), HT.BR(), align='left', width=100, Class=col_class), text="symbol", idx=1), - THCell(HT.TD('Mb Start',HT.BR(),'(rn3)', align='left', width=100, Class=col_class), text="mb_start_rn3", idx=2), - THCell(HT.TD('Length (Kb)', HT.BR(), HT.BR(), align='left', width=100, Class=col_class), text="length", idx=3), - THCell(HT.TD('Avg',HT.BR(),'Expr', HT.BR(), HT.BR(), align='left', width=44, Class=col_class), sort=0, idx=4), - THCell(HT.TD('Mouse',HT.BR(),'Chr', align='left', width=60, Class=col_class), text="mouse_chr", idx=5), - THCell(HT.TD('Mb Start',HT.BR(),'(mm9)', align='left', width=100, Class=col_class), text="mb_start_mm9", idx=6), - THCell(HT.TD('Human',HT.BR(),'Chr', align='left', width=60, Class=col_class), text="human_chr", idx=7), - THCell(HT.TD('Mb Start',HT.BR(),'(hg19)', align='left', width=100, Class=col_class), text="mb_start_hg19", idx=8), - THCell(HT.TD('Gene Description', HT.BR(), HT.BR(), align='left', Class=col_class), text="description", idx=9)]] + gene_table_header_list = ["", + "Index", + "Symbol", + "Mb Start", + "Length (Kb)", + "SNP Count", + "SNP Density", + "Avg Expr", + "Human Chr", + "Mb Start (hg19)", + "Gene Description", + "PolymiRTS Database" + HT.Href(url='http://compbio.uthsc.edu/miRSNP/', text='>>', target="_blank").__str__(), + "Gene Weaver Info Content" + HT.Href(url='http://geneweaver.org/', text='>>', target="_blank").__str__()] + + # gene_tblobj_header = [[THCell(HT.TD('Index', HT.BR(), HT.BR(), align='left', width=50, Class=col_class), text="index", idx=0), + # THCell(HT.TD('Symbol', HT.BR(), HT.BR(), align='left', width=100, Class=col_class), text="symbol", idx=1), + # THCell(HT.TD('Mb Start',HT.BR(),'(mm9)', align='left', width=100, Class=col_class), text="mb_start_mm9", idx=2), + # THCell(HT.TD('Length (Kb)', HT.BR(), HT.BR(), align='left', width=100, Class=col_class), text="length", idx=3), + # THCell(HT.TD('SNP',HT.BR(),'Count', align='left', width=47, Class=col_class), text="snp_count", idx=4), + # THCell(HT.TD('SNP',HT.BR(),'Density', align='left', width=78, Class=col_class), text="snp_density", idx=5), + # THCell(HT.TD('Avg',HT.BR(),'Expr', HT.BR(), HT.BR(), align='left', width=44, Class=col_class), sort=0, idx=6), + # THCell(HT.TD('Human',HT.BR(),'Chr', align='left', width=60, Class=col_class), text="human_chr", idx=7), + # THCell(HT.TD('Mb Start',HT.BR(),'(hg19)', align='left', width=100, Class=col_class), text="mb_start_hg19", idx=8), + # THCell(HT.TD('Gene Description', HT.BR(), HT.BR(), align='left', width=290, Class=col_class), text="description", idx=9), + # THCell(HT.TD('PolymiRTS',HT.BR(),'Database', HT.BR(), HT.Href(url='http://compbio.uthsc.edu/miRSNP/', text='>>', target="_blank", Class="normalsize"), + # align='left', width=100, Class=col_class), sort=0, idx=10), + # THCell(HT.TD('Gene Weaver', HT.BR(), 'Info Content', HT.BR(), HT.Href(url='http://geneweaver.org/', text='>>', target="_blank", Class="normalsize"), + # align='left', width=110, Class=col_class), sort=0, idx=11), + # ]] + + elif self.dataset.group.species == "rat": + + gene_table_header_list = ["", + "Index", + "Symbol", + "Mb Start", + "Length (Kb)", + "Avg Expr", + "Mouse Chr", + "Mb Start (mm9)", + "Human Chr", + "Mb Start (hg19)", + "Gene Description"] + + # gene_tblobj_header = [[THCell(HT.TD('Index', HT.BR(), HT.BR(), align='left', width=50, Class=col_class), text="index", idx=0), + # THCell(HT.TD('Symbol', HT.BR(), HT.BR(), align='left', width=100, Class=col_class), text="symbol", idx=1), + # THCell(HT.TD('Mb Start',HT.BR(),'(rn3)', align='left', width=100, Class=col_class), text="mb_start_rn3", idx=2), + # THCell(HT.TD('Length (Kb)', HT.BR(), HT.BR(), align='left', width=100, Class=col_class), text="length", idx=3), + # THCell(HT.TD('Avg',HT.BR(),'Expr', HT.BR(), HT.BR(), align='left', width=44, Class=col_class), sort=0, idx=4), + # THCell(HT.TD('Mouse',HT.BR(),'Chr', align='left', width=60, Class=col_class), text="mouse_chr", idx=5), + # THCell(HT.TD('Mb Start',HT.BR(),'(mm9)', align='left', width=100, Class=col_class), text="mb_start_mm9", idx=6), + # THCell(HT.TD('Human',HT.BR(),'Chr', align='left', width=60, Class=col_class), text="human_chr", idx=7), + # THCell(HT.TD('Mb Start',HT.BR(),'(hg19)', align='left', width=100, Class=col_class), text="mb_start_hg19", idx=8), + # THCell(HT.TD('Gene Description', HT.BR(), HT.BR(), align='left', Class=col_class), text="description", idx=9)]] else: pass - return gene_tblobj_header + return gene_table_header_list + #return gene_tblobj_header def getGeneTableBody(self, geneCol, refGene=None): tblobj_body = [] #contains table rows className = "fs13 b1 c222" + + gene_table_body = [] tableIterationsCnt = 0 - if self.species == "mouse": + if self.dataset.group.species == "mouse": # polymiRTS # http://lily.uthsc.edu:8080/20090422_UTHSC_cuiyan/PolymiRTS_CLS?chrom=2&chrom_from=115&chrom_to=125 @@ -2642,8 +2798,8 @@ class MarkerRegression(object): allProbeString = '%s?cmd=sch&gene=%s&alias=1' % (os.path.join(webqtlConfig.CGIDIR, webqtlConfig.SCRIPTFILE), theGO["GeneSymbol"]) if theGO["snpCount"]: - snpString = HT.Href(url="%s&chr=%s&start=%s&end=%s&geneName=%s&s1=%d&s2=%d" % (os.path.join(webqtlConfig.CGIDIR, 'main.py?FormID=snpBrowser'), - theGO["Chromosome"], theGO["TxStart"], theGO["TxEnd"], theGO["GeneSymbol"], self.diffCol[0], self.diffCol[1]), + snpString = HT.Href(url="http://genenetwork.org/webqtl/main.py?FormID=snpBrowser&chr=%s&start=%s&end=%s&geneName=%s&s1=%d&s2=%d" % (theGO["Chromosome"], + theGO["TxStart"], theGO["TxEnd"], theGO["GeneSymbol"], self.diffCol[0], self.diffCol[1]), text=theGO["snpCount"], target="_blank", Class="normalsize") else: snpString = 0 @@ -2680,7 +2836,7 @@ class MarkerRegression(object): geneDescription = theGO["GeneDescription"] if len(geneDescription) > 26: geneDescription = geneDescription[:26]+"..." - probeSetSearch = HT.Href(allProbeString, HT.Image("/images/webqtl_search.gif", border=0), target="_blank") + probeSetSearch = HT.Href(allProbeString, ">>", target="_blank") if theGO["snpDensity"] < 0.000001: snpDensityStr = "0" @@ -2707,37 +2863,69 @@ class MarkerRegression(object): literatureCorrelationString = str(self.getLiteratureCorrelation(self.cursor,refGene,theGO['GeneID']) or "N/A") - this_row.append(TDCell(HT.TD(tableIterationsCnt, selectCheck, width=30, align='right', Class=className), tableIterationsCnt, tableIterationsCnt)) - this_row.append(TDCell(HT.TD(HT.Href(geneIdString, theGO["GeneSymbol"], target="_blank"), " ", probeSetSearch, align='right', Class=className), theGO["GeneSymbol"], theGO["GeneSymbol"])) - this_row.append(TDCell(HT.TD(HT.Href(mouseStartString, "%0.6f" % txStart, target="_blank"), align='right', Class=className), str(mouseStartValue), mouseStartValue)) - this_row.append(TDCell(HT.TD(HT.Href("javascript:centerIntervalMapOnRange2('%s', " % theGO["Chromosome"]+str(txStart-tenPercentLength) + ", " + str(txEnd+tenPercentLength) + ", document.changeViewForm)", "%0.3f" % geneLength), align='right', Class=className), "%0.3f" % geneLength, geneLength)) - this_row.append(TDCell(HT.TD(snpString, align='right', Class=className), str(theGO["snpCount"]), theGO["snpCount"])) - this_row.append(TDCell(HT.TD(snpDensityStr, align='right', Class=className), snpDensityStr, theGO["snpDensity"])) - this_row.append(TDCell(HT.TD(avgExpr, align='right', Class=className), "--", "--")) - this_row.append(TDCell(HT.TD(humanChr, align='right', Class=className), humanChr, humanChrSort)) - this_row.append(TDCell(HT.TD(HT.Href(humanStartString, humanStartDisplay, target="_blank"), align='right', Class=className), humanStartDisplay, humanStartValue)) - this_row.append(TDCell(HT.TD(literatureCorrelationString, align='right', Class=className), literatureCorrelationString, literatureCorrelation)) - this_row.append(TDCell(HT.TD(geneDescription, align='right', Class=className), geneDescription, geneDescription)) - this_row.append(TDCell(HT.TD(polymiRTS, align='right', Class=className), "", "")) - this_row.append(TDCell(HT.TD("", align='right', Class=className), "", "")) + this_row = [selectCheck.__str__(), + str(tableIterationsCnt), + HT.Href(geneIdString, theGO["GeneSymbol"], target="_blank").__str__() + " " + probeSetSearch.__str__(), + HT.Href(mouseStartString, "%0.6f" % txStart, target="_blank").__str__(), + HT.Href("javascript:rangeView('%s', %f, %f)" % (str(int(theGO["Chromosome"])-1), txStart-tenPercentLength, txEnd+tenPercentLength), "%0.3f" % geneLength).__str__(), + snpString, + snpDensityStr, + avgExpr, + humanChr, + HT.Href(humanStartString, humanStartDisplay, target="_blank").__str__(), + literatureCorrelationString, + geneDescription, + polymiRTS, + ""] + + # this_row.append(TDCell(HT.TD(tableIterationsCnt, selectCheck, width=30, align='right', Class=className), tableIterationsCnt, tableIterationsCnt)) + # this_row.append(TDCell(HT.TD(HT.Href(geneIdString, theGO["GeneSymbol"], target="_blank"), " ", probeSetSearch, align='right', Class=className), theGO["GeneSymbol"], theGO["GeneSymbol"])) + # this_row.append(TDCell(HT.TD(HT.Href(mouseStartString, "%0.6f" % txStart, target="_blank"), align='right', Class=className), str(mouseStartValue), mouseStartValue)) + # this_row.append(TDCell(HT.TD(HT.Href("javascript:centerIntervalMapOnRange2('%s', " % theGO["Chromosome"]+str(txStart-tenPercentLength) + ", " + str(txEnd+tenPercentLength) + ", document.changeViewForm)", "%0.3f" % geneLength), align='right', Class=className), "%0.3f" % geneLength, geneLength)) + # this_row.append(TDCell(HT.TD(snpString, align='right', Class=className), str(theGO["snpCount"]), theGO["snpCount"])) + # this_row.append(TDCell(HT.TD(snpDensityStr, align='right', Class=className), snpDensityStr, theGO["snpDensity"])) + # this_row.append(TDCell(HT.TD(avgExpr, align='right', Class=className), "--", "--")) + # this_row.append(TDCell(HT.TD(humanChr, align='right', Class=className), humanChr, humanChrSort)) + # this_row.append(TDCell(HT.TD(HT.Href(humanStartString, humanStartDisplay, target="_blank"), align='right', Class=className), humanStartDisplay, humanStartValue)) + # this_row.append(TDCell(HT.TD(literatureCorrelationString, align='right', Class=className), literatureCorrelationString, literatureCorrelation)) + # this_row.append(TDCell(HT.TD(geneDescription, align='right', Class=className), geneDescription, geneDescription)) + # this_row.append(TDCell(HT.TD(polymiRTS, align='right', Class=className), "", "")) + # this_row.append(TDCell(HT.TD("", align='right', Class=className), "", "")) else: - this_row.append(TDCell(HT.TD(tableIterationsCnt, selectCheck, width=30, align='right', Class=className), tableIterationsCnt, tableIterationsCnt)) - this_row.append(TDCell(HT.TD(HT.Href(geneIdString, theGO["GeneSymbol"], target="_blank"), " ", probeSetSearch, align='right', Class=className), theGO["GeneSymbol"], theGO["GeneSymbol"])) - this_row.append(TDCell(HT.TD(HT.Href(mouseStartString, "%0.6f" % txStart, target="_blank"), align='right', Class=className), str(mouseStartValue), mouseStartValue)) - this_row.append(TDCell(HT.TD(HT.Href("javascript:centerIntervalMapOnRange2('%s', " % theGO["Chromosome"]+str(txStart-tenPercentLength) + ", " + str(txEnd+tenPercentLength) + ", document.changeViewForm)", "%0.3f" % geneLength), align='right', Class=className), "%0.3f" % geneLength, geneLength)) - this_row.append(TDCell(HT.TD(snpString, align='right', Class=className), str(theGO["snpCount"]), theGO["snpCount"])) - this_row.append(TDCell(HT.TD(snpDensityStr, align='right', Class=className), snpDensityStr, theGO["snpDensity"])) - this_row.append(TDCell(HT.TD(avgExpr, align='right', Class=className), "--", "--")) - this_row.append(TDCell(HT.TD(humanChr, align='right', Class=className), humanChr, humanChrSort)) - this_row.append(TDCell(HT.TD(HT.Href(humanStartString, humanStartDisplay, target="_blank"), align='right', Class=className), humanStartDisplay, humanStartValue)) - this_row.append(TDCell(HT.TD(geneDescription, align='right', Class=className), geneDescription, geneDescription)) - this_row.append(TDCell(HT.TD(polymiRTS, align='right', Class=className), "", "")) - this_row.append(TDCell(HT.TD("", align='right', Class=className), "", "")) - - tblobj_body.append(this_row) - - elif self.species == 'rat': + + this_row = [selectCheck.__str__(), + str(tableIterationsCnt), + HT.Href(geneIdString, theGO["GeneSymbol"], target="_blank").__str__() + " " + probeSetSearch.__str__(), + HT.Href(mouseStartString, "%0.6f" % txStart, target="_blank").__str__(), + HT.Href("javascript:rangeView('%s', %f, %f)" % (str(int(theGO["Chromosome"])-1), txStart-tenPercentLength, txEnd+tenPercentLength), "%0.3f" % geneLength).__str__(), + snpString, + snpDensityStr, + avgExpr, + humanChr, + HT.Href(humanStartString, humanStartDisplay, target="_blank").__str__(), + geneDescription, + polymiRTS, + ""] + + + # this_row.append(TDCell(HT.TD(tableIterationsCnt, selectCheck, width=30, align='right', Class=className), tableIterationsCnt, tableIterationsCnt)) + # this_row.append(TDCell(HT.TD(HT.Href(geneIdString, theGO["GeneSymbol"], target="_blank"), " ", probeSetSearch, align='right', Class=className), theGO["GeneSymbol"], theGO["GeneSymbol"])) + # this_row.append(TDCell(HT.TD(HT.Href(mouseStartString, "%0.6f" % txStart, target="_blank"), align='right', Class=className), str(mouseStartValue), mouseStartValue)) + # this_row.append(TDCell(HT.TD(HT.Href("javascript:centerIntervalMapOnRange2('%s', " % theGO["Chromosome"]+str(txStart-tenPercentLength) + ", " + str(txEnd+tenPercentLength) + ", document.changeViewForm)", "%0.3f" % geneLength), align='right', Class=className), "%0.3f" % geneLength, geneLength)) + # this_row.append(TDCell(HT.TD(snpString, align='right', Class=className), str(theGO["snpCount"]), theGO["snpCount"])) + # this_row.append(TDCell(HT.TD(snpDensityStr, align='right', Class=className), snpDensityStr, theGO["snpDensity"])) + # this_row.append(TDCell(HT.TD(avgExpr, align='right', Class=className), "--", "--")) + # this_row.append(TDCell(HT.TD(humanChr, align='right', Class=className), humanChr, humanChrSort)) + # this_row.append(TDCell(HT.TD(HT.Href(humanStartString, humanStartDisplay, target="_blank"), align='right', Class=className), humanStartDisplay, humanStartValue)) + # this_row.append(TDCell(HT.TD(geneDescription, align='right', Class=className), geneDescription, geneDescription)) + # this_row.append(TDCell(HT.TD(polymiRTS, align='right', Class=className), "", "")) + # this_row.append(TDCell(HT.TD("", align='right', Class=className), "", "")) + + gene_table_body.append(this_row) + #tblobj_body.append(this_row) + + elif self.dataset.group.species == 'rat': for gIndex, theGO in enumerate(geneCol): @@ -2752,7 +2940,8 @@ class MarkerRegression(object): geneSymbolNCBI = theGO["GeneSymbol"] geneLength = (float(theGO["TxEnd"]) - float(theGO["TxStart"])) - geneLengthURL = "javascript:centerIntervalMapOnRange2('%s', %f, %f, document.changeViewForm)" % (theGO["Chromosome"], float(theGO["TxStart"])-(geneLength*0.1), float(theGO["TxEnd"])+(geneLength*0.1)) + #geneLengthURL = "javascript:centerIntervalMapOnRange2('%s', %f, %f, document.changeViewForm)" % (theGO["Chromosome"], float(theGO["TxStart"])-(geneLength*0.1), float(theGO["TxEnd"])+(geneLength*0.1)) + geneLengthURL = "javascript:rangeView('%s', %f, %f)" % (theGO["Chromosome"], float(theGO["TxStart"])-(geneLength*0.1), float(theGO["TxEnd"])+(geneLength*0.1)) avgExprVal = [] if avgExprVal != "" and avgExprVal: @@ -2784,35 +2973,60 @@ class MarkerRegression(object): if geneDesc == "---": geneDesc = "" - """ - if len(geneDesc) > 40: - geneDesc = gene0So apparently Angola prison (which used to be a slave plantation) has a rodeo that they invite the general public to. -The prisoners are not trained before hand -But its cool because its completely voluntary. -And by voluntary, according to HFG when I talked to him, they have a choice between doing it or door number two and "door number 2 is... rather worse than volunteering"Desc[:37] + "..." - """ - - this_row.append(TDCell(HT.TD(gIndex + 1, selectCheck, align='left', Class=className), str(gIndex+1), gIndex+1)) - this_row.append(TDCell(HT.TD(webqtlSearch, geneSymbolNCBI, align='left', Class=className), theGO["GeneSymbol"], theGO["GeneSymbol"])) - this_row.append(TDCell(HT.TD(theGO["TxStart"], align='left', Class=className), theGO["TxStart"], theGO["TxStart"])) - this_row.append(TDCell(HT.TD(HT.Href(geneLengthURL, "%0.3f" % (geneLength*1000.0)), align='left', Class=className), "%0.3f" % (geneLength*1000.0), (geneLength*1000.0))) - this_row.append(TDCell(HT.TD(avgExprVal, align='left', Class=className), "", "")) - this_row.append(TDCell(HT.TD(mouseChr, align='left', Class=className), mouseChr, mouseChr)) - this_row.append(TDCell(HT.TD(mouseTxStart, align='left', Class=className), mouseTxStart, mouseTxStart)) - this_row.append(TDCell(HT.TD(humanChr, align='left', Class=className), humanChr, humanChrSort)) - this_row.append(TDCell(HT.TD(humanTxStart, align='left', Class=className), humanTxStart, humanTxStart)) - this_row.append(TDCell(HT.TD(geneDesc, align='left', Class=className), geneDesc, geneDesc)) - - tblobj_body.append(this_row) + this_row = [selectCheck.__str__(), + str(gIndex+1), + webqtlSearch.__str__() + geneSymbolNCBI, + theGO["TxStart"], + HT.Href(geneLengthURL, "%0.3f" % (geneLength*1000.0)).__str__(), + avgExprVal, + mouseChr, + mouseTxStart, + humanChr, + humanTxStart, + geneDesc] + + + #this_row.append(TDCell(HT.TD(gIndex + 1, selectCheck, align='left', Class=className), str(gIndex+1), gIndex+1)) + #this_row.append(TDCell(HT.TD(webqtlSearch, geneSymbolNCBI, align='left', Class=className), theGO["GeneSymbol"], theGO["GeneSymbol"])) + #this_row.append(TDCell(HT.TD(theGO["TxStart"], align='left', Class=className), theGO["TxStart"], theGO["TxStart"])) + #this_row.append(TDCell(HT.TD(HT.Href(geneLengthURL, "%0.3f" % (geneLength*1000.0)), align='left', Class=className), "%0.3f" % (geneLength*1000.0), (geneLength*1000.0))) + #this_row.append(TDCell(HT.TD(avgExprVal, align='left', Class=className), "", "")) + #this_row.append(TDCell(HT.TD(mouseChr, align='left', Class=className), mouseChr, mouseChr)) + #this_row.append(TDCell(HT.TD(mouseTxStart, align='left', Class=className), mouseTxStart, mouseTxStart)) + #this_row.append(TDCell(HT.TD(humanChr, align='left', Class=className), humanChr, humanChrSort)) + #this_row.append(TDCell(HT.TD(humanTxStart, align='left', Class=className), humanTxStart, humanTxStart)) + #this_row.append(TDCell(HT.TD(geneDesc, align='left', Class=className), geneDesc, geneDesc)) + + gene_table_body.append(this_row) + #tblobj_body.append(this_row) else: pass - return tblobj_body - + return gene_table_body + #return tblobj_body + + def getLiteratureCorrelation(cursor,geneId1=None,geneId2=None): + if not geneId1 or not geneId2: + return None + if geneId1 == geneId2: + return 1.0 + geneId1 = str(geneId1) + geneId2 = str(geneId2) + lCorr = None + try: + query = 'SELECT Value FROM LCorrRamin3 WHERE GeneId1 = %s and GeneId2 = %s' + for x,y in [(geneId1,geneId2),(geneId2,geneId1)]: + cursor.execute(query,(x,y)) + lCorr = cursor.fetchone() + if lCorr: + lCorr = lCorr[0] + break + except: raise #lCorr = None + return lCorr def getSortByValue(self): sortby = ("", "") - return sortby
\ No newline at end of file + return sortby diff --git a/wqflask/wqflask/model.py b/wqflask/wqflask/model.py index 5ea32e1f..5ea32e1f 100755..100644 --- a/wqflask/wqflask/model.py +++ b/wqflask/wqflask/model.py diff --git a/wqflask/wqflask/search_results.py b/wqflask/wqflask/search_results.py index fb03f027..8a0485b3 100755..100644 --- a/wqflask/wqflask/search_results.py +++ b/wqflask/wqflask/search_results.py @@ -24,9 +24,8 @@ from flask import Flask, g from MySQLdb import escape_string as escape # Instead of importing HT we're going to build a class below until we can eliminate it -from htmlgen import HTMLgen2 as HT +# from htmlgen import HTMLgen2 as HT -from base import webqtlConfig from utility.benchmark import Bench from base.data_set import create_dataset from base.trait import GeneralTrait @@ -64,40 +63,29 @@ class SearchResultPage(object): # self.dataset_group_ids = map(lambda x: x[2], results) #else: - self.quick = False - self.uc_id = uuid.uuid4() print("uc_id:", self.uc_id) - if 'q' in kw: - self.results = {} - self.quick = True - self.search_terms = kw['q'] - print("self.search_terms is: ", self.search_terms) - self.trait_type = kw['trait_type'] - self.quick_search() + print("kw is:", kw) + if kw['search_terms_or']: + self.and_or = "or" + self.search_terms = kw['search_terms_or'] else: - print("kw is:", kw) - if kw['search_terms_or']: - self.and_or = "or" - self.search_terms = kw['search_terms_or'] - else: - self.and_or = "and" - self.search_terms = kw['search_terms_and'] - self.search_term_exists = True - self.results = [] - if kw['type'] == "Phenotypes": - dataset_type = "Publish" - elif kw['type'] == "Genotypes": - dataset_type = "Geno" - else: - dataset_type = "ProbeSet" - self.dataset = create_dataset(kw['dataset'], dataset_type) - print("KEYWORD:", self.search_terms) - self.search() - if self.search_term_exists: - self.gen_search_result() - + self.and_or = "and" + self.search_terms = kw['search_terms_and'] + self.search_term_exists = True + self.results = [] + if kw['type'] == "Phenotypes": + dataset_type = "Publish" + elif kw['type'] == "Genotypes": + dataset_type = "Geno" + else: + dataset_type = "ProbeSet" + self.dataset = create_dataset(kw['dataset'], dataset_type) + print("KEYWORD:", self.search_terms) + self.search() + if self.search_term_exists: + self.gen_search_result() def gen_search_result(self): @@ -119,62 +107,12 @@ class SearchResultPage(object): #### Excel file needs to be generated #### - print("foo locals are:", locals()) + #print("foo locals are:", locals()) trait_id = result[0] - this_trait = GeneralTrait(dataset=self.dataset, name=trait_id, get_qtl_info=True) + this_trait = GeneralTrait(dataset=self.dataset, name=trait_id, get_qtl_info=True, get_sample_info=False) self.trait_list.append(this_trait) self.dataset.get_trait_info(self.trait_list, species) - - def quick_search(self): - #search_terms = "" - #for term in self.search_terms.split(): - # search_terms += '+{} '.format(term) - - search_terms = ' '.join('+{}'.format(escape(term)) for term in self.search_terms.split()) - print("search_terms are:", search_terms) - - query = """ SELECT table_name, the_key, result_fields - FROM QuickSearch - WHERE MATCH (terms) - AGAINST ('{}' IN BOOLEAN MODE) """.format(search_terms) - - with Bench("Doing QuickSearch Query: "): - dbresults = g.db.execute(query, no_parameters=True).fetchall() - #print("results: ", pf(results)) - - self.results = collections.defaultdict(list) - - type_dict = {'PublishXRef': 'phenotype', - 'ProbeSetXRef': 'mrna_assay', - 'GenoXRef': 'genotype'} - - self.species_groups = {} - - for dbresult in dbresults: - this_result = {} - this_result['table_name'] = dbresult.table_name - if self.trait_type == type_dict[dbresult.table_name] or self.trait_type == 'all': - this_result['key'] = dbresult.the_key - this_result['result_fields'] = json.loads(dbresult.result_fields) - this_species = this_result['result_fields']['species'] - this_group = this_result['result_fields']['group_name'] - if this_species not in self.species_groups: - self.species_groups[this_species] = {} - if type_dict[dbresult.table_name] not in self.species_groups[this_species]: - self.species_groups[this_species][type_dict[dbresult.table_name]] = [] - if this_group not in self.species_groups[this_species][type_dict[dbresult.table_name]]: - self.species_groups[this_species][type_dict[dbresult.table_name]].append(this_group) - #if type_dict[dbresult.table_name] not in self.species_groups: - # self.species_groups[type_dict[dbresult.table_name]] = {} - #if this_species not in self.species_groups[type_dict[dbresult.table_name]]: - # self.species_groups[type_dict[dbresult.table_name]][this_species] = [] - #if this_group not in self.species_groups[type_dict[dbresult.table_name]][this_species]: - # self.species_groups[type_dict[dbresult.table_name]][this_species].append(this_group) - self.results[type_dict[dbresult.table_name]].append(this_result) - - import redis - Redis = redis.Redis() #def get_group_species_tree(self): # self.species_groups = collections.default_dict(list) @@ -184,43 +122,6 @@ class SearchResultPage(object): # item['result_fields']['group_name']) - #def quick_search(self): - # self.search_terms = parser.parse(self.search_terms) - # - # search_types = ["quick_mrna_assay", "quick_phenotype"] - # - # for search_category in search_types: - # these_results = [] - # search_ob = do_search.DoSearch.get_search(search_category) - # search_class = getattr(do_search, search_ob) - # for a_search in self.search_terms: - # search_term = a_search['search_term'] - # the_search = search_class(search_term) - # these_results.extend(the_search.run()) - # print("in the search results are:", self.results) - # self.results[search_category] = these_results - # - # #for a_search in self.search_terms: - # # search_term = a_search['search_term'] - # # - # # #Do mRNA assay search - # # search_ob = do_search.DoSearch.get_search("quick_mrna_assay") - # # search_class = getattr(do_search, search_ob) - # # the_search = search_class(search_term) - # # - # # self.results.extend(the_search.run()) - # # print("in the search results are:", self.results) - # - # - # #return True - # - # #search_gene - # #search_geno - # #search_pheno - # #search_mrn - # #search_publish - - def search(self): self.search_terms = parser.parse(self.search_terms) print("After parsing:", self.search_terms) diff --git a/wqflask/wqflask/show_trait/export_trait_data.py b/wqflask/wqflask/show_trait/export_trait_data.py index f7f2d6d4..f5d02e73 100755 --- a/wqflask/wqflask/show_trait/export_trait_data.py +++ b/wqflask/wqflask/show_trait/export_trait_data.py @@ -21,6 +21,19 @@ def export_sample_table(targs): def dict_to_sorted_list(dictionary): sorted_list = [item for item in dictionary.iteritems()] - sorted_list = sorted(sorted_list, key=operator.itemgetter(0)) + sorted_list = sorted(sorted_list, cmp=cmp_samples) sorted_values = [item[1] for item in sorted_list] - return sorted_values
\ No newline at end of file + return sorted_values + +def cmp_samples(a, b): + if b[0] == 'name': + return 1 + elif b[0] == 'value': + if a[0] == 'se': + return 1 + else: + return -1 + elif b[0] == 'se': + return -1 + else: + return 0
\ No newline at end of file diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py index aa6f9562..f7a33d4f 100755..100644 --- a/wqflask/wqflask/show_trait/show_trait.py +++ b/wqflask/wqflask/show_trait/show_trait.py @@ -16,7 +16,6 @@ from base import webqtlConfig from base import webqtlCaseData from wqflask.show_trait.SampleList import SampleList from utility import webqtlUtil, Plot, Bunch, helper_functions -from utility.tools import pylmm_command, plink_command from base.trait import GeneralTrait from base import data_set from dbFunction import webqtlDatabaseFunction @@ -24,8 +23,8 @@ from basicStatistics import BasicStatisticsFunctions from pprint import pformat as pf -PYLMM_PATH,PYLMM_COMMAND = pylmm_command() -PLINK_PATH,PLINK_COMMAND = plink_command() +from utility.tools import flat_files +MAPPING_PATH = flat_files("mapping") ############################################### # @@ -34,8 +33,6 @@ PLINK_PATH,PLINK_COMMAND = plink_command() # ############################################## - - class ShowTrait(object): def __init__(self, kw): @@ -150,24 +147,27 @@ class ShowTrait(object): self.get_mapping_methods() - js_data = dict(sample_group_types = self.sample_group_types, - sample_lists = sample_lists, - attribute_names = self.sample_groups[0].attributes, - temp_uuid = self.temp_uuid) + self.trait_table_width = get_trait_table_width(self.sample_groups) + + js_data = dict(dataset_type = self.dataset.type, + data_scale = self.dataset.data_scale, + sample_group_types = self.sample_group_types, + sample_lists = sample_lists, + attribute_names = self.sample_groups[0].attributes, + temp_uuid = self.temp_uuid) self.js_data = js_data def get_mapping_methods(self): '''Only display mapping methods when the dataset group's genotype file exists''' def check_plink_gemma(): - if (os.path.isfile(PLINK_PATH+"/"+self.dataset.group.name+".bed") and - os.path.isfile(PLINK_PATH+"/"+self.dataset.group.name+".map")): - + if (os.path.isfile(MAPPING_PATH+"/"+self.dataset.group.name+".bed") and + os.path.isfile(MAPPING_PATH+"/"+self.dataset.group.name+".map")): return True else: return False def check_pylmm_rqtl(): - if os.path.isfile(webqtlConfig.GENODIR+self.dataset.group.name+".geno") and (os.path.getsize(webqtlConfig.NEWGENODIR+self.dataset.group.name+".json") > 0): + if os.path.isfile(webqtlConfig.GENODIR+self.dataset.group.name+".geno") and (os.path.getsize(webqtlConfig.JSON_GENODIR+self.dataset.group.name+".json") > 0): return True else: return False @@ -1184,17 +1184,16 @@ class ShowTrait(object): all_samples_ordered = self.dataset.group.all_samples_ordered() primary_sample_names = list(all_samples_ordered) - - print("self.dataset.group", pf(self.dataset.group.__dict__)) - print("-*- primary_samplelist is:", pf(primary_sample_names)) - + other_sample_names = [] for sample in this_trait.data.keys(): - if sample not in all_samples_ordered: + if (this_trait.data[sample].name2 in primary_sample_names) and (this_trait.data[sample].name not in primary_sample_names): + primary_sample_names.append(this_trait.data[sample].name) + primary_sample_names.remove(this_trait.data[sample].name2) + elif sample not in all_samples_ordered: all_samples_ordered.append(sample) other_sample_names.append(sample) - print("species:", self.dataset.group.species) if self.dataset.group.species == "human": primary_sample_names += other_sample_names @@ -1257,5 +1256,16 @@ def get_nearest_marker(this_trait, this_db): else: return result[0][0] #return result[0][0], result[1][0] + +def get_trait_table_width(sample_groups): + table_width = 35 + if sample_groups[0].se_exists(): + table_width += 10 + if (table_width + len(sample_groups[0].attributes)*10) > 100: + table_width = 100 + else: + table_width += len(sample_groups[0].attributes)*10 + + return table_width diff --git a/wqflask/wqflask/static/css b/wqflask/wqflask/static/css deleted file mode 120000 index 9d8c2f68..00000000 --- a/wqflask/wqflask/static/css +++ /dev/null @@ -1 +0,0 @@ -../../../web/css
\ No newline at end of file diff --git a/wqflask/wqflask/static/dbdoc/TODO.md b/wqflask/wqflask/static/dbdoc/TODO.md deleted file mode 100644 index c0a8bab7..00000000 --- a/wqflask/wqflask/static/dbdoc/TODO.md +++ /dev/null @@ -1 +0,0 @@ -TODO: Add all database documentation into this folder diff --git a/wqflask/wqflask/static/images b/wqflask/wqflask/static/images deleted file mode 120000 index 12f0f8b5..00000000 --- a/wqflask/wqflask/static/images +++ /dev/null @@ -1 +0,0 @@ -../../../web/images
\ No newline at end of file diff --git a/wqflask/wqflask/static/javascript b/wqflask/wqflask/static/javascript deleted file mode 120000 index 5f58faf4..00000000 --- a/wqflask/wqflask/static/javascript +++ /dev/null @@ -1 +0,0 @@ -../../../web/javascript
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/css/corr_matrix.css b/wqflask/wqflask/static/new/css/corr_matrix.css index 495ca28c..cd2b0a80 100755 --- a/wqflask/wqflask/static/new/css/corr_matrix.css +++ b/wqflask/wqflask/static/new/css/corr_matrix.css @@ -3,7 +3,7 @@ -moz-transform: rotate(-90deg); -ms-transform: rotate(-90deg); -o-transform: rotate(-90deg); - trasnform: rotate(-90deg); + transform: rotate(-90deg); color: #000 font-size: 22px; height: 50px; diff --git a/wqflask/wqflask/static/new/javascript/create_lodchart.coffee b/wqflask/wqflask/static/new/javascript/create_lodchart.coffee index 472ec12d..88003f4e 100644 --- a/wqflask/wqflask/static/new/javascript/create_lodchart.coffee +++ b/wqflask/wqflask/static/new/javascript/create_lodchart.coffee @@ -46,9 +46,5 @@ create_lod_chart = -> .transition().duration(500).attr("r", r) $ -> - #window.setTimeout ( -> - # console.log(js_data) - #), 1000 - #window.setTimeout(create_lod_chart(), 1000) root.create_lod_chart = create_lod_chart diff --git a/wqflask/wqflask/static/new/javascript/create_lodchart.js b/wqflask/wqflask/static/new/javascript/create_lodchart.js index c756d842..778eed3a 100644 --- a/wqflask/wqflask/static/new/javascript/create_lodchart.js +++ b/wqflask/wqflask/static/new/javascript/create_lodchart.js @@ -1,45 +1,50 @@ -// Generated by CoffeeScript 1.9.2 -(function() { - var create_lod_chart; +//var create_lod_chart; - create_lod_chart = function() { - var chrrect, data, h, halfh, margin, mychart, totalh, totalw, w; - h = 500; - w = 1200; - margin = { - left: 60, - top: 40, - right: 40, - bottom: 40, - inner: 5 - }; - halfh = h + margin.top + margin.bottom; - totalh = halfh * 2; - totalw = w + margin.left + margin.right; - console.log("js_data:", js_data); - mychart = lodchart().lodvarname("lod.hk").height(h).width(w).margin(margin).ylab(js_data.result_score_type + " score").mappingScale(js_data.mapping_scale).manhattanPlot(js_data.manhattan_plot); - data = js_data.json_data; - d3.select("div#topchart").datum(data).call(mychart); - chrrect = mychart.chrSelect(); - chrrect.on("mouseover", function() { - return d3.select(this).attr("fill", "#E9CFEC"); - }).on("mouseout", function(d, i) { - return d3.select(this).attr("fill", function() { - if (i % 2) { - return "#F1F1F9"; - } - return "#FBFBFF"; - }); - }); - return mychart.markerSelect().on("click", function(d) { - var r; - r = d3.select(this).attr("r"); - return d3.select(this).transition().duration(500).attr("r", r * 3).transition().duration(500).attr("r", r); - }); +create_lod_chart = function() { + var additive, chrrect, data, h, halfh, margin, mychart, totalh, totalw, w; + h = 500; + w = 1200; + margin = { + left: 60, + top: 40, + right: 40, + bottom: 40, + inner: 5 }; - - $(function() { - return root.create_lod_chart = create_lod_chart; + halfh = h + margin.top + margin.bottom; + totalh = halfh * 2; + totalw = w + margin.left + margin.right; + if ('additive' in js_data) { + additive = js_data.additive; + } else { + additive = false; + } + console.log("js_data:", js_data); + mychart = lodchart().lodvarname("lod.hk").height(h).width(w).margin(margin).ylab(js_data.result_score_type + " score").manhattanPlot(js_data.manhattan_plot); + data = js_data.json_data; + d3.select("div#topchart").datum(data).call(mychart); + chrrect = mychart.chrSelect(); + chrrect.on("mouseover", function() { + return d3.select(this).attr("fill", "#E9CFEC"); + }).on("mouseout", function(d, i) { + return d3.select(this).attr("fill", function() { + if (i % 2) { + return "#F1F1F9"; + } + return "#FBFBFF"; + }); + }); + return mychart.markerSelect().on("click", function(d) { + var r; + r = d3.select(this).attr("r"); + return d3.select(this).transition().duration(500).attr("r", r * 3).transition().duration(500).attr("r", r); }); +}; + +create_lod_chart() -}).call(this); +/* +$(function() { + return root.create_lod_chart = create_lod_chart; +}); +*/
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json index 2154541c..12a30e84 100755 --- a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json +++ b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json @@ -117,14 +117,14 @@ "Barley1 Leaf MAS 5.0 SCRI (Dec06)" ], [ - "126", - "B30_K_1206_Rn", - "Barley1 Leaf gcRMAn SCRI (Dec06)" - ], - [ "125", "B30_K_1206_R", "Barley1 Leaf gcRMA SCRI (Dec06)" + ], + [ + "126", + "B30_K_1206_Rn", + "Barley1 Leaf gcRMAn SCRI (Dec06)" ] ], "Phenotypes": [ @@ -1340,14 +1340,14 @@ "GSE9588 Human Liver Normal (Mar11) Both Sexes" ], [ - "383", - "HLCM_0311", - "GSE9588 Human Liver Normal (Mar11) Males" - ], - [ "384", "HLCF_0311", "GSE9588 Human Liver Normal (Mar11) Females" + ], + [ + "383", + "HLCM_0311", + "GSE9588 Human Liver Normal (Mar11) Males" ] ], "Phenotypes": [ @@ -1510,14 +1510,14 @@ "NCI Mammary LMT miRNA v2 (Apr09) RMA" ], [ - "37", - "MA_M_0704_R", - "NCI Mammary mRNA M430 (July04) RMA" - ], - [ "36", "MA_M_0704_M", "NCI Mammary mRNA M430 (July04) MAS5" + ], + [ + "37", + "MA_M_0704_R", + "NCI Mammary mRNA M430 (July04) RMA" ] ] }, @@ -1575,14 +1575,14 @@ ], "Liver mRNA": [ [ - "39", - "LVF2_M_0704_R", - "(B6 x BTBR)F2-ob/ob Liver mRNA M430 (Jul04) RMA" - ], - [ "38", "LVF2_M_0704_M", "(B6 x BTBR)F2-ob/ob Liver mRNA M430 (Jul04) MAS5" + ], + [ + "39", + "LVF2_M_0704_R", + "(B6 x BTBR)F2-ob/ob Liver mRNA M430 (Jul04) RMA" ] ], "Phenotypes": [ @@ -1616,14 +1616,14 @@ "OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) PDNN" ], [ - "32", - "BRF2_M_0304_R", - "OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) RMA" - ], - [ "31", "BRF2_M_0304_M", "OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) MAS5" + ], + [ + "32", + "BRF2_M_0304_R", + "OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) RMA" ] ], "Genotypes": [ @@ -1685,11 +1685,6 @@ ], "Striatum mRNA": [ [ - "84", - "SA_M2_0905_R", - "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) RMA" - ], - [ "83", "SA_M2_0905_M", "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) MAS5" @@ -1698,22 +1693,27 @@ "85", "SA_M2_0905_P", "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) PDNN" + ], + [ + "84", + "SA_M2_0905_R", + "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) RMA" ] ] }, "BHF2": { "Adipose mRNA": [ [ - "196", - "UCLA_BHF2_ADIPOSE_MALE", - "UCLA BHF2 Adipose Male mlratio" - ], - [ "197", "UCLA_BHF2_ADIPOSE_FEMALE", "UCLA BHF2 Adipose Female mlratio" ], [ + "196", + "UCLA_BHF2_ADIPOSE_MALE", + "UCLA BHF2 Adipose Male mlratio" + ], + [ "165", "UCLA_BHF2_ADIPOSE_0605", "UCLA BHF2 Adipose (June05) mlratio" @@ -1721,16 +1721,16 @@ ], "Brain mRNA": [ [ - "198", - "UCLA_BHF2_BRAIN_MALE", - "UCLA BHF2 Brain Male mlratio" - ], - [ "199", "UCLA_BHF2_BRAIN_FEMALE", "UCLA BHF2 Brain Female mlratio" ], [ + "198", + "UCLA_BHF2_BRAIN_MALE", + "UCLA BHF2 Brain Male mlratio" + ], + [ "166", "UCLA_BHF2_BRAIN_0605", "UCLA BHF2 Brain (June05) mlratio" @@ -1745,16 +1745,16 @@ ], "Liver mRNA": [ [ - "200", - "UCLA_BHF2_LIVER_MALE", - "UCLA BHF2 Liver Male mlratio" - ], - [ "201", "UCLA_BHF2_LIVER_FEMALE", "UCLA BHF2 Liver Female mlratio" ], [ + "200", + "UCLA_BHF2_LIVER_MALE", + "UCLA BHF2 Liver Male mlratio" + ], + [ "167", "UCLA_BHF2_LIVER_0605", "UCLA BHF2 Liver (June05) mlratio" @@ -1846,6 +1846,18 @@ ] }, "BXD": { + "Adipose Proteome": [ + [ + "797", + "EPFL_AdiPro0416", + "EPFL/ETHZ BXD Brown Adipose, Total Tissue Proteome, Chow Diet (Apr16) Light SWATH **" + ], + [ + "798", + "EPFL_AdiMitPro0416", + "EPFL/ETHZ BXD Brown Adipose, Isolated Mitochondria Proteome, Chow Diet (Apr16) Light SWATH **" + ] + ], "Adipose mRNA": [ [ "469", @@ -1916,21 +1928,21 @@ [ "414", "UCLA_BXD-on_Femur_0113_RSN", - "UCLA GSE27483 BXD Only Bone Femur ILM Mouse WG-6 v2.0 (Jan13) RSN" + "UCLA GSE27483 BXD Only Bone Femur ILM Mouse WG-6 v1.1 (Jan13) RSN" ] ], "Brain mRNA": [ [ - "164", - "UTHSC_BXD_WB_RNASeq1112", - "UTHSC Mouse BXD Whole Brain RNA Sequence (Nov12) RPKM Untrimmed" - ], - [ "590", "UTHSC_BXD_WB_RNASeqtrim1_1112", "UTHSC Mouse BXD Whole Brain RNA Sequence (Nov12) RPKM Trimmed 1.0" ], [ + "164", + "UTHSC_BXD_WB_RNASeq1112", + "UTHSC Mouse BXD Whole Brain RNA Sequence (Nov12) RPKM Untrimmed" + ], + [ "394", "UTHSC_BXD_WB_RNASeqEx1112", "UTHSC Mouse BXD Whole Brain RNA Sequence Exon Level (Nov12) RPKM" @@ -1946,11 +1958,6 @@ "UTHSC Brain mRNA U74Av2 (Nov05) PDNN" ], [ - "80", - "BR_U_0805_M", - "UTHSC Brain mRNA U74Av2 (Aug05) MAS5" - ], - [ "82", "BR_U_0805_R", "UTHSC Brain mRNA U74Av2 (Aug05) RMA" @@ -1961,6 +1968,11 @@ "UTHSC Brain mRNA U74Av2 (Aug05) PDNN" ], [ + "80", + "BR_U_0805_M", + "UTHSC Brain mRNA U74Av2 (Aug05) MAS5" + ], + [ "42", "CB_M_0204_P", "INIA Brain mRNA M430 (Feb04) PDNN" @@ -2164,6 +2176,21 @@ "UMUTAffy Hippocampus Exon (Feb09) RMA" ], [ + "780", + "UTHSC_ILM_BXD_hipp_NOEb_0216", + "UTHSC BXD Hippocampus ILM v6.1 NOE Balanced (Feb16) RankInv" + ], + [ + "781", + "UTHSC_ILM_BXD_hipp_RSEb_0216", + "UTHSC BXD Hippocampus ILM v6.1 RSE Balanced (Feb16) RankInv" + ], + [ + "782", + "UTHSC_ILM_BXD_hipp_RSSb_0216", + "UTHSC BXD Hippocampus ILM v6.1 RSS Balanced (Feb16) RankInv" + ], + [ "291", "UT_ILM_BXD_hipp_5T_1112", "UTHSC Hippocampus Illumina v6.1 All Combined (Nov12) RankInv" @@ -2283,14 +2310,14 @@ "Mouse Kidney M430v2 Sex Balanced (Aug06) PDNN" ], [ - "116", - "MA_M2_0706_P", - "Mouse Kidney M430v2 (Jul06) PDNN" - ], - [ "115", "MA_M2_0706_R", "Mouse Kidney M430v2 (Jul06) RMA" + ], + [ + "116", + "MA_M2_0706_P", + "Mouse Kidney M430v2 (Jul06) PDNN" ] ], "Liver Metabolome": [ @@ -2452,16 +2479,16 @@ ], "Neocortex mRNA": [ [ - "375", - "DevNeocortex_ILM6.2P14RInv_1111", - "BIDMC/UTHSC Dev Neocortex P14 ILMv6.2 (Nov11) RankInv" - ], - [ "374", "DevNeocortex_ILM6.2P3RInv_1111", "BIDMC/UTHSC Dev Neocortex P3 ILMv6.2 (Nov11) RankInv" ], [ + "375", + "DevNeocortex_ILM6.2P14RInv_1111", + "BIDMC/UTHSC Dev Neocortex P14 ILMv6.2 (Nov11) RankInv" + ], + [ "284", "HQFNeoc_1210v2_RankInv", "HQF BXD Neocortex ILM6v1.1 (Dec10v2) RankInv" @@ -2477,14 +2504,14 @@ "HQF BXD Neocortex ILM6v1.1 (Feb08) RankInv" ], [ - "274", - "DevNeocortex_ILM6.2P3RInv_1110", - "BIDMC/UTHSC Dev Neocortex P3 ILMv6.2 (Nov10) RankInv" - ], - [ "275", "DevNeocortex_ILM6.2P14RInv_1110", "BIDMC/UTHSC Dev Neocortex P14 ILMv6.2 (Nov10) RankInv" + ], + [ + "274", + "DevNeocortex_ILM6.2P3RInv_1110", + "BIDMC/UTHSC Dev Neocortex P3 ILMv6.2 (Nov10) RankInv" ] ], "Nucleus Accumbens mRNA": [ @@ -2542,29 +2569,29 @@ ], "Retina mRNA": [ [ + "267", + "Illum_Retina_BXD_RankInv0410", + "Full HEI Retina Illumina V6.2 (Apr10) RankInv" + ], + [ + "302", + "G2NEI_ILM_Retina_BXD_RI0410", + "HEI Retina Normal Illumina V6.2 (Apr10) RankInv" + ], + [ "709", "DoDCMMRPRetMoGene2_0515", - "DoD CDMRP Retina Affy MoGene 2.0 ST (May15) RMA Gene Level" + "DoD Retina Normal Affy MoGene 2.0 ST (May15) RMA Gene Level" ], [ "710", "DoDCMMRPRetMoGene2Ex_0515", - "DoD CDMRP Retina Affy MoGene 2.0 ST (May15) RMA Exon Level" + "DoD Retina Normal Affy MoGene 2.0 ST (May15) RMA Exon Level" ], [ "385", "ONCRetILM6_0412", "ONC HEI Retina (April 2012) RankInv" - ], - [ - "302", - "G2NEI_ILM_Retina_BXD_RI0410", - "Normal HEI Retina (April 2010) RankInv" - ], - [ - "267", - "Illum_Retina_BXD_RankInv0410", - "Full HEI Retina (April 2010) RankInv" ] ], "Spleen mRNA": [ @@ -2689,6 +2716,23 @@ "RTC_1106_R", "HZI Treg M430v2 (Feb11) RMA" ] + ], + "Ventral Tegmental Area mRNA": [ + [ + "228", + "VCUSal_0609_R", + "VCU BXD VTA Sal M430 2.0 (Jun09) RMA" + ], + [ + "230", + "VCUEtvsSal_0609_R", + "VCU BXD VTA Et vs Sal M430 2.0 (Jun09) RMA" + ], + [ + "229", + "VCUEtOH_0609_R", + "VCU BXD VTA EtOH M430 2.0 (Jun09) RMA" + ] ] }, "BXH": { @@ -2795,6 +2839,16 @@ "170", "UCLA_CTB6B6CTF2_ADIPOSE_2005", "UCLA CTB6/B6CTF2 Adipose (2005) mlratio" + ], + [ + "189", + "UCLA_CTB6B6CTF2_ADIPOSE_FEMALE", + "UCLA CTB6B6CTF2 Adipose Female mlratio" + ], + [ + "188", + "UCLA_CTB6B6CTF2_ADIPOSE_MALE", + "UCLA CTB6B6CTF2 Adipose Male mlratio" ] ], "Brain mRNA": [ @@ -2826,6 +2880,16 @@ "172", "UCLA_CTB6B6CTF2_LIVER_2005", "UCLA CTB6/B6CTF2 Liver (2005) mlratio" + ], + [ + "193", + "UCLA_CTB6B6CTF2_LIVER_FEMALE", + "UCLA CTB6B6CTF2 Liver Female mlratio" + ], + [ + "192", + "UCLA_CTB6B6CTF2_LIVER_MALE", + "UCLA CTB6B6CTF2 Liver Male mlratio" ] ], "Muscle mRNA": [ @@ -2833,6 +2897,16 @@ "173", "UCLA_CTB6B6CTF2_MUSCLE_2005", "UCLA CTB6/B6CTF2 Muscle (2005) mlratio" + ], + [ + "195", + "UCLA_CTB6B6CTF2_MUSCLE_FEMALE", + "UCLA CTB6B6CTF2 Muscle Female mlratio" + ], + [ + "194", + "UCLA_CTB6B6CTF2_MUSCLE_MALE", + "UCLA CTB6B6CTF2 Muscle Male mlratio" ] ], "Phenotypes": [ @@ -2853,14 +2927,14 @@ ], "Hippocampus mRNA": [ [ - "100", - "HC_M2CB_1205_R", - "Hippocampus Consortium M430v2 CXB (Dec05) RMA" - ], - [ "99", "HC_M2CB_1205_P", "Hippocampus Consortium M430v2 CXB (Dec05) PDNN" + ], + [ + "100", + "HC_M2CB_1205_R", + "Hippocampus Consortium M430v2 CXB (Dec05) RMA" ] ], "Phenotypes": [ @@ -2927,11 +3001,6 @@ ], "Hippocampus mRNA": [ [ - "219", - "Illum_LXS_Hipp_NON_1008", - "Hippocampus Illumina NON (Oct08) RankInv beta" - ], - [ "212", "Illum_LXS_Hipp_RSE_1008", "Hippocampus Illumina RSE (Oct08) RankInv beta" @@ -2952,6 +3021,11 @@ "Hippocampus Illumina NOS (Oct08) RankInv beta" ], [ + "219", + "Illum_LXS_Hipp_NON_1008", + "Hippocampus Illumina NON (Oct08) RankInv beta" + ], + [ "143", "Illum_LXS_Hipp_loess0807", "Hippocampus Illumina (Aug07) LOESS" @@ -3042,14 +3116,14 @@ ], "Hippocampus mRNA": [ [ - "273", - "UMUTAffyExon_0209_RMA_MDP", - "UMUTAffy Hippocampus Exon (Feb09) RMA MDP" - ], - [ "272", "HC_M2_0606_MDP", "Hippocampus Consortium M430v2 (Jun06) RMA MDP" + ], + [ + "273", + "UMUTAffyExon_0209_RMA_MDP", + "UMUTAffy Hippocampus Exon (Feb09) RMA MDP" ] ], "Liver mRNA": [ @@ -3115,16 +3189,32 @@ "Scripps-2013": {} }, "rat": { - "HSNIH": { + "HSNIH-Palmer": { "Phenotypes": [ [ - "619", - "HSNIHPublish", - "HSNIH Published Phenotypes" + "None", + "HSNIH-PalmerPublish", + "HSNIH-Palmer Published Phenotypes" + ] + ] + }, + "HSNIH-RGSMC": { + "Phenotypes": [ + [ + "None", + "HSNIH-RGSMCPublish", + "HSNIH-RGSMC Published Phenotypes" ] ] }, "HXBBXH": { + "Adipose mRNA": [ + [ + "799", + "FGUCAS_BAdip0516", + "FGUCAS BXH/HXB Brown Adipose Affy Rat Gene 2.0 ST (May16) log2 **" + ] + ], "Adrenal Gland mRNA": [ [ "220", @@ -3445,8 +3535,12 @@ ], "rat": [ [ - "HSNIH", - "NIH Heterogeneous Stock" + "HSNIH-Palmer", + "NIH Heterogeneous Stock (Palmer)" + ], + [ + "HSNIH-RGSMC", + "NIH Heterogeneous Stock (RGSMC 2013)" ], [ "HXBBXH", @@ -4336,6 +4430,10 @@ "Adipose mRNA" ], [ + "Adipose Proteome", + "Adipose Proteome" + ], + [ "Adrenal Gland mRNA", "Adrenal Gland mRNA" ], @@ -4450,6 +4548,10 @@ [ "T Cell (regulatory) mRNA", "T Cell (regulatory) mRNA" + ], + [ + "Ventral Tegmental Area mRNA", + "Ventral Tegmental Area mRNA" ] ], "BXH": [ @@ -4641,7 +4743,13 @@ "Scripps-2013": [] }, "rat": { - "HSNIH": [ + "HSNIH-Palmer": [ + [ + "Phenotypes", + "Phenotypes" + ] + ], + "HSNIH-RGSMC": [ [ "Phenotypes", "Phenotypes" @@ -4657,6 +4765,10 @@ "Genotypes" ], [ + "Adipose mRNA", + "Adipose mRNA" + ], + [ "Adrenal Gland mRNA", "Adrenal Gland mRNA" ], diff --git a/wqflask/wqflask/static/new/javascript/draw_probability_plot.js b/wqflask/wqflask/static/new/javascript/draw_probability_plot.js index 3eb6295f..1eeb6e73 100644 --- a/wqflask/wqflask/static/new/javascript/draw_probability_plot.js +++ b/wqflask/wqflask/static/new/javascript/draw_probability_plot.js @@ -46,7 +46,7 @@ chart.pointRange([50, 50]); chart.legend.updateState(false); chart.xAxis.axisLabel("Theoretical quantiles").tickFormat(d3.format('.02f')); - chart.yAxis.axisLabel("Sample quantiles").tickFormat(d3.format('.02f')); + //chart.yAxis.axisLabel("Sample quantiles").tickFormat(d3.format('.02f')); chart.tooltipContent(function(obj) { return '<b style="font-size: 20px">' + obj.point.name + '</b>'; }); @@ -66,15 +66,20 @@ sorted_names = names.sort(function(x, y) { return all_samples[x].value - all_samples[y].value; }); + max_decimals = 0 sorted_values = (function() { var j, len, results; results = []; for (j = 0, len = sorted_names.length; j < len; j++) { x = sorted_names[j]; results.push(all_samples[x].value); + if (all_samples[x].value.countDecimals() > max_decimals) { + max_decimals = all_samples[x].value.countDecimals()-1 + } } return results; })(); + chart.yAxis.axisLabel("Sample quantiles").tickFormat(d3.format('.0'+max_decimals.toString()+'f')); sw_result = ShapiroWilkW(sorted_values); W = sw_result.w.toFixed(3); pvalue = sw_result.p.toFixed(3); diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js index 1dd54e3a..589b1074 100755..100644 --- a/wqflask/wqflask/static/new/javascript/show_trait.js +++ b/wqflask/wqflask/static/new/javascript/show_trait.js @@ -50,7 +50,7 @@ }, { vn: "interquartile", pretty: "Interquartile Range", - url: "/glossary.html#Interquartile", + url: "http://www.genenetwork.org/glossary.html#Interquartile", digits: 2 } ]; @@ -174,7 +174,6 @@ make_table = function() { var header, key, row, row_line, table, the_id, the_rows, value, _i, _len, _ref, _ref1; header = "<thead><tr><th> </th>"; - console.log("js_data.sample_group_types:", js_data.sample_group_types); _ref = js_data.sample_group_types; for (key in _ref) { if (!__hasProp.call(_ref, key)) continue; @@ -186,14 +185,15 @@ the_rows = "<tbody>"; for (_i = 0, _len = Stat_Table_Rows.length; _i < _len; _i++) { row = Stat_Table_Rows[_i]; - console.log("rowing"); + if ((row.vn == "range_fold" || row.vn == "range") && js_data.dataset_type == "Publish"){ + continue; + } row_line = "<tr>"; if (row.url != null) { row_line += "<td id=\"" + row.vn + "\"><a href=\"" + row.url + "\">" + row.pretty + "</a></td>"; } else { row_line += "<td id=\"" + row.vn + "\">" + row.pretty + "</td>"; } - console.log("box - js_data.sample_group_types:", js_data.sample_group_types); _ref1 = js_data.sample_group_types; for (key in _ref1) { if (!__hasProp.call(_ref1, key)) continue; @@ -202,12 +202,10 @@ row_line += "<td id=\"" + the_id + "\">foo</td>"; } row_line += "</tr>"; - console.log("row line:", row_line); the_rows += row_line; } the_rows += "</tbody>"; table = header + the_rows; - console.log("table is:", table); return $("#stats_table").append(table); }; process_id = function() { @@ -298,18 +296,37 @@ }; on_corr_method_change = function() { var corr_method; - console.log("in beginning of on_corr_method_change"); - corr_method = $('select[name=corr_method]').val(); + corr_method = $('select[name=corr_type]').val(); console.log("corr_method is:", corr_method); $('.correlation_desc').hide(); $('#' + corr_method + "_r_desc").show().effect("highlight"); if (corr_method === "lit") { - return $("#corr_sample_method_options").hide(); + return $("#corr_sample_method").hide(); } else { - return $("#corr_sample_method_options").show(); + return $("#corr_sample_method").show(); } }; - $('select[name=corr_method]').change(on_corr_method_change); + $('select[name=corr_type]').change(on_corr_method_change); + + submit_special = function(url) { + $("#trait_data_form").attr("action", url); + return $("#trait_data_form").submit(); + }; + + submit_corr = function(){ + var url; + url = "/corr_compute"; + return submit_special(url); + }; + + $(".corr_compute").on("click", (function(_this) { + return function() { + var url; + url = "/corr_compute"; + return submit_special(url); + }; + })(this)); + create_value_dropdown = function(value) { return "<option val=" + value + ">" + value + "</option>"; }; @@ -504,5 +521,10 @@ $('#reset').click(edit_data_change); return console.log("end"); }); + + Number.prototype.countDecimals = function () { + if(Math.floor(this.valueOf()) === this.valueOf()) return 0; + return this.toString().split(".")[1].length || 0; + } }).call(this); 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 3637233e..3b1a1205 100755 --- a/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js +++ b/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js @@ -3,11 +3,9 @@ var block_outliers, composite_mapping_fields, do_ajax_post, get_progress, mapping_method_fields, open_mapping_results, outlier_text, showalert, submit_special, toggle_enable_disable, update_time_remaining; submit_special = function(url) { - //var url; console.log("In submit_special"); console.log("this is:", this); console.log("$(this) is:", $(this)); - //url = $(this).data("url"); console.log("url is:", url); $("#trait_data_form").attr("action", url); return $("#trait_data_form").submit(); @@ -137,6 +135,8 @@ outlier_text = "One or more outliers exist in this data set. Please review values before mapping. Including outliers when mapping may lead to misleading results. We recommend <A HREF=\"http://en.wikipedia.org/wiki/Winsorising\">winsorising</A> the outliers or simply deleting them."; + runtime_warning_text = "This function could take as long as 10-20 minutes to run, so please do not close your browser window until it finishes." + showalert = function(message, alerttype) { return $('#alert_placeholder').append('<div id="alertdiv" class="alert ' + alerttype + '"><a class="close" data-dismiss="alert">�</a><span>' + message + '</span></div>'); }; @@ -189,8 +189,20 @@ $('input[name=do_control]').val($('input[name=do_control_rqtl]:checked').val()); form_data = $('#trait_data_form').serialize(); console.log("form_data is:", form_data); - return submit_special(url); - //return do_ajax_post(url, form_data); + if ($('input[name=pair_scan]:checked').val() == "true") { + console.log("PAIR SCAN:", $('input[name=pair_scan]:checked').val()) + run_pair_scan = confirm(runtime_warning_text) + if (run_pair_scan == true) { + submit_special(url); + } + else { + return false + } + } + else { + return submit_special(url); + //return do_ajax_post(url, form_data); + } }; })(this)); @@ -230,9 +242,10 @@ //$("#progress_bar_container").modal(); url = "/marker_regression"; $('input[name=method]').val("reaper"); - $('input[name=manhattan_plot]').val($('input[name=manhattan_plot_reaper]:checked').val()); + $('input[name=num_perm]').val($('input[name=num_perm_reaper]').val()); $('input[name=control_marker]').val($('input[name=control_reaper]').val()); $('input[name=do_control]').val($('input[name=do_control_reaper]:checked').val()); + $('input[name=manhattan_plot]').val($('input[name=manhattan_plot_reaper]:checked').val()); $('input[name=mapping_display_all]').val($('input[name=display_all_reaper]')); $('input[name=suggestive]').val($('input[name=suggestive_reaper]')); form_data = $('#trait_data_form').serialize(); diff --git a/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css b/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css index 931ec6b3..6540d01f 100755 --- a/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css +++ b/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css @@ -20,7 +20,7 @@ table.dataTable tfoot th { } table.dataTable thead th, table.dataTable thead td { - padding: 10px 18px; + padding: 10px 18px 10px 0px; border-bottom: 1px solid #111; } table.dataTable thead th:active, @@ -69,7 +69,7 @@ table.dataTable tbody tr.selected { } table.dataTable tbody th, table.dataTable tbody td { - padding: 8px 10px; + padding: 4px 5px; } table.dataTable.row-border tbody th, table.dataTable.row-border tbody td, table.dataTable.display tbody th, table.dataTable.display tbody td { border-top: 1px solid #ddd; diff --git a/wqflask/wqflask/static/new/packages/DataTables/js/dataTables.naturalSort.js b/wqflask/wqflask/static/new/packages/DataTables/js/dataTables.naturalSort.js index c9e26682..8b7fa8fd 100755 --- a/wqflask/wqflask/static/new/packages/DataTables/js/dataTables.naturalSort.js +++ b/wqflask/wqflask/static/new/packages/DataTables/js/dataTables.naturalSort.js @@ -1,56 +1,68 @@ -(function() {
-
-/*
- * Natural Sort algorithm for Javascript - Version 0.7 - Released under MIT license
- * Author: Jim Palmer (based on chunking idea from Dave Koelle)
- * Contributors: Mike Grier (mgrier.com), Clint Priest, Kyle Adams, guillermo
- * See: http://js-naturalsort.googlecode.com/svn/trunk/naturalSort.js
- */
-function naturalSort (a, b) {
- var re = /(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,
- sre = /(^[ ]*|[ ]*$)/g,
- dre = /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,
- hre = /^0x[0-9a-f]+$/i,
- ore = /^0/,
- // convert all to strings and trim()
- x = a.toString().replace(sre, '') || '',
- y = b.toString().replace(sre, '') || '',
- // chunk/tokenize
- xN = x.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'),
- yN = y.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'),
- // numeric, hex or date detection
- xD = parseInt(x.match(hre)) || (xN.length != 1 && x.match(dre) && Date.parse(x)),
- yD = parseInt(y.match(hre)) || xD && y.match(dre) && Date.parse(y) || null;
- // first try and sort Hex codes or Dates
- if (yD)
- if ( xD < yD ) return -1;
- else if ( xD > yD ) return 1;
- // natural sorting through split numeric strings and default strings
- for(var cLoc=0, numS=Math.max(xN.length, yN.length); cLoc < numS; cLoc++) {
- // find floats not starting with '0', string or 0 if not defined (Clint Priest)
- var oFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc]) || xN[cLoc] || 0;
- var oFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc]) || yN[cLoc] || 0;
- // handle numeric vs string comparison - number < string - (Kyle Adams)
- if (isNaN(oFxNcL) !== isNaN(oFyNcL)) return (isNaN(oFxNcL)) ? 1 : -1;
- // rely on string comparison if different types - i.e. '02' < 2 != '02' < '2'
- else if (typeof oFxNcL !== typeof oFyNcL) {
- oFxNcL += '';
- oFyNcL += '';
- }
- if (oFxNcL < oFyNcL) return -1;
- if (oFxNcL > oFyNcL) return 1;
- }
- return 0;
-}
-
-jQuery.extend( jQuery.fn.dataTableExt.oSort, {
- "natural-asc": function ( a, b ) {
- return naturalSort(a,b);
- },
-
- "natural-desc": function ( a, b ) {
- return naturalSort(a,b) * -1;
- }
-} );
-
+(function() { + +/* + * Natural Sort algorithm for Javascript - Version 0.7 - Released under MIT license + * Author: Jim Palmer (based on chunking idea from Dave Koelle) + * Contributors: Mike Grier (mgrier.com), Clint Priest, Kyle Adams, guillermo + * See: http://js-naturalsort.googlecode.com/svn/trunk/naturalSort.js + */ +function naturalSort (a, b) { + var re = /(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi, + sre = /(^[ ]*|[ ]*$)/g, + dre = /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/, + hre = /^0x[0-9a-f]+$/i, + ore = /^0/, + // convert all to strings and trim() + x = a.toString().replace(sre, '') || '', + y = b.toString().replace(sre, '') || '', + // chunk/tokenize + xN = x.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'), + yN = y.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'), + // numeric, hex or date detection + xD = parseInt(x.match(hre)) || (xN.length != 1 && x.match(dre) && Date.parse(x)), + yD = parseInt(y.match(hre)) || xD && y.match(dre) && Date.parse(y) || null; + + // first try and sort Hex codes or Dates + if (yD) + if ( xD < yD ) return -1; + else if ( xD > yD ) return 1; + + // natural sorting through split numeric strings and default strings + for(var cLoc=0, numS=Math.max(xN.length, yN.length); cLoc < numS; cLoc++) { + // find floats not starting with '0', string or 0 if not defined (Clint Priest) + var oFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc]) || xN[cLoc] || 0; + var oFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc]) || yN[cLoc] || 0; + // handle numeric vs string comparison - number < string - (Kyle Adams) + if (isNaN(oFxNcL) !== isNaN(oFyNcL)) return (isNaN(oFxNcL)) ? 1 : -1; + // rely on string comparison if different types - i.e. '02' < 2 != '02' < '2' + else if (typeof oFxNcL !== typeof oFyNcL) { + oFxNcL += ''; + oFyNcL += ''; + } + if (oFxNcL < oFyNcL) return -1; + if (oFxNcL > oFyNcL) return 1; + } + + return 0; +} + +jQuery.extend( jQuery.fn.dataTableExt.oSort, { + "natural-asc": function ( a, b ) { + // first check if null or n/a + if (a == "N/A" || a == "NA" || a == "" || a == "--") return 1; + else if (b == "N/A" || b == "NA" || b == "" || b == "--") return -1; + else { + return naturalSort(a,b); + } + }, + + "natural-desc": function ( a, b ) { + if (a == "N/A" || a == "NA" || a == "" || a == "--") return 1; + else if (b == "N/A" || b == "NA" || b == "" || b == "--") return -1; + else { + return naturalSort(a,b) * -1; + } + } +} ); + }());
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/additional-methods.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/additional-methods.js deleted file mode 100644 index df41fbd4..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/additional-methods.js +++ /dev/null @@ -1,998 +0,0 @@ -/*! - * jQuery Validation Plugin v1.14.0 - * - * http://jqueryvalidation.org/ - * - * Copyright (c) 2015 Jörn Zaefferer - * Released under the MIT license - */ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "./jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -(function() { - - function stripHtml(value) { - // remove html tags and space chars - return value.replace(/<.[^<>]*?>/g, " ").replace(/ | /gi, " ") - // remove punctuation - .replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g, ""); - } - - $.validator.addMethod("maxWords", function(value, element, params) { - return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length <= params; - }, $.validator.format("Please enter {0} words or less.")); - - $.validator.addMethod("minWords", function(value, element, params) { - return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length >= params; - }, $.validator.format("Please enter at least {0} words.")); - - $.validator.addMethod("rangeWords", function(value, element, params) { - var valueStripped = stripHtml(value), - regex = /\b\w+\b/g; - return this.optional(element) || valueStripped.match(regex).length >= params[0] && valueStripped.match(regex).length <= params[1]; - }, $.validator.format("Please enter between {0} and {1} words.")); - -}()); - -// Accept a value from a file input based on a required mimetype -$.validator.addMethod("accept", function(value, element, param) { - // Split mime on commas in case we have multiple types we can accept - var typeParam = typeof param === "string" ? param.replace(/\s/g, "").replace(/,/g, "|") : "image/*", - optionalValue = this.optional(element), - i, file; - - // Element is optional - if (optionalValue) { - return optionalValue; - } - - if ($(element).attr("type") === "file") { - // If we are using a wildcard, make it regex friendly - typeParam = typeParam.replace(/\*/g, ".*"); - - // Check if the element has a FileList before checking each file - if (element.files && element.files.length) { - for (i = 0; i < element.files.length; i++) { - file = element.files[i]; - - // Grab the mimetype from the loaded file, verify it matches - if (!file.type.match(new RegExp( "\\.?(" + typeParam + ")$", "i"))) { - return false; - } - } - } - } - - // Either return true because we've validated each file, or because the - // browser does not support element.files and the FileList feature - return true; -}, $.validator.format("Please enter a value with a valid mimetype.")); - -$.validator.addMethod("alphanumeric", function(value, element) { - return this.optional(element) || /^\w+$/i.test(value); -}, "Letters, numbers, and underscores only please"); - -/* - * Dutch bank account numbers (not 'giro' numbers) have 9 digits - * and pass the '11 check'. - * We accept the notation with spaces, as that is common. - * acceptable: 123456789 or 12 34 56 789 - */ -$.validator.addMethod("bankaccountNL", function(value, element) { - if (this.optional(element)) { - return true; - } - if (!(/^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test(value))) { - return false; - } - // now '11 check' - var account = value.replace(/ /g, ""), // remove spaces - sum = 0, - len = account.length, - pos, factor, digit; - for ( pos = 0; pos < len; pos++ ) { - factor = len - pos; - digit = account.substring(pos, pos + 1); - sum = sum + factor * digit; - } - return sum % 11 === 0; -}, "Please specify a valid bank account number"); - -$.validator.addMethod("bankorgiroaccountNL", function(value, element) { - return this.optional(element) || - ($.validator.methods.bankaccountNL.call(this, value, element)) || - ($.validator.methods.giroaccountNL.call(this, value, element)); -}, "Please specify a valid bank or giro account number"); - -/** - * BIC is the business identifier code (ISO 9362). This BIC check is not a guarantee for authenticity. - * - * BIC pattern: BBBBCCLLbbb (8 or 11 characters long; bbb is optional) - * - * BIC definition in detail: - * - First 4 characters - bank code (only letters) - * - Next 2 characters - ISO 3166-1 alpha-2 country code (only letters) - * - Next 2 characters - location code (letters and digits) - * a. shall not start with '0' or '1' - * b. second character must be a letter ('O' is not allowed) or one of the following digits ('0' for test (therefore not allowed), '1' for passive participant and '2' for active participant) - * - Last 3 characters - branch code, optional (shall not start with 'X' except in case of 'XXX' for primary office) (letters and digits) - */ -$.validator.addMethod("bic", function(value, element) { - return this.optional( element ) || /^([A-Z]{6}[A-Z2-9][A-NP-Z1-2])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test( value ); -}, "Please specify a valid BIC code"); - -/* - * Código de identificación fiscal ( CIF ) is the tax identification code for Spanish legal entities - * Further rules can be found in Spanish on http://es.wikipedia.org/wiki/C%C3%B3digo_de_identificaci%C3%B3n_fiscal - */ -$.validator.addMethod( "cifES", function( value ) { - "use strict"; - - var num = [], - controlDigit, sum, i, count, tmp, secondDigit; - - value = value.toUpperCase(); - - // Quick format test - if ( !value.match( "((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)" ) ) { - return false; - } - - for ( i = 0; i < 9; i++ ) { - num[ i ] = parseInt( value.charAt( i ), 10 ); - } - - // Algorithm for checking CIF codes - sum = num[ 2 ] + num[ 4 ] + num[ 6 ]; - for ( count = 1; count < 8; count += 2 ) { - tmp = ( 2 * num[ count ] ).toString(); - secondDigit = tmp.charAt( 1 ); - - sum += parseInt( tmp.charAt( 0 ), 10 ) + ( secondDigit === "" ? 0 : parseInt( secondDigit, 10 ) ); - } - - /* The first (position 1) is a letter following the following criteria: - * A. Corporations - * B. LLCs - * C. General partnerships - * D. Companies limited partnerships - * E. Communities of goods - * F. Cooperative Societies - * G. Associations - * H. Communities of homeowners in horizontal property regime - * J. Civil Societies - * K. Old format - * L. Old format - * M. Old format - * N. Nonresident entities - * P. Local authorities - * Q. Autonomous bodies, state or not, and the like, and congregations and religious institutions - * R. Congregations and religious institutions (since 2008 ORDER EHA/451/2008) - * S. Organs of State Administration and regions - * V. Agrarian Transformation - * W. Permanent establishments of non-resident in Spain - */ - if ( /^[ABCDEFGHJNPQRSUVW]{1}/.test( value ) ) { - sum += ""; - controlDigit = 10 - parseInt( sum.charAt( sum.length - 1 ), 10 ); - value += controlDigit; - return ( num[ 8 ].toString() === String.fromCharCode( 64 + controlDigit ) || num[ 8 ].toString() === value.charAt( value.length - 1 ) ); - } - - return false; - -}, "Please specify a valid CIF number." ); - -/* - * Brazillian CPF number (Cadastrado de Pessoas Físicas) is the equivalent of a Brazilian tax registration number. - * CPF numbers have 11 digits in total: 9 numbers followed by 2 check numbers that are being used for validation. - */ -$.validator.addMethod("cpfBR", function(value) { - // Removing special characters from value - value = value.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, ""); - - // Checking value to have 11 digits only - if (value.length !== 11) { - return false; - } - - var sum = 0, - firstCN, secondCN, checkResult, i; - - firstCN = parseInt(value.substring(9, 10), 10); - secondCN = parseInt(value.substring(10, 11), 10); - - checkResult = function(sum, cn) { - var result = (sum * 10) % 11; - if ((result === 10) || (result === 11)) {result = 0;} - return (result === cn); - }; - - // Checking for dump data - if (value === "" || - value === "00000000000" || - value === "11111111111" || - value === "22222222222" || - value === "33333333333" || - value === "44444444444" || - value === "55555555555" || - value === "66666666666" || - value === "77777777777" || - value === "88888888888" || - value === "99999999999" - ) { - return false; - } - - // Step 1 - using first Check Number: - for ( i = 1; i <= 9; i++ ) { - sum = sum + parseInt(value.substring(i - 1, i), 10) * (11 - i); - } - - // If first Check Number (CN) is valid, move to Step 2 - using second Check Number: - if ( checkResult(sum, firstCN) ) { - sum = 0; - for ( i = 1; i <= 10; i++ ) { - sum = sum + parseInt(value.substring(i - 1, i), 10) * (12 - i); - } - return checkResult(sum, secondCN); - } - return false; - -}, "Please specify a valid CPF number"); - -/* NOTICE: Modified version of Castle.Components.Validator.CreditCardValidator - * Redistributed under the the Apache License 2.0 at http://www.apache.org/licenses/LICENSE-2.0 - * Valid Types: mastercard, visa, amex, dinersclub, enroute, discover, jcb, unknown, all (overrides all other settings) - */ -$.validator.addMethod("creditcardtypes", function(value, element, param) { - if (/[^0-9\-]+/.test(value)) { - return false; - } - - value = value.replace(/\D/g, ""); - - var validTypes = 0x0000; - - if (param.mastercard) { - validTypes |= 0x0001; - } - if (param.visa) { - validTypes |= 0x0002; - } - if (param.amex) { - validTypes |= 0x0004; - } - if (param.dinersclub) { - validTypes |= 0x0008; - } - if (param.enroute) { - validTypes |= 0x0010; - } - if (param.discover) { - validTypes |= 0x0020; - } - if (param.jcb) { - validTypes |= 0x0040; - } - if (param.unknown) { - validTypes |= 0x0080; - } - if (param.all) { - validTypes = 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040 | 0x0080; - } - if (validTypes & 0x0001 && /^(5[12345])/.test(value)) { //mastercard - return value.length === 16; - } - if (validTypes & 0x0002 && /^(4)/.test(value)) { //visa - return value.length === 16; - } - if (validTypes & 0x0004 && /^(3[47])/.test(value)) { //amex - return value.length === 15; - } - if (validTypes & 0x0008 && /^(3(0[012345]|[68]))/.test(value)) { //dinersclub - return value.length === 14; - } - if (validTypes & 0x0010 && /^(2(014|149))/.test(value)) { //enroute - return value.length === 15; - } - if (validTypes & 0x0020 && /^(6011)/.test(value)) { //discover - return value.length === 16; - } - if (validTypes & 0x0040 && /^(3)/.test(value)) { //jcb - return value.length === 16; - } - if (validTypes & 0x0040 && /^(2131|1800)/.test(value)) { //jcb - return value.length === 15; - } - if (validTypes & 0x0080) { //unknown - return true; - } - return false; -}, "Please enter a valid credit card number."); - -/** - * Validates currencies with any given symbols by @jameslouiz - * Symbols can be optional or required. Symbols required by default - * - * Usage examples: - * currency: ["£", false] - Use false for soft currency validation - * currency: ["$", false] - * currency: ["RM", false] - also works with text based symbols such as "RM" - Malaysia Ringgit etc - * - * <input class="currencyInput" name="currencyInput"> - * - * Soft symbol checking - * currencyInput: { - * currency: ["$", false] - * } - * - * Strict symbol checking (default) - * currencyInput: { - * currency: "$" - * //OR - * currency: ["$", true] - * } - * - * Multiple Symbols - * currencyInput: { - * currency: "$,£,¢" - * } - */ -$.validator.addMethod("currency", function(value, element, param) { - var isParamString = typeof param === "string", - symbol = isParamString ? param : param[0], - soft = isParamString ? true : param[1], - regex; - - symbol = symbol.replace(/,/g, ""); - symbol = soft ? symbol + "]" : symbol + "]?"; - regex = "^[" + symbol + "([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$"; - regex = new RegExp(regex); - return this.optional(element) || regex.test(value); - -}, "Please specify a valid currency"); - -$.validator.addMethod("dateFA", function(value, element) { - return this.optional(element) || /^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(value); -}, $.validator.messages.date); - -/** - * Return true, if the value is a valid date, also making this formal check dd/mm/yyyy. - * - * @example $.validator.methods.date("01/01/1900") - * @result true - * - * @example $.validator.methods.date("01/13/1990") - * @result false - * - * @example $.validator.methods.date("01.01.1900") - * @result false - * - * @example <input name="pippo" class="{dateITA:true}" /> - * @desc Declares an optional input element whose value must be a valid date. - * - * @name $.validator.methods.dateITA - * @type Boolean - * @cat Plugins/Validate/Methods - */ -$.validator.addMethod("dateITA", function(value, element) { - var check = false, - re = /^\d{1,2}\/\d{1,2}\/\d{4}$/, - adata, gg, mm, aaaa, xdata; - if ( re.test(value)) { - adata = value.split("/"); - gg = parseInt(adata[0], 10); - mm = parseInt(adata[1], 10); - aaaa = parseInt(adata[2], 10); - xdata = new Date(Date.UTC(aaaa, mm - 1, gg, 12, 0, 0, 0)); - if ( ( xdata.getUTCFullYear() === aaaa ) && ( xdata.getUTCMonth () === mm - 1 ) && ( xdata.getUTCDate() === gg ) ) { - check = true; - } else { - check = false; - } - } else { - check = false; - } - return this.optional(element) || check; -}, $.validator.messages.date); - -$.validator.addMethod("dateNL", function(value, element) { - return this.optional(element) || /^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(value); -}, $.validator.messages.date); - -// Older "accept" file extension method. Old docs: http://docs.jquery.com/Plugins/Validation/Methods/accept -$.validator.addMethod("extension", function(value, element, param) { - param = typeof param === "string" ? param.replace(/,/g, "|") : "png|jpe?g|gif"; - return this.optional(element) || value.match(new RegExp("\\.(" + param + ")$", "i")); -}, $.validator.format("Please enter a value with a valid extension.")); - -/** - * Dutch giro account numbers (not bank numbers) have max 7 digits - */ -$.validator.addMethod("giroaccountNL", function(value, element) { - return this.optional(element) || /^[0-9]{1,7}$/.test(value); -}, "Please specify a valid giro account number"); - -/** - * IBAN is the international bank account number. - * It has a country - specific format, that is checked here too - */ -$.validator.addMethod("iban", function(value, element) { - // some quick simple tests to prevent needless work - if (this.optional(element)) { - return true; - } - - // remove spaces and to upper case - var iban = value.replace(/ /g, "").toUpperCase(), - ibancheckdigits = "", - leadingZeroes = true, - cRest = "", - cOperator = "", - countrycode, ibancheck, charAt, cChar, bbanpattern, bbancountrypatterns, ibanregexp, i, p; - - // check the country code and find the country specific format - countrycode = iban.substring(0, 2); - bbancountrypatterns = { - "AL": "\\d{8}[\\dA-Z]{16}", - "AD": "\\d{8}[\\dA-Z]{12}", - "AT": "\\d{16}", - "AZ": "[\\dA-Z]{4}\\d{20}", - "BE": "\\d{12}", - "BH": "[A-Z]{4}[\\dA-Z]{14}", - "BA": "\\d{16}", - "BR": "\\d{23}[A-Z][\\dA-Z]", - "BG": "[A-Z]{4}\\d{6}[\\dA-Z]{8}", - "CR": "\\d{17}", - "HR": "\\d{17}", - "CY": "\\d{8}[\\dA-Z]{16}", - "CZ": "\\d{20}", - "DK": "\\d{14}", - "DO": "[A-Z]{4}\\d{20}", - "EE": "\\d{16}", - "FO": "\\d{14}", - "FI": "\\d{14}", - "FR": "\\d{10}[\\dA-Z]{11}\\d{2}", - "GE": "[\\dA-Z]{2}\\d{16}", - "DE": "\\d{18}", - "GI": "[A-Z]{4}[\\dA-Z]{15}", - "GR": "\\d{7}[\\dA-Z]{16}", - "GL": "\\d{14}", - "GT": "[\\dA-Z]{4}[\\dA-Z]{20}", - "HU": "\\d{24}", - "IS": "\\d{22}", - "IE": "[\\dA-Z]{4}\\d{14}", - "IL": "\\d{19}", - "IT": "[A-Z]\\d{10}[\\dA-Z]{12}", - "KZ": "\\d{3}[\\dA-Z]{13}", - "KW": "[A-Z]{4}[\\dA-Z]{22}", - "LV": "[A-Z]{4}[\\dA-Z]{13}", - "LB": "\\d{4}[\\dA-Z]{20}", - "LI": "\\d{5}[\\dA-Z]{12}", - "LT": "\\d{16}", - "LU": "\\d{3}[\\dA-Z]{13}", - "MK": "\\d{3}[\\dA-Z]{10}\\d{2}", - "MT": "[A-Z]{4}\\d{5}[\\dA-Z]{18}", - "MR": "\\d{23}", - "MU": "[A-Z]{4}\\d{19}[A-Z]{3}", - "MC": "\\d{10}[\\dA-Z]{11}\\d{2}", - "MD": "[\\dA-Z]{2}\\d{18}", - "ME": "\\d{18}", - "NL": "[A-Z]{4}\\d{10}", - "NO": "\\d{11}", - "PK": "[\\dA-Z]{4}\\d{16}", - "PS": "[\\dA-Z]{4}\\d{21}", - "PL": "\\d{24}", - "PT": "\\d{21}", - "RO": "[A-Z]{4}[\\dA-Z]{16}", - "SM": "[A-Z]\\d{10}[\\dA-Z]{12}", - "SA": "\\d{2}[\\dA-Z]{18}", - "RS": "\\d{18}", - "SK": "\\d{20}", - "SI": "\\d{15}", - "ES": "\\d{20}", - "SE": "\\d{20}", - "CH": "\\d{5}[\\dA-Z]{12}", - "TN": "\\d{20}", - "TR": "\\d{5}[\\dA-Z]{17}", - "AE": "\\d{3}\\d{16}", - "GB": "[A-Z]{4}\\d{14}", - "VG": "[\\dA-Z]{4}\\d{16}" - }; - - bbanpattern = bbancountrypatterns[countrycode]; - // As new countries will start using IBAN in the - // future, we only check if the countrycode is known. - // This prevents false negatives, while almost all - // false positives introduced by this, will be caught - // by the checksum validation below anyway. - // Strict checking should return FALSE for unknown - // countries. - if (typeof bbanpattern !== "undefined") { - ibanregexp = new RegExp("^[A-Z]{2}\\d{2}" + bbanpattern + "$", ""); - if (!(ibanregexp.test(iban))) { - return false; // invalid country specific format - } - } - - // now check the checksum, first convert to digits - ibancheck = iban.substring(4, iban.length) + iban.substring(0, 4); - for (i = 0; i < ibancheck.length; i++) { - charAt = ibancheck.charAt(i); - if (charAt !== "0") { - leadingZeroes = false; - } - if (!leadingZeroes) { - ibancheckdigits += "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(charAt); - } - } - - // calculate the result of: ibancheckdigits % 97 - for (p = 0; p < ibancheckdigits.length; p++) { - cChar = ibancheckdigits.charAt(p); - cOperator = "" + cRest + "" + cChar; - cRest = cOperator % 97; - } - return cRest === 1; -}, "Please specify a valid IBAN"); - -$.validator.addMethod("integer", function(value, element) { - return this.optional(element) || /^-?\d+$/.test(value); -}, "A positive or negative non-decimal number please"); - -$.validator.addMethod("ipv4", function(value, element) { - return this.optional(element) || /^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(value); -}, "Please enter a valid IP v4 address."); - -$.validator.addMethod("ipv6", function(value, element) { - return this.optional(element) || /^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(value); -}, "Please enter a valid IP v6 address."); - -$.validator.addMethod("lettersonly", function(value, element) { - return this.optional(element) || /^[a-z]+$/i.test(value); -}, "Letters only please"); - -$.validator.addMethod("letterswithbasicpunc", function(value, element) { - return this.optional(element) || /^[a-z\-.,()'"\s]+$/i.test(value); -}, "Letters or punctuation only please"); - -$.validator.addMethod("mobileNL", function(value, element) { - return this.optional(element) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test(value); -}, "Please specify a valid mobile number"); - -/* For UK phone functions, do the following server side processing: - * Compare original input with this RegEx pattern: - * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$ - * Extract $1 and set $prefix to '+44<space>' if $1 is '44', otherwise set $prefix to '0' - * Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2. - * A number of very detailed GB telephone number RegEx patterns can also be found at: - * http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers - */ -$.validator.addMethod("mobileUK", function(phone_number, element) { - phone_number = phone_number.replace(/\(|\)|\s+|-/g, ""); - return this.optional(element) || phone_number.length > 9 && - phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/); -}, "Please specify a valid mobile number"); - -/* - * The número de identidad de extranjero ( NIE )is a code used to identify the non-nationals in Spain - */ -$.validator.addMethod( "nieES", function( value ) { - "use strict"; - - value = value.toUpperCase(); - - // Basic format test - if ( !value.match( "((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)" ) ) { - return false; - } - - // Test NIE - //T - if ( /^[T]{1}/.test( value ) ) { - return ( value[ 8 ] === /^[T]{1}[A-Z0-9]{8}$/.test( value ) ); - } - - //XYZ - if ( /^[XYZ]{1}/.test( value ) ) { - return ( - value[ 8 ] === "TRWAGMYFPDXBNJZSQVHLCKE".charAt( - value.replace( "X", "0" ) - .replace( "Y", "1" ) - .replace( "Z", "2" ) - .substring( 0, 8 ) % 23 - ) - ); - } - - return false; - -}, "Please specify a valid NIE number." ); - -/* - * The Número de Identificación Fiscal ( NIF ) is the way tax identification used in Spain for individuals - */ -$.validator.addMethod( "nifES", function( value ) { - "use strict"; - - value = value.toUpperCase(); - - // Basic format test - if ( !value.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)") ) { - return false; - } - - // Test NIF - if ( /^[0-9]{8}[A-Z]{1}$/.test( value ) ) { - return ( "TRWAGMYFPDXBNJZSQVHLCKE".charAt( value.substring( 8, 0 ) % 23 ) === value.charAt( 8 ) ); - } - // Test specials NIF (starts with K, L or M) - if ( /^[KLM]{1}/.test( value ) ) { - return ( value[ 8 ] === String.fromCharCode( 64 ) ); - } - - return false; - -}, "Please specify a valid NIF number." ); - -jQuery.validator.addMethod( "notEqualTo", function( value, element, param ) { - return this.optional(element) || !$.validator.methods.equalTo.call( this, value, element, param ); -}, "Please enter a different value, values must not be the same." ); - -$.validator.addMethod("nowhitespace", function(value, element) { - return this.optional(element) || /^\S+$/i.test(value); -}, "No white space please"); - -/** -* Return true if the field value matches the given format RegExp -* -* @example $.validator.methods.pattern("AR1004",element,/^AR\d{4}$/) -* @result true -* -* @example $.validator.methods.pattern("BR1004",element,/^AR\d{4}$/) -* @result false -* -* @name $.validator.methods.pattern -* @type Boolean -* @cat Plugins/Validate/Methods -*/ -$.validator.addMethod("pattern", function(value, element, param) { - if (this.optional(element)) { - return true; - } - if (typeof param === "string") { - param = new RegExp("^(?:" + param + ")$"); - } - return param.test(value); -}, "Invalid format."); - -/** - * Dutch phone numbers have 10 digits (or 11 and start with +31). - */ -$.validator.addMethod("phoneNL", function(value, element) { - return this.optional(element) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(value); -}, "Please specify a valid phone number."); - -/* For UK phone functions, do the following server side processing: - * Compare original input with this RegEx pattern: - * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$ - * Extract $1 and set $prefix to '+44<space>' if $1 is '44', otherwise set $prefix to '0' - * Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2. - * A number of very detailed GB telephone number RegEx patterns can also be found at: - * http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers - */ -$.validator.addMethod("phoneUK", function(phone_number, element) { - phone_number = phone_number.replace(/\(|\)|\s+|-/g, ""); - return this.optional(element) || phone_number.length > 9 && - phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/); -}, "Please specify a valid phone number"); - -/** - * matches US phone number format - * - * where the area code may not start with 1 and the prefix may not start with 1 - * allows '-' or ' ' as a separator and allows parens around area code - * some people may want to put a '1' in front of their number - * - * 1(212)-999-2345 or - * 212 999 2344 or - * 212-999-0983 - * - * but not - * 111-123-5434 - * and not - * 212 123 4567 - */ -$.validator.addMethod("phoneUS", function(phone_number, element) { - phone_number = phone_number.replace(/\s+/g, ""); - return this.optional(element) || phone_number.length > 9 && - phone_number.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]([02-9]\d|1[02-9])-?\d{4}$/); -}, "Please specify a valid phone number"); - -/* For UK phone functions, do the following server side processing: - * Compare original input with this RegEx pattern: - * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$ - * Extract $1 and set $prefix to '+44<space>' if $1 is '44', otherwise set $prefix to '0' - * Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2. - * A number of very detailed GB telephone number RegEx patterns can also be found at: - * http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers - */ -//Matches UK landline + mobile, accepting only 01-3 for landline or 07 for mobile to exclude many premium numbers -$.validator.addMethod("phonesUK", function(phone_number, element) { - phone_number = phone_number.replace(/\(|\)|\s+|-/g, ""); - return this.optional(element) || phone_number.length > 9 && - phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/); -}, "Please specify a valid uk phone number"); - -/** - * Matches a valid Canadian Postal Code - * - * @example jQuery.validator.methods.postalCodeCA( "H0H 0H0", element ) - * @result true - * - * @example jQuery.validator.methods.postalCodeCA( "H0H0H0", element ) - * @result false - * - * @name jQuery.validator.methods.postalCodeCA - * @type Boolean - * @cat Plugins/Validate/Methods - */ -$.validator.addMethod( "postalCodeCA", function( value, element ) { - return this.optional( element ) || /^[ABCEGHJKLMNPRSTVXY]\d[A-Z] \d[A-Z]\d$/.test( value ); -}, "Please specify a valid postal code" ); - -/* -* Valida CEPs do brasileiros: -* -* Formatos aceitos: -* 99999-999 -* 99.999-999 -* 99999999 -*/ -$.validator.addMethod("postalcodeBR", function(cep_value, element) { - return this.optional(element) || /^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test( cep_value ); -}, "Informe um CEP válido."); - -/* Matches Italian postcode (CAP) */ -$.validator.addMethod("postalcodeIT", function(value, element) { - return this.optional(element) || /^\d{5}$/.test(value); -}, "Please specify a valid postal code"); - -$.validator.addMethod("postalcodeNL", function(value, element) { - return this.optional(element) || /^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(value); -}, "Please specify a valid postal code"); - -// Matches UK postcode. Does not match to UK Channel Islands that have their own postcodes (non standard UK) -$.validator.addMethod("postcodeUK", function(value, element) { - return this.optional(element) || /^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(value); -}, "Please specify a valid UK postcode"); - -/* - * Lets you say "at least X inputs that match selector Y must be filled." - * - * The end result is that neither of these inputs: - * - * <input class="productinfo" name="partnumber"> - * <input class="productinfo" name="description"> - * - * ...will validate unless at least one of them is filled. - * - * partnumber: {require_from_group: [1,".productinfo"]}, - * description: {require_from_group: [1,".productinfo"]} - * - * options[0]: number of fields that must be filled in the group - * options[1]: CSS selector that defines the group of conditionally required fields - */ -$.validator.addMethod("require_from_group", function(value, element, options) { - var $fields = $(options[1], element.form), - $fieldsFirst = $fields.eq(0), - validator = $fieldsFirst.data("valid_req_grp") ? $fieldsFirst.data("valid_req_grp") : $.extend({}, this), - isValid = $fields.filter(function() { - return validator.elementValue(this); - }).length >= options[0]; - - // Store the cloned validator for future validation - $fieldsFirst.data("valid_req_grp", validator); - - // If element isn't being validated, run each require_from_group field's validation rules - if (!$(element).data("being_validated")) { - $fields.data("being_validated", true); - $fields.each(function() { - validator.element(this); - }); - $fields.data("being_validated", false); - } - return isValid; -}, $.validator.format("Please fill at least {0} of these fields.")); - -/* - * Lets you say "either at least X inputs that match selector Y must be filled, - * OR they must all be skipped (left blank)." - * - * The end result, is that none of these inputs: - * - * <input class="productinfo" name="partnumber"> - * <input class="productinfo" name="description"> - * <input class="productinfo" name="color"> - * - * ...will validate unless either at least two of them are filled, - * OR none of them are. - * - * partnumber: {skip_or_fill_minimum: [2,".productinfo"]}, - * description: {skip_or_fill_minimum: [2,".productinfo"]}, - * color: {skip_or_fill_minimum: [2,".productinfo"]} - * - * options[0]: number of fields that must be filled in the group - * options[1]: CSS selector that defines the group of conditionally required fields - * - */ -$.validator.addMethod("skip_or_fill_minimum", function(value, element, options) { - var $fields = $(options[1], element.form), - $fieldsFirst = $fields.eq(0), - validator = $fieldsFirst.data("valid_skip") ? $fieldsFirst.data("valid_skip") : $.extend({}, this), - numberFilled = $fields.filter(function() { - return validator.elementValue(this); - }).length, - isValid = numberFilled === 0 || numberFilled >= options[0]; - - // Store the cloned validator for future validation - $fieldsFirst.data("valid_skip", validator); - - // If element isn't being validated, run each skip_or_fill_minimum field's validation rules - if (!$(element).data("being_validated")) { - $fields.data("being_validated", true); - $fields.each(function() { - validator.element(this); - }); - $fields.data("being_validated", false); - } - return isValid; -}, $.validator.format("Please either skip these fields or fill at least {0} of them.")); - -/* Validates US States and/or Territories by @jdforsythe - * Can be case insensitive or require capitalization - default is case insensitive - * Can include US Territories or not - default does not - * Can include US Military postal abbreviations (AA, AE, AP) - default does not - * - * Note: "States" always includes DC (District of Colombia) - * - * Usage examples: - * - * This is the default - case insensitive, no territories, no military zones - * stateInput: { - * caseSensitive: false, - * includeTerritories: false, - * includeMilitary: false - * } - * - * Only allow capital letters, no territories, no military zones - * stateInput: { - * caseSensitive: false - * } - * - * Case insensitive, include territories but not military zones - * stateInput: { - * includeTerritories: true - * } - * - * Only allow capital letters, include territories and military zones - * stateInput: { - * caseSensitive: true, - * includeTerritories: true, - * includeMilitary: true - * } - * - * - * - */ - -$.validator.addMethod("stateUS", function(value, element, options) { - var isDefault = typeof options === "undefined", - caseSensitive = ( isDefault || typeof options.caseSensitive === "undefined" ) ? false : options.caseSensitive, - includeTerritories = ( isDefault || typeof options.includeTerritories === "undefined" ) ? false : options.includeTerritories, - includeMilitary = ( isDefault || typeof options.includeMilitary === "undefined" ) ? false : options.includeMilitary, - regex; - - if (!includeTerritories && !includeMilitary) { - regex = "^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$"; - } else if (includeTerritories && includeMilitary) { - regex = "^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$"; - } else if (includeTerritories) { - regex = "^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$"; - } else { - regex = "^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$"; - } - - regex = caseSensitive ? new RegExp(regex) : new RegExp(regex, "i"); - return this.optional(element) || regex.test(value); -}, -"Please specify a valid state"); - -// TODO check if value starts with <, otherwise don't try stripping anything -$.validator.addMethod("strippedminlength", function(value, element, param) { - return $(value).text().length >= param; -}, $.validator.format("Please enter at least {0} characters")); - -$.validator.addMethod("time", function(value, element) { - return this.optional(element) || /^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test(value); -}, "Please enter a valid time, between 00:00 and 23:59"); - -$.validator.addMethod("time12h", function(value, element) { - return this.optional(element) || /^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(value); -}, "Please enter a valid time in 12-hour am/pm format"); - -// same as url, but TLD is optional -$.validator.addMethod("url2", function(value, element) { - return this.optional(element) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value); -}, $.validator.messages.url); - -/** - * Return true, if the value is a valid vehicle identification number (VIN). - * - * Works with all kind of text inputs. - * - * @example <input type="text" size="20" name="VehicleID" class="{required:true,vinUS:true}" /> - * @desc Declares a required input element whose value must be a valid vehicle identification number. - * - * @name $.validator.methods.vinUS - * @type Boolean - * @cat Plugins/Validate/Methods - */ -$.validator.addMethod("vinUS", function(v) { - if (v.length !== 17) { - return false; - } - - var LL = [ "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ], - VL = [ 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 7, 9, 2, 3, 4, 5, 6, 7, 8, 9 ], - FL = [ 8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2 ], - rs = 0, - i, n, d, f, cd, cdv; - - for (i = 0; i < 17; i++) { - f = FL[i]; - d = v.slice(i, i + 1); - if (i === 8) { - cdv = d; - } - if (!isNaN(d)) { - d *= f; - } else { - for (n = 0; n < LL.length; n++) { - if (d.toUpperCase() === LL[n]) { - d = VL[n]; - d *= f; - if (isNaN(cdv) && n === 8) { - cdv = LL[n]; - } - break; - } - } - } - rs += d; - } - cd = rs % 11; - if (cd === 10) { - cd = "X"; - } - if (cd === cdv) { - return true; - } - return false; -}, "The specified vehicle identification number (VIN) is invalid."); - -$.validator.addMethod("zipcodeUS", function(value, element) { - return this.optional(element) || /^\d{5}(-\d{4})?$/.test(value); -}, "The specified US ZIP Code is invalid"); - -$.validator.addMethod("ziprange", function(value, element) { - return this.optional(element) || /^90[2-5]\d\{2\}-\d{4}$/.test(value); -}, "Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx"); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/additional-methods.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/additional-methods.min.js deleted file mode 100644 index b63c3ca1..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/additional-methods.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","./jquery.validate.min"],a):a(jQuery)}(function(a){!function(){function b(a){return a.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ").replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g,"")}a.validator.addMethod("maxWords",function(a,c,d){return this.optional(c)||b(a).match(/\b\w+\b/g).length<=d},a.validator.format("Please enter {0} words or less.")),a.validator.addMethod("minWords",function(a,c,d){return this.optional(c)||b(a).match(/\b\w+\b/g).length>=d},a.validator.format("Please enter at least {0} words.")),a.validator.addMethod("rangeWords",function(a,c,d){var e=b(a),f=/\b\w+\b/g;return this.optional(c)||e.match(f).length>=d[0]&&e.match(f).length<=d[1]},a.validator.format("Please enter between {0} and {1} words."))}(),a.validator.addMethod("accept",function(b,c,d){var e,f,g="string"==typeof d?d.replace(/\s/g,"").replace(/,/g,"|"):"image/*",h=this.optional(c);if(h)return h;if("file"===a(c).attr("type")&&(g=g.replace(/\*/g,".*"),c.files&&c.files.length))for(e=0;e<c.files.length;e++)if(f=c.files[e],!f.type.match(new RegExp("\\.?("+g+")$","i")))return!1;return!0},a.validator.format("Please enter a value with a valid mimetype.")),a.validator.addMethod("alphanumeric",function(a,b){return this.optional(b)||/^\w+$/i.test(a)},"Letters, numbers, and underscores only please"),a.validator.addMethod("bankaccountNL",function(a,b){if(this.optional(b))return!0;if(!/^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test(a))return!1;var c,d,e,f=a.replace(/ /g,""),g=0,h=f.length;for(c=0;h>c;c++)d=h-c,e=f.substring(c,c+1),g+=d*e;return g%11===0},"Please specify a valid bank account number"),a.validator.addMethod("bankorgiroaccountNL",function(b,c){return this.optional(c)||a.validator.methods.bankaccountNL.call(this,b,c)||a.validator.methods.giroaccountNL.call(this,b,c)},"Please specify a valid bank or giro account number"),a.validator.addMethod("bic",function(a,b){return this.optional(b)||/^([A-Z]{6}[A-Z2-9][A-NP-Z1-2])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test(a)},"Please specify a valid BIC code"),a.validator.addMethod("cifES",function(a){"use strict";var b,c,d,e,f,g,h=[];if(a=a.toUpperCase(),!a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)"))return!1;for(d=0;9>d;d++)h[d]=parseInt(a.charAt(d),10);for(c=h[2]+h[4]+h[6],e=1;8>e;e+=2)f=(2*h[e]).toString(),g=f.charAt(1),c+=parseInt(f.charAt(0),10)+(""===g?0:parseInt(g,10));return/^[ABCDEFGHJNPQRSUVW]{1}/.test(a)?(c+="",b=10-parseInt(c.charAt(c.length-1),10),a+=b,h[8].toString()===String.fromCharCode(64+b)||h[8].toString()===a.charAt(a.length-1)):!1},"Please specify a valid CIF number."),a.validator.addMethod("cpfBR",function(a){if(a=a.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,""),11!==a.length)return!1;var b,c,d,e,f=0;if(b=parseInt(a.substring(9,10),10),c=parseInt(a.substring(10,11),10),d=function(a,b){var c=10*a%11;return(10===c||11===c)&&(c=0),c===b},""===a||"00000000000"===a||"11111111111"===a||"22222222222"===a||"33333333333"===a||"44444444444"===a||"55555555555"===a||"66666666666"===a||"77777777777"===a||"88888888888"===a||"99999999999"===a)return!1;for(e=1;9>=e;e++)f+=parseInt(a.substring(e-1,e),10)*(11-e);if(d(f,b)){for(f=0,e=1;10>=e;e++)f+=parseInt(a.substring(e-1,e),10)*(12-e);return d(f,c)}return!1},"Please specify a valid CPF number"),a.validator.addMethod("creditcardtypes",function(a,b,c){if(/[^0-9\-]+/.test(a))return!1;a=a.replace(/\D/g,"");var d=0;return c.mastercard&&(d|=1),c.visa&&(d|=2),c.amex&&(d|=4),c.dinersclub&&(d|=8),c.enroute&&(d|=16),c.discover&&(d|=32),c.jcb&&(d|=64),c.unknown&&(d|=128),c.all&&(d=255),1&d&&/^(5[12345])/.test(a)?16===a.length:2&d&&/^(4)/.test(a)?16===a.length:4&d&&/^(3[47])/.test(a)?15===a.length:8&d&&/^(3(0[012345]|[68]))/.test(a)?14===a.length:16&d&&/^(2(014|149))/.test(a)?15===a.length:32&d&&/^(6011)/.test(a)?16===a.length:64&d&&/^(3)/.test(a)?16===a.length:64&d&&/^(2131|1800)/.test(a)?15===a.length:128&d?!0:!1},"Please enter a valid credit card number."),a.validator.addMethod("currency",function(a,b,c){var d,e="string"==typeof c,f=e?c:c[0],g=e?!0:c[1];return f=f.replace(/,/g,""),f=g?f+"]":f+"]?",d="^["+f+"([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$",d=new RegExp(d),this.optional(b)||d.test(a)},"Please specify a valid currency"),a.validator.addMethod("dateFA",function(a,b){return this.optional(b)||/^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(a)},a.validator.messages.date),a.validator.addMethod("dateITA",function(a,b){var c,d,e,f,g,h=!1,i=/^\d{1,2}\/\d{1,2}\/\d{4}$/;return i.test(a)?(c=a.split("/"),d=parseInt(c[0],10),e=parseInt(c[1],10),f=parseInt(c[2],10),g=new Date(Date.UTC(f,e-1,d,12,0,0,0)),h=g.getUTCFullYear()===f&&g.getUTCMonth()===e-1&&g.getUTCDate()===d?!0:!1):h=!1,this.optional(b)||h},a.validator.messages.date),a.validator.addMethod("dateNL",function(a,b){return this.optional(b)||/^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(a)},a.validator.messages.date),a.validator.addMethod("extension",function(a,b,c){return c="string"==typeof c?c.replace(/,/g,"|"):"png|jpe?g|gif",this.optional(b)||a.match(new RegExp("\\.("+c+")$","i"))},a.validator.format("Please enter a value with a valid extension.")),a.validator.addMethod("giroaccountNL",function(a,b){return this.optional(b)||/^[0-9]{1,7}$/.test(a)},"Please specify a valid giro account number"),a.validator.addMethod("iban",function(a,b){if(this.optional(b))return!0;var c,d,e,f,g,h,i,j,k,l=a.replace(/ /g,"").toUpperCase(),m="",n=!0,o="",p="";if(c=l.substring(0,2),h={AL:"\\d{8}[\\dA-Z]{16}",AD:"\\d{8}[\\dA-Z]{12}",AT:"\\d{16}",AZ:"[\\dA-Z]{4}\\d{20}",BE:"\\d{12}",BH:"[A-Z]{4}[\\dA-Z]{14}",BA:"\\d{16}",BR:"\\d{23}[A-Z][\\dA-Z]",BG:"[A-Z]{4}\\d{6}[\\dA-Z]{8}",CR:"\\d{17}",HR:"\\d{17}",CY:"\\d{8}[\\dA-Z]{16}",CZ:"\\d{20}",DK:"\\d{14}",DO:"[A-Z]{4}\\d{20}",EE:"\\d{16}",FO:"\\d{14}",FI:"\\d{14}",FR:"\\d{10}[\\dA-Z]{11}\\d{2}",GE:"[\\dA-Z]{2}\\d{16}",DE:"\\d{18}",GI:"[A-Z]{4}[\\dA-Z]{15}",GR:"\\d{7}[\\dA-Z]{16}",GL:"\\d{14}",GT:"[\\dA-Z]{4}[\\dA-Z]{20}",HU:"\\d{24}",IS:"\\d{22}",IE:"[\\dA-Z]{4}\\d{14}",IL:"\\d{19}",IT:"[A-Z]\\d{10}[\\dA-Z]{12}",KZ:"\\d{3}[\\dA-Z]{13}",KW:"[A-Z]{4}[\\dA-Z]{22}",LV:"[A-Z]{4}[\\dA-Z]{13}",LB:"\\d{4}[\\dA-Z]{20}",LI:"\\d{5}[\\dA-Z]{12}",LT:"\\d{16}",LU:"\\d{3}[\\dA-Z]{13}",MK:"\\d{3}[\\dA-Z]{10}\\d{2}",MT:"[A-Z]{4}\\d{5}[\\dA-Z]{18}",MR:"\\d{23}",MU:"[A-Z]{4}\\d{19}[A-Z]{3}",MC:"\\d{10}[\\dA-Z]{11}\\d{2}",MD:"[\\dA-Z]{2}\\d{18}",ME:"\\d{18}",NL:"[A-Z]{4}\\d{10}",NO:"\\d{11}",PK:"[\\dA-Z]{4}\\d{16}",PS:"[\\dA-Z]{4}\\d{21}",PL:"\\d{24}",PT:"\\d{21}",RO:"[A-Z]{4}[\\dA-Z]{16}",SM:"[A-Z]\\d{10}[\\dA-Z]{12}",SA:"\\d{2}[\\dA-Z]{18}",RS:"\\d{18}",SK:"\\d{20}",SI:"\\d{15}",ES:"\\d{20}",SE:"\\d{20}",CH:"\\d{5}[\\dA-Z]{12}",TN:"\\d{20}",TR:"\\d{5}[\\dA-Z]{17}",AE:"\\d{3}\\d{16}",GB:"[A-Z]{4}\\d{14}",VG:"[\\dA-Z]{4}\\d{16}"},g=h[c],"undefined"!=typeof g&&(i=new RegExp("^[A-Z]{2}\\d{2}"+g+"$",""),!i.test(l)))return!1;for(d=l.substring(4,l.length)+l.substring(0,4),j=0;j<d.length;j++)e=d.charAt(j),"0"!==e&&(n=!1),n||(m+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(e));for(k=0;k<m.length;k++)f=m.charAt(k),p=""+o+f,o=p%97;return 1===o},"Please specify a valid IBAN"),a.validator.addMethod("integer",function(a,b){return this.optional(b)||/^-?\d+$/.test(a)},"A positive or negative non-decimal number please"),a.validator.addMethod("ipv4",function(a,b){return this.optional(b)||/^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(a)},"Please enter a valid IP v4 address."),a.validator.addMethod("ipv6",function(a,b){return this.optional(b)||/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(a)},"Please enter a valid IP v6 address."),a.validator.addMethod("lettersonly",function(a,b){return this.optional(b)||/^[a-z]+$/i.test(a)},"Letters only please"),a.validator.addMethod("letterswithbasicpunc",function(a,b){return this.optional(b)||/^[a-z\-.,()'"\s]+$/i.test(a)},"Letters or punctuation only please"),a.validator.addMethod("mobileNL",function(a,b){return this.optional(b)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test(a)},"Please specify a valid mobile number"),a.validator.addMethod("mobileUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/)},"Please specify a valid mobile number"),a.validator.addMethod("nieES",function(a){"use strict";return a=a.toUpperCase(),a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")?/^[T]{1}/.test(a)?a[8]===/^[T]{1}[A-Z0-9]{8}$/.test(a):/^[XYZ]{1}/.test(a)?a[8]==="TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.replace("X","0").replace("Y","1").replace("Z","2").substring(0,8)%23):!1:!1},"Please specify a valid NIE number."),a.validator.addMethod("nifES",function(a){"use strict";return a=a.toUpperCase(),a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")?/^[0-9]{8}[A-Z]{1}$/.test(a)?"TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.substring(8,0)%23)===a.charAt(8):/^[KLM]{1}/.test(a)?a[8]===String.fromCharCode(64):!1:!1},"Please specify a valid NIF number."),jQuery.validator.addMethod("notEqualTo",function(b,c,d){return this.optional(c)||!a.validator.methods.equalTo.call(this,b,c,d)},"Please enter a different value, values must not be the same."),a.validator.addMethod("nowhitespace",function(a,b){return this.optional(b)||/^\S+$/i.test(a)},"No white space please"),a.validator.addMethod("pattern",function(a,b,c){return this.optional(b)?!0:("string"==typeof c&&(c=new RegExp("^(?:"+c+")$")),c.test(a))},"Invalid format."),a.validator.addMethod("phoneNL",function(a,b){return this.optional(b)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(a)},"Please specify a valid phone number."),a.validator.addMethod("phoneUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/)},"Please specify a valid phone number"),a.validator.addMethod("phoneUS",function(a,b){return a=a.replace(/\s+/g,""),this.optional(b)||a.length>9&&a.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]([02-9]\d|1[02-9])-?\d{4}$/)},"Please specify a valid phone number"),a.validator.addMethod("phonesUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/)},"Please specify a valid uk phone number"),a.validator.addMethod("postalCodeCA",function(a,b){return this.optional(b)||/^[ABCEGHJKLMNPRSTVXY]\d[A-Z] \d[A-Z]\d$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postalcodeBR",function(a,b){return this.optional(b)||/^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test(a)},"Informe um CEP válido."),a.validator.addMethod("postalcodeIT",function(a,b){return this.optional(b)||/^\d{5}$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postalcodeNL",function(a,b){return this.optional(b)||/^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postcodeUK",function(a,b){return this.optional(b)||/^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(a)},"Please specify a valid UK postcode"),a.validator.addMethod("require_from_group",function(b,c,d){var e=a(d[1],c.form),f=e.eq(0),g=f.data("valid_req_grp")?f.data("valid_req_grp"):a.extend({},this),h=e.filter(function(){return g.elementValue(this)}).length>=d[0];return f.data("valid_req_grp",g),a(c).data("being_validated")||(e.data("being_validated",!0),e.each(function(){g.element(this)}),e.data("being_validated",!1)),h},a.validator.format("Please fill at least {0} of these fields.")),a.validator.addMethod("skip_or_fill_minimum",function(b,c,d){var e=a(d[1],c.form),f=e.eq(0),g=f.data("valid_skip")?f.data("valid_skip"):a.extend({},this),h=e.filter(function(){return g.elementValue(this)}).length,i=0===h||h>=d[0];return f.data("valid_skip",g),a(c).data("being_validated")||(e.data("being_validated",!0),e.each(function(){g.element(this)}),e.data("being_validated",!1)),i},a.validator.format("Please either skip these fields or fill at least {0} of them.")),a.validator.addMethod("stateUS",function(a,b,c){var d,e="undefined"==typeof c,f=e||"undefined"==typeof c.caseSensitive?!1:c.caseSensitive,g=e||"undefined"==typeof c.includeTerritories?!1:c.includeTerritories,h=e||"undefined"==typeof c.includeMilitary?!1:c.includeMilitary;return d=g||h?g&&h?"^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":g?"^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":"^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$":"^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$",d=f?new RegExp(d):new RegExp(d,"i"),this.optional(b)||d.test(a)},"Please specify a valid state"),a.validator.addMethod("strippedminlength",function(b,c,d){return a(b).text().length>=d},a.validator.format("Please enter at least {0} characters")),a.validator.addMethod("time",function(a,b){return this.optional(b)||/^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test(a)},"Please enter a valid time, between 00:00 and 23:59"),a.validator.addMethod("time12h",function(a,b){return this.optional(b)||/^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(a)},"Please enter a valid time in 12-hour am/pm format"),a.validator.addMethod("url2",function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},a.validator.messages.url),a.validator.addMethod("vinUS",function(a){if(17!==a.length)return!1;var b,c,d,e,f,g,h=["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"],i=[1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9],j=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2],k=0;for(b=0;17>b;b++){if(e=j[b],d=a.slice(b,b+1),8===b&&(g=d),isNaN(d)){for(c=0;c<h.length;c++)if(d.toUpperCase()===h[c]){d=i[c],d*=e,isNaN(g)&&8===c&&(g=h[c]);break}}else d*=e;k+=d}return f=k%11,10===f&&(f="X"),f===g?!0:!1},"The specified vehicle identification number (VIN) is invalid."),a.validator.addMethod("zipcodeUS",function(a,b){return this.optional(b)||/^\d{5}(-\d{4})?$/.test(a)},"The specified US ZIP Code is invalid"),a.validator.addMethod("ziprange",function(a,b){return this.optional(b)||/^90[2-5]\d\{2\}-\d{4}$/.test(a)},"Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx")});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/jquery.validate.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/jquery.validate.js deleted file mode 100644 index 4e979bcf..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/jquery.validate.js +++ /dev/null @@ -1,1398 +0,0 @@ -/*! - * jQuery Validation Plugin v1.14.0 - * - * http://jqueryvalidation.org/ - * - * Copyright (c) 2015 Jörn Zaefferer - * Released under the MIT license - */ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -$.extend($.fn, { - // http://jqueryvalidation.org/validate/ - validate: function( options ) { - - // if nothing is selected, return nothing; can't chain anyway - if ( !this.length ) { - if ( options && options.debug && window.console ) { - console.warn( "Nothing selected, can't validate, returning nothing." ); - } - return; - } - - // check if a validator for this form was already created - var validator = $.data( this[ 0 ], "validator" ); - if ( validator ) { - return validator; - } - - // Add novalidate tag if HTML5. - this.attr( "novalidate", "novalidate" ); - - validator = new $.validator( options, this[ 0 ] ); - $.data( this[ 0 ], "validator", validator ); - - if ( validator.settings.onsubmit ) { - - this.on( "click.validate", ":submit", function( event ) { - if ( validator.settings.submitHandler ) { - validator.submitButton = event.target; - } - - // allow suppressing validation by adding a cancel class to the submit button - if ( $( this ).hasClass( "cancel" ) ) { - validator.cancelSubmit = true; - } - - // allow suppressing validation by adding the html5 formnovalidate attribute to the submit button - if ( $( this ).attr( "formnovalidate" ) !== undefined ) { - validator.cancelSubmit = true; - } - }); - - // validate the form on submit - this.on( "submit.validate", function( event ) { - if ( validator.settings.debug ) { - // prevent form submit to be able to see console output - event.preventDefault(); - } - function handle() { - var hidden, result; - if ( validator.settings.submitHandler ) { - if ( validator.submitButton ) { - // insert a hidden input as a replacement for the missing submit button - hidden = $( "<input type='hidden'/>" ) - .attr( "name", validator.submitButton.name ) - .val( $( validator.submitButton ).val() ) - .appendTo( validator.currentForm ); - } - result = validator.settings.submitHandler.call( validator, validator.currentForm, event ); - if ( validator.submitButton ) { - // and clean up afterwards; thanks to no-block-scope, hidden can be referenced - hidden.remove(); - } - if ( result !== undefined ) { - return result; - } - return false; - } - return true; - } - - // prevent submit for invalid forms or custom submit handlers - if ( validator.cancelSubmit ) { - validator.cancelSubmit = false; - return handle(); - } - if ( validator.form() ) { - if ( validator.pendingRequest ) { - validator.formSubmitted = true; - return false; - } - return handle(); - } else { - validator.focusInvalid(); - return false; - } - }); - } - - return validator; - }, - // http://jqueryvalidation.org/valid/ - valid: function() { - var valid, validator, errorList; - - if ( $( this[ 0 ] ).is( "form" ) ) { - valid = this.validate().form(); - } else { - errorList = []; - valid = true; - validator = $( this[ 0 ].form ).validate(); - this.each( function() { - valid = validator.element( this ) && valid; - errorList = errorList.concat( validator.errorList ); - }); - validator.errorList = errorList; - } - return valid; - }, - - // http://jqueryvalidation.org/rules/ - rules: function( command, argument ) { - var element = this[ 0 ], - settings, staticRules, existingRules, data, param, filtered; - - if ( command ) { - settings = $.data( element.form, "validator" ).settings; - staticRules = settings.rules; - existingRules = $.validator.staticRules( element ); - switch ( command ) { - case "add": - $.extend( existingRules, $.validator.normalizeRule( argument ) ); - // remove messages from rules, but allow them to be set separately - delete existingRules.messages; - staticRules[ element.name ] = existingRules; - if ( argument.messages ) { - settings.messages[ element.name ] = $.extend( settings.messages[ element.name ], argument.messages ); - } - break; - case "remove": - if ( !argument ) { - delete staticRules[ element.name ]; - return existingRules; - } - filtered = {}; - $.each( argument.split( /\s/ ), function( index, method ) { - filtered[ method ] = existingRules[ method ]; - delete existingRules[ method ]; - if ( method === "required" ) { - $( element ).removeAttr( "aria-required" ); - } - }); - return filtered; - } - } - - data = $.validator.normalizeRules( - $.extend( - {}, - $.validator.classRules( element ), - $.validator.attributeRules( element ), - $.validator.dataRules( element ), - $.validator.staticRules( element ) - ), element ); - - // make sure required is at front - if ( data.required ) { - param = data.required; - delete data.required; - data = $.extend( { required: param }, data ); - $( element ).attr( "aria-required", "true" ); - } - - // make sure remote is at back - if ( data.remote ) { - param = data.remote; - delete data.remote; - data = $.extend( data, { remote: param }); - } - - return data; - } -}); - -// Custom selectors -$.extend( $.expr[ ":" ], { - // http://jqueryvalidation.org/blank-selector/ - blank: function( a ) { - return !$.trim( "" + $( a ).val() ); - }, - // http://jqueryvalidation.org/filled-selector/ - filled: function( a ) { - return !!$.trim( "" + $( a ).val() ); - }, - // http://jqueryvalidation.org/unchecked-selector/ - unchecked: function( a ) { - return !$( a ).prop( "checked" ); - } -}); - -// constructor for validator -$.validator = function( options, form ) { - this.settings = $.extend( true, {}, $.validator.defaults, options ); - this.currentForm = form; - this.init(); -}; - -// http://jqueryvalidation.org/jQuery.validator.format/ -$.validator.format = function( source, params ) { - if ( arguments.length === 1 ) { - return function() { - var args = $.makeArray( arguments ); - args.unshift( source ); - return $.validator.format.apply( this, args ); - }; - } - if ( arguments.length > 2 && params.constructor !== Array ) { - params = $.makeArray( arguments ).slice( 1 ); - } - if ( params.constructor !== Array ) { - params = [ params ]; - } - $.each( params, function( i, n ) { - source = source.replace( new RegExp( "\\{" + i + "\\}", "g" ), function() { - return n; - }); - }); - return source; -}; - -$.extend( $.validator, { - - defaults: { - messages: {}, - groups: {}, - rules: {}, - errorClass: "error", - validClass: "valid", - errorElement: "label", - focusCleanup: false, - focusInvalid: true, - errorContainer: $( [] ), - errorLabelContainer: $( [] ), - onsubmit: true, - ignore: ":hidden", - ignoreTitle: false, - onfocusin: function( element ) { - this.lastActive = element; - - // Hide error label and remove error class on focus if enabled - if ( this.settings.focusCleanup ) { - if ( this.settings.unhighlight ) { - this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass ); - } - this.hideThese( this.errorsFor( element ) ); - } - }, - onfocusout: function( element ) { - if ( !this.checkable( element ) && ( element.name in this.submitted || !this.optional( element ) ) ) { - this.element( element ); - } - }, - onkeyup: function( element, event ) { - // Avoid revalidate the field when pressing one of the following keys - // Shift => 16 - // Ctrl => 17 - // Alt => 18 - // Caps lock => 20 - // End => 35 - // Home => 36 - // Left arrow => 37 - // Up arrow => 38 - // Right arrow => 39 - // Down arrow => 40 - // Insert => 45 - // Num lock => 144 - // AltGr key => 225 - var excludedKeys = [ - 16, 17, 18, 20, 35, 36, 37, - 38, 39, 40, 45, 144, 225 - ]; - - if ( event.which === 9 && this.elementValue( element ) === "" || $.inArray( event.keyCode, excludedKeys ) !== -1 ) { - return; - } else if ( element.name in this.submitted || element === this.lastElement ) { - this.element( element ); - } - }, - onclick: function( element ) { - // click on selects, radiobuttons and checkboxes - if ( element.name in this.submitted ) { - this.element( element ); - - // or option elements, check parent select in that case - } else if ( element.parentNode.name in this.submitted ) { - this.element( element.parentNode ); - } - }, - highlight: function( element, errorClass, validClass ) { - if ( element.type === "radio" ) { - this.findByName( element.name ).addClass( errorClass ).removeClass( validClass ); - } else { - $( element ).addClass( errorClass ).removeClass( validClass ); - } - }, - unhighlight: function( element, errorClass, validClass ) { - if ( element.type === "radio" ) { - this.findByName( element.name ).removeClass( errorClass ).addClass( validClass ); - } else { - $( element ).removeClass( errorClass ).addClass( validClass ); - } - } - }, - - // http://jqueryvalidation.org/jQuery.validator.setDefaults/ - setDefaults: function( settings ) { - $.extend( $.validator.defaults, settings ); - }, - - messages: { - required: "This field is required.", - remote: "Please fix this field.", - email: "Please enter a valid email address.", - url: "Please enter a valid URL.", - date: "Please enter a valid date.", - dateISO: "Please enter a valid date ( ISO ).", - number: "Please enter a valid number.", - digits: "Please enter only digits.", - creditcard: "Please enter a valid credit card number.", - equalTo: "Please enter the same value again.", - maxlength: $.validator.format( "Please enter no more than {0} characters." ), - minlength: $.validator.format( "Please enter at least {0} characters." ), - rangelength: $.validator.format( "Please enter a value between {0} and {1} characters long." ), - range: $.validator.format( "Please enter a value between {0} and {1}." ), - max: $.validator.format( "Please enter a value less than or equal to {0}." ), - min: $.validator.format( "Please enter a value greater than or equal to {0}." ) - }, - - autoCreateRanges: false, - - prototype: { - - init: function() { - this.labelContainer = $( this.settings.errorLabelContainer ); - this.errorContext = this.labelContainer.length && this.labelContainer || $( this.currentForm ); - this.containers = $( this.settings.errorContainer ).add( this.settings.errorLabelContainer ); - this.submitted = {}; - this.valueCache = {}; - this.pendingRequest = 0; - this.pending = {}; - this.invalid = {}; - this.reset(); - - var groups = ( this.groups = {} ), - rules; - $.each( this.settings.groups, function( key, value ) { - if ( typeof value === "string" ) { - value = value.split( /\s/ ); - } - $.each( value, function( index, name ) { - groups[ name ] = key; - }); - }); - rules = this.settings.rules; - $.each( rules, function( key, value ) { - rules[ key ] = $.validator.normalizeRule( value ); - }); - - function delegate( event ) { - var validator = $.data( this.form, "validator" ), - eventType = "on" + event.type.replace( /^validate/, "" ), - settings = validator.settings; - if ( settings[ eventType ] && !$( this ).is( settings.ignore ) ) { - settings[ eventType ].call( validator, this, event ); - } - } - - $( this.currentForm ) - .on( "focusin.validate focusout.validate keyup.validate", - ":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], " + - "[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], " + - "[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], " + - "[type='radio'], [type='checkbox']", delegate) - // Support: Chrome, oldIE - // "select" is provided as event.target when clicking a option - .on("click.validate", "select, option, [type='radio'], [type='checkbox']", delegate); - - if ( this.settings.invalidHandler ) { - $( this.currentForm ).on( "invalid-form.validate", this.settings.invalidHandler ); - } - - // Add aria-required to any Static/Data/Class required fields before first validation - // Screen readers require this attribute to be present before the initial submission http://www.w3.org/TR/WCAG-TECHS/ARIA2.html - $( this.currentForm ).find( "[required], [data-rule-required], .required" ).attr( "aria-required", "true" ); - }, - - // http://jqueryvalidation.org/Validator.form/ - form: function() { - this.checkForm(); - $.extend( this.submitted, this.errorMap ); - this.invalid = $.extend({}, this.errorMap ); - if ( !this.valid() ) { - $( this.currentForm ).triggerHandler( "invalid-form", [ this ]); - } - this.showErrors(); - return this.valid(); - }, - - checkForm: function() { - this.prepareForm(); - for ( var i = 0, elements = ( this.currentElements = this.elements() ); elements[ i ]; i++ ) { - this.check( elements[ i ] ); - } - return this.valid(); - }, - - // http://jqueryvalidation.org/Validator.element/ - element: function( element ) { - var cleanElement = this.clean( element ), - checkElement = this.validationTargetFor( cleanElement ), - result = true; - - this.lastElement = checkElement; - - if ( checkElement === undefined ) { - delete this.invalid[ cleanElement.name ]; - } else { - this.prepareElement( checkElement ); - this.currentElements = $( checkElement ); - - result = this.check( checkElement ) !== false; - if ( result ) { - delete this.invalid[ checkElement.name ]; - } else { - this.invalid[ checkElement.name ] = true; - } - } - // Add aria-invalid status for screen readers - $( element ).attr( "aria-invalid", !result ); - - if ( !this.numberOfInvalids() ) { - // Hide error containers on last error - this.toHide = this.toHide.add( this.containers ); - } - this.showErrors(); - return result; - }, - - // http://jqueryvalidation.org/Validator.showErrors/ - showErrors: function( errors ) { - if ( errors ) { - // add items to error list and map - $.extend( this.errorMap, errors ); - this.errorList = []; - for ( var name in errors ) { - this.errorList.push({ - message: errors[ name ], - element: this.findByName( name )[ 0 ] - }); - } - // remove items from success list - this.successList = $.grep( this.successList, function( element ) { - return !( element.name in errors ); - }); - } - if ( this.settings.showErrors ) { - this.settings.showErrors.call( this, this.errorMap, this.errorList ); - } else { - this.defaultShowErrors(); - } - }, - - // http://jqueryvalidation.org/Validator.resetForm/ - resetForm: function() { - if ( $.fn.resetForm ) { - $( this.currentForm ).resetForm(); - } - this.submitted = {}; - this.lastElement = null; - this.prepareForm(); - this.hideErrors(); - var i, elements = this.elements() - .removeData( "previousValue" ) - .removeAttr( "aria-invalid" ); - - if ( this.settings.unhighlight ) { - for ( i = 0; elements[ i ]; i++ ) { - this.settings.unhighlight.call( this, elements[ i ], - this.settings.errorClass, "" ); - } - } else { - elements.removeClass( this.settings.errorClass ); - } - }, - - numberOfInvalids: function() { - return this.objectLength( this.invalid ); - }, - - objectLength: function( obj ) { - /* jshint unused: false */ - var count = 0, - i; - for ( i in obj ) { - count++; - } - return count; - }, - - hideErrors: function() { - this.hideThese( this.toHide ); - }, - - hideThese: function( errors ) { - errors.not( this.containers ).text( "" ); - this.addWrapper( errors ).hide(); - }, - - valid: function() { - return this.size() === 0; - }, - - size: function() { - return this.errorList.length; - }, - - focusInvalid: function() { - if ( this.settings.focusInvalid ) { - try { - $( this.findLastActive() || this.errorList.length && this.errorList[ 0 ].element || []) - .filter( ":visible" ) - .focus() - // manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find - .trigger( "focusin" ); - } catch ( e ) { - // ignore IE throwing errors when focusing hidden elements - } - } - }, - - findLastActive: function() { - var lastActive = this.lastActive; - return lastActive && $.grep( this.errorList, function( n ) { - return n.element.name === lastActive.name; - }).length === 1 && lastActive; - }, - - elements: function() { - var validator = this, - rulesCache = {}; - - // select all valid inputs inside the form (no submit or reset buttons) - return $( this.currentForm ) - .find( "input, select, textarea" ) - .not( ":submit, :reset, :image, :disabled" ) - .not( this.settings.ignore ) - .filter( function() { - if ( !this.name && validator.settings.debug && window.console ) { - console.error( "%o has no name assigned", this ); - } - - // select only the first element for each name, and only those with rules specified - if ( this.name in rulesCache || !validator.objectLength( $( this ).rules() ) ) { - return false; - } - - rulesCache[ this.name ] = true; - return true; - }); - }, - - clean: function( selector ) { - return $( selector )[ 0 ]; - }, - - errors: function() { - var errorClass = this.settings.errorClass.split( " " ).join( "." ); - return $( this.settings.errorElement + "." + errorClass, this.errorContext ); - }, - - reset: function() { - this.successList = []; - this.errorList = []; - this.errorMap = {}; - this.toShow = $( [] ); - this.toHide = $( [] ); - this.currentElements = $( [] ); - }, - - prepareForm: function() { - this.reset(); - this.toHide = this.errors().add( this.containers ); - }, - - prepareElement: function( element ) { - this.reset(); - this.toHide = this.errorsFor( element ); - }, - - elementValue: function( element ) { - var val, - $element = $( element ), - type = element.type; - - if ( type === "radio" || type === "checkbox" ) { - return this.findByName( element.name ).filter(":checked").val(); - } else if ( type === "number" && typeof element.validity !== "undefined" ) { - return element.validity.badInput ? false : $element.val(); - } - - val = $element.val(); - if ( typeof val === "string" ) { - return val.replace(/\r/g, "" ); - } - return val; - }, - - check: function( element ) { - element = this.validationTargetFor( this.clean( element ) ); - - var rules = $( element ).rules(), - rulesCount = $.map( rules, function( n, i ) { - return i; - }).length, - dependencyMismatch = false, - val = this.elementValue( element ), - result, method, rule; - - for ( method in rules ) { - rule = { method: method, parameters: rules[ method ] }; - try { - - result = $.validator.methods[ method ].call( this, val, element, rule.parameters ); - - // if a method indicates that the field is optional and therefore valid, - // don't mark it as valid when there are no other rules - if ( result === "dependency-mismatch" && rulesCount === 1 ) { - dependencyMismatch = true; - continue; - } - dependencyMismatch = false; - - if ( result === "pending" ) { - this.toHide = this.toHide.not( this.errorsFor( element ) ); - return; - } - - if ( !result ) { - this.formatAndAdd( element, rule ); - return false; - } - } catch ( e ) { - if ( this.settings.debug && window.console ) { - console.log( "Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e ); - } - if ( e instanceof TypeError ) { - e.message += ". Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method."; - } - - throw e; - } - } - if ( dependencyMismatch ) { - return; - } - if ( this.objectLength( rules ) ) { - this.successList.push( element ); - } - return true; - }, - - // return the custom message for the given element and validation method - // specified in the element's HTML5 data attribute - // return the generic message if present and no method specific message is present - customDataMessage: function( element, method ) { - return $( element ).data( "msg" + method.charAt( 0 ).toUpperCase() + - method.substring( 1 ).toLowerCase() ) || $( element ).data( "msg" ); - }, - - // return the custom message for the given element name and validation method - customMessage: function( name, method ) { - var m = this.settings.messages[ name ]; - return m && ( m.constructor === String ? m : m[ method ]); - }, - - // return the first defined argument, allowing empty strings - findDefined: function() { - for ( var i = 0; i < arguments.length; i++) { - if ( arguments[ i ] !== undefined ) { - return arguments[ i ]; - } - } - return undefined; - }, - - defaultMessage: function( element, method ) { - return this.findDefined( - this.customMessage( element.name, method ), - this.customDataMessage( element, method ), - // title is never undefined, so handle empty string as undefined - !this.settings.ignoreTitle && element.title || undefined, - $.validator.messages[ method ], - "<strong>Warning: No message defined for " + element.name + "</strong>" - ); - }, - - formatAndAdd: function( element, rule ) { - var message = this.defaultMessage( element, rule.method ), - theregex = /\$?\{(\d+)\}/g; - if ( typeof message === "function" ) { - message = message.call( this, rule.parameters, element ); - } else if ( theregex.test( message ) ) { - message = $.validator.format( message.replace( theregex, "{$1}" ), rule.parameters ); - } - this.errorList.push({ - message: message, - element: element, - method: rule.method - }); - - this.errorMap[ element.name ] = message; - this.submitted[ element.name ] = message; - }, - - addWrapper: function( toToggle ) { - if ( this.settings.wrapper ) { - toToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) ); - } - return toToggle; - }, - - defaultShowErrors: function() { - var i, elements, error; - for ( i = 0; this.errorList[ i ]; i++ ) { - error = this.errorList[ i ]; - if ( this.settings.highlight ) { - this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.validClass ); - } - this.showLabel( error.element, error.message ); - } - if ( this.errorList.length ) { - this.toShow = this.toShow.add( this.containers ); - } - if ( this.settings.success ) { - for ( i = 0; this.successList[ i ]; i++ ) { - this.showLabel( this.successList[ i ] ); - } - } - if ( this.settings.unhighlight ) { - for ( i = 0, elements = this.validElements(); elements[ i ]; i++ ) { - this.settings.unhighlight.call( this, elements[ i ], this.settings.errorClass, this.settings.validClass ); - } - } - this.toHide = this.toHide.not( this.toShow ); - this.hideErrors(); - this.addWrapper( this.toShow ).show(); - }, - - validElements: function() { - return this.currentElements.not( this.invalidElements() ); - }, - - invalidElements: function() { - return $( this.errorList ).map(function() { - return this.element; - }); - }, - - showLabel: function( element, message ) { - var place, group, errorID, - error = this.errorsFor( element ), - elementID = this.idOrName( element ), - describedBy = $( element ).attr( "aria-describedby" ); - if ( error.length ) { - // refresh error/success class - error.removeClass( this.settings.validClass ).addClass( this.settings.errorClass ); - // replace message on existing label - error.html( message ); - } else { - // create error element - error = $( "<" + this.settings.errorElement + ">" ) - .attr( "id", elementID + "-error" ) - .addClass( this.settings.errorClass ) - .html( message || "" ); - - // Maintain reference to the element to be placed into the DOM - place = error; - if ( this.settings.wrapper ) { - // make sure the element is visible, even in IE - // actually showing the wrapped element is handled elsewhere - place = error.hide().show().wrap( "<" + this.settings.wrapper + "/>" ).parent(); - } - if ( this.labelContainer.length ) { - this.labelContainer.append( place ); - } else if ( this.settings.errorPlacement ) { - this.settings.errorPlacement( place, $( element ) ); - } else { - place.insertAfter( element ); - } - - // Link error back to the element - if ( error.is( "label" ) ) { - // If the error is a label, then associate using 'for' - error.attr( "for", elementID ); - } else if ( error.parents( "label[for='" + elementID + "']" ).length === 0 ) { - // If the element is not a child of an associated label, then it's necessary - // to explicitly apply aria-describedby - - errorID = error.attr( "id" ).replace( /(:|\.|\[|\]|\$)/g, "\\$1"); - // Respect existing non-error aria-describedby - if ( !describedBy ) { - describedBy = errorID; - } else if ( !describedBy.match( new RegExp( "\\b" + errorID + "\\b" ) ) ) { - // Add to end of list if not already present - describedBy += " " + errorID; - } - $( element ).attr( "aria-describedby", describedBy ); - - // If this element is grouped, then assign to all elements in the same group - group = this.groups[ element.name ]; - if ( group ) { - $.each( this.groups, function( name, testgroup ) { - if ( testgroup === group ) { - $( "[name='" + name + "']", this.currentForm ) - .attr( "aria-describedby", error.attr( "id" ) ); - } - }); - } - } - } - if ( !message && this.settings.success ) { - error.text( "" ); - if ( typeof this.settings.success === "string" ) { - error.addClass( this.settings.success ); - } else { - this.settings.success( error, element ); - } - } - this.toShow = this.toShow.add( error ); - }, - - errorsFor: function( element ) { - var name = this.idOrName( element ), - describer = $( element ).attr( "aria-describedby" ), - selector = "label[for='" + name + "'], label[for='" + name + "'] *"; - - // aria-describedby should directly reference the error element - if ( describer ) { - selector = selector + ", #" + describer.replace( /\s+/g, ", #" ); - } - return this - .errors() - .filter( selector ); - }, - - idOrName: function( element ) { - return this.groups[ element.name ] || ( this.checkable( element ) ? element.name : element.id || element.name ); - }, - - validationTargetFor: function( element ) { - - // If radio/checkbox, validate first element in group instead - if ( this.checkable( element ) ) { - element = this.findByName( element.name ); - } - - // Always apply ignore filter - return $( element ).not( this.settings.ignore )[ 0 ]; - }, - - checkable: function( element ) { - return ( /radio|checkbox/i ).test( element.type ); - }, - - findByName: function( name ) { - return $( this.currentForm ).find( "[name='" + name + "']" ); - }, - - getLength: function( value, element ) { - switch ( element.nodeName.toLowerCase() ) { - case "select": - return $( "option:selected", element ).length; - case "input": - if ( this.checkable( element ) ) { - return this.findByName( element.name ).filter( ":checked" ).length; - } - } - return value.length; - }, - - depend: function( param, element ) { - return this.dependTypes[typeof param] ? this.dependTypes[typeof param]( param, element ) : true; - }, - - dependTypes: { - "boolean": function( param ) { - return param; - }, - "string": function( param, element ) { - return !!$( param, element.form ).length; - }, - "function": function( param, element ) { - return param( element ); - } - }, - - optional: function( element ) { - var val = this.elementValue( element ); - return !$.validator.methods.required.call( this, val, element ) && "dependency-mismatch"; - }, - - startRequest: function( element ) { - if ( !this.pending[ element.name ] ) { - this.pendingRequest++; - this.pending[ element.name ] = true; - } - }, - - stopRequest: function( element, valid ) { - this.pendingRequest--; - // sometimes synchronization fails, make sure pendingRequest is never < 0 - if ( this.pendingRequest < 0 ) { - this.pendingRequest = 0; - } - delete this.pending[ element.name ]; - if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() ) { - $( this.currentForm ).submit(); - this.formSubmitted = false; - } else if (!valid && this.pendingRequest === 0 && this.formSubmitted ) { - $( this.currentForm ).triggerHandler( "invalid-form", [ this ]); - this.formSubmitted = false; - } - }, - - previousValue: function( element ) { - return $.data( element, "previousValue" ) || $.data( element, "previousValue", { - old: null, - valid: true, - message: this.defaultMessage( element, "remote" ) - }); - }, - - // cleans up all forms and elements, removes validator-specific events - destroy: function() { - this.resetForm(); - - $( this.currentForm ) - .off( ".validate" ) - .removeData( "validator" ); - } - - }, - - classRuleSettings: { - required: { required: true }, - email: { email: true }, - url: { url: true }, - date: { date: true }, - dateISO: { dateISO: true }, - number: { number: true }, - digits: { digits: true }, - creditcard: { creditcard: true } - }, - - addClassRules: function( className, rules ) { - if ( className.constructor === String ) { - this.classRuleSettings[ className ] = rules; - } else { - $.extend( this.classRuleSettings, className ); - } - }, - - classRules: function( element ) { - var rules = {}, - classes = $( element ).attr( "class" ); - - if ( classes ) { - $.each( classes.split( " " ), function() { - if ( this in $.validator.classRuleSettings ) { - $.extend( rules, $.validator.classRuleSettings[ this ]); - } - }); - } - return rules; - }, - - normalizeAttributeRule: function( rules, type, method, value ) { - - // convert the value to a number for number inputs, and for text for backwards compability - // allows type="date" and others to be compared as strings - if ( /min|max/.test( method ) && ( type === null || /number|range|text/.test( type ) ) ) { - value = Number( value ); - - // Support Opera Mini, which returns NaN for undefined minlength - if ( isNaN( value ) ) { - value = undefined; - } - } - - if ( value || value === 0 ) { - rules[ method ] = value; - } else if ( type === method && type !== "range" ) { - - // exception: the jquery validate 'range' method - // does not test for the html5 'range' type - rules[ method ] = true; - } - }, - - attributeRules: function( element ) { - var rules = {}, - $element = $( element ), - type = element.getAttribute( "type" ), - method, value; - - for ( method in $.validator.methods ) { - - // support for <input required> in both html5 and older browsers - if ( method === "required" ) { - value = element.getAttribute( method ); - - // Some browsers return an empty string for the required attribute - // and non-HTML5 browsers might have required="" markup - if ( value === "" ) { - value = true; - } - - // force non-HTML5 browsers to return bool - value = !!value; - } else { - value = $element.attr( method ); - } - - this.normalizeAttributeRule( rules, type, method, value ); - } - - // maxlength may be returned as -1, 2147483647 ( IE ) and 524288 ( safari ) for text inputs - if ( rules.maxlength && /-1|2147483647|524288/.test( rules.maxlength ) ) { - delete rules.maxlength; - } - - return rules; - }, - - dataRules: function( element ) { - var rules = {}, - $element = $( element ), - type = element.getAttribute( "type" ), - method, value; - - for ( method in $.validator.methods ) { - value = $element.data( "rule" + method.charAt( 0 ).toUpperCase() + method.substring( 1 ).toLowerCase() ); - this.normalizeAttributeRule( rules, type, method, value ); - } - return rules; - }, - - staticRules: function( element ) { - var rules = {}, - validator = $.data( element.form, "validator" ); - - if ( validator.settings.rules ) { - rules = $.validator.normalizeRule( validator.settings.rules[ element.name ] ) || {}; - } - return rules; - }, - - normalizeRules: function( rules, element ) { - // handle dependency check - $.each( rules, function( prop, val ) { - // ignore rule when param is explicitly false, eg. required:false - if ( val === false ) { - delete rules[ prop ]; - return; - } - if ( val.param || val.depends ) { - var keepRule = true; - switch ( typeof val.depends ) { - case "string": - keepRule = !!$( val.depends, element.form ).length; - break; - case "function": - keepRule = val.depends.call( element, element ); - break; - } - if ( keepRule ) { - rules[ prop ] = val.param !== undefined ? val.param : true; - } else { - delete rules[ prop ]; - } - } - }); - - // evaluate parameters - $.each( rules, function( rule, parameter ) { - rules[ rule ] = $.isFunction( parameter ) ? parameter( element ) : parameter; - }); - - // clean number parameters - $.each([ "minlength", "maxlength" ], function() { - if ( rules[ this ] ) { - rules[ this ] = Number( rules[ this ] ); - } - }); - $.each([ "rangelength", "range" ], function() { - var parts; - if ( rules[ this ] ) { - if ( $.isArray( rules[ this ] ) ) { - rules[ this ] = [ Number( rules[ this ][ 0 ]), Number( rules[ this ][ 1 ] ) ]; - } else if ( typeof rules[ this ] === "string" ) { - parts = rules[ this ].replace(/[\[\]]/g, "" ).split( /[\s,]+/ ); - rules[ this ] = [ Number( parts[ 0 ]), Number( parts[ 1 ] ) ]; - } - } - }); - - if ( $.validator.autoCreateRanges ) { - // auto-create ranges - if ( rules.min != null && rules.max != null ) { - rules.range = [ rules.min, rules.max ]; - delete rules.min; - delete rules.max; - } - if ( rules.minlength != null && rules.maxlength != null ) { - rules.rangelength = [ rules.minlength, rules.maxlength ]; - delete rules.minlength; - delete rules.maxlength; - } - } - - return rules; - }, - - // Converts a simple string to a {string: true} rule, e.g., "required" to {required:true} - normalizeRule: function( data ) { - if ( typeof data === "string" ) { - var transformed = {}; - $.each( data.split( /\s/ ), function() { - transformed[ this ] = true; - }); - data = transformed; - } - return data; - }, - - // http://jqueryvalidation.org/jQuery.validator.addMethod/ - addMethod: function( name, method, message ) { - $.validator.methods[ name ] = method; - $.validator.messages[ name ] = message !== undefined ? message : $.validator.messages[ name ]; - if ( method.length < 3 ) { - $.validator.addClassRules( name, $.validator.normalizeRule( name ) ); - } - }, - - methods: { - - // http://jqueryvalidation.org/required-method/ - required: function( value, element, param ) { - // check if dependency is met - if ( !this.depend( param, element ) ) { - return "dependency-mismatch"; - } - if ( element.nodeName.toLowerCase() === "select" ) { - // could be an array for select-multiple or a string, both are fine this way - var val = $( element ).val(); - return val && val.length > 0; - } - if ( this.checkable( element ) ) { - return this.getLength( value, element ) > 0; - } - return value.length > 0; - }, - - // http://jqueryvalidation.org/email-method/ - email: function( value, element ) { - // From https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address - // Retrieved 2014-01-14 - // If you have a problem with this implementation, report a bug against the above spec - // Or use custom methods to implement your own email validation - return this.optional( element ) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test( value ); - }, - - // http://jqueryvalidation.org/url-method/ - url: function( value, element ) { - - // Copyright (c) 2010-2013 Diego Perini, MIT licensed - // https://gist.github.com/dperini/729294 - // see also https://mathiasbynens.be/demo/url-regex - // modified to allow protocol-relative URLs - return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value ); - }, - - // http://jqueryvalidation.org/date-method/ - date: function( value, element ) { - return this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() ); - }, - - // http://jqueryvalidation.org/dateISO-method/ - dateISO: function( value, element ) { - return this.optional( element ) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test( value ); - }, - - // http://jqueryvalidation.org/number-method/ - number: function( value, element ) { - return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test( value ); - }, - - // http://jqueryvalidation.org/digits-method/ - digits: function( value, element ) { - return this.optional( element ) || /^\d+$/.test( value ); - }, - - // http://jqueryvalidation.org/creditcard-method/ - // based on http://en.wikipedia.org/wiki/Luhn_algorithm - creditcard: function( value, element ) { - if ( this.optional( element ) ) { - return "dependency-mismatch"; - } - // accept only spaces, digits and dashes - if ( /[^0-9 \-]+/.test( value ) ) { - return false; - } - var nCheck = 0, - nDigit = 0, - bEven = false, - n, cDigit; - - value = value.replace( /\D/g, "" ); - - // Basing min and max length on - // http://developer.ean.com/general_info/Valid_Credit_Card_Types - if ( value.length < 13 || value.length > 19 ) { - return false; - } - - for ( n = value.length - 1; n >= 0; n--) { - cDigit = value.charAt( n ); - nDigit = parseInt( cDigit, 10 ); - if ( bEven ) { - if ( ( nDigit *= 2 ) > 9 ) { - nDigit -= 9; - } - } - nCheck += nDigit; - bEven = !bEven; - } - - return ( nCheck % 10 ) === 0; - }, - - // http://jqueryvalidation.org/minlength-method/ - minlength: function( value, element, param ) { - var length = $.isArray( value ) ? value.length : this.getLength( value, element ); - return this.optional( element ) || length >= param; - }, - - // http://jqueryvalidation.org/maxlength-method/ - maxlength: function( value, element, param ) { - var length = $.isArray( value ) ? value.length : this.getLength( value, element ); - return this.optional( element ) || length <= param; - }, - - // http://jqueryvalidation.org/rangelength-method/ - rangelength: function( value, element, param ) { - var length = $.isArray( value ) ? value.length : this.getLength( value, element ); - return this.optional( element ) || ( length >= param[ 0 ] && length <= param[ 1 ] ); - }, - - // http://jqueryvalidation.org/min-method/ - min: function( value, element, param ) { - return this.optional( element ) || value >= param; - }, - - // http://jqueryvalidation.org/max-method/ - max: function( value, element, param ) { - return this.optional( element ) || value <= param; - }, - - // http://jqueryvalidation.org/range-method/ - range: function( value, element, param ) { - return this.optional( element ) || ( value >= param[ 0 ] && value <= param[ 1 ] ); - }, - - // http://jqueryvalidation.org/equalTo-method/ - equalTo: function( value, element, param ) { - // bind to the blur event of the target in order to revalidate whenever the target field is updated - // TODO find a way to bind the event just once, avoiding the unbind-rebind overhead - var target = $( param ); - if ( this.settings.onfocusout ) { - target.off( ".validate-equalTo" ).on( "blur.validate-equalTo", function() { - $( element ).valid(); - }); - } - return value === target.val(); - }, - - // http://jqueryvalidation.org/remote-method/ - remote: function( value, element, param ) { - if ( this.optional( element ) ) { - return "dependency-mismatch"; - } - - var previous = this.previousValue( element ), - validator, data; - - if (!this.settings.messages[ element.name ] ) { - this.settings.messages[ element.name ] = {}; - } - previous.originalMessage = this.settings.messages[ element.name ].remote; - this.settings.messages[ element.name ].remote = previous.message; - - param = typeof param === "string" && { url: param } || param; - - if ( previous.old === value ) { - return previous.valid; - } - - previous.old = value; - validator = this; - this.startRequest( element ); - data = {}; - data[ element.name ] = value; - $.ajax( $.extend( true, { - mode: "abort", - port: "validate" + element.name, - dataType: "json", - data: data, - context: validator.currentForm, - success: function( response ) { - var valid = response === true || response === "true", - errors, message, submitted; - - validator.settings.messages[ element.name ].remote = previous.originalMessage; - if ( valid ) { - submitted = validator.formSubmitted; - validator.prepareElement( element ); - validator.formSubmitted = submitted; - validator.successList.push( element ); - delete validator.invalid[ element.name ]; - validator.showErrors(); - } else { - errors = {}; - message = response || validator.defaultMessage( element, "remote" ); - errors[ element.name ] = previous.message = $.isFunction( message ) ? message( value ) : message; - validator.invalid[ element.name ] = true; - validator.showErrors( errors ); - } - previous.valid = valid; - validator.stopRequest( element, valid ); - } - }, param ) ); - return "pending"; - } - } - -}); - -// ajax mode: abort -// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]}); -// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort() - -var pendingRequests = {}, - ajax; -// Use a prefilter if available (1.5+) -if ( $.ajaxPrefilter ) { - $.ajaxPrefilter(function( settings, _, xhr ) { - var port = settings.port; - if ( settings.mode === "abort" ) { - if ( pendingRequests[port] ) { - pendingRequests[port].abort(); - } - pendingRequests[port] = xhr; - } - }); -} else { - // Proxy ajax - ajax = $.ajax; - $.ajax = function( settings ) { - var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode, - port = ( "port" in settings ? settings : $.ajaxSettings ).port; - if ( mode === "abort" ) { - if ( pendingRequests[port] ) { - pendingRequests[port].abort(); - } - pendingRequests[port] = ajax.apply(this, arguments); - return pendingRequests[port]; - } - return ajax.apply(this, arguments); - }; -} - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/jquery.validate.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/jquery.validate.min.js deleted file mode 100644 index 643837b9..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/jquery.validate.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.on("click.validate",":submit",function(b){c.settings.submitHandler&&(c.submitButton=b.target),a(this).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(this).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.on("submit.validate",function(b){function d(){var d,e;return c.settings.submitHandler?(c.submitButton&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),e=c.settings.submitHandler.call(c,c.currentForm,b),c.submitButton&&d.remove(),void 0!==e?e:!1):!0}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c,d;return a(this[0]).is("form")?b=this.validate().form():(d=[],b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b,d=d.concat(c.errorList)}),c.errorList=d),b},rules:function(b,c){var d,e,f,g,h,i,j=this[0];if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(b,c){i[c]=f[c],delete f[c],"required"===c&&a(j).removeAttr("aria-required")}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g),a(j).attr("aria-required","true")),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}),a.extend(a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){return!!a.trim(""+a(b).val())},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(b,c){var d=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===c.which&&""===this.elementValue(b)||-1!==a.inArray(c.keyCode,d)||(b.name in this.submitted||b===this.lastElement)&&this.element(b)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date ( ISO ).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c=a.data(this.form,"validator"),d="on"+b.type.replace(/^validate/,""),e=c.settings;e[d]&&!a(this).is(e.ignore)&&e[d].call(c,this,b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){d[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox']",b).on("click.validate","select, option, [type='radio'], [type='checkbox']",b),this.settings.invalidHandler&&a(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler),a(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required","true")},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c=this.clean(b),d=this.validationTargetFor(c),e=!0;return this.lastElement=d,void 0===d?delete this.invalid[c.name]:(this.prepareElement(d),this.currentElements=a(d),e=this.check(d)!==!1,e?delete this.invalid[d.name]:this.invalid[d.name]=!0),a(b).attr("aria-invalid",!e),this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),e},showErrors:function(b){if(b){a.extend(this.errorMap,b),this.errorList=[];for(var c in b)this.errorList.push({message:b[c],element:this.findByName(c)[0]});this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors();var b,c=this.elements().removeData("previousValue").removeAttr("aria-invalid");if(this.settings.unhighlight)for(b=0;c[b];b++)this.settings.unhighlight.call(this,c[b],this.settings.errorClass,"");else c.removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){return!this.name&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in c||!b.objectLength(a(this).rules())?!1:(c[this.name]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([]),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d=a(b),e=b.type;return"radio"===e||"checkbox"===e?this.findByName(b.name).filter(":checked").val():"number"===e&&"undefined"!=typeof b.validity?b.validity.badInput?!1:d.val():(c=d.val(),"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f=a(b).rules(),g=a.map(f,function(a,b){return b}).length,h=!1,i=this.elementValue(b);for(d in f){e={method:d,parameters:f[d]};try{if(c=a.validator.methods[d].call(this,i,b,e.parameters),"dependency-mismatch"===c&&1===g){h=!0;continue}if(h=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(j){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",j),j instanceof TypeError&&(j.message+=". Exception occurred when checking element "+b.id+", check the '"+e.method+"' method."),j}}if(!h)return this.objectLength(f)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a];return void 0},defaultMessage:function(b,c){return this.findDefined(this.customMessage(b.name,c),this.customDataMessage(b,c),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c],"<strong>Warning: No message defined for "+b.name+"</strong>")},formatAndAdd:function(b,c){var d=this.defaultMessage(b,c.method),e=/\$?\{(\d+)\}/g;"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),this.errorList.push({message:d,element:b,method:c.method}),this.errorMap[b.name]=d,this.submitted[b.name]=d},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g=this.errorsFor(b),h=this.idOrName(b),i=a(b).attr("aria-describedby");g.length?(g.removeClass(this.settings.validClass).addClass(this.settings.errorClass),g.html(c)):(g=a("<"+this.settings.errorElement+">").attr("id",h+"-error").addClass(this.settings.errorClass).html(c||""),d=g,this.settings.wrapper&&(d=g.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement(d,a(b)):d.insertAfter(b),g.is("label")?g.attr("for",h):0===g.parents("label[for='"+h+"']").length&&(f=g.attr("id").replace(/(:|\.|\[|\]|\$)/g,"\\$1"),i?i.match(new RegExp("\\b"+f+"\\b"))||(i+=" "+f):i=f,a(b).attr("aria-describedby",i),e=this.groups[b.name],e&&a.each(this.groups,function(b,c){c===e&&a("[name='"+b+"']",this.currentForm).attr("aria-describedby",g.attr("id"))}))),!c&&this.settings.success&&(g.text(""),"string"==typeof this.settings.success?g.addClass(this.settings.success):this.settings.success(g,b)),this.toShow=this.toShow.add(g)},errorsFor:function(b){var c=this.idOrName(b),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+d.replace(/\s+/g,", #")),this.errors().filter(e)},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+b+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):!0},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(a){this.pending[a.name]||(this.pendingRequest++,this.pending[a.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,"remote")})},destroy:function(){this.resetForm(),a(this.currentForm).off(".validate").removeData("validator")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},normalizeAttributeRule:function(a,b,c,d){/min|max/.test(c)&&(null===b||/number|range|text/.test(b))&&(d=Number(d),isNaN(d)&&(d=void 0)),d||0===d?a[c]=d:b===c&&"range"!==b&&(a[c]=!0)},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),this.normalizeAttributeRule(e,g,c,d);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),this.normalizeAttributeRule(e,g,c,d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0!==e.param?e.param:!0:delete b[d]}}),a.each(b,function(d,e){b[d]=a.isFunction(e)?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:b.length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a).toString())},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 \-]+/.test(a))return!1;var c,d,e=0,f=0,g=!1;if(a=a.replace(/\D/g,""),a.length<13||a.length>19)return!1;for(c=a.length-1;c>=0;c--)d=a.charAt(c),f=parseInt(d,10),g&&(f*=2)>9&&(f-=9),e+=f,g=!g;return e%10===0},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||d>=e},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||c>=a},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.off(".validate-equalTo").on("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d){if(this.optional(c))return"dependency-mismatch";var e,f,g=this.previousValue(c);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),g.originalMessage=this.settings.messages[c.name].remote,this.settings.messages[c.name].remote=g.message,d="string"==typeof d&&{url:d}||d,g.old===b?g.valid:(g.old=b,e=this,this.startRequest(c),f={},f[c.name]=b,a.ajax(a.extend(!0,{mode:"abort",port:"validate"+c.name,dataType:"json",data:f,context:e.currentForm,success:function(d){var f,h,i,j=d===!0||"true"===d;e.settings.messages[c.name].remote=g.originalMessage,j?(i=e.formSubmitted,e.prepareElement(c),e.formSubmitted=i,e.successList.push(c),delete e.invalid[c.name],e.showErrors()):(f={},h=d||e.defaultMessage(c,"remote"),f[c.name]=g.message=a.isFunction(h)?h(b):h,e.invalid[c.name]=!0,e.showErrors(f)),g.valid=j,e.stopRequest(c,j)}},d)),"pending")}}});var b,c={};a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=a.ajax,a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ar.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ar.js deleted file mode 100644 index e609dbb6..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ar.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: AR (Arabic; العربية) - */ -$.extend($.validator.messages, { - required: "هذا الحقل إلزامي", - remote: "يرجى تصحيح هذا الحقل للمتابعة", - email: "رجاء إدخال عنوان بريد إلكتروني صحيح", - url: "رجاء إدخال عنوان موقع إلكتروني صحيح", - date: "رجاء إدخال تاريخ صحيح", - dateISO: "رجاء إدخال تاريخ صحيح (ISO)", - number: "رجاء إدخال عدد بطريقة صحيحة", - digits: "رجاء إدخال أرقام فقط", - creditcard: "رجاء إدخال رقم بطاقة ائتمان صحيح", - equalTo: "رجاء إدخال نفس القيمة", - extension: "رجاء إدخال ملف بامتداد موافق عليه", - maxlength: $.validator.format("الحد الأقصى لعدد الحروف هو {0}"), - minlength: $.validator.format("الحد الأدنى لعدد الحروف هو {0}"), - rangelength: $.validator.format("عدد الحروف يجب أن يكون بين {0} و {1}"), - range: $.validator.format("رجاء إدخال عدد قيمته بين {0} و {1}"), - max: $.validator.format("رجاء إدخال عدد أقل من أو يساوي (0}"), - min: $.validator.format("رجاء إدخال عدد أكبر من أو يساوي (0}") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ar.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ar.min.js deleted file mode 100644 index b641c1a0..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ar.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"هذا الحقل إلزامي",remote:"يرجى تصحيح هذا الحقل للمتابعة",email:"رجاء إدخال عنوان بريد إلكتروني صحيح",url:"رجاء إدخال عنوان موقع إلكتروني صحيح",date:"رجاء إدخال تاريخ صحيح",dateISO:"رجاء إدخال تاريخ صحيح (ISO)",number:"رجاء إدخال عدد بطريقة صحيحة",digits:"رجاء إدخال أرقام فقط",creditcard:"رجاء إدخال رقم بطاقة ائتمان صحيح",equalTo:"رجاء إدخال نفس القيمة",extension:"رجاء إدخال ملف بامتداد موافق عليه",maxlength:a.validator.format("الحد الأقصى لعدد الحروف هو {0}"),minlength:a.validator.format("الحد الأدنى لعدد الحروف هو {0}"),rangelength:a.validator.format("عدد الحروف يجب أن يكون بين {0} و {1}"),range:a.validator.format("رجاء إدخال عدد قيمته بين {0} و {1}"),max:a.validator.format("رجاء إدخال عدد أقل من أو يساوي (0}"),min:a.validator.format("رجاء إدخال عدد أكبر من أو يساوي (0}")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_bg.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_bg.js deleted file mode 100644 index fea21cf5..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_bg.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: BG (Bulgarian; български език) - */ -$.extend($.validator.messages, { - required: "Полето е задължително.", - remote: "Моля, въведете правилната стойност.", - email: "Моля, въведете валиден email.", - url: "Моля, въведете валидно URL.", - date: "Моля, въведете валидна дата.", - dateISO: "Моля, въведете валидна дата (ISO).", - number: "Моля, въведете валиден номер.", - digits: "Моля, въведете само цифри.", - creditcard: "Моля, въведете валиден номер на кредитна карта.", - equalTo: "Моля, въведете същата стойност отново.", - extension: "Моля, въведете стойност с валидно разширение.", - maxlength: $.validator.format("Моля, въведете повече от {0} символа."), - minlength: $.validator.format("Моля, въведете поне {0} символа."), - rangelength: $.validator.format("Моля, въведете стойност с дължина между {0} и {1} символа."), - range: $.validator.format("Моля, въведете стойност между {0} и {1}."), - max: $.validator.format("Моля, въведете стойност по-малка или равна на {0}."), - min: $.validator.format("Моля, въведете стойност по-голяма или равна на {0}.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_bg.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_bg.min.js deleted file mode 100644 index 8f7251de..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_bg.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Полето е задължително.",remote:"Моля, въведете правилната стойност.",email:"Моля, въведете валиден email.",url:"Моля, въведете валидно URL.",date:"Моля, въведете валидна дата.",dateISO:"Моля, въведете валидна дата (ISO).",number:"Моля, въведете валиден номер.",digits:"Моля, въведете само цифри.",creditcard:"Моля, въведете валиден номер на кредитна карта.",equalTo:"Моля, въведете същата стойност отново.",extension:"Моля, въведете стойност с валидно разширение.",maxlength:a.validator.format("Моля, въведете повече от {0} символа."),minlength:a.validator.format("Моля, въведете поне {0} символа."),rangelength:a.validator.format("Моля, въведете стойност с дължина между {0} и {1} символа."),range:a.validator.format("Моля, въведете стойност между {0} и {1}."),max:a.validator.format("Моля, въведете стойност по-малка или равна на {0}."),min:a.validator.format("Моля, въведете стойност по-голяма или равна на {0}.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_bn_BD.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_bn_BD.js deleted file mode 100644 index 4d68aa41..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_bn_BD.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: bn_BD (Bengali, Bangladesh) - */ -$.extend($.validator.messages, { - required: "এই তথ্যটি আবশ্যক।", - remote: "এই তথ্যটি ঠিক করুন।", - email: "অনুগ্রহ করে একটি সঠিক মেইল ঠিকানা লিখুন।", - url: "অনুগ্রহ করে একটি সঠিক লিঙ্ক দিন।", - date: "তারিখ সঠিক নয়।", - dateISO: "অনুগ্রহ করে একটি সঠিক (ISO) তারিখ লিখুন।", - number: "অনুগ্রহ করে একটি সঠিক নম্বর লিখুন।", - digits: "এখানে শুধু সংখ্যা ব্যবহার করা যাবে।", - creditcard: "অনুগ্রহ করে একটি ক্রেডিট কার্ডের সঠিক নম্বর লিখুন।", - equalTo: "একই মান আবার লিখুন।", - extension: "সঠিক ধরনের ফাইল আপলোড করুন।", - maxlength: $.validator.format("{0}টির বেশি অক্ষর লেখা যাবে না।"), - minlength: $.validator.format("{0}টির কম অক্ষর লেখা যাবে না।"), - rangelength: $.validator.format("{0} থেকে {1} টি অক্ষর সম্বলিত মান লিখুন।"), - range: $.validator.format("{0} থেকে {1} এর মধ্যে একটি মান ব্যবহার করুন।"), - max: $.validator.format("অনুগ্রহ করে {0} বা তার চাইতে কম মান ব্যবহার করুন।"), - min: $.validator.format("অনুগ্রহ করে {0} বা তার চাইতে বেশি মান ব্যবহার করুন।") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_bn_BD.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_bn_BD.min.js deleted file mode 100644 index 38571f2f..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_bn_BD.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"এই তথ্যটি আবশ্যক।",remote:"এই তথ্যটি ঠিক করুন।",email:"অনুগ্রহ করে একটি সঠিক মেইল ঠিকানা লিখুন।",url:"অনুগ্রহ করে একটি সঠিক লিঙ্ক দিন।",date:"তারিখ সঠিক নয়।",dateISO:"অনুগ্রহ করে একটি সঠিক (ISO) তারিখ লিখুন।",number:"অনুগ্রহ করে একটি সঠিক নম্বর লিখুন।",digits:"এখানে শুধু সংখ্যা ব্যবহার করা যাবে।",creditcard:"অনুগ্রহ করে একটি ক্রেডিট কার্ডের সঠিক নম্বর লিখুন।",equalTo:"একই মান আবার লিখুন।",extension:"সঠিক ধরনের ফাইল আপলোড করুন।",maxlength:a.validator.format("{0}টির বেশি অক্ষর লেখা যাবে না।"),minlength:a.validator.format("{0}টির কম অক্ষর লেখা যাবে না।"),rangelength:a.validator.format("{0} থেকে {1} টি অক্ষর সম্বলিত মান লিখুন।"),range:a.validator.format("{0} থেকে {1} এর মধ্যে একটি মান ব্যবহার করুন।"),max:a.validator.format("অনুগ্রহ করে {0} বা তার চাইতে কম মান ব্যবহার করুন।"),min:a.validator.format("অনুগ্রহ করে {0} বা তার চাইতে বেশি মান ব্যবহার করুন।")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ca.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ca.js deleted file mode 100644 index cb82b74d..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ca.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: CA (Catalan; català) - */ -$.extend($.validator.messages, { - required: "Aquest camp és obligatori.", - remote: "Si us plau, omple aquest camp.", - email: "Si us plau, escriu una adreça de correu-e vàlida", - url: "Si us plau, escriu una URL vàlida.", - date: "Si us plau, escriu una data vàlida.", - dateISO: "Si us plau, escriu una data (ISO) vàlida.", - number: "Si us plau, escriu un número enter vàlid.", - digits: "Si us plau, escriu només dígits.", - creditcard: "Si us plau, escriu un número de tarjeta vàlid.", - equalTo: "Si us plau, escriu el mateix valor de nou.", - extension: "Si us plau, escriu un valor amb una extensió acceptada.", - maxlength: $.validator.format("Si us plau, no escriguis més de {0} caracters."), - minlength: $.validator.format("Si us plau, no escriguis menys de {0} caracters."), - rangelength: $.validator.format("Si us plau, escriu un valor entre {0} i {1} caracters."), - range: $.validator.format("Si us plau, escriu un valor entre {0} i {1}."), - max: $.validator.format("Si us plau, escriu un valor menor o igual a {0}."), - min: $.validator.format("Si us plau, escriu un valor major o igual a {0}.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ca.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ca.min.js deleted file mode 100644 index 65cda540..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ca.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Aquest camp és obligatori.",remote:"Si us plau, omple aquest camp.",email:"Si us plau, escriu una adreça de correu-e vàlida",url:"Si us plau, escriu una URL vàlida.",date:"Si us plau, escriu una data vàlida.",dateISO:"Si us plau, escriu una data (ISO) vàlida.",number:"Si us plau, escriu un número enter vàlid.",digits:"Si us plau, escriu només dígits.",creditcard:"Si us plau, escriu un número de tarjeta vàlid.",equalTo:"Si us plau, escriu el mateix valor de nou.",extension:"Si us plau, escriu un valor amb una extensió acceptada.",maxlength:a.validator.format("Si us plau, no escriguis més de {0} caracters."),minlength:a.validator.format("Si us plau, no escriguis menys de {0} caracters."),rangelength:a.validator.format("Si us plau, escriu un valor entre {0} i {1} caracters."),range:a.validator.format("Si us plau, escriu un valor entre {0} i {1}."),max:a.validator.format("Si us plau, escriu un valor menor o igual a {0}."),min:a.validator.format("Si us plau, escriu un valor major o igual a {0}.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_cs.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_cs.js deleted file mode 100644 index 6c27e2b0..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_cs.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: CS (Czech; čeština, český jazyk) - */ -$.extend($.validator.messages, { - required: "Tento údaj je povinný.", - remote: "Prosím, opravte tento údaj.", - email: "Prosím, zadejte platný e-mail.", - url: "Prosím, zadejte platné URL.", - date: "Prosím, zadejte platné datum.", - dateISO: "Prosím, zadejte platné datum (ISO).", - number: "Prosím, zadejte číslo.", - digits: "Prosím, zadávejte pouze číslice.", - creditcard: "Prosím, zadejte číslo kreditní karty.", - equalTo: "Prosím, zadejte znovu stejnou hodnotu.", - extension: "Prosím, zadejte soubor se správnou příponou.", - maxlength: $.validator.format("Prosím, zadejte nejvíce {0} znaků."), - minlength: $.validator.format("Prosím, zadejte nejméně {0} znaků."), - rangelength: $.validator.format("Prosím, zadejte od {0} do {1} znaků."), - range: $.validator.format("Prosím, zadejte hodnotu od {0} do {1}."), - max: $.validator.format("Prosím, zadejte hodnotu menší nebo rovnu {0}."), - min: $.validator.format("Prosím, zadejte hodnotu větší nebo rovnu {0}.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_cs.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_cs.min.js deleted file mode 100644 index 54a8f847..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_cs.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Tento údaj je povinný.",remote:"Prosím, opravte tento údaj.",email:"Prosím, zadejte platný e-mail.",url:"Prosím, zadejte platné URL.",date:"Prosím, zadejte platné datum.",dateISO:"Prosím, zadejte platné datum (ISO).",number:"Prosím, zadejte číslo.",digits:"Prosím, zadávejte pouze číslice.",creditcard:"Prosím, zadejte číslo kreditní karty.",equalTo:"Prosím, zadejte znovu stejnou hodnotu.",extension:"Prosím, zadejte soubor se správnou příponou.",maxlength:a.validator.format("Prosím, zadejte nejvíce {0} znaků."),minlength:a.validator.format("Prosím, zadejte nejméně {0} znaků."),rangelength:a.validator.format("Prosím, zadejte od {0} do {1} znaků."),range:a.validator.format("Prosím, zadejte hodnotu od {0} do {1}."),max:a.validator.format("Prosím, zadejte hodnotu menší nebo rovnu {0}."),min:a.validator.format("Prosím, zadejte hodnotu větší nebo rovnu {0}.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_da.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_da.js deleted file mode 100644 index e862abad..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_da.js +++ /dev/null @@ -1,30 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: DA (Danish; dansk) - */ -$.extend($.validator.messages, { - required: "Dette felt er påkrævet.", - maxlength: $.validator.format("Indtast højst {0} tegn."), - minlength: $.validator.format("Indtast mindst {0} tegn."), - rangelength: $.validator.format("Indtast mindst {0} og højst {1} tegn."), - email: "Indtast en gyldig email-adresse.", - url: "Indtast en gyldig URL.", - date: "Indtast en gyldig dato.", - number: "Indtast et tal.", - digits: "Indtast kun cifre.", - equalTo: "Indtast den samme værdi igen.", - range: $.validator.format("Angiv en værdi mellem {0} og {1}."), - max: $.validator.format("Angiv en værdi der højst er {0}."), - min: $.validator.format("Angiv en værdi der mindst er {0}."), - creditcard: "Indtast et gyldigt kreditkortnummer." -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_da.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_da.min.js deleted file mode 100644 index 777c309e..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_da.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Dette felt er påkrævet.",maxlength:a.validator.format("Indtast højst {0} tegn."),minlength:a.validator.format("Indtast mindst {0} tegn."),rangelength:a.validator.format("Indtast mindst {0} og højst {1} tegn."),email:"Indtast en gyldig email-adresse.",url:"Indtast en gyldig URL.",date:"Indtast en gyldig dato.",number:"Indtast et tal.",digits:"Indtast kun cifre.",equalTo:"Indtast den samme værdi igen.",range:a.validator.format("Angiv en værdi mellem {0} og {1}."),max:a.validator.format("Angiv en værdi der højst er {0}."),min:a.validator.format("Angiv en værdi der mindst er {0}."),creditcard:"Indtast et gyldigt kreditkortnummer."})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_de.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_de.js deleted file mode 100644 index 7f5bc8fe..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_de.js +++ /dev/null @@ -1,30 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: DE (German, Deutsch) - */ -$.extend($.validator.messages, { - required: "Dieses Feld ist ein Pflichtfeld.", - maxlength: $.validator.format("Geben Sie bitte maximal {0} Zeichen ein."), - minlength: $.validator.format("Geben Sie bitte mindestens {0} Zeichen ein."), - rangelength: $.validator.format("Geben Sie bitte mindestens {0} und maximal {1} Zeichen ein."), - email: "Geben Sie bitte eine gültige E-Mail Adresse ein.", - url: "Geben Sie bitte eine gültige URL ein.", - date: "Bitte geben Sie ein gültiges Datum ein.", - number: "Geben Sie bitte eine Nummer ein.", - digits: "Geben Sie bitte nur Ziffern ein.", - equalTo: "Bitte denselben Wert wiederholen.", - range: $.validator.format("Geben Sie bitte einen Wert zwischen {0} und {1} ein."), - max: $.validator.format("Geben Sie bitte einen Wert kleiner oder gleich {0} ein."), - min: $.validator.format("Geben Sie bitte einen Wert größer oder gleich {0} ein."), - creditcard: "Geben Sie bitte eine gültige Kreditkarten-Nummer ein." -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_de.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_de.min.js deleted file mode 100644 index 157dd571..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_de.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Dieses Feld ist ein Pflichtfeld.",maxlength:a.validator.format("Geben Sie bitte maximal {0} Zeichen ein."),minlength:a.validator.format("Geben Sie bitte mindestens {0} Zeichen ein."),rangelength:a.validator.format("Geben Sie bitte mindestens {0} und maximal {1} Zeichen ein."),email:"Geben Sie bitte eine gültige E-Mail Adresse ein.",url:"Geben Sie bitte eine gültige URL ein.",date:"Bitte geben Sie ein gültiges Datum ein.",number:"Geben Sie bitte eine Nummer ein.",digits:"Geben Sie bitte nur Ziffern ein.",equalTo:"Bitte denselben Wert wiederholen.",range:a.validator.format("Geben Sie bitte einen Wert zwischen {0} und {1} ein."),max:a.validator.format("Geben Sie bitte einen Wert kleiner oder gleich {0} ein."),min:a.validator.format("Geben Sie bitte einen Wert größer oder gleich {0} ein."),creditcard:"Geben Sie bitte eine gültige Kreditkarten-Nummer ein."})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_el.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_el.js deleted file mode 100644 index 5758f56f..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_el.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: EL (Greek; ελληνικά) - */ -$.extend($.validator.messages, { - required: "Αυτό το πεδίο είναι υποχρεωτικό.", - remote: "Παρακαλώ διορθώστε αυτό το πεδίο.", - email: "Παρακαλώ εισάγετε μια έγκυρη διεύθυνση email.", - url: "Παρακαλώ εισάγετε ένα έγκυρο URL.", - date: "Παρακαλώ εισάγετε μια έγκυρη ημερομηνία.", - dateISO: "Παρακαλώ εισάγετε μια έγκυρη ημερομηνία (ISO).", - number: "Παρακαλώ εισάγετε έναν έγκυρο αριθμό.", - digits: "Παρακαλώ εισάγετε μόνο αριθμητικά ψηφία.", - creditcard: "Παρακαλώ εισάγετε έναν έγκυρο αριθμό πιστωτικής κάρτας.", - equalTo: "Παρακαλώ εισάγετε την ίδια τιμή ξανά.", - extension: "Παρακαλώ εισάγετε μια τιμή με έγκυρη επέκταση αρχείου.", - maxlength: $.validator.format("Παρακαλώ εισάγετε μέχρι και {0} χαρακτήρες."), - minlength: $.validator.format("Παρακαλώ εισάγετε τουλάχιστον {0} χαρακτήρες."), - rangelength: $.validator.format("Παρακαλώ εισάγετε μια τιμή με μήκος μεταξύ {0} και {1} χαρακτήρων."), - range: $.validator.format("Παρακαλώ εισάγετε μια τιμή μεταξύ {0} και {1}."), - max: $.validator.format("Παρακαλώ εισάγετε μια τιμή μικρότερη ή ίση του {0}."), - min: $.validator.format("Παρακαλώ εισάγετε μια τιμή μεγαλύτερη ή ίση του {0}.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_el.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_el.min.js deleted file mode 100644 index e41b9870..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_el.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Αυτό το πεδίο είναι υποχρεωτικό.",remote:"Παρακαλώ διορθώστε αυτό το πεδίο.",email:"Παρακαλώ εισάγετε μια έγκυρη διεύθυνση email.",url:"Παρακαλώ εισάγετε ένα έγκυρο URL.",date:"Παρακαλώ εισάγετε μια έγκυρη ημερομηνία.",dateISO:"Παρακαλώ εισάγετε μια έγκυρη ημερομηνία (ISO).",number:"Παρακαλώ εισάγετε έναν έγκυρο αριθμό.",digits:"Παρακαλώ εισάγετε μόνο αριθμητικά ψηφία.",creditcard:"Παρακαλώ εισάγετε έναν έγκυρο αριθμό πιστωτικής κάρτας.",equalTo:"Παρακαλώ εισάγετε την ίδια τιμή ξανά.",extension:"Παρακαλώ εισάγετε μια τιμή με έγκυρη επέκταση αρχείου.",maxlength:a.validator.format("Παρακαλώ εισάγετε μέχρι και {0} χαρακτήρες."),minlength:a.validator.format("Παρακαλώ εισάγετε τουλάχιστον {0} χαρακτήρες."),rangelength:a.validator.format("Παρακαλώ εισάγετε μια τιμή με μήκος μεταξύ {0} και {1} χαρακτήρων."),range:a.validator.format("Παρακαλώ εισάγετε μια τιμή μεταξύ {0} και {1}."),max:a.validator.format("Παρακαλώ εισάγετε μια τιμή μικρότερη ή ίση του {0}."),min:a.validator.format("Παρακαλώ εισάγετε μια τιμή μεγαλύτερη ή ίση του {0}.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_es.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_es.js deleted file mode 100644 index bf37c17a..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_es.js +++ /dev/null @@ -1,36 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: ES (Spanish; Español) - */ -$.extend($.validator.messages, { - required: "Este campo es obligatorio.", - remote: "Por favor, rellena este campo.", - email: "Por favor, escribe una dirección de correo válida.", - url: "Por favor, escribe una URL válida.", - date: "Por favor, escribe una fecha válida.", - dateISO: "Por favor, escribe una fecha (ISO) válida.", - number: "Por favor, escribe un número válido.", - digits: "Por favor, escribe sólo dígitos.", - creditcard: "Por favor, escribe un número de tarjeta válido.", - equalTo: "Por favor, escribe el mismo valor de nuevo.", - extension: "Por favor, escribe un valor con una extensión aceptada.", - maxlength: $.validator.format("Por favor, no escribas más de {0} caracteres."), - minlength: $.validator.format("Por favor, no escribas menos de {0} caracteres."), - rangelength: $.validator.format("Por favor, escribe un valor entre {0} y {1} caracteres."), - range: $.validator.format("Por favor, escribe un valor entre {0} y {1}."), - max: $.validator.format("Por favor, escribe un valor menor o igual a {0}."), - min: $.validator.format("Por favor, escribe un valor mayor o igual a {0}."), - nifES: "Por favor, escribe un NIF válido.", - nieES: "Por favor, escribe un NIE válido.", - cifES: "Por favor, escribe un CIF válido." -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_es.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_es.min.js deleted file mode 100644 index c735dd99..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_es.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Este campo es obligatorio.",remote:"Por favor, rellena este campo.",email:"Por favor, escribe una dirección de correo válida.",url:"Por favor, escribe una URL válida.",date:"Por favor, escribe una fecha válida.",dateISO:"Por favor, escribe una fecha (ISO) válida.",number:"Por favor, escribe un número válido.",digits:"Por favor, escribe sólo dígitos.",creditcard:"Por favor, escribe un número de tarjeta válido.",equalTo:"Por favor, escribe el mismo valor de nuevo.",extension:"Por favor, escribe un valor con una extensión aceptada.",maxlength:a.validator.format("Por favor, no escribas más de {0} caracteres."),minlength:a.validator.format("Por favor, no escribas menos de {0} caracteres."),rangelength:a.validator.format("Por favor, escribe un valor entre {0} y {1} caracteres."),range:a.validator.format("Por favor, escribe un valor entre {0} y {1}."),max:a.validator.format("Por favor, escribe un valor menor o igual a {0}."),min:a.validator.format("Por favor, escribe un valor mayor o igual a {0}."),nifES:"Por favor, escribe un NIF válido.",nieES:"Por favor, escribe un NIE válido.",cifES:"Por favor, escribe un CIF válido."})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_es_AR.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_es_AR.js deleted file mode 100644 index c7279e47..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_es_AR.js +++ /dev/null @@ -1,37 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: ES (Spanish; Español) - * Region: AR (Argentina) - */ -$.extend($.validator.messages, { - required: "Este campo es obligatorio.", - remote: "Por favor, completá este campo.", - email: "Por favor, escribí una dirección de correo válida.", - url: "Por favor, escribí una URL válida.", - date: "Por favor, escribí una fecha válida.", - dateISO: "Por favor, escribí una fecha (ISO) válida.", - number: "Por favor, escribí un número entero válido.", - digits: "Por favor, escribí sólo dígitos.", - creditcard: "Por favor, escribí un número de tarjeta válido.", - equalTo: "Por favor, escribí el mismo valor de nuevo.", - extension: "Por favor, escribí un valor con una extensión aceptada.", - maxlength: $.validator.format("Por favor, no escribas más de {0} caracteres."), - minlength: $.validator.format("Por favor, no escribas menos de {0} caracteres."), - rangelength: $.validator.format("Por favor, escribí un valor entre {0} y {1} caracteres."), - range: $.validator.format("Por favor, escribí un valor entre {0} y {1}."), - max: $.validator.format("Por favor, escribí un valor menor o igual a {0}."), - min: $.validator.format("Por favor, escribí un valor mayor o igual a {0}."), - nifES: "Por favor, escribí un NIF válido.", - nieES: "Por favor, escribí un NIE válido.", - cifES: "Por favor, escribí un CIF válido." -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_es_AR.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_es_AR.min.js deleted file mode 100644 index 0af43952..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_es_AR.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Este campo es obligatorio.",remote:"Por favor, completá este campo.",email:"Por favor, escribí una dirección de correo válida.",url:"Por favor, escribí una URL válida.",date:"Por favor, escribí una fecha válida.",dateISO:"Por favor, escribí una fecha (ISO) válida.",number:"Por favor, escribí un número entero válido.",digits:"Por favor, escribí sólo dígitos.",creditcard:"Por favor, escribí un número de tarjeta válido.",equalTo:"Por favor, escribí el mismo valor de nuevo.",extension:"Por favor, escribí un valor con una extensión aceptada.",maxlength:a.validator.format("Por favor, no escribas más de {0} caracteres."),minlength:a.validator.format("Por favor, no escribas menos de {0} caracteres."),rangelength:a.validator.format("Por favor, escribí un valor entre {0} y {1} caracteres."),range:a.validator.format("Por favor, escribí un valor entre {0} y {1}."),max:a.validator.format("Por favor, escribí un valor menor o igual a {0}."),min:a.validator.format("Por favor, escribí un valor mayor o igual a {0}."),nifES:"Por favor, escribí un NIF válido.",nieES:"Por favor, escribí un NIE válido.",cifES:"Por favor, escribí un CIF válido."})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_es_PE.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_es_PE.js deleted file mode 100644 index 2879e6f2..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_es_PE.js +++ /dev/null @@ -1,37 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: ES (Spanish; Español) - * Region: PE (Perú) - */ -$.extend($.validator.messages, { - required: "Este campo es obligatorio.", - remote: "Por favor, llene este campo.", - email: "Por favor, escriba un correo electrónico válido.", - url: "Por favor, escriba una URL válida.", - date: "Por favor, escriba una fecha válida.", - dateISO: "Por favor, escriba una fecha (ISO) válida.", - number: "Por favor, escriba un número válido.", - digits: "Por favor, escriba sólo dígitos.", - creditcard: "Por favor, escriba un número de tarjeta válido.", - equalTo: "Por favor, escriba el mismo valor de nuevo.", - extension: "Por favor, escriba un valor con una extensión permitida.", - maxlength: $.validator.format("Por favor, no escriba más de {0} caracteres."), - minlength: $.validator.format("Por favor, no escriba menos de {0} caracteres."), - rangelength: $.validator.format("Por favor, escriba un valor entre {0} y {1} caracteres."), - range: $.validator.format("Por favor, escriba un valor entre {0} y {1}."), - max: $.validator.format("Por favor, escriba un valor menor o igual a {0}."), - min: $.validator.format("Por favor, escriba un valor mayor o igual a {0}."), - nifES: "Por favor, escriba un NIF válido.", - nieES: "Por favor, escriba un NIE válido.", - cifES: "Por favor, escriba un CIF válido." -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_es_PE.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_es_PE.min.js deleted file mode 100644 index 2d8061f0..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_es_PE.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Este campo es obligatorio.",remote:"Por favor, llene este campo.",email:"Por favor, escriba un correo electrónico válido.",url:"Por favor, escriba una URL válida.",date:"Por favor, escriba una fecha válida.",dateISO:"Por favor, escriba una fecha (ISO) válida.",number:"Por favor, escriba un número válido.",digits:"Por favor, escriba sólo dígitos.",creditcard:"Por favor, escriba un número de tarjeta válido.",equalTo:"Por favor, escriba el mismo valor de nuevo.",extension:"Por favor, escriba un valor con una extensión permitida.",maxlength:a.validator.format("Por favor, no escriba más de {0} caracteres."),minlength:a.validator.format("Por favor, no escriba menos de {0} caracteres."),rangelength:a.validator.format("Por favor, escriba un valor entre {0} y {1} caracteres."),range:a.validator.format("Por favor, escriba un valor entre {0} y {1}."),max:a.validator.format("Por favor, escriba un valor menor o igual a {0}."),min:a.validator.format("Por favor, escriba un valor mayor o igual a {0}."),nifES:"Por favor, escriba un NIF válido.",nieES:"Por favor, escriba un NIE válido.",cifES:"Por favor, escriba un CIF válido."})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_et.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_et.js deleted file mode 100644 index 0dd93cd2..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_et.js +++ /dev/null @@ -1,31 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: ET (Estonian; eesti, eesti keel) - */ -$.extend($.validator.messages, { - required: "See väli peab olema täidetud.", - maxlength: $.validator.format("Palun sisestage vähem kui {0} tähemärki."), - minlength: $.validator.format("Palun sisestage vähemalt {0} tähemärki."), - rangelength: $.validator.format("Palun sisestage väärtus vahemikus {0} kuni {1} tähemärki."), - email: "Palun sisestage korrektne e-maili aadress.", - url: "Palun sisestage korrektne URL.", - date: "Palun sisestage korrektne kuupäev.", - dateISO: "Palun sisestage korrektne kuupäev (YYYY-MM-DD).", - number: "Palun sisestage korrektne number.", - digits: "Palun sisestage ainult numbreid.", - equalTo: "Palun sisestage sama väärtus uuesti.", - range: $.validator.format("Palun sisestage väärtus vahemikus {0} kuni {1}."), - max: $.validator.format("Palun sisestage väärtus, mis on väiksem või võrdne arvuga {0}."), - min: $.validator.format("Palun sisestage väärtus, mis on suurem või võrdne arvuga {0}."), - creditcard: "Palun sisestage korrektne krediitkaardi number." -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_et.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_et.min.js deleted file mode 100644 index c99089fd..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_et.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"See väli peab olema täidetud.",maxlength:a.validator.format("Palun sisestage vähem kui {0} tähemärki."),minlength:a.validator.format("Palun sisestage vähemalt {0} tähemärki."),rangelength:a.validator.format("Palun sisestage väärtus vahemikus {0} kuni {1} tähemärki."),email:"Palun sisestage korrektne e-maili aadress.",url:"Palun sisestage korrektne URL.",date:"Palun sisestage korrektne kuupäev.",dateISO:"Palun sisestage korrektne kuupäev (YYYY-MM-DD).",number:"Palun sisestage korrektne number.",digits:"Palun sisestage ainult numbreid.",equalTo:"Palun sisestage sama väärtus uuesti.",range:a.validator.format("Palun sisestage väärtus vahemikus {0} kuni {1}."),max:a.validator.format("Palun sisestage väärtus, mis on väiksem või võrdne arvuga {0}."),min:a.validator.format("Palun sisestage väärtus, mis on suurem või võrdne arvuga {0}."),creditcard:"Palun sisestage korrektne krediitkaardi number."})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_eu.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_eu.js deleted file mode 100644 index a9b07773..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_eu.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: EU (Basque; euskara, euskera) - */ -$.extend($.validator.messages, { - required: "Eremu hau beharrezkoa da.", - remote: "Mesedez, bete eremu hau.", - email: "Mesedez, idatzi baliozko posta helbide bat.", - url: "Mesedez, idatzi baliozko URL bat.", - date: "Mesedez, idatzi baliozko data bat.", - dateISO: "Mesedez, idatzi baliozko (ISO) data bat.", - number: "Mesedez, idatzi baliozko zenbaki oso bat.", - digits: "Mesedez, idatzi digituak soilik.", - creditcard: "Mesedez, idatzi baliozko txartel zenbaki bat.", - equalTo: "Mesedez, idatzi berdina berriro ere.", - extension: "Mesedez, idatzi onartutako luzapena duen balio bat.", - maxlength: $.validator.format("Mesedez, ez idatzi {0} karaktere baino gehiago."), - minlength: $.validator.format("Mesedez, ez idatzi {0} karaktere baino gutxiago."), - rangelength: $.validator.format("Mesedez, idatzi {0} eta {1} karaktere arteko balio bat."), - range: $.validator.format("Mesedez, idatzi {0} eta {1} arteko balio bat."), - max: $.validator.format("Mesedez, idatzi {0} edo txikiagoa den balio bat."), - min: $.validator.format("Mesedez, idatzi {0} edo handiagoa den balio bat.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_eu.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_eu.min.js deleted file mode 100644 index 69eeb312..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_eu.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Eremu hau beharrezkoa da.",remote:"Mesedez, bete eremu hau.",email:"Mesedez, idatzi baliozko posta helbide bat.",url:"Mesedez, idatzi baliozko URL bat.",date:"Mesedez, idatzi baliozko data bat.",dateISO:"Mesedez, idatzi baliozko (ISO) data bat.",number:"Mesedez, idatzi baliozko zenbaki oso bat.",digits:"Mesedez, idatzi digituak soilik.",creditcard:"Mesedez, idatzi baliozko txartel zenbaki bat.",equalTo:"Mesedez, idatzi berdina berriro ere.",extension:"Mesedez, idatzi onartutako luzapena duen balio bat.",maxlength:a.validator.format("Mesedez, ez idatzi {0} karaktere baino gehiago."),minlength:a.validator.format("Mesedez, ez idatzi {0} karaktere baino gutxiago."),rangelength:a.validator.format("Mesedez, idatzi {0} eta {1} karaktere arteko balio bat."),range:a.validator.format("Mesedez, idatzi {0} eta {1} arteko balio bat."),max:a.validator.format("Mesedez, idatzi {0} edo txikiagoa den balio bat."),min:a.validator.format("Mesedez, idatzi {0} edo handiagoa den balio bat.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_fa.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_fa.js deleted file mode 100644 index eb7d3367..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_fa.js +++ /dev/null @@ -1,36 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: FA (Persian; فارسی) - */ -$.extend($.validator.messages, { - required: "تکمیل این فیلد اجباری است.", - remote: "لطفا این فیلد را تصحیح کنید.", - email: ".لطفا یک ایمیل صحیح وارد کنید", - url: "لطفا آدرس صحیح وارد کنید.", - date: "لطفا یک تاریخ صحیح وارد کنید", - dateFA: "لطفا یک تاریخ صحیح وارد کنید", - dateISO: "لطفا تاریخ صحیح وارد کنید (ISO).", - number: "لطفا عدد صحیح وارد کنید.", - digits: "لطفا تنها رقم وارد کنید", - creditcard: "لطفا کریدیت کارت صحیح وارد کنید.", - equalTo: "لطفا مقدار برابری وارد کنید", - extension: "لطفا مقداری وارد کنید که ", - maxlength: $.validator.format("لطفا بیشتر از {0} حرف وارد نکنید."), - minlength: $.validator.format("لطفا کمتر از {0} حرف وارد نکنید."), - rangelength: $.validator.format("لطفا مقداری بین {0} تا {1} حرف وارد کنید."), - range: $.validator.format("لطفا مقداری بین {0} تا {1} حرف وارد کنید."), - max: $.validator.format("لطفا مقداری کمتر از {0} حرف وارد کنید."), - min: $.validator.format("لطفا مقداری بیشتر از {0} حرف وارد کنید."), - minWords: $.validator.format("لطفا حداقل {0} کلمه وارد کنید."), - maxWords: $.validator.format("لطفا حداکثر {0} کلمه وارد کنید.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_fa.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_fa.min.js deleted file mode 100644 index be2bc135..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_fa.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"تکمیل این فیلد اجباری است.",remote:"لطفا این فیلد را تصحیح کنید.",email:".لطفا یک ایمیل صحیح وارد کنید",url:"لطفا آدرس صحیح وارد کنید.",date:"لطفا یک تاریخ صحیح وارد کنید",dateFA:"لطفا یک تاریخ صحیح وارد کنید",dateISO:"لطفا تاریخ صحیح وارد کنید (ISO).",number:"لطفا عدد صحیح وارد کنید.",digits:"لطفا تنها رقم وارد کنید",creditcard:"لطفا کریدیت کارت صحیح وارد کنید.",equalTo:"لطفا مقدار برابری وارد کنید",extension:"لطفا مقداری وارد کنید که ",maxlength:a.validator.format("لطفا بیشتر از {0} حرف وارد نکنید."),minlength:a.validator.format("لطفا کمتر از {0} حرف وارد نکنید."),rangelength:a.validator.format("لطفا مقداری بین {0} تا {1} حرف وارد کنید."),range:a.validator.format("لطفا مقداری بین {0} تا {1} حرف وارد کنید."),max:a.validator.format("لطفا مقداری کمتر از {0} حرف وارد کنید."),min:a.validator.format("لطفا مقداری بیشتر از {0} حرف وارد کنید."),minWords:a.validator.format("لطفا حداقل {0} کلمه وارد کنید."),maxWords:a.validator.format("لطفا حداکثر {0} کلمه وارد کنید.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_fi.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_fi.js deleted file mode 100644 index b2964c4e..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_fi.js +++ /dev/null @@ -1,31 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: FI (Finnish; suomi, suomen kieli) - */ -$.extend($.validator.messages, { - required: "Tämä kenttä on pakollinen.", - email: "Syötä oikea sähköpostiosoite.", - url: "Syötä oikea URL-osoite.", - date: "Syötä oikea päivämäärä.", - dateISO: "Syötä oikea päivämäärä muodossa VVVV-KK-PP.", - number: "Syötä luku.", - creditcard: "Syötä voimassa oleva luottokorttinumero.", - digits: "Syötä pelkästään numeroita.", - equalTo: "Syötä sama arvo uudestaan.", - maxlength: $.validator.format("Voit syöttää enintään {0} merkkiä."), - minlength: $.validator.format("Vähintään {0} merkkiä."), - rangelength: $.validator.format("Syötä vähintään {0} ja enintään {1} merkkiä."), - range: $.validator.format("Syötä arvo väliltä {0}–{1}."), - max: $.validator.format("Syötä arvo, joka on enintään {0}."), - min: $.validator.format("Syötä arvo, joka on vähintään {0}.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_fi.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_fi.min.js deleted file mode 100644 index cafd522a..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_fi.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Tämä kenttä on pakollinen.",email:"Syötä oikea sähköpostiosoite.",url:"Syötä oikea URL-osoite.",date:"Syötä oikea päivämäärä.",dateISO:"Syötä oikea päivämäärä muodossa VVVV-KK-PP.",number:"Syötä luku.",creditcard:"Syötä voimassa oleva luottokorttinumero.",digits:"Syötä pelkästään numeroita.",equalTo:"Syötä sama arvo uudestaan.",maxlength:a.validator.format("Voit syöttää enintään {0} merkkiä."),minlength:a.validator.format("Vähintään {0} merkkiä."),rangelength:a.validator.format("Syötä vähintään {0} ja enintään {1} merkkiä."),range:a.validator.format("Syötä arvo väliltä {0}–{1}."),max:a.validator.format("Syötä arvo, joka on enintään {0}."),min:a.validator.format("Syötä arvo, joka on vähintään {0}.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_fr.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_fr.js deleted file mode 100644 index d465538d..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_fr.js +++ /dev/null @@ -1,59 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: FR (French; français) - */ -$.extend($.validator.messages, { - required: "Ce champ est obligatoire.", - remote: "Veuillez corriger ce champ.", - email: "Veuillez fournir une adresse électronique valide.", - url: "Veuillez fournir une adresse URL valide.", - date: "Veuillez fournir une date valide.", - dateISO: "Veuillez fournir une date valide (ISO).", - number: "Veuillez fournir un numéro valide.", - digits: "Veuillez fournir seulement des chiffres.", - creditcard: "Veuillez fournir un numéro de carte de crédit valide.", - equalTo: "Veuillez fournir encore la même valeur.", - extension: "Veuillez fournir une valeur avec une extension valide.", - maxlength: $.validator.format("Veuillez fournir au plus {0} caractères."), - minlength: $.validator.format("Veuillez fournir au moins {0} caractères."), - rangelength: $.validator.format("Veuillez fournir une valeur qui contient entre {0} et {1} caractères."), - range: $.validator.format("Veuillez fournir une valeur entre {0} et {1}."), - max: $.validator.format("Veuillez fournir une valeur inférieure ou égale à {0}."), - min: $.validator.format("Veuillez fournir une valeur supérieure ou égale à {0}."), - maxWords: $.validator.format("Veuillez fournir au plus {0} mots."), - minWords: $.validator.format("Veuillez fournir au moins {0} mots."), - rangeWords: $.validator.format("Veuillez fournir entre {0} et {1} mots."), - letterswithbasicpunc: "Veuillez fournir seulement des lettres et des signes de ponctuation.", - alphanumeric: "Veuillez fournir seulement des lettres, nombres, espaces et soulignages.", - lettersonly: "Veuillez fournir seulement des lettres.", - nowhitespace: "Veuillez ne pas inscrire d'espaces blancs.", - ziprange: "Veuillez fournir un code postal entre 902xx-xxxx et 905-xx-xxxx.", - integer: "Veuillez fournir un nombre non décimal qui est positif ou négatif.", - vinUS: "Veuillez fournir un numéro d'identification du véhicule (VIN).", - dateITA: "Veuillez fournir une date valide.", - time: "Veuillez fournir une heure valide entre 00:00 et 23:59.", - phoneUS: "Veuillez fournir un numéro de téléphone valide.", - phoneUK: "Veuillez fournir un numéro de téléphone valide.", - mobileUK: "Veuillez fournir un numéro de téléphone mobile valide.", - strippedminlength: $.validator.format("Veuillez fournir au moins {0} caractères."), - email2: "Veuillez fournir une adresse électronique valide.", - url2: "Veuillez fournir une adresse URL valide.", - creditcardtypes: "Veuillez fournir un numéro de carte de crédit valide.", - ipv4: "Veuillez fournir une adresse IP v4 valide.", - ipv6: "Veuillez fournir une adresse IP v6 valide.", - require_from_group: "Veuillez fournir au moins {0} de ces champs.", - nifES: "Veuillez fournir un numéro NIF valide.", - nieES: "Veuillez fournir un numéro NIE valide.", - cifES: "Veuillez fournir un numéro CIF valide.", - postalCodeCA: "Veuillez fournir un code postal valide." -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_fr.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_fr.min.js deleted file mode 100644 index b7ef93e3..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_fr.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Ce champ est obligatoire.",remote:"Veuillez corriger ce champ.",email:"Veuillez fournir une adresse électronique valide.",url:"Veuillez fournir une adresse URL valide.",date:"Veuillez fournir une date valide.",dateISO:"Veuillez fournir une date valide (ISO).",number:"Veuillez fournir un numéro valide.",digits:"Veuillez fournir seulement des chiffres.",creditcard:"Veuillez fournir un numéro de carte de crédit valide.",equalTo:"Veuillez fournir encore la même valeur.",extension:"Veuillez fournir une valeur avec une extension valide.",maxlength:a.validator.format("Veuillez fournir au plus {0} caractères."),minlength:a.validator.format("Veuillez fournir au moins {0} caractères."),rangelength:a.validator.format("Veuillez fournir une valeur qui contient entre {0} et {1} caractères."),range:a.validator.format("Veuillez fournir une valeur entre {0} et {1}."),max:a.validator.format("Veuillez fournir une valeur inférieure ou égale à {0}."),min:a.validator.format("Veuillez fournir une valeur supérieure ou égale à {0}."),maxWords:a.validator.format("Veuillez fournir au plus {0} mots."),minWords:a.validator.format("Veuillez fournir au moins {0} mots."),rangeWords:a.validator.format("Veuillez fournir entre {0} et {1} mots."),letterswithbasicpunc:"Veuillez fournir seulement des lettres et des signes de ponctuation.",alphanumeric:"Veuillez fournir seulement des lettres, nombres, espaces et soulignages.",lettersonly:"Veuillez fournir seulement des lettres.",nowhitespace:"Veuillez ne pas inscrire d'espaces blancs.",ziprange:"Veuillez fournir un code postal entre 902xx-xxxx et 905-xx-xxxx.",integer:"Veuillez fournir un nombre non décimal qui est positif ou négatif.",vinUS:"Veuillez fournir un numéro d'identification du véhicule (VIN).",dateITA:"Veuillez fournir une date valide.",time:"Veuillez fournir une heure valide entre 00:00 et 23:59.",phoneUS:"Veuillez fournir un numéro de téléphone valide.",phoneUK:"Veuillez fournir un numéro de téléphone valide.",mobileUK:"Veuillez fournir un numéro de téléphone mobile valide.",strippedminlength:a.validator.format("Veuillez fournir au moins {0} caractères."),email2:"Veuillez fournir une adresse électronique valide.",url2:"Veuillez fournir une adresse URL valide.",creditcardtypes:"Veuillez fournir un numéro de carte de crédit valide.",ipv4:"Veuillez fournir une adresse IP v4 valide.",ipv6:"Veuillez fournir une adresse IP v6 valide.",require_from_group:"Veuillez fournir au moins {0} de ces champs.",nifES:"Veuillez fournir un numéro NIF valide.",nieES:"Veuillez fournir un numéro NIE valide.",cifES:"Veuillez fournir un numéro CIF valide.",postalCodeCA:"Veuillez fournir un code postal valide."})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ge.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ge.js deleted file mode 100644 index dd84881e..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ge.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/** - * @author @tatocaster <kutaliatato@gmail.com> - * Translated default messages for the jQuery validation plugin. - * Locale: GE (Georgian; ქართული) - */ -$.extend($.validator.messages, { - required: "ეს ველი სავალდებულოა", - remote: "გთხოვთ შეასწოროთ.", - email: "გთხოვთ შეიყვანოთ სწორი ფორმატით.", - url: "გთხოვთ შეიყვანოთ სწორი ფორმატით.", - date: "გთხოვთ შეიყვანოთ სწორი თარიღი.", - dateISO: "გთხოვთ შეიყვანოთ სწორი ფორმატით ( ISO ).", - number: "გთხოვთ შეიყვანოთ რიცხვი.", - digits: "დაშვებულია მხოლოდ ციფრები.", - creditcard: "გთხოვთ შეიყვანოთ სწორი ფორმატის ბარათის კოდი.", - equalTo: "გთხოვთ შეიყვანოთ იგივე მნიშვნელობა.", - maxlength: $.validator.format( "გთხოვთ შეიყვანოთ არა უმეტეს {0} სიმბოლოსი." ), - minlength: $.validator.format( "შეიყვანეთ მინიმუმ {0} სიმბოლო." ), - rangelength: $.validator.format( "გთხოვთ შეიყვანოთ {0} -დან {1} -მდე რაოდენობის სიმბოლოები." ), - range: $.validator.format( "შეიყვანეთ {0} -სა {1} -ს შორის." ), - max: $.validator.format( "გთხოვთ შეიყვანოთ მნიშვნელობა ნაკლები ან ტოლი {0} -ს." ), - min: $.validator.format( "გთხოვთ შეიყვანოთ მნიშვნელობა მეტი ან ტოლი {0} -ს." ) -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ge.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ge.min.js deleted file mode 100644 index d3459cf9..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ge.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"ეს ველი სავალდებულოა",remote:"გთხოვთ შეასწოროთ.",email:"გთხოვთ შეიყვანოთ სწორი ფორმატით.",url:"გთხოვთ შეიყვანოთ სწორი ფორმატით.",date:"გთხოვთ შეიყვანოთ სწორი თარიღი.",dateISO:"გთხოვთ შეიყვანოთ სწორი ფორმატით ( ISO ).",number:"გთხოვთ შეიყვანოთ რიცხვი.",digits:"დაშვებულია მხოლოდ ციფრები.",creditcard:"გთხოვთ შეიყვანოთ სწორი ფორმატის ბარათის კოდი.",equalTo:"გთხოვთ შეიყვანოთ იგივე მნიშვნელობა.",maxlength:a.validator.format("გთხოვთ შეიყვანოთ არა უმეტეს {0} სიმბოლოსი."),minlength:a.validator.format("შეიყვანეთ მინიმუმ {0} სიმბოლო."),rangelength:a.validator.format("გთხოვთ შეიყვანოთ {0} -დან {1} -მდე რაოდენობის სიმბოლოები."),range:a.validator.format("შეიყვანეთ {0} -სა {1} -ს შორის."),max:a.validator.format("გთხოვთ შეიყვანოთ მნიშვნელობა ნაკლები ან ტოლი {0} -ს."),min:a.validator.format("გთხოვთ შეიყვანოთ მნიშვნელობა მეტი ან ტოლი {0} -ს.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_gl.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_gl.js deleted file mode 100644 index a36f6090..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_gl.js +++ /dev/null @@ -1,38 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: GL (Galician; Galego) - */ -(function($) { - $.extend($.validator.messages, { - required: "Este campo é obrigatorio.", - remote: "Por favor, cubre este campo.", - email: "Por favor, escribe unha dirección de correo válida.", - url: "Por favor, escribe unha URL válida.", - date: "Por favor, escribe unha data válida.", - dateISO: "Por favor, escribe unha data (ISO) válida.", - number: "Por favor, escribe un número válido.", - digits: "Por favor, escribe só díxitos.", - creditcard: "Por favor, escribe un número de tarxeta válido.", - equalTo: "Por favor, escribe o mesmo valor de novo.", - extension: "Por favor, escribe un valor cunha extensión aceptada.", - maxlength: $.validator.format("Por favor, non escribas máis de {0} caracteres."), - minlength: $.validator.format("Por favor, non escribas menos de {0} caracteres."), - rangelength: $.validator.format("Por favor, escribe un valor entre {0} e {1} caracteres."), - range: $.validator.format("Por favor, escribe un valor entre {0} e {1}."), - max: $.validator.format("Por favor, escribe un valor menor ou igual a {0}."), - min: $.validator.format("Por favor, escribe un valor maior ou igual a {0}."), - nifES: "Por favor, escribe un NIF válido.", - nieES: "Por favor, escribe un NIE válido.", - cifES: "Por favor, escribe un CIF válido." - }); -}(jQuery)); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_gl.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_gl.min.js deleted file mode 100644 index f34f3015..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_gl.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){!function(a){a.extend(a.validator.messages,{required:"Este campo é obrigatorio.",remote:"Por favor, cubre este campo.",email:"Por favor, escribe unha dirección de correo válida.",url:"Por favor, escribe unha URL válida.",date:"Por favor, escribe unha data válida.",dateISO:"Por favor, escribe unha data (ISO) válida.",number:"Por favor, escribe un número válido.",digits:"Por favor, escribe só díxitos.",creditcard:"Por favor, escribe un número de tarxeta válido.",equalTo:"Por favor, escribe o mesmo valor de novo.",extension:"Por favor, escribe un valor cunha extensión aceptada.",maxlength:a.validator.format("Por favor, non escribas máis de {0} caracteres."),minlength:a.validator.format("Por favor, non escribas menos de {0} caracteres."),rangelength:a.validator.format("Por favor, escribe un valor entre {0} e {1} caracteres."),range:a.validator.format("Por favor, escribe un valor entre {0} e {1}."),max:a.validator.format("Por favor, escribe un valor menor ou igual a {0}."),min:a.validator.format("Por favor, escribe un valor maior ou igual a {0}."),nifES:"Por favor, escribe un NIF válido.",nieES:"Por favor, escribe un NIE válido.",cifES:"Por favor, escribe un CIF válido."})}(jQuery)});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_he.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_he.js deleted file mode 100644 index b50beb0e..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_he.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: HE (Hebrew; עברית) - */ -$.extend($.validator.messages, { - required: "השדה הזה הינו שדה חובה", - remote: "נא לתקן שדה זה", - email: "נא למלא כתובת דוא\"ל חוקית", - url: "נא למלא כתובת אינטרנט חוקית", - date: "נא למלא תאריך חוקי", - dateISO: "נא למלא תאריך חוקי (ISO)", - number: "נא למלא מספר", - digits: "נא למלא רק מספרים", - creditcard: "נא למלא מספר כרטיס אשראי חוקי", - equalTo: "נא למלא את אותו ערך שוב", - extension: "נא למלא ערך עם סיומת חוקית", - maxlength: $.validator.format(".נא לא למלא יותר מ- {0} תווים"), - minlength: $.validator.format("נא למלא לפחות {0} תווים"), - rangelength: $.validator.format("נא למלא ערך בין {0} ל- {1} תווים"), - range: $.validator.format("נא למלא ערך בין {0} ל- {1}"), - max: $.validator.format("נא למלא ערך קטן או שווה ל- {0}"), - min: $.validator.format("נא למלא ערך גדול או שווה ל- {0}") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_he.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_he.min.js deleted file mode 100644 index d9e954fa..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_he.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"השדה הזה הינו שדה חובה",remote:"נא לתקן שדה זה",email:'נא למלא כתובת דוא"ל חוקית',url:"נא למלא כתובת אינטרנט חוקית",date:"נא למלא תאריך חוקי",dateISO:"נא למלא תאריך חוקי (ISO)",number:"נא למלא מספר",digits:"נא למלא רק מספרים",creditcard:"נא למלא מספר כרטיס אשראי חוקי",equalTo:"נא למלא את אותו ערך שוב",extension:"נא למלא ערך עם סיומת חוקית",maxlength:a.validator.format(".נא לא למלא יותר מ- {0} תווים"),minlength:a.validator.format("נא למלא לפחות {0} תווים"),rangelength:a.validator.format("נא למלא ערך בין {0} ל- {1} תווים"),range:a.validator.format("נא למלא ערך בין {0} ל- {1}"),max:a.validator.format("נא למלא ערך קטן או שווה ל- {0}"),min:a.validator.format("נא למלא ערך גדול או שווה ל- {0}")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_hr.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_hr.js deleted file mode 100644 index 792ac448..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_hr.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: HR (Croatia; hrvatski jezik) - */ -$.extend($.validator.messages, { - required: "Ovo polje je obavezno.", - remote: "Ovo polje treba popraviti.", - email: "Unesite ispravnu e-mail adresu.", - url: "Unesite ispravan URL.", - date: "Unesite ispravan datum.", - dateISO: "Unesite ispravan datum (ISO).", - number: "Unesite ispravan broj.", - digits: "Unesite samo brojeve.", - creditcard: "Unesite ispravan broj kreditne kartice.", - equalTo: "Unesite ponovo istu vrijednost.", - extension: "Unesite vrijednost sa ispravnom ekstenzijom.", - maxlength: $.validator.format("Maksimalni broj znakova je {0} ."), - minlength: $.validator.format("Minimalni broj znakova je {0} ."), - rangelength: $.validator.format("Unesite vrijednost između {0} i {1} znakova."), - range: $.validator.format("Unesite vrijednost između {0} i {1}."), - max: $.validator.format("Unesite vrijednost manju ili jednaku {0}."), - min: $.validator.format("Unesite vrijednost veću ili jednaku {0}.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_hr.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_hr.min.js deleted file mode 100644 index 6161356f..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_hr.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Ovo polje je obavezno.",remote:"Ovo polje treba popraviti.",email:"Unesite ispravnu e-mail adresu.",url:"Unesite ispravan URL.",date:"Unesite ispravan datum.",dateISO:"Unesite ispravan datum (ISO).",number:"Unesite ispravan broj.",digits:"Unesite samo brojeve.",creditcard:"Unesite ispravan broj kreditne kartice.",equalTo:"Unesite ponovo istu vrijednost.",extension:"Unesite vrijednost sa ispravnom ekstenzijom.",maxlength:a.validator.format("Maksimalni broj znakova je {0} ."),minlength:a.validator.format("Minimalni broj znakova je {0} ."),rangelength:a.validator.format("Unesite vrijednost između {0} i {1} znakova."),range:a.validator.format("Unesite vrijednost između {0} i {1}."),max:a.validator.format("Unesite vrijednost manju ili jednaku {0}."),min:a.validator.format("Unesite vrijednost veću ili jednaku {0}.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_hu.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_hu.js deleted file mode 100644 index 735bc3b6..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_hu.js +++ /dev/null @@ -1,32 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: HU (Hungarian; Magyar) - */ -$.extend($.validator.messages, { - required: "Kötelező megadni.", - maxlength: $.validator.format("Legfeljebb {0} karakter hosszú legyen."), - minlength: $.validator.format("Legalább {0} karakter hosszú legyen."), - rangelength: $.validator.format("Legalább {0} és legfeljebb {1} karakter hosszú legyen."), - email: "Érvényes e-mail címnek kell lennie.", - url: "Érvényes URL-nek kell lennie.", - date: "Dátumnak kell lennie.", - number: "Számnak kell lennie.", - digits: "Csak számjegyek lehetnek.", - equalTo: "Meg kell egyeznie a két értéknek.", - range: $.validator.format("{0} és {1} közé kell esnie."), - max: $.validator.format("Nem lehet nagyobb, mint {0}."), - min: $.validator.format("Nem lehet kisebb, mint {0}."), - creditcard: "Érvényes hitelkártyaszámnak kell lennie.", - remote: "Kérem javítsa ki ezt a mezőt.", - dateISO: "Kérem írjon be egy érvényes dátumot (ISO)." -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_hu.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_hu.min.js deleted file mode 100644 index 0e224c9b..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_hu.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Kötelező megadni.",maxlength:a.validator.format("Legfeljebb {0} karakter hosszú legyen."),minlength:a.validator.format("Legalább {0} karakter hosszú legyen."),rangelength:a.validator.format("Legalább {0} és legfeljebb {1} karakter hosszú legyen."),email:"Érvényes e-mail címnek kell lennie.",url:"Érvényes URL-nek kell lennie.",date:"Dátumnak kell lennie.",number:"Számnak kell lennie.",digits:"Csak számjegyek lehetnek.",equalTo:"Meg kell egyeznie a két értéknek.",range:a.validator.format("{0} és {1} közé kell esnie."),max:a.validator.format("Nem lehet nagyobb, mint {0}."),min:a.validator.format("Nem lehet kisebb, mint {0}."),creditcard:"Érvényes hitelkártyaszámnak kell lennie.",remote:"Kérem javítsa ki ezt a mezőt.",dateISO:"Kérem írjon be egy érvényes dátumot (ISO)."})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_hy_AM.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_hy_AM.js deleted file mode 100644 index d46a6261..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_hy_AM.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: HY_AM (Armenian; հայերեն լեզու) - */ -$.extend($.validator.messages, { - required: "Պարտադիր լրացման դաշտ", - remote: "Ներմուծեք ճիշտ արժեքը", - email: "Ներմուծեք վավեր էլեկտրոնային փոստի հասցե", - url: "Ներմուծեք վավեր URL", - date: "Ներմուծեք վավեր ամսաթիվ", - dateISO: "Ներմուծեք ISO ֆորմատով վավեր ամսաթիվ։", - number: "Ներմուծեք թիվ", - digits: "Ներմուծեք միայն թվեր", - creditcard: "Ներմուծեք ճիշտ բանկային քարտի համար", - equalTo: "Ներմուծեք միևնուն արժեքը ևս մեկ անգամ", - extension: "Ընտրեք ճիշտ ընդլանումով ֆայլ", - maxlength: $.validator.format("Ներմուծեք ոչ ավել քան {0} նիշ"), - minlength: $.validator.format("Ներմուծեք ոչ պակաս քան {0} նիշ"), - rangelength: $.validator.format("Ներմուծեք {0}֊ից {1} երկարությամբ արժեք"), - range: $.validator.format("Ներմուծեք թիվ {0}֊ից {1} միջակայքում"), - max: $.validator.format("Ներմուծեք թիվ, որը փոքր կամ հավասար է {0}֊ին"), - min: $.validator.format("Ներմուծեք թիվ, որը մեծ կամ հավասար է {0}֊ին") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_hy_AM.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_hy_AM.min.js deleted file mode 100644 index 5f83475c..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_hy_AM.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Պարտադիր լրացման դաշտ",remote:"Ներմուծեք ճիշտ արժեքը",email:"Ներմուծեք վավեր էլեկտրոնային փոստի հասցե",url:"Ներմուծեք վավեր URL",date:"Ներմուծեք վավեր ամսաթիվ",dateISO:"Ներմուծեք ISO ֆորմատով վավեր ամսաթիվ։",number:"Ներմուծեք թիվ",digits:"Ներմուծեք միայն թվեր",creditcard:"Ներմուծեք ճիշտ բանկային քարտի համար",equalTo:"Ներմուծեք միևնուն արժեքը ևս մեկ անգամ",extension:"Ընտրեք ճիշտ ընդլանումով ֆայլ",maxlength:a.validator.format("Ներմուծեք ոչ ավել քան {0} նիշ"),minlength:a.validator.format("Ներմուծեք ոչ պակաս քան {0} նիշ"),rangelength:a.validator.format("Ներմուծեք {0}֊ից {1} երկարությամբ արժեք"),range:a.validator.format("Ներմուծեք թիվ {0}֊ից {1} միջակայքում"),max:a.validator.format("Ներմուծեք թիվ, որը փոքր կամ հավասար է {0}֊ին"),min:a.validator.format("Ներմուծեք թիվ, որը մեծ կամ հավասար է {0}֊ին")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_id.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_id.js deleted file mode 100644 index 48f7b9ad..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_id.js +++ /dev/null @@ -1,32 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: ID (Indonesia; Indonesian) - */ -$.extend($.validator.messages, { - required: "Kolom ini diperlukan.", - remote: "Harap benarkan kolom ini.", - email: "Silakan masukkan format email yang benar.", - url: "Silakan masukkan format URL yang benar.", - date: "Silakan masukkan format tanggal yang benar.", - dateISO: "Silakan masukkan format tanggal(ISO) yang benar.", - number: "Silakan masukkan angka yang benar.", - digits: "Harap masukan angka saja.", - creditcard: "Harap masukkan format kartu kredit yang benar.", - equalTo: "Harap masukkan nilai yg sama dengan sebelumnya.", - maxlength: $.validator.format("Input dibatasi hanya {0} karakter."), - minlength: $.validator.format("Input tidak kurang dari {0} karakter."), - rangelength: $.validator.format("Panjang karakter yg diizinkan antara {0} dan {1} karakter."), - range: $.validator.format("Harap masukkan nilai antara {0} dan {1}."), - max: $.validator.format("Harap masukkan nilai lebih kecil atau sama dengan {0}."), - min: $.validator.format("Harap masukkan nilai lebih besar atau sama dengan {0}.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_id.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_id.min.js deleted file mode 100644 index 7698afcc..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_id.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Kolom ini diperlukan.",remote:"Harap benarkan kolom ini.",email:"Silakan masukkan format email yang benar.",url:"Silakan masukkan format URL yang benar.",date:"Silakan masukkan format tanggal yang benar.",dateISO:"Silakan masukkan format tanggal(ISO) yang benar.",number:"Silakan masukkan angka yang benar.",digits:"Harap masukan angka saja.",creditcard:"Harap masukkan format kartu kredit yang benar.",equalTo:"Harap masukkan nilai yg sama dengan sebelumnya.",maxlength:a.validator.format("Input dibatasi hanya {0} karakter."),minlength:a.validator.format("Input tidak kurang dari {0} karakter."),rangelength:a.validator.format("Panjang karakter yg diizinkan antara {0} dan {1} karakter."),range:a.validator.format("Harap masukkan nilai antara {0} dan {1}."),max:a.validator.format("Harap masukkan nilai lebih kecil atau sama dengan {0}."),min:a.validator.format("Harap masukkan nilai lebih besar atau sama dengan {0}.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_is.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_is.js deleted file mode 100644 index 00948d4f..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_is.js +++ /dev/null @@ -1,31 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: IS (Icelandic; íslenska) - */ -$.extend($.validator.messages, { - required: "Þessi reitur er nauðsynlegur.", - remote: "Lagaðu þennan reit.", - maxlength: $.validator.format("Sláðu inn mest {0} stafi."), - minlength: $.validator.format("Sláðu inn minnst {0} stafi."), - rangelength: $.validator.format("Sláðu inn minnst {0} og mest {1} stafi."), - email: "Sláðu inn gilt netfang.", - url: "Sláðu inn gilda vefslóð.", - date: "Sláðu inn gilda dagsetningu.", - number: "Sláðu inn tölu.", - digits: "Sláðu inn tölustafi eingöngu.", - equalTo: "Sláðu sama gildi inn aftur.", - range: $.validator.format("Sláðu inn gildi milli {0} og {1}."), - max: $.validator.format("Sláðu inn gildi sem er minna en eða jafnt og {0}."), - min: $.validator.format("Sláðu inn gildi sem er stærra en eða jafnt og {0}."), - creditcard: "Sláðu inn gilt greiðslukortanúmer." -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_is.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_is.min.js deleted file mode 100644 index d1a2a500..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_is.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Þessi reitur er nauðsynlegur.",remote:"Lagaðu þennan reit.",maxlength:a.validator.format("Sláðu inn mest {0} stafi."),minlength:a.validator.format("Sláðu inn minnst {0} stafi."),rangelength:a.validator.format("Sláðu inn minnst {0} og mest {1} stafi."),email:"Sláðu inn gilt netfang.",url:"Sláðu inn gilda vefslóð.",date:"Sláðu inn gilda dagsetningu.",number:"Sláðu inn tölu.",digits:"Sláðu inn tölustafi eingöngu.",equalTo:"Sláðu sama gildi inn aftur.",range:a.validator.format("Sláðu inn gildi milli {0} og {1}."),max:a.validator.format("Sláðu inn gildi sem er minna en eða jafnt og {0}."),min:a.validator.format("Sláðu inn gildi sem er stærra en eða jafnt og {0}."),creditcard:"Sláðu inn gilt greiðslukortanúmer."})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_it.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_it.js deleted file mode 100644 index 170152d3..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_it.js +++ /dev/null @@ -1,37 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: IT (Italian; Italiano) - */ -$.extend($.validator.messages, { - required: "Campo obbligatorio", - remote: "Controlla questo campo", - email: "Inserisci un indirizzo email valido", - url: "Inserisci un indirizzo web valido", - date: "Inserisci una data valida", - dateISO: "Inserisci una data valida (ISO)", - number: "Inserisci un numero valido", - digits: "Inserisci solo numeri", - creditcard: "Inserisci un numero di carta di credito valido", - equalTo: "Il valore non corrisponde", - extension: "Inserisci un valore con un'estensione valida", - maxlength: $.validator.format("Non inserire più di {0} caratteri"), - minlength: $.validator.format("Inserisci almeno {0} caratteri"), - rangelength: $.validator.format("Inserisci un valore compreso tra {0} e {1} caratteri"), - range: $.validator.format("Inserisci un valore compreso tra {0} e {1}"), - max: $.validator.format("Inserisci un valore minore o uguale a {0}"), - min: $.validator.format("Inserisci un valore maggiore o uguale a {0}"), - nifES: "Inserisci un NIF valido", - nieES: "Inserisci un NIE valido", - cifES: "Inserisci un CIF valido", - currency: "Inserisci una valuta valida" -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_it.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_it.min.js deleted file mode 100644 index bb91758b..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_it.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Campo obbligatorio",remote:"Controlla questo campo",email:"Inserisci un indirizzo email valido",url:"Inserisci un indirizzo web valido",date:"Inserisci una data valida",dateISO:"Inserisci una data valida (ISO)",number:"Inserisci un numero valido",digits:"Inserisci solo numeri",creditcard:"Inserisci un numero di carta di credito valido",equalTo:"Il valore non corrisponde",extension:"Inserisci un valore con un'estensione valida",maxlength:a.validator.format("Non inserire più di {0} caratteri"),minlength:a.validator.format("Inserisci almeno {0} caratteri"),rangelength:a.validator.format("Inserisci un valore compreso tra {0} e {1} caratteri"),range:a.validator.format("Inserisci un valore compreso tra {0} e {1}"),max:a.validator.format("Inserisci un valore minore o uguale a {0}"),min:a.validator.format("Inserisci un valore maggiore o uguale a {0}"),nifES:"Inserisci un NIF valido",nieES:"Inserisci un NIE valido",cifES:"Inserisci un CIF valido",currency:"Inserisci una valuta valida"})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ja.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ja.js deleted file mode 100644 index 3eed43d3..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ja.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: JA (Japanese; 日本語) - */ -$.extend($.validator.messages, { - required: "このフィールドは必須です。", - remote: "このフィールドを修正してください。", - email: "有効なEメールアドレスを入力してください。", - url: "有効なURLを入力してください。", - date: "有効な日付を入力してください。", - dateISO: "有効な日付(ISO)を入力してください。", - number: "有効な数字を入力してください。", - digits: "数字のみを入力してください。", - creditcard: "有効なクレジットカード番号を入力してください。", - equalTo: "同じ値をもう一度入力してください。", - extension: "有効な拡張子を含む値を入力してください。", - maxlength: $.validator.format("{0} 文字以内で入力してください。"), - minlength: $.validator.format("{0} 文字以上で入力してください。"), - rangelength: $.validator.format("{0} 文字から {1} 文字までの値を入力してください。"), - range: $.validator.format("{0} から {1} までの値を入力してください。"), - max: $.validator.format("{0} 以下の値を入力してください。"), - min: $.validator.format("{0} 以上の値を入力してください。") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ja.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ja.min.js deleted file mode 100644 index 479550bd..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ja.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"このフィールドは必須です。",remote:"このフィールドを修正してください。",email:"有効なEメールアドレスを入力してください。",url:"有効なURLを入力してください。",date:"有効な日付を入力してください。",dateISO:"有効な日付(ISO)を入力してください。",number:"有効な数字を入力してください。",digits:"数字のみを入力してください。",creditcard:"有効なクレジットカード番号を入力してください。",equalTo:"同じ値をもう一度入力してください。",extension:"有効な拡張子を含む値を入力してください。",maxlength:a.validator.format("{0} 文字以内で入力してください。"),minlength:a.validator.format("{0} 文字以上で入力してください。"),rangelength:a.validator.format("{0} 文字から {1} 文字までの値を入力してください。"),range:a.validator.format("{0} から {1} までの値を入力してください。"),max:a.validator.format("{0} 以下の値を入力してください。"),min:a.validator.format("{0} 以上の値を入力してください。")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ka.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ka.js deleted file mode 100644 index 494ec918..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ka.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: KA (Georgian; ქართული) - */ -$.extend($.validator.messages, { - required: "ამ ველის შევსება აუცილებელია.", - remote: "გთხოვთ მიუთითოთ სწორი მნიშვნელობა.", - email: "გთხოვთ მიუთითოთ ელ-ფოსტის კორექტული მისამართი.", - url: "გთხოვთ მიუთითოთ კორექტული URL.", - date: "გთხოვთ მიუთითოთ კორექტული თარიღი.", - dateISO: "გთხოვთ მიუთითოთ კორექტული თარიღი ISO ფორმატში.", - number: "გთხოვთ მიუთითოთ ციფრი.", - digits: "გთხოვთ მიუთითოთ მხოლოდ ციფრები.", - creditcard: "გთხოვთ მიუთითოთ საკრედიტო ბარათის კორექტული ნომერი.", - equalTo: "გთხოვთ მიუთითოთ ასეთივე მნიშვნელობა კიდევ ერთხელ.", - extension: "გთხოვთ აირჩიოთ ფაილი კორექტული გაფართოებით.", - maxlength: $.validator.format("დასაშვებია არაუმეტეს {0} სიმბოლო."), - minlength: $.validator.format("აუცილებელია შეიყვანოთ მინიმუმ {0} სიმბოლო."), - rangelength: $.validator.format("ტექსტში სიმბოლოების რაოდენობა უნდა იყოს {0}-დან {1}-მდე."), - range: $.validator.format("გთხოვთ შეიყვანოთ ციფრი {0}-დან {1}-მდე."), - max: $.validator.format("გთხოვთ შეიყვანოთ ციფრი რომელიც ნაკლებია ან უდრის {0}-ს."), - min: $.validator.format("გთხოვთ შეიყვანოთ ციფრი რომელიც მეტია ან უდრის {0}-ს.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ka.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ka.min.js deleted file mode 100644 index 79c42d51..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ka.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"ამ ველის შევსება აუცილებელია.",remote:"გთხოვთ მიუთითოთ სწორი მნიშვნელობა.",email:"გთხოვთ მიუთითოთ ელ-ფოსტის კორექტული მისამართი.",url:"გთხოვთ მიუთითოთ კორექტული URL.",date:"გთხოვთ მიუთითოთ კორექტული თარიღი.",dateISO:"გთხოვთ მიუთითოთ კორექტული თარიღი ISO ფორმატში.",number:"გთხოვთ მიუთითოთ ციფრი.",digits:"გთხოვთ მიუთითოთ მხოლოდ ციფრები.",creditcard:"გთხოვთ მიუთითოთ საკრედიტო ბარათის კორექტული ნომერი.",equalTo:"გთხოვთ მიუთითოთ ასეთივე მნიშვნელობა კიდევ ერთხელ.",extension:"გთხოვთ აირჩიოთ ფაილი კორექტული გაფართოებით.",maxlength:a.validator.format("დასაშვებია არაუმეტეს {0} სიმბოლო."),minlength:a.validator.format("აუცილებელია შეიყვანოთ მინიმუმ {0} სიმბოლო."),rangelength:a.validator.format("ტექსტში სიმბოლოების რაოდენობა უნდა იყოს {0}-დან {1}-მდე."),range:a.validator.format("გთხოვთ შეიყვანოთ ციფრი {0}-დან {1}-მდე."),max:a.validator.format("გთხოვთ შეიყვანოთ ციფრი რომელიც ნაკლებია ან უდრის {0}-ს."),min:a.validator.format("გთხოვთ შეიყვანოთ ციფრი რომელიც მეტია ან უდრის {0}-ს.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_kk.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_kk.js deleted file mode 100644 index 17c8b83a..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_kk.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: KK (Kazakh; қазақ тілі) - */ -$.extend($.validator.messages, { - required: "Бұл өрісті міндетті түрде толтырыңыз.", - remote: "Дұрыс мағына енгізуіңізді сұраймыз.", - email: "Нақты электронды поштаңызды енгізуіңізді сұраймыз.", - url: "Нақты URL-ды енгізуіңізді сұраймыз.", - date: "Нақты URL-ды енгізуіңізді сұраймыз.", - dateISO: "Нақты ISO форматымен сәйкес датасын енгізуіңізді сұраймыз.", - number: "Күнді енгізуіңізді сұраймыз.", - digits: "Тек қана сандарды енгізуіңізді сұраймыз.", - creditcard: "Несие картасының нөмірін дұрыс енгізуіңізді сұраймыз.", - equalTo: "Осы мәнді қайта енгізуіңізді сұраймыз.", - extension: "Файлдың кеңейтуін дұрыс таңдаңыз.", - maxlength: $.validator.format("Ұзындығы {0} символдан көр болмасын."), - minlength: $.validator.format("Ұзындығы {0} символдан аз болмасын."), - rangelength: $.validator.format("Ұзындығы {0}-{1} дейін мән енгізуіңізді сұраймыз."), - range: $.validator.format("Пожалуйста, введите число от {0} до {1}. - {0} - {1} санын енгізуіңізді сұраймыз."), - max: $.validator.format("{0} аз немесе тең санын енгізуіңіді сұраймыз."), - min: $.validator.format("{0} көп немесе тең санын енгізуіңізді сұраймыз.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_kk.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_kk.min.js deleted file mode 100644 index 927cfa73..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_kk.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Бұл өрісті міндетті түрде толтырыңыз.",remote:"Дұрыс мағына енгізуіңізді сұраймыз.",email:"Нақты электронды поштаңызды енгізуіңізді сұраймыз.",url:"Нақты URL-ды енгізуіңізді сұраймыз.",date:"Нақты URL-ды енгізуіңізді сұраймыз.",dateISO:"Нақты ISO форматымен сәйкес датасын енгізуіңізді сұраймыз.",number:"Күнді енгізуіңізді сұраймыз.",digits:"Тек қана сандарды енгізуіңізді сұраймыз.",creditcard:"Несие картасының нөмірін дұрыс енгізуіңізді сұраймыз.",equalTo:"Осы мәнді қайта енгізуіңізді сұраймыз.",extension:"Файлдың кеңейтуін дұрыс таңдаңыз.",maxlength:a.validator.format("Ұзындығы {0} символдан көр болмасын."),minlength:a.validator.format("Ұзындығы {0} символдан аз болмасын."),rangelength:a.validator.format("Ұзындығы {0}-{1} дейін мән енгізуіңізді сұраймыз."),range:a.validator.format("Пожалуйста, введите число от {0} до {1}. - {0} - {1} санын енгізуіңізді сұраймыз."),max:a.validator.format("{0} аз немесе тең санын енгізуіңіді сұраймыз."),min:a.validator.format("{0} көп немесе тең санын енгізуіңізді сұраймыз.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ko.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ko.js deleted file mode 100644 index f6b53559..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ko.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: KO (Korean; 한국어) - */ -$.extend($.validator.messages, { - required: "필수 항목입니다.", - remote: "항목을 수정하세요.", - email: "유효하지 않은 E-Mail주소입니다.", - url: "유효하지 않은 URL입니다.", - date: "올바른 날짜를 입력하세요.", - dateISO: "올바른 날짜(ISO)를 입력하세요.", - number: "유효한 숫자가 아닙니다.", - digits: "숫자만 입력 가능합니다.", - creditcard: "신용카드 번호가 바르지 않습니다.", - equalTo: "같은 값을 다시 입력하세요.", - extension: "올바른 확장자가 아닙니다.", - maxlength: $.validator.format("{0}자를 넘을 수 없습니다. "), - minlength: $.validator.format("{0}자 이상 입력하세요."), - rangelength: $.validator.format("문자 길이가 {0} 에서 {1} 사이의 값을 입력하세요."), - range: $.validator.format("{0} 에서 {1} 사이의 값을 입력하세요."), - max: $.validator.format("{0} 이하의 값을 입력하세요."), - min: $.validator.format("{0} 이상의 값을 입력하세요.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ko.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ko.min.js deleted file mode 100644 index 24c7cb7b..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ko.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"필수 항목입니다.",remote:"항목을 수정하세요.",email:"유효하지 않은 E-Mail주소입니다.",url:"유효하지 않은 URL입니다.",date:"올바른 날짜를 입력하세요.",dateISO:"올바른 날짜(ISO)를 입력하세요.",number:"유효한 숫자가 아닙니다.",digits:"숫자만 입력 가능합니다.",creditcard:"신용카드 번호가 바르지 않습니다.",equalTo:"같은 값을 다시 입력하세요.",extension:"올바른 확장자가 아닙니다.",maxlength:a.validator.format("{0}자를 넘을 수 없습니다. "),minlength:a.validator.format("{0}자 이상 입력하세요."),rangelength:a.validator.format("문자 길이가 {0} 에서 {1} 사이의 값을 입력하세요."),range:a.validator.format("{0} 에서 {1} 사이의 값을 입력하세요."),max:a.validator.format("{0} 이하의 값을 입력하세요."),min:a.validator.format("{0} 이상의 값을 입력하세요.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_lt.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_lt.js deleted file mode 100644 index df17a1ed..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_lt.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: LT (Lithuanian; lietuvių kalba) - */ -$.extend($.validator.messages, { - required: "Šis laukas yra privalomas.", - remote: "Prašau pataisyti šį lauką.", - email: "Prašau įvesti teisingą elektroninio pašto adresą.", - url: "Prašau įvesti teisingą URL.", - date: "Prašau įvesti teisingą datą.", - dateISO: "Prašau įvesti teisingą datą (ISO).", - number: "Prašau įvesti teisingą skaičių.", - digits: "Prašau naudoti tik skaitmenis.", - creditcard: "Prašau įvesti teisingą kreditinės kortelės numerį.", - equalTo: "Prašau įvestį tą pačią reikšmę dar kartą.", - extension: "Prašau įvesti reikšmę su teisingu plėtiniu.", - maxlength: $.validator.format("Prašau įvesti ne daugiau kaip {0} simbolių."), - minlength: $.validator.format("Prašau įvesti bent {0} simbolius."), - rangelength: $.validator.format("Prašau įvesti reikšmes, kurių ilgis nuo {0} iki {1} simbolių."), - range: $.validator.format("Prašau įvesti reikšmę intervale nuo {0} iki {1}."), - max: $.validator.format("Prašau įvesti reikšmę mažesnę arba lygią {0}."), - min: $.validator.format("Prašau įvesti reikšmę didesnę arba lygią {0}.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_lt.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_lt.min.js deleted file mode 100644 index d0dfebbf..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_lt.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Šis laukas yra privalomas.",remote:"Prašau pataisyti šį lauką.",email:"Prašau įvesti teisingą elektroninio pašto adresą.",url:"Prašau įvesti teisingą URL.",date:"Prašau įvesti teisingą datą.",dateISO:"Prašau įvesti teisingą datą (ISO).",number:"Prašau įvesti teisingą skaičių.",digits:"Prašau naudoti tik skaitmenis.",creditcard:"Prašau įvesti teisingą kreditinės kortelės numerį.",equalTo:"Prašau įvestį tą pačią reikšmę dar kartą.",extension:"Prašau įvesti reikšmę su teisingu plėtiniu.",maxlength:a.validator.format("Prašau įvesti ne daugiau kaip {0} simbolių."),minlength:a.validator.format("Prašau įvesti bent {0} simbolius."),rangelength:a.validator.format("Prašau įvesti reikšmes, kurių ilgis nuo {0} iki {1} simbolių."),range:a.validator.format("Prašau įvesti reikšmę intervale nuo {0} iki {1}."),max:a.validator.format("Prašau įvesti reikšmę mažesnę arba lygią {0}."),min:a.validator.format("Prašau įvesti reikšmę didesnę arba lygią {0}.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_lv.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_lv.js deleted file mode 100644 index ade1b88f..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_lv.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: LV (Latvian; latviešu valoda) - */ -$.extend($.validator.messages, { - required: "Šis lauks ir obligāts.", - remote: "Lūdzu, pārbaudiet šo lauku.", - email: "Lūdzu, ievadiet derīgu e-pasta adresi.", - url: "Lūdzu, ievadiet derīgu URL adresi.", - date: "Lūdzu, ievadiet derīgu datumu.", - dateISO: "Lūdzu, ievadiet derīgu datumu (ISO).", - number: "Lūdzu, ievadiet derīgu numuru.", - digits: "Lūdzu, ievadiet tikai ciparus.", - creditcard: "Lūdzu, ievadiet derīgu kredītkartes numuru.", - equalTo: "Lūdzu, ievadiet to pašu vēlreiz.", - extension: "Lūdzu, ievadiet vērtību ar derīgu paplašinājumu.", - maxlength: $.validator.format("Lūdzu, ievadiet ne vairāk kā {0} rakstzīmes."), - minlength: $.validator.format("Lūdzu, ievadiet vismaz {0} rakstzīmes."), - rangelength: $.validator.format("Lūdzu ievadiet {0} līdz {1} rakstzīmes."), - range: $.validator.format("Lūdzu, ievadiet skaitli no {0} līdz {1}."), - max: $.validator.format("Lūdzu, ievadiet skaitli, kurš ir mazāks vai vienāds ar {0}."), - min: $.validator.format("Lūdzu, ievadiet skaitli, kurš ir lielāks vai vienāds ar {0}.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_lv.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_lv.min.js deleted file mode 100644 index 789831ea..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_lv.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Šis lauks ir obligāts.",remote:"Lūdzu, pārbaudiet šo lauku.",email:"Lūdzu, ievadiet derīgu e-pasta adresi.",url:"Lūdzu, ievadiet derīgu URL adresi.",date:"Lūdzu, ievadiet derīgu datumu.",dateISO:"Lūdzu, ievadiet derīgu datumu (ISO).",number:"Lūdzu, ievadiet derīgu numuru.",digits:"Lūdzu, ievadiet tikai ciparus.",creditcard:"Lūdzu, ievadiet derīgu kredītkartes numuru.",equalTo:"Lūdzu, ievadiet to pašu vēlreiz.",extension:"Lūdzu, ievadiet vērtību ar derīgu paplašinājumu.",maxlength:a.validator.format("Lūdzu, ievadiet ne vairāk kā {0} rakstzīmes."),minlength:a.validator.format("Lūdzu, ievadiet vismaz {0} rakstzīmes."),rangelength:a.validator.format("Lūdzu ievadiet {0} līdz {1} rakstzīmes."),range:a.validator.format("Lūdzu, ievadiet skaitli no {0} līdz {1}."),max:a.validator.format("Lūdzu, ievadiet skaitli, kurš ir mazāks vai vienāds ar {0}."),min:a.validator.format("Lūdzu, ievadiet skaitli, kurš ir lielāks vai vienāds ar {0}.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_my.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_my.js deleted file mode 100644 index 9de974ab..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_my.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: MY (Malay; Melayu) - */ -$.extend($.validator.messages, { - required: "Medan ini diperlukan.", - remote: "Sila betulkan medan ini.", - email: "Sila masukkan alamat emel yang betul.", - url: "Sila masukkan URL yang betul.", - date: "Sila masukkan tarikh yang betul.", - dateISO: "Sila masukkan tarikh(ISO) yang betul.", - number: "Sila masukkan nombor yang betul.", - digits: "Sila masukkan nilai digit sahaja.", - creditcard: "Sila masukkan nombor kredit kad yang betul.", - equalTo: "Sila masukkan nilai yang sama semula.", - extension: "Sila masukkan nilai yang telah diterima.", - maxlength: $.validator.format("Sila masukkan nilai tidak lebih dari {0} aksara."), - minlength: $.validator.format("Sila masukkan nilai sekurang-kurangnya {0} aksara."), - rangelength: $.validator.format("Sila masukkan panjang nilai antara {0} dan {1} aksara."), - range: $.validator.format("Sila masukkan nilai antara {0} dan {1} aksara."), - max: $.validator.format("Sila masukkan nilai yang kurang atau sama dengan {0}."), - min: $.validator.format("Sila masukkan nilai yang lebih atau sama dengan {0}.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_my.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_my.min.js deleted file mode 100644 index 6cb9bfc6..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_my.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Medan ini diperlukan.",remote:"Sila betulkan medan ini.",email:"Sila masukkan alamat emel yang betul.",url:"Sila masukkan URL yang betul.",date:"Sila masukkan tarikh yang betul.",dateISO:"Sila masukkan tarikh(ISO) yang betul.",number:"Sila masukkan nombor yang betul.",digits:"Sila masukkan nilai digit sahaja.",creditcard:"Sila masukkan nombor kredit kad yang betul.",equalTo:"Sila masukkan nilai yang sama semula.",extension:"Sila masukkan nilai yang telah diterima.",maxlength:a.validator.format("Sila masukkan nilai tidak lebih dari {0} aksara."),minlength:a.validator.format("Sila masukkan nilai sekurang-kurangnya {0} aksara."),rangelength:a.validator.format("Sila masukkan panjang nilai antara {0} dan {1} aksara."),range:a.validator.format("Sila masukkan nilai antara {0} dan {1} aksara."),max:a.validator.format("Sila masukkan nilai yang kurang atau sama dengan {0}."),min:a.validator.format("Sila masukkan nilai yang lebih atau sama dengan {0}.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_nl.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_nl.js deleted file mode 100644 index cdba3812..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_nl.js +++ /dev/null @@ -1,43 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: NL (Dutch; Nederlands, Vlaams) - */ -$.extend($.validator.messages, { - required: "Dit is een verplicht veld.", - remote: "Controleer dit veld.", - email: "Vul hier een geldig e-mailadres in.", - url: "Vul hier een geldige URL in.", - date: "Vul hier een geldige datum in.", - dateISO: "Vul hier een geldige datum in (ISO-formaat).", - number: "Vul hier een geldig getal in.", - digits: "Vul hier alleen getallen in.", - creditcard: "Vul hier een geldig creditcardnummer in.", - equalTo: "Vul hier dezelfde waarde in.", - extension: "Vul hier een waarde in met een geldige extensie.", - maxlength: $.validator.format("Vul hier maximaal {0} tekens in."), - minlength: $.validator.format("Vul hier minimaal {0} tekens in."), - rangelength: $.validator.format("Vul hier een waarde in van minimaal {0} en maximaal {1} tekens."), - range: $.validator.format("Vul hier een waarde in van minimaal {0} en maximaal {1}."), - max: $.validator.format("Vul hier een waarde in kleiner dan of gelijk aan {0}."), - min: $.validator.format("Vul hier een waarde in groter dan of gelijk aan {0}."), - - // for validations in additional-methods.js - iban: "Vul hier een geldig IBAN in.", - dateNL: "Vul hier een geldige datum in.", - phoneNL: "Vul hier een geldig Nederlands telefoonnummer in.", - mobileNL: "Vul hier een geldig Nederlands mobiel telefoonnummer in.", - postalcodeNL: "Vul hier een geldige postcode in.", - bankaccountNL: "Vul hier een geldig bankrekeningnummer in.", - giroaccountNL: "Vul hier een geldig gironummer in.", - bankorgiroaccountNL: "Vul hier een geldig bank- of gironummer in." -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_nl.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_nl.min.js deleted file mode 100644 index b28c8a8b..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_nl.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Dit is een verplicht veld.",remote:"Controleer dit veld.",email:"Vul hier een geldig e-mailadres in.",url:"Vul hier een geldige URL in.",date:"Vul hier een geldige datum in.",dateISO:"Vul hier een geldige datum in (ISO-formaat).",number:"Vul hier een geldig getal in.",digits:"Vul hier alleen getallen in.",creditcard:"Vul hier een geldig creditcardnummer in.",equalTo:"Vul hier dezelfde waarde in.",extension:"Vul hier een waarde in met een geldige extensie.",maxlength:a.validator.format("Vul hier maximaal {0} tekens in."),minlength:a.validator.format("Vul hier minimaal {0} tekens in."),rangelength:a.validator.format("Vul hier een waarde in van minimaal {0} en maximaal {1} tekens."),range:a.validator.format("Vul hier een waarde in van minimaal {0} en maximaal {1}."),max:a.validator.format("Vul hier een waarde in kleiner dan of gelijk aan {0}."),min:a.validator.format("Vul hier een waarde in groter dan of gelijk aan {0}."),iban:"Vul hier een geldig IBAN in.",dateNL:"Vul hier een geldige datum in.",phoneNL:"Vul hier een geldig Nederlands telefoonnummer in.",mobileNL:"Vul hier een geldig Nederlands mobiel telefoonnummer in.",postalcodeNL:"Vul hier een geldige postcode in.",bankaccountNL:"Vul hier een geldig bankrekeningnummer in.",giroaccountNL:"Vul hier een geldig gironummer in.",bankorgiroaccountNL:"Vul hier een geldig bank- of gironummer in."})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_no.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_no.js deleted file mode 100644 index 308b715a..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_no.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: NO (Norwegian; Norsk) - */ -$.extend($.validator.messages, { - required: "Dette feltet er obligatorisk.", - maxlength: $.validator.format("Maksimalt {0} tegn."), - minlength: $.validator.format("Minimum {0} tegn."), - rangelength: $.validator.format("Angi minimum {0} og maksimum {1} tegn."), - email: "Oppgi en gyldig epostadresse.", - url: "Angi en gyldig URL.", - date: "Angi en gyldig dato.", - dateISO: "Angi en gyldig dato (&ARING;&ARING;&ARING;&ARING;-MM-DD).", - dateSE: "Angi en gyldig dato.", - number: "Angi et gyldig nummer.", - numberSE: "Angi et gyldig nummer.", - digits: "Skriv kun tall.", - equalTo: "Skriv samme verdi igjen.", - range: $.validator.format("Angi en verdi mellom {0} og {1}."), - max: $.validator.format("Angi en verdi som er mindre eller lik {0}."), - min: $.validator.format("Angi en verdi som er større eller lik {0}."), - creditcard: "Angi et gyldig kredittkortnummer." -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_no.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_no.min.js deleted file mode 100644 index c860d217..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_no.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Dette feltet er obligatorisk.",maxlength:a.validator.format("Maksimalt {0} tegn."),minlength:a.validator.format("Minimum {0} tegn."),rangelength:a.validator.format("Angi minimum {0} og maksimum {1} tegn."),email:"Oppgi en gyldig epostadresse.",url:"Angi en gyldig URL.",date:"Angi en gyldig dato.",dateISO:"Angi en gyldig dato (&ARING;&ARING;&ARING;&ARING;-MM-DD).",dateSE:"Angi en gyldig dato.",number:"Angi et gyldig nummer.",numberSE:"Angi et gyldig nummer.",digits:"Skriv kun tall.",equalTo:"Skriv samme verdi igjen.",range:a.validator.format("Angi en verdi mellom {0} og {1}."),max:a.validator.format("Angi en verdi som er mindre eller lik {0}."),min:a.validator.format("Angi en verdi som er større eller lik {0}."),creditcard:"Angi et gyldig kredittkortnummer."})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_pl.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_pl.js deleted file mode 100644 index 453ba772..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_pl.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: PL (Polish; język polski, polszczyzna) - */ -$.extend($.validator.messages, { - required: "To pole jest wymagane.", - remote: "Proszę o wypełnienie tego pola.", - email: "Proszę o podanie prawidłowego adresu email.", - url: "Proszę o podanie prawidłowego URL.", - date: "Proszę o podanie prawidłowej daty.", - dateISO: "Proszę o podanie prawidłowej daty (ISO).", - number: "Proszę o podanie prawidłowej liczby.", - digits: "Proszę o podanie samych cyfr.", - creditcard: "Proszę o podanie prawidłowej karty kredytowej.", - equalTo: "Proszę o podanie tej samej wartości ponownie.", - extension: "Proszę o podanie wartości z prawidłowym rozszerzeniem.", - maxlength: $.validator.format("Proszę o podanie nie więcej niż {0} znaków."), - minlength: $.validator.format("Proszę o podanie przynajmniej {0} znaków."), - rangelength: $.validator.format("Proszę o podanie wartości o długości od {0} do {1} znaków."), - range: $.validator.format("Proszę o podanie wartości z przedziału od {0} do {1}."), - max: $.validator.format("Proszę o podanie wartości mniejszej bądź równej {0}."), - min: $.validator.format("Proszę o podanie wartości większej bądź równej {0}.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_pl.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_pl.min.js deleted file mode 100644 index 2684218b..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_pl.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"To pole jest wymagane.",remote:"Proszę o wypełnienie tego pola.",email:"Proszę o podanie prawidłowego adresu email.",url:"Proszę o podanie prawidłowego URL.",date:"Proszę o podanie prawidłowej daty.",dateISO:"Proszę o podanie prawidłowej daty (ISO).",number:"Proszę o podanie prawidłowej liczby.",digits:"Proszę o podanie samych cyfr.",creditcard:"Proszę o podanie prawidłowej karty kredytowej.",equalTo:"Proszę o podanie tej samej wartości ponownie.",extension:"Proszę o podanie wartości z prawidłowym rozszerzeniem.",maxlength:a.validator.format("Proszę o podanie nie więcej niż {0} znaków."),minlength:a.validator.format("Proszę o podanie przynajmniej {0} znaków."),rangelength:a.validator.format("Proszę o podanie wartości o długości od {0} do {1} znaków."),range:a.validator.format("Proszę o podanie wartości z przedziału od {0} do {1}."),max:a.validator.format("Proszę o podanie wartości mniejszej bądź równej {0}."),min:a.validator.format("Proszę o podanie wartości większej bądź równej {0}.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_pt_BR.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_pt_BR.js deleted file mode 100644 index 63bc9564..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_pt_BR.js +++ /dev/null @@ -1,39 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: PT (Portuguese; português) - * Region: BR (Brazil) - */ -$.extend($.validator.messages, { - required: "Este campo é requerido.", - remote: "Por favor, corrija este campo.", - email: "Por favor, forneça um endereço de email válido.", - url: "Por favor, forneça uma URL válida.", - date: "Por favor, forneça uma data válida.", - dateISO: "Por favor, forneça uma data válida (ISO).", - number: "Por favor, forneça um número válido.", - digits: "Por favor, forneça somente dígitos.", - creditcard: "Por favor, forneça um cartão de crédito válido.", - equalTo: "Por favor, forneça o mesmo valor novamente.", - extension: "Por favor, forneça um valor com uma extensão válida.", - maxlength: $.validator.format("Por favor, forneça não mais que {0} caracteres."), - minlength: $.validator.format("Por favor, forneça ao menos {0} caracteres."), - rangelength: $.validator.format("Por favor, forneça um valor entre {0} e {1} caracteres de comprimento."), - range: $.validator.format("Por favor, forneça um valor entre {0} e {1}."), - max: $.validator.format("Por favor, forneça um valor menor ou igual a {0}."), - min: $.validator.format("Por favor, forneça um valor maior ou igual a {0}."), - nifES: "Por favor, forneça um NIF válido.", - nieES: "Por favor, forneça um NIE válido.", - cifEE: "Por favor, forneça um CIF válido.", - postalcodeBR: "Por favor, forneça um CEP válido.", - cpfBR: "Por favor, forneça um CPF válido." -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_pt_BR.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_pt_BR.min.js deleted file mode 100644 index a121d244..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_pt_BR.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Este campo é requerido.",remote:"Por favor, corrija este campo.",email:"Por favor, forneça um endereço de email válido.",url:"Por favor, forneça uma URL válida.",date:"Por favor, forneça uma data válida.",dateISO:"Por favor, forneça uma data válida (ISO).",number:"Por favor, forneça um número válido.",digits:"Por favor, forneça somente dígitos.",creditcard:"Por favor, forneça um cartão de crédito válido.",equalTo:"Por favor, forneça o mesmo valor novamente.",extension:"Por favor, forneça um valor com uma extensão válida.",maxlength:a.validator.format("Por favor, forneça não mais que {0} caracteres."),minlength:a.validator.format("Por favor, forneça ao menos {0} caracteres."),rangelength:a.validator.format("Por favor, forneça um valor entre {0} e {1} caracteres de comprimento."),range:a.validator.format("Por favor, forneça um valor entre {0} e {1}."),max:a.validator.format("Por favor, forneça um valor menor ou igual a {0}."),min:a.validator.format("Por favor, forneça um valor maior ou igual a {0}."),nifES:"Por favor, forneça um NIF válido.",nieES:"Por favor, forneça um NIE válido.",cifEE:"Por favor, forneça um CIF válido.",postalcodeBR:"Por favor, forneça um CEP válido.",cpfBR:"Por favor, forneça um CPF válido."})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_pt_PT.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_pt_PT.js deleted file mode 100644 index 4c2a7826..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_pt_PT.js +++ /dev/null @@ -1,37 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: PT (Portuguese; português) - * Region: PT (Portugal) - */ -$.extend($.validator.messages, { - required: "Campo de preenchimento obrigatório.", - remote: "Por favor, corrija este campo.", - email: "Por favor, introduza um endereço eletrónico válido.", - url: "Por favor, introduza um URL válido.", - date: "Por favor, introduza uma data válida.", - dateISO: "Por favor, introduza uma data válida (ISO).", - number: "Por favor, introduza um número válido.", - digits: "Por favor, introduza apenas dígitos.", - creditcard: "Por favor, introduza um número de cartão de crédito válido.", - equalTo: "Por favor, introduza de novo o mesmo valor.", - extension: "Por favor, introduza um ficheiro com uma extensão válida.", - maxlength: $.validator.format("Por favor, não introduza mais do que {0} caracteres."), - minlength: $.validator.format("Por favor, introduza pelo menos {0} caracteres."), - rangelength: $.validator.format("Por favor, introduza entre {0} e {1} caracteres."), - range: $.validator.format("Por favor, introduza um valor entre {0} e {1}."), - max: $.validator.format("Por favor, introduza um valor menor ou igual a {0}."), - min: $.validator.format("Por favor, introduza um valor maior ou igual a {0}."), - nifES: "Por favor, introduza um NIF válido.", - nieES: "Por favor, introduza um NIE válido.", - cifES: "Por favor, introduza um CIF válido." -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_pt_PT.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_pt_PT.min.js deleted file mode 100644 index e4377fca..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_pt_PT.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Campo de preenchimento obrigatório.",remote:"Por favor, corrija este campo.",email:"Por favor, introduza um endereço eletrónico válido.",url:"Por favor, introduza um URL válido.",date:"Por favor, introduza uma data válida.",dateISO:"Por favor, introduza uma data válida (ISO).",number:"Por favor, introduza um número válido.",digits:"Por favor, introduza apenas dígitos.",creditcard:"Por favor, introduza um número de cartão de crédito válido.",equalTo:"Por favor, introduza de novo o mesmo valor.",extension:"Por favor, introduza um ficheiro com uma extensão válida.",maxlength:a.validator.format("Por favor, não introduza mais do que {0} caracteres."),minlength:a.validator.format("Por favor, introduza pelo menos {0} caracteres."),rangelength:a.validator.format("Por favor, introduza entre {0} e {1} caracteres."),range:a.validator.format("Por favor, introduza um valor entre {0} e {1}."),max:a.validator.format("Por favor, introduza um valor menor ou igual a {0}."),min:a.validator.format("Por favor, introduza um valor maior ou igual a {0}."),nifES:"Por favor, introduza um NIF válido.",nieES:"Por favor, introduza um NIE válido.",cifES:"Por favor, introduza um CIF válido."})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ro.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ro.js deleted file mode 100644 index be77eabc..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ro.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: RO (Romanian, limba română) - */ -$.extend($.validator.messages, { - required: "Acest câmp este obligatoriu.", - remote: "Te rugăm să completezi acest câmp.", - email: "Te rugăm să introduci o adresă de email validă", - url: "Te rugăm sa introduci o adresă URL validă.", - date: "Te rugăm să introduci o dată corectă.", - dateISO: "Te rugăm să introduci o dată (ISO) corectă.", - number: "Te rugăm să introduci un număr întreg valid.", - digits: "Te rugăm să introduci doar cifre.", - creditcard: "Te rugăm să introduci un numar de carte de credit valid.", - equalTo: "Te rugăm să reintroduci valoarea.", - extension: "Te rugăm să introduci o valoare cu o extensie validă.", - maxlength: $.validator.format("Te rugăm să nu introduci mai mult de {0} caractere."), - minlength: $.validator.format("Te rugăm să introduci cel puțin {0} caractere."), - rangelength: $.validator.format("Te rugăm să introduci o valoare între {0} și {1} caractere."), - range: $.validator.format("Te rugăm să introduci o valoare între {0} și {1}."), - max: $.validator.format("Te rugăm să introduci o valoare egal sau mai mică decât {0}."), - min: $.validator.format("Te rugăm să introduci o valoare egal sau mai mare decât {0}.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ro.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ro.min.js deleted file mode 100644 index fa36199f..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ro.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Acest câmp este obligatoriu.",remote:"Te rugăm să completezi acest câmp.",email:"Te rugăm să introduci o adresă de email validă",url:"Te rugăm sa introduci o adresă URL validă.",date:"Te rugăm să introduci o dată corectă.",dateISO:"Te rugăm să introduci o dată (ISO) corectă.",number:"Te rugăm să introduci un număr întreg valid.",digits:"Te rugăm să introduci doar cifre.",creditcard:"Te rugăm să introduci un numar de carte de credit valid.",equalTo:"Te rugăm să reintroduci valoarea.",extension:"Te rugăm să introduci o valoare cu o extensie validă.",maxlength:a.validator.format("Te rugăm să nu introduci mai mult de {0} caractere."),minlength:a.validator.format("Te rugăm să introduci cel puțin {0} caractere."),rangelength:a.validator.format("Te rugăm să introduci o valoare între {0} și {1} caractere."),range:a.validator.format("Te rugăm să introduci o valoare între {0} și {1}."),max:a.validator.format("Te rugăm să introduci o valoare egal sau mai mică decât {0}."),min:a.validator.format("Te rugăm să introduci o valoare egal sau mai mare decât {0}.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ru.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ru.js deleted file mode 100644 index 896827bf..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ru.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: RU (Russian; русский язык) - */ -$.extend($.validator.messages, { - required: "Это поле необходимо заполнить.", - remote: "Пожалуйста, введите правильное значение.", - email: "Пожалуйста, введите корректный адрес электронной почты.", - url: "Пожалуйста, введите корректный URL.", - date: "Пожалуйста, введите корректную дату.", - dateISO: "Пожалуйста, введите корректную дату в формате ISO.", - number: "Пожалуйста, введите число.", - digits: "Пожалуйста, вводите только цифры.", - creditcard: "Пожалуйста, введите правильный номер кредитной карты.", - equalTo: "Пожалуйста, введите такое же значение ещё раз.", - extension: "Пожалуйста, выберите файл с правильным расширением.", - maxlength: $.validator.format("Пожалуйста, введите не больше {0} символов."), - minlength: $.validator.format("Пожалуйста, введите не меньше {0} символов."), - rangelength: $.validator.format("Пожалуйста, введите значение длиной от {0} до {1} символов."), - range: $.validator.format("Пожалуйста, введите число от {0} до {1}."), - max: $.validator.format("Пожалуйста, введите число, меньшее или равное {0}."), - min: $.validator.format("Пожалуйста, введите число, большее или равное {0}.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ru.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ru.min.js deleted file mode 100644 index b5c84081..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_ru.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Это поле необходимо заполнить.",remote:"Пожалуйста, введите правильное значение.",email:"Пожалуйста, введите корректный адрес электронной почты.",url:"Пожалуйста, введите корректный URL.",date:"Пожалуйста, введите корректную дату.",dateISO:"Пожалуйста, введите корректную дату в формате ISO.",number:"Пожалуйста, введите число.",digits:"Пожалуйста, вводите только цифры.",creditcard:"Пожалуйста, введите правильный номер кредитной карты.",equalTo:"Пожалуйста, введите такое же значение ещё раз.",extension:"Пожалуйста, выберите файл с правильным расширением.",maxlength:a.validator.format("Пожалуйста, введите не больше {0} символов."),minlength:a.validator.format("Пожалуйста, введите не меньше {0} символов."),rangelength:a.validator.format("Пожалуйста, введите значение длиной от {0} до {1} символов."),range:a.validator.format("Пожалуйста, введите число от {0} до {1}."),max:a.validator.format("Пожалуйста, введите число, меньшее или равное {0}."),min:a.validator.format("Пожалуйста, введите число, большее или равное {0}.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_si.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_si.js deleted file mode 100644 index 8e04a9d5..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_si.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: SI (Slovenian) - */ -$.extend($.validator.messages, { - required: "To polje je obvezno.", - remote: "Vpis v tem polju ni v pravi obliki.", - email: "Prosimo, vnesite pravi email naslov.", - url: "Prosimo, vnesite pravi URL.", - date: "Prosimo, vnesite pravi datum.", - dateISO: "Prosimo, vnesite pravi datum (ISO).", - number: "Prosimo, vnesite pravo številko.", - digits: "Prosimo, vnesite samo številke.", - creditcard: "Prosimo, vnesite pravo številko kreditne kartice.", - equalTo: "Prosimo, ponovno vnesite enako vsebino.", - extension: "Prosimo, vnesite vsebino z pravo končnico.", - maxlength: $.validator.format("Prosimo, da ne vnašate več kot {0} znakov."), - minlength: $.validator.format("Prosimo, vnesite vsaj {0} znakov."), - rangelength: $.validator.format("Prosimo, vnesite od {0} do {1} znakov."), - range: $.validator.format("Prosimo, vnesite vrednost med {0} in {1}."), - max: $.validator.format("Prosimo, vnesite vrednost manjšo ali enako {0}."), - min: $.validator.format("Prosimo, vnesite vrednost večjo ali enako {0}.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_si.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_si.min.js deleted file mode 100644 index fa01417e..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_si.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"To polje je obvezno.",remote:"Vpis v tem polju ni v pravi obliki.",email:"Prosimo, vnesite pravi email naslov.",url:"Prosimo, vnesite pravi URL.",date:"Prosimo, vnesite pravi datum.",dateISO:"Prosimo, vnesite pravi datum (ISO).",number:"Prosimo, vnesite pravo številko.",digits:"Prosimo, vnesite samo številke.",creditcard:"Prosimo, vnesite pravo številko kreditne kartice.",equalTo:"Prosimo, ponovno vnesite enako vsebino.",extension:"Prosimo, vnesite vsebino z pravo končnico.",maxlength:a.validator.format("Prosimo, da ne vnašate več kot {0} znakov."),minlength:a.validator.format("Prosimo, vnesite vsaj {0} znakov."),rangelength:a.validator.format("Prosimo, vnesite od {0} do {1} znakov."),range:a.validator.format("Prosimo, vnesite vrednost med {0} in {1}."),max:a.validator.format("Prosimo, vnesite vrednost manjšo ali enako {0}."),min:a.validator.format("Prosimo, vnesite vrednost večjo ali enako {0}.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sk.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sk.js deleted file mode 100644 index cf3680eb..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sk.js +++ /dev/null @@ -1,30 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: SK (Slovak; slovenčina, slovenský jazyk) - */ -$.extend($.validator.messages, { - required: "Povinné zadať.", - maxlength: $.validator.format("Maximálne {0} znakov."), - minlength: $.validator.format("Minimálne {0} znakov."), - rangelength: $.validator.format("Minimálne {0} a Maximálne {1} znakov."), - email: "E-mailová adresa musí byť platná.", - url: "URL musí byť platný.", - date: "Musí byť dátum.", - number: "Musí byť číslo.", - digits: "Môže obsahovať iba číslice.", - equalTo: "Dva hodnoty sa musia rovnať.", - range: $.validator.format("Musí byť medzi {0} a {1}."), - max: $.validator.format("Nemôže byť viac ako{0}."), - min: $.validator.format("Nemôže byť menej ako{0}."), - creditcard: "Číslo platobnej karty musí byť platné." -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sk.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sk.min.js deleted file mode 100644 index b586b0e2..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sk.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Povinné zadať.",maxlength:a.validator.format("Maximálne {0} znakov."),minlength:a.validator.format("Minimálne {0} znakov."),rangelength:a.validator.format("Minimálne {0} a Maximálne {1} znakov."),email:"E-mailová adresa musí byť platná.",url:"URL musí byť platný.",date:"Musí byť dátum.",number:"Musí byť číslo.",digits:"Môže obsahovať iba číslice.",equalTo:"Dva hodnoty sa musia rovnať.",range:a.validator.format("Musí byť medzi {0} a {1}."),max:a.validator.format("Nemôže byť viac ako{0}."),min:a.validator.format("Nemôže byť menej ako{0}."),creditcard:"Číslo platobnej karty musí byť platné."})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sl.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sl.js deleted file mode 100644 index 6eb9e0b2..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sl.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Language: SL (Slovenian; slovenski jezik) - */ -$.extend($.validator.messages, { - required: "To polje je obvezno.", - remote: "Prosimo popravite to polje.", - email: "Prosimo vnesite veljaven email naslov.", - url: "Prosimo vnesite veljaven URL naslov.", - date: "Prosimo vnesite veljaven datum.", - dateISO: "Prosimo vnesite veljaven ISO datum.", - number: "Prosimo vnesite veljavno število.", - digits: "Prosimo vnesite samo števila.", - creditcard: "Prosimo vnesite veljavno številko kreditne kartice.", - equalTo: "Prosimo ponovno vnesite vrednost.", - extension: "Prosimo vnesite vrednost z veljavno končnico.", - maxlength: $.validator.format("Prosimo vnesite največ {0} znakov."), - minlength: $.validator.format("Prosimo vnesite najmanj {0} znakov."), - rangelength: $.validator.format("Prosimo vnesite najmanj {0} in največ {1} znakov."), - range: $.validator.format("Prosimo vnesite vrednost med {0} in {1}."), - max: $.validator.format("Prosimo vnesite vrednost manjše ali enako {0}."), - min: $.validator.format("Prosimo vnesite vrednost večje ali enako {0}.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sl.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sl.min.js deleted file mode 100644 index f5009d6d..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sl.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"To polje je obvezno.",remote:"Prosimo popravite to polje.",email:"Prosimo vnesite veljaven email naslov.",url:"Prosimo vnesite veljaven URL naslov.",date:"Prosimo vnesite veljaven datum.",dateISO:"Prosimo vnesite veljaven ISO datum.",number:"Prosimo vnesite veljavno število.",digits:"Prosimo vnesite samo števila.",creditcard:"Prosimo vnesite veljavno številko kreditne kartice.",equalTo:"Prosimo ponovno vnesite vrednost.",extension:"Prosimo vnesite vrednost z veljavno končnico.",maxlength:a.validator.format("Prosimo vnesite največ {0} znakov."),minlength:a.validator.format("Prosimo vnesite najmanj {0} znakov."),rangelength:a.validator.format("Prosimo vnesite najmanj {0} in največ {1} znakov."),range:a.validator.format("Prosimo vnesite vrednost med {0} in {1}."),max:a.validator.format("Prosimo vnesite vrednost manjše ali enako {0}."),min:a.validator.format("Prosimo vnesite vrednost večje ali enako {0}.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sr.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sr.js deleted file mode 100644 index e268be82..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sr.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: SR (Serbian; српски језик) - */ -$.extend($.validator.messages, { - required: "Поље је обавезно.", - remote: "Средите ово поље.", - email: "Унесите исправну и-мејл адресу.", - url: "Унесите исправан URL.", - date: "Унесите исправан датум.", - dateISO: "Унесите исправан датум (ISO).", - number: "Унесите исправан број.", - digits: "Унесите само цифе.", - creditcard: "Унесите исправан број кредитне картице.", - equalTo: "Унесите исту вредност поново.", - extension: "Унесите вредност са одговарајућом екстензијом.", - maxlength: $.validator.format("Унесите мање од {0} карактера."), - minlength: $.validator.format("Унесите барем {0} карактера."), - rangelength: $.validator.format("Унесите вредност дугачку између {0} и {1} карактера."), - range: $.validator.format("Унесите вредност између {0} и {1}."), - max: $.validator.format("Унесите вредност мању или једнаку {0}."), - min: $.validator.format("Унесите вредност већу или једнаку {0}.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sr.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sr.min.js deleted file mode 100644 index 325b44c4..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sr.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Поље је обавезно.",remote:"Средите ово поље.",email:"Унесите исправну и-мејл адресу.",url:"Унесите исправан URL.",date:"Унесите исправан датум.",dateISO:"Унесите исправан датум (ISO).",number:"Унесите исправан број.",digits:"Унесите само цифе.",creditcard:"Унесите исправан број кредитне картице.",equalTo:"Унесите исту вредност поново.",extension:"Унесите вредност са одговарајућом екстензијом.",maxlength:a.validator.format("Унесите мање од {0} карактера."),minlength:a.validator.format("Унесите барем {0} карактера."),rangelength:a.validator.format("Унесите вредност дугачку између {0} и {1} карактера."),range:a.validator.format("Унесите вредност између {0} и {1}."),max:a.validator.format("Унесите вредност мању или једнаку {0}."),min:a.validator.format("Унесите вредност већу или једнаку {0}.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sr_lat.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sr_lat.js deleted file mode 100644 index fbcb7d3a..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sr_lat.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: SR (Serbian - Latin alphabet; srpski jezik - latinica) - */ -$.extend($.validator.messages, { - required: "Polje je obavezno.", - remote: "Sredite ovo polje.", - email: "Unesite ispravnu e-mail adresu", - url: "Unesite ispravan URL.", - date: "Unesite ispravan datum.", - dateISO: "Unesite ispravan datum (ISO).", - number: "Unesite ispravan broj.", - digits: "Unesite samo cifre.", - creditcard: "Unesite ispravan broj kreditne kartice.", - equalTo: "Unesite istu vrednost ponovo.", - extension: "Unesite vrednost sa odgovarajućom ekstenzijom.", - maxlength: $.validator.format("Unesite manje od {0} karaktera."), - minlength: $.validator.format("Unesite barem {0} karaktera."), - rangelength: $.validator.format("Unesite vrednost dugačku između {0} i {1} karaktera."), - range: $.validator.format("Unesite vrednost između {0} i {1}."), - max: $.validator.format("Unesite vrednost manju ili jednaku {0}."), - min: $.validator.format("Unesite vrednost veću ili jednaku {0}.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sr_lat.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sr_lat.min.js deleted file mode 100644 index 6fa3800a..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sr_lat.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Polje je obavezno.",remote:"Sredite ovo polje.",email:"Unesite ispravnu e-mail adresu",url:"Unesite ispravan URL.",date:"Unesite ispravan datum.",dateISO:"Unesite ispravan datum (ISO).",number:"Unesite ispravan broj.",digits:"Unesite samo cifre.",creditcard:"Unesite ispravan broj kreditne kartice.",equalTo:"Unesite istu vrednost ponovo.",extension:"Unesite vrednost sa odgovarajućom ekstenzijom.",maxlength:a.validator.format("Unesite manje od {0} karaktera."),minlength:a.validator.format("Unesite barem {0} karaktera."),rangelength:a.validator.format("Unesite vrednost dugačku između {0} i {1} karaktera."),range:a.validator.format("Unesite vrednost između {0} i {1}."),max:a.validator.format("Unesite vrednost manju ili jednaku {0}."),min:a.validator.format("Unesite vrednost veću ili jednaku {0}.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sv.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sv.js deleted file mode 100644 index 758c8a72..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sv.js +++ /dev/null @@ -1,31 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: SV (Swedish; Svenska) - */ -$.extend($.validator.messages, { - required: "Detta fält är obligatoriskt.", - maxlength: $.validator.format("Du får ange högst {0} tecken."), - minlength: $.validator.format("Du måste ange minst {0} tecken."), - rangelength: $.validator.format("Ange minst {0} och max {1} tecken."), - email: "Ange en korrekt e-postadress.", - url: "Ange en korrekt URL.", - date: "Ange ett korrekt datum.", - dateISO: "Ange ett korrekt datum (ÅÅÅÅ-MM-DD).", - number: "Ange ett korrekt nummer.", - digits: "Ange endast siffror.", - equalTo: "Ange samma värde igen.", - range: $.validator.format("Ange ett värde mellan {0} och {1}."), - max: $.validator.format("Ange ett värde som är mindre eller lika med {0}."), - min: $.validator.format("Ange ett värde som är större eller lika med {0}."), - creditcard: "Ange ett korrekt kreditkortsnummer." -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sv.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sv.min.js deleted file mode 100644 index 62f31013..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_sv.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Detta fält är obligatoriskt.",maxlength:a.validator.format("Du får ange högst {0} tecken."),minlength:a.validator.format("Du måste ange minst {0} tecken."),rangelength:a.validator.format("Ange minst {0} och max {1} tecken."),email:"Ange en korrekt e-postadress.",url:"Ange en korrekt URL.",date:"Ange ett korrekt datum.",dateISO:"Ange ett korrekt datum (ÅÅÅÅ-MM-DD).",number:"Ange ett korrekt nummer.",digits:"Ange endast siffror.",equalTo:"Ange samma värde igen.",range:a.validator.format("Ange ett värde mellan {0} och {1}."),max:a.validator.format("Ange ett värde som är mindre eller lika med {0}."),min:a.validator.format("Ange ett värde som är större eller lika med {0}."),creditcard:"Ange ett korrekt kreditkortsnummer."})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_th.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_th.js deleted file mode 100644 index e354e50a..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_th.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: TH (Thai; ไทย) - */ -$.extend($.validator.messages, { - required: "โปรดระบุ", - remote: "โปรดแก้ไขให้ถูกต้อง", - email: "โปรดระบุที่อยู่อีเมล์ที่ถูกต้อง", - url: "โปรดระบุ URL ที่ถูกต้อง", - date: "โปรดระบุวันที่ ที่ถูกต้อง", - dateISO: "โปรดระบุวันที่ ที่ถูกต้อง (ระบบ ISO).", - number: "โปรดระบุทศนิยมที่ถูกต้อง", - digits: "โปรดระบุจำนวนเต็มที่ถูกต้อง", - creditcard: "โปรดระบุรหัสบัตรเครดิตที่ถูกต้อง", - equalTo: "โปรดระบุค่าเดิมอีกครั้ง", - extension: "โปรดระบุค่าที่มีส่วนขยายที่ถูกต้อง", - maxlength: $.validator.format("โปรดอย่าระบุค่าที่ยาวกว่า {0} อักขระ"), - minlength: $.validator.format("โปรดอย่าระบุค่าที่สั้นกว่า {0} อักขระ"), - rangelength: $.validator.format("โปรดอย่าระบุค่าความยาวระหว่าง {0} ถึง {1} อักขระ"), - range: $.validator.format("โปรดระบุค่าระหว่าง {0} และ {1}"), - max: $.validator.format("โปรดระบุค่าน้อยกว่าหรือเท่ากับ {0}"), - min: $.validator.format("โปรดระบุค่ามากกว่าหรือเท่ากับ {0}") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_th.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_th.min.js deleted file mode 100644 index 44780a94..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_th.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"โปรดระบุ",remote:"โปรดแก้ไขให้ถูกต้อง",email:"โปรดระบุที่อยู่อีเมล์ที่ถูกต้อง",url:"โปรดระบุ URL ที่ถูกต้อง",date:"โปรดระบุวันที่ ที่ถูกต้อง",dateISO:"โปรดระบุวันที่ ที่ถูกต้อง (ระบบ ISO).",number:"โปรดระบุทศนิยมที่ถูกต้อง",digits:"โปรดระบุจำนวนเต็มที่ถูกต้อง",creditcard:"โปรดระบุรหัสบัตรเครดิตที่ถูกต้อง",equalTo:"โปรดระบุค่าเดิมอีกครั้ง",extension:"โปรดระบุค่าที่มีส่วนขยายที่ถูกต้อง",maxlength:a.validator.format("โปรดอย่าระบุค่าที่ยาวกว่า {0} อักขระ"),minlength:a.validator.format("โปรดอย่าระบุค่าที่สั้นกว่า {0} อักขระ"),rangelength:a.validator.format("โปรดอย่าระบุค่าความยาวระหว่าง {0} ถึง {1} อักขระ"),range:a.validator.format("โปรดระบุค่าระหว่าง {0} และ {1}"),max:a.validator.format("โปรดระบุค่าน้อยกว่าหรือเท่ากับ {0}"),min:a.validator.format("โปรดระบุค่ามากกว่าหรือเท่ากับ {0}")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_tj.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_tj.js deleted file mode 100644 index 67e1e2ca..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_tj.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: TJ (Tajikistan; Забони тоҷикӣ) - */ -$.extend($.validator.messages, { - required: "Ворид кардани ин филд маҷбури аст.", - remote: "Илтимос, маълумоти саҳеҳ ворид кунед.", - email: "Илтимос, почтаи электронии саҳеҳ ворид кунед.", - url: "Илтимос, URL адреси саҳеҳ ворид кунед.", - date: "Илтимос, таърихи саҳеҳ ворид кунед.", - dateISO: "Илтимос, таърихи саҳеҳи (ISO)ӣ ворид кунед.", - number: "Илтимос, рақамҳои саҳеҳ ворид кунед.", - digits: "Илтимос, танҳо рақам ворид кунед.", - creditcard: "Илтимос, кредит карди саҳеҳ ворид кунед.", - equalTo: "Илтимос, миқдори баробар ворид кунед.", - extension: "Илтимос, қофияи файлро дуруст интихоб кунед", - maxlength: $.validator.format("Илтимос, бештар аз {0} рамз ворид накунед."), - minlength: $.validator.format("Илтимос, камтар аз {0} рамз ворид накунед."), - rangelength: $.validator.format("Илтимос, камтар аз {0} ва зиёда аз {1} рамз ворид кунед."), - range: $.validator.format("Илтимос, аз {0} то {1} рақам зиёд ворид кунед."), - max: $.validator.format("Илтимос, бештар аз {0} рақам ворид накунед."), - min: $.validator.format("Илтимос, камтар аз {0} рақам ворид накунед.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_tj.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_tj.min.js deleted file mode 100644 index 59828ba1..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_tj.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Ворид кардани ин филд маҷбури аст.",remote:"Илтимос, маълумоти саҳеҳ ворид кунед.",email:"Илтимос, почтаи электронии саҳеҳ ворид кунед.",url:"Илтимос, URL адреси саҳеҳ ворид кунед.",date:"Илтимос, таърихи саҳеҳ ворид кунед.",dateISO:"Илтимос, таърихи саҳеҳи (ISO)ӣ ворид кунед.",number:"Илтимос, рақамҳои саҳеҳ ворид кунед.",digits:"Илтимос, танҳо рақам ворид кунед.",creditcard:"Илтимос, кредит карди саҳеҳ ворид кунед.",equalTo:"Илтимос, миқдори баробар ворид кунед.",extension:"Илтимос, қофияи файлро дуруст интихоб кунед",maxlength:a.validator.format("Илтимос, бештар аз {0} рамз ворид накунед."),minlength:a.validator.format("Илтимос, камтар аз {0} рамз ворид накунед."),rangelength:a.validator.format("Илтимос, камтар аз {0} ва зиёда аз {1} рамз ворид кунед."),range:a.validator.format("Илтимос, аз {0} то {1} рақам зиёд ворид кунед."),max:a.validator.format("Илтимос, бештар аз {0} рақам ворид накунед."),min:a.validator.format("Илтимос, камтар аз {0} рақам ворид накунед.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_tr.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_tr.js deleted file mode 100644 index f7344a8c..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_tr.js +++ /dev/null @@ -1,34 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: TR (Turkish; Türkçe) - */ -$.extend($.validator.messages, { - required: "Bu alanın doldurulması zorunludur.", - remote: "Lütfen bu alanı düzeltin.", - email: "Lütfen geçerli bir e-posta adresi giriniz.", - url: "Lütfen geçerli bir web adresi (URL) giriniz.", - date: "Lütfen geçerli bir tarih giriniz.", - dateISO: "Lütfen geçerli bir tarih giriniz(ISO formatında)", - number: "Lütfen geçerli bir sayı giriniz.", - digits: "Lütfen sadece sayısal karakterler giriniz.", - creditcard: "Lütfen geçerli bir kredi kartı giriniz.", - equalTo: "Lütfen aynı değeri tekrar giriniz.", - extension: "Lütfen geçerli uzantıya sahip bir değer giriniz.", - maxlength: $.validator.format("Lütfen en fazla {0} karakter uzunluğunda bir değer giriniz."), - minlength: $.validator.format("Lütfen en az {0} karakter uzunluğunda bir değer giriniz."), - rangelength: $.validator.format("Lütfen en az {0} ve en fazla {1} uzunluğunda bir değer giriniz."), - range: $.validator.format("Lütfen {0} ile {1} arasında bir değer giriniz."), - max: $.validator.format("Lütfen {0} değerine eşit ya da daha küçük bir değer giriniz."), - min: $.validator.format("Lütfen {0} değerine eşit ya da daha büyük bir değer giriniz."), - require_from_group: "Lütfen bu alanların en az {0} tanesini doldurunuz." -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_tr.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_tr.min.js deleted file mode 100644 index a8cf8fea..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_tr.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Bu alanın doldurulması zorunludur.",remote:"Lütfen bu alanı düzeltin.",email:"Lütfen geçerli bir e-posta adresi giriniz.",url:"Lütfen geçerli bir web adresi (URL) giriniz.",date:"Lütfen geçerli bir tarih giriniz.",dateISO:"Lütfen geçerli bir tarih giriniz(ISO formatında)",number:"Lütfen geçerli bir sayı giriniz.",digits:"Lütfen sadece sayısal karakterler giriniz.",creditcard:"Lütfen geçerli bir kredi kartı giriniz.",equalTo:"Lütfen aynı değeri tekrar giriniz.",extension:"Lütfen geçerli uzantıya sahip bir değer giriniz.",maxlength:a.validator.format("Lütfen en fazla {0} karakter uzunluğunda bir değer giriniz."),minlength:a.validator.format("Lütfen en az {0} karakter uzunluğunda bir değer giriniz."),rangelength:a.validator.format("Lütfen en az {0} ve en fazla {1} uzunluğunda bir değer giriniz."),range:a.validator.format("Lütfen {0} ile {1} arasında bir değer giriniz."),max:a.validator.format("Lütfen {0} değerine eşit ya da daha küçük bir değer giriniz."),min:a.validator.format("Lütfen {0} değerine eşit ya da daha büyük bir değer giriniz."),require_from_group:"Lütfen bu alanların en az {0} tanesini doldurunuz."})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_uk.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_uk.js deleted file mode 100644 index ecb855cc..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_uk.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: UK (Ukrainian; українська мова) - */ -$.extend($.validator.messages, { - required: "Це поле необхідно заповнити.", - remote: "Будь ласка, введіть правильне значення.", - email: "Будь ласка, введіть коректну адресу електронної пошти.", - url: "Будь ласка, введіть коректний URL.", - date: "Будь ласка, введіть коректну дату.", - dateISO: "Будь ласка, введіть коректну дату у форматі ISO.", - number: "Будь ласка, введіть число.", - digits: "Вводите потрібно лише цифри.", - creditcard: "Будь ласка, введіть правильний номер кредитної карти.", - equalTo: "Будь ласка, введіть таке ж значення ще раз.", - extension: "Будь ласка, виберіть файл з правильним розширенням.", - maxlength: $.validator.format("Будь ласка, введіть не більше {0} символів."), - minlength: $.validator.format("Будь ласка, введіть не менше {0} символів."), - rangelength: $.validator.format("Будь ласка, введіть значення довжиною від {0} до {1} символів."), - range: $.validator.format("Будь ласка, введіть число від {0} до {1}."), - max: $.validator.format("Будь ласка, введіть число, менше або рівно {0}."), - min: $.validator.format("Будь ласка, введіть число, більше або рівно {0}.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_uk.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_uk.min.js deleted file mode 100644 index 39607644..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_uk.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Це поле необхідно заповнити.",remote:"Будь ласка, введіть правильне значення.",email:"Будь ласка, введіть коректну адресу електронної пошти.",url:"Будь ласка, введіть коректний URL.",date:"Будь ласка, введіть коректну дату.",dateISO:"Будь ласка, введіть коректну дату у форматі ISO.",number:"Будь ласка, введіть число.",digits:"Вводите потрібно лише цифри.",creditcard:"Будь ласка, введіть правильний номер кредитної карти.",equalTo:"Будь ласка, введіть таке ж значення ще раз.",extension:"Будь ласка, виберіть файл з правильним розширенням.",maxlength:a.validator.format("Будь ласка, введіть не більше {0} символів."),minlength:a.validator.format("Будь ласка, введіть не менше {0} символів."),rangelength:a.validator.format("Будь ласка, введіть значення довжиною від {0} до {1} символів."),range:a.validator.format("Будь ласка, введіть число від {0} до {1}."),max:a.validator.format("Будь ласка, введіть число, менше або рівно {0}."),min:a.validator.format("Будь ласка, введіть число, більше або рівно {0}.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_vi.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_vi.js deleted file mode 100644 index f37b00e8..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_vi.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: VI (Vietnamese; Tiếng Việt) - */ -$.extend($.validator.messages, { - required: "Hãy nhập.", - remote: "Hãy sửa cho đúng.", - email: "Hãy nhập email.", - url: "Hãy nhập URL.", - date: "Hãy nhập ngày.", - dateISO: "Hãy nhập ngày (ISO).", - number: "Hãy nhập số.", - digits: "Hãy nhập chữ số.", - creditcard: "Hãy nhập số thẻ tín dụng.", - equalTo: "Hãy nhập thêm lần nữa.", - extension: "Phần mở rộng không đúng.", - maxlength: $.validator.format("Hãy nhập từ {0} kí tự trở xuống."), - minlength: $.validator.format("Hãy nhập từ {0} kí tự trở lên."), - rangelength: $.validator.format("Hãy nhập từ {0} đến {1} kí tự."), - range: $.validator.format("Hãy nhập từ {0} đến {1}."), - max: $.validator.format("Hãy nhập từ {0} trở xuống."), - min: $.validator.format("Hãy nhập từ {1} trở lên.") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_vi.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_vi.min.js deleted file mode 100644 index 831b108f..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_vi.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Hãy nhập.",remote:"Hãy sửa cho đúng.",email:"Hãy nhập email.",url:"Hãy nhập URL.",date:"Hãy nhập ngày.",dateISO:"Hãy nhập ngày (ISO).",number:"Hãy nhập số.",digits:"Hãy nhập chữ số.",creditcard:"Hãy nhập số thẻ tín dụng.",equalTo:"Hãy nhập thêm lần nữa.",extension:"Phần mở rộng không đúng.",maxlength:a.validator.format("Hãy nhập từ {0} kí tự trở xuống."),minlength:a.validator.format("Hãy nhập từ {0} kí tự trở lên."),rangelength:a.validator.format("Hãy nhập từ {0} đến {1} kí tự."),range:a.validator.format("Hãy nhập từ {0} đến {1}."),max:a.validator.format("Hãy nhập từ {0} trở xuống."),min:a.validator.format("Hãy nhập từ {1} trở lên.")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_zh.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_zh.js deleted file mode 100644 index 41c1bf83..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_zh.js +++ /dev/null @@ -1,33 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: ZH (Chinese, 中文 (Zhōngwén), 汉语, 漢語) - */ -$.extend($.validator.messages, { - required: "这是必填字段", - remote: "请修正此字段", - email: "请输入有效的电子邮件地址", - url: "请输入有效的网址", - date: "请输入有效的日期", - dateISO: "请输入有效的日期 (YYYY-MM-DD)", - number: "请输入有效的数字", - digits: "只能输入数字", - creditcard: "请输入有效的信用卡号码", - equalTo: "你的输入不相同", - extension: "请输入有效的后缀", - maxlength: $.validator.format("最多可以输入 {0} 个字符"), - minlength: $.validator.format("最少要输入 {0} 个字符"), - rangelength: $.validator.format("请输入长度在 {0} 到 {1} 之间的字符串"), - range: $.validator.format("请输入范围在 {0} 到 {1} 之间的数值"), - max: $.validator.format("请输入不大于 {0} 的数值"), - min: $.validator.format("请输入不小于 {0} 的数值") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_zh.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_zh.min.js deleted file mode 100644 index 8ca93f22..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_zh.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"这是必填字段",remote:"请修正此字段",email:"请输入有效的电子邮件地址",url:"请输入有效的网址",date:"请输入有效的日期",dateISO:"请输入有效的日期 (YYYY-MM-DD)",number:"请输入有效的数字",digits:"只能输入数字",creditcard:"请输入有效的信用卡号码",equalTo:"你的输入不相同",extension:"请输入有效的后缀",maxlength:a.validator.format("最多可以输入 {0} 个字符"),minlength:a.validator.format("最少要输入 {0} 个字符"),rangelength:a.validator.format("请输入长度在 {0} 到 {1} 之间的字符串"),range:a.validator.format("请输入范围在 {0} 到 {1} 之间的数值"),max:a.validator.format("请输入不大于 {0} 的数值"),min:a.validator.format("请输入不小于 {0} 的数值")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_zh_TW.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_zh_TW.js deleted file mode 100644 index fc86be39..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_zh_TW.js +++ /dev/null @@ -1,34 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Translated default messages for the jQuery validation plugin. - * Locale: ZH (Chinese; 中文 (Zhōngwén), 汉语, 漢語) - * Region: TW (Taiwan) - */ -$.extend($.validator.messages, { - required: "必須填寫", - remote: "請修正此欄位", - email: "請輸入有效的電子郵件", - url: "請輸入有效的網址", - date: "請輸入有效的日期", - dateISO: "請輸入有效的日期 (YYYY-MM-DD)", - number: "請輸入正確的數值", - digits: "只可輸入數字", - creditcard: "請輸入有效的信用卡號碼", - equalTo: "請重複輸入一次", - extension: "請輸入有效的後綴", - maxlength: $.validator.format("最多 {0} 個字"), - minlength: $.validator.format("最少 {0} 個字"), - rangelength: $.validator.format("請輸入長度為 {0} 至 {1} 之間的字串"), - range: $.validator.format("請輸入 {0} 至 {1} 之間的數值"), - max: $.validator.format("請輸入不大於 {0} 的數值"), - min: $.validator.format("請輸入不小於 {0} 的數值") -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_zh_TW.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_zh_TW.min.js deleted file mode 100644 index da54115c..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/messages_zh_TW.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"必須填寫",remote:"請修正此欄位",email:"請輸入有效的電子郵件",url:"請輸入有效的網址",date:"請輸入有效的日期",dateISO:"請輸入有效的日期 (YYYY-MM-DD)",number:"請輸入正確的數值",digits:"只可輸入數字",creditcard:"請輸入有效的信用卡號碼",equalTo:"請重複輸入一次",extension:"請輸入有效的後綴",maxlength:a.validator.format("最多 {0} 個字"),minlength:a.validator.format("最少 {0} 個字"),rangelength:a.validator.format("請輸入長度為 {0} 至 {1} 之間的字串"),range:a.validator.format("請輸入 {0} 至 {1} 之間的數值"),max:a.validator.format("請輸入不大於 {0} 的數值"),min:a.validator.format("請輸入不小於 {0} 的數值")})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_de.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_de.js deleted file mode 100644 index 470133ed..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_de.js +++ /dev/null @@ -1,22 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Localized default methods for the jQuery validation plugin. - * Locale: DE - */ -$.extend($.validator.methods, { - date: function(value, element) { - return this.optional(element) || /^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(value); - }, - number: function(value, element) { - return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(value); - } -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_de.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_de.min.js deleted file mode 100644 index 114e83fa..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_de.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.methods,{date:function(a,b){return this.optional(b)||/^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(a)}})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_es_CL.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_es_CL.js deleted file mode 100644 index 16446e44..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_es_CL.js +++ /dev/null @@ -1,22 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Localized default methods for the jQuery validation plugin. - * Locale: ES_CL - */ -$.extend($.validator.methods, { - date: function(value, element) { - return this.optional(element) || /^\d\d?\-\d\d?\-\d\d\d?\d?$/.test(value); - }, - number: function(value, element) { - return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(value); - } -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_es_CL.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_es_CL.min.js deleted file mode 100644 index cc54741c..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_es_CL.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.methods,{date:function(a,b){return this.optional(b)||/^\d\d?\-\d\d?\-\d\d\d?\d?$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(a)}})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_fi.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_fi.js deleted file mode 100644 index 44b3e365..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_fi.js +++ /dev/null @@ -1,22 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Localized default methods for the jQuery validation plugin. - * Locale: FI - */ -$.extend($.validator.methods, { - date: function(value, element) { - return this.optional(element) || /^\d{1,2}\.\d{1,2}\.\d{4}$/.test(value); - }, - number: function(value, element) { - return this.optional(element) || /^-?(?:\d+)(?:,\d+)?$/.test(value); - } -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_fi.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_fi.min.js deleted file mode 100644 index f135efff..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_fi.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.methods,{date:function(a,b){return this.optional(b)||/^\d{1,2}\.\d{1,2}\.\d{4}$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+)(?:,\d+)?$/.test(a)}})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_nl.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_nl.js deleted file mode 100644 index 91e0d8c5..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_nl.js +++ /dev/null @@ -1,19 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Localized default methods for the jQuery validation plugin. - * Locale: NL - */ -$.extend($.validator.methods, { - date: function(value, element) { - return this.optional(element) || /^\d\d?[\.\/\-]\d\d?[\.\/\-]\d\d\d?\d?$/.test(value); - } -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_nl.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_nl.min.js deleted file mode 100644 index 020682e6..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_nl.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.methods,{date:function(a,b){return this.optional(b)||/^\d\d?[\.\/\-]\d\d?[\.\/\-]\d\d\d?\d?$/.test(a)}})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_pt.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_pt.js deleted file mode 100644 index d06ccec8..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_pt.js +++ /dev/null @@ -1,19 +0,0 @@ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "../jquery.validate"], factory ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -/* - * Localized default methods for the jQuery validation plugin. - * Locale: PT_BR - */ -$.extend($.validator.methods, { - date: function(value, element) { - return this.optional(element) || /^\d\d?\/\d\d?\/\d\d\d?\d?$/.test(value); - } -}); - -}));
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_pt.min.js b/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_pt.min.js deleted file mode 100644 index a5af4462..00000000 --- a/wqflask/wqflask/static/new/packages/ValidationPlugin/dist/localization/methods_pt.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 - * http://jqueryvalidation.org/ - * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.methods,{date:function(a,b){return this.optional(b)||/^\d\d?\/\d\d?\/\d\d\d?\d?$/.test(a)}})});
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/nvd3/nv.d3.css b/wqflask/wqflask/static/new/packages/nvd3/nv.d3.css index 726f76c3..694b9218 100644 --- a/wqflask/wqflask/static/new/packages/nvd3/nv.d3.css +++ b/wqflask/wqflask/static/new/packages/nvd3/nv.d3.css @@ -16,7 +16,7 @@ }
.nvd3 .nv-axis.nv-x path.domain {
- stroke-opacity: 0;
+ stroke-opacity: 1;
}
.nvd3 .nv-axis line {
diff --git a/wqflask/wqflask/static/new/packages/nvd3/nv.d3.js b/wqflask/wqflask/static/new/packages/nvd3/nv.d3.js index b11ce58f..4d8b9d65 100644 --- a/wqflask/wqflask/static/new/packages/nvd3/nv.d3.js +++ b/wqflask/wqflask/static/new/packages/nvd3/nv.d3.js @@ -1556,7 +1556,7 @@ nv.models.axis = function() { , width = 75 //only used for tickLabel currently , height = 60 //only used for tickLabel currently , axisLabelText = null - , showMaxMin = true //TODO: showMaxMin should be disabled on all ordinal scaled axes + , showMaxMin = false //TODO: showMaxMin should be disabled on all ordinal scaled axes , rotateLabels = 0 , rotateYLabel = true , staggerLabels = false @@ -7894,7 +7894,8 @@ nv.models.multiBar = function() { bars.select('polyline') .attr('fill', 'none') - .attr('stroke', function(d, i, j) { return errorBarColor(d, j, i); }) + .attr('stroke', 'black') + //.attr('stroke', function(d, i, j) { return errorBarColor(d, j, i); }) .attr('points', function(d,i) { var yerr = getYerr(d,i) , mid = 0.8 * x.rangeBand() / ((stacked ? 1 : data.length) * 2); diff --git a/wqflask/wqflask/static/output/Itvl_3kiKQR1g.jpeg b/wqflask/wqflask/static/output/Itvl_3kiKQR1g.jpeg Binary files differnew file mode 100644 index 00000000..bdd94651 --- /dev/null +++ b/wqflask/wqflask/static/output/Itvl_3kiKQR1g.jpeg diff --git a/wqflask/wqflask/static/output/Itvl_hNsk2rxO.jpeg b/wqflask/wqflask/static/output/Itvl_hNsk2rxO.jpeg Binary files differnew file mode 100644 index 00000000..bdd94651 --- /dev/null +++ b/wqflask/wqflask/static/output/Itvl_hNsk2rxO.jpeg diff --git a/wqflask/wqflask/static/packages/bootstrap/css/docs.css b/wqflask/wqflask/static/packages/bootstrap/css/docs.css index 2d6a713c..31616821 100755 --- a/wqflask/wqflask/static/packages/bootstrap/css/docs.css +++ b/wqflask/wqflask/static/packages/bootstrap/css/docs.css @@ -94,7 +94,7 @@ hr.soften { .jumbotron { position: relative; padding: 0px 0; - color: #336699; + color: black; text-align: left; text-shadow: 0 1px 3px rgba(0,0,0,.4), 0 0 30px rgba(0,0,0,.075); background: #d5d5d5; /* Old browsers */ @@ -107,7 +107,7 @@ hr.soften { line-height: 1; } .jumbotron p { - font-size: 15px; + font-size: 20px; font-weight: 300; line-height: 20px; margin-bottom: 10px; diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html index f25bf9f7..759c4a8d 100755 --- a/wqflask/wqflask/templates/base.html +++ b/wqflask/wqflask/templates/base.html @@ -19,7 +19,7 @@ </head> -<body style="width: 1500px !important;"> +<body style="width: 100% !important;"> <!-- Navbar ================================================== --> <div class="navbar navbar-inverse navbar-static-top pull-left" role="navigation"> @@ -151,7 +151,7 @@ <!--</p>--> <ul class="footer-links"> - <li><a href="http://atlas.uthsc.edu/mailman/listinfo/genenetwork" target="_blank">Join the mailing list</a></li> + <li><a href="http://listserv.uthsc.edu/mailman/listinfo/genenetwork-dev">Join the mailing list</a></li> <!--<li><a href="#">Friend us on facebook</a></li>--> <!--<li><a href="#">Follow us on twitter</a></li>--> </ul> diff --git a/wqflask/wqflask/templates/collections/list.html b/wqflask/wqflask/templates/collections/list.html index 52106eae..0e7612aa 100755 --- a/wqflask/wqflask/templates/collections/list.html +++ b/wqflask/wqflask/templates/collections/list.html @@ -4,6 +4,7 @@ <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/css/jquery.dataTables.css" /> <link rel="stylesheet" type="text/css" href="/static/packages/DT_bootstrap/DT_bootstrap.css" /> <link rel="stylesheet" type="text/css" href="/static/packages/TableTools/media/css/TableTools.css" /> + <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/extensions/buttons.bootstrap.css" /> {% endblock %} {% block content %} <!-- Start of body --> @@ -55,6 +56,10 @@ {% block js %} <script type="text/javascript" src="/static/packages/smart-time-ago/lib/timeago.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/jquery.dataTables.min.js"></script> + <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/dataTables.buttons.min.js"></script> + <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.html5.min.js"></script> + <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.bootstrap.min.js"></script> + <script language="javascript" type="text/javascript" src="/static/new/js_external/jszip.min.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/dataTables.naturalSort.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.colResize.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.colReorder.js"></script> @@ -62,7 +67,15 @@ <script language="javascript" type="text/javascript" src="/static/packages/TableTools/media/js/TableTools.min.js"></script> <script> $('#trait_table').dataTable( { - "sDom": "RZtir", + "buttons": [ + { + extend: 'csvHtml5', + text: 'Download CSV', + title: 'collection_list', + fieldBoundary: '"' + } + ], + "sDom": "RZBtir", "iDisplayLength": -1, "autoWidth": true, "bDeferRender": true, diff --git a/wqflask/wqflask/templates/collections/view.html b/wqflask/wqflask/templates/collections/view.html index 5450f903..288207e7 100755 --- a/wqflask/wqflask/templates/collections/view.html +++ b/wqflask/wqflask/templates/collections/view.html @@ -4,16 +4,21 @@ <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/css/jquery.dataTables.css" /> <link rel="stylesheet" type="text/css" href="/static/packages/DT_bootstrap/DT_bootstrap.css" /> <link rel="stylesheet" type="text/css" href="/static/packages/TableTools/media/css/TableTools.css" /> + <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/extensions/buttons.bootstrap.css" /> {% endblock %} {% block content %} <!-- Start of body --> + + <div class="container"> {% if uc %} - {{ header(uc.name, - 'This collection has {}.'.format(numify(trait_obs|count, "record", "records"))) }} + <h2>{{ uc.name }}</h2> + <h3>{{ 'This collection has {}.'.format(numify(trait_obs|count, "record", "records")) }}</h3> {% else %} - {{ header('Your Collection', - 'This collection has {}.'.format(numify(trait_obs|count, "record", "records"))) }} + <h2>Your Collection</h2> + <h3>{{ 'This collection has {}.'.format(numify(trait_obs|count, "record", "records")) }}</h3> {% endif %} + </div> + <div class="container"> <div> {% if uc %} @@ -50,6 +55,18 @@ <input type="submit" class="btn btn-primary" value="WGCNA Analysis" /> </div> </form> + <form action="/ctl_setup" method="post"> + {% if uc %} + <input type="hidden" name="uc_id" id="uc_id" value="{{ uc.id }}" /> + {% endif %} + <input type="hidden" name="trait_list" id="trait_list" value= " + {% for this_trait in trait_obs %} + {{ this_trait.name }}:{{ this_trait.dataset.name }}, + {% endfor %}" > + <div class="col-xs-2 controls"> + <input type="submit" class="btn btn-primary" value="CTL Analysis" /> + </div> + </form> <form action="/heatmap" method="post"> {% if uc %} <input type="hidden" name="uc_id" id="uc_id" value="{{ uc.id }}" /> @@ -73,30 +90,32 @@ <button class="btn btn-default" id="invert"><span class="glyphicon glyphicon-resize-vertical"></span> Invert</button> <button class="btn" id="add" disabled="disabled"><i class="icon-plus-sign"></i> Add Record to Other Collection</button> <button class="btn" id="remove" disabled="disabled"><i class="icon-minus-sign"></i> Remove Record</button> - <button class="btn btn-primary pull-right"><i class="icon-download icon-white"></i> Download Table</button> <br /> <br /> + <div style="background-color: #eeeeee; border: 1px solid black;"> <table class="table table-hover table-striped" id='trait_table'> <thead> <tr> - <th>Index</th> - <th>Record</th> - <th>Description</th> - <th>Location</th> - <th>Mean</th> - <th>Max LRS<a href="http://genenetwork.org//glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th> - <th>Max LRS Location</th> - <th>Additive Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th> + <th style="background-color: #eeeeee;"></th> + <th style="background-color: #eeeeee;">Index</th> + <th style="background-color: #eeeeee;">Record</th> + <th style="background-color: #eeeeee;">Description</th> + <th style="background-color: #eeeeee;">Location</th> + <th style="background-color: #eeeeee;">Mean</th> + <th style="background-color: #eeeeee;">Max LRS<a href="http://genenetwork.org//glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th> + <th style="background-color: #eeeeee;">Max LRS Location</th> + <th style="background-color: #eeeeee;">Additive Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th> </tr> </thead> <tbody> {% for this_trait in trait_obs %} <TR id="trait:{{ this_trait.name }}:{{ this_trait.dataset.name }}"> - <TD>{{ loop.index }} + <TD> <INPUT TYPE="checkbox" NAME="searchResult" class="checkbox trait_checkbox" VALUE="{{ data_hmac('{}:{}'.format(this_trait.name, this_trait.dataset.name)) }}"> </TD> + <TD>{{ loop.index }}</TD> <TD> <a href="{{ url_for('show_trait_page', trait_id = this_trait.name, @@ -118,6 +137,7 @@ </tbody> </table> + </div> <br /> </div> </div> @@ -129,6 +149,10 @@ {% block js %} <script type="text/javascript" src="/static/new/javascript/search_results.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/jquery.dataTables.min.js"></script> + <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/dataTables.buttons.min.js"></script> + <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.html5.min.js"></script> + <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.bootstrap.min.js"></script> + <script language="javascript" type="text/javascript" src="/static/new/js_external/jszip.min.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/dataTables.naturalSort.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.colResize.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.colReorder.js"></script> @@ -150,6 +174,7 @@ "columns": [ { "type": "natural" }, { "type": "natural" }, + { "type": "natural" }, { "type": "natural", "width": "35%" }, { "type": "natural", @@ -161,7 +186,18 @@ "width": "15%" }, { "type": "natural" } ], - "sDom": "ZRtir", + "buttons": [ + { + extend: 'csvHtml5', + text: 'Download CSV', + title: 'collection', + fieldBoundary: '"', + exportOptions: { + columns: [1, 2, 3, 4, 5, 6, 7, 8] + } + } + ], + "sDom": "ZRBtir", "iDisplayLength": -1, "autoWidth": true, "bDeferRender": true, diff --git a/wqflask/wqflask/templates/correlation_page.html b/wqflask/wqflask/templates/correlation_page.html index efc94c42..c5b4477b 100755 --- a/wqflask/wqflask/templates/correlation_page.html +++ b/wqflask/wqflask/templates/correlation_page.html @@ -3,8 +3,6 @@ <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/css/jquery.dataTables.css" /> <link rel="stylesheet" type="text/css" href="/static/packages/DT_bootstrap/DT_bootstrap.css" /> <link rel="stylesheet" type="text/css" href="/static/packages/TableTools/media/css/TableTools.css" /> - <link href="//cdn.datatables.net/fixedheader/2.1.2/css/dataTables.fixedHeader.css" rel="stylesheet"> - <link href="//cdn.datatables.net/fixedcolumns/3.0.4/css/dataTables.fixedColumns.css" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/extensions/buttons.bootstrap.css" /> {% endblock %} {% block content %} @@ -34,55 +32,65 @@ <br /> <br /> - <div> - <table id="trait_table" class="table table-hover table-striped"> + <div style="width: {% if target_dataset.type == "ProbeSet" %}1600px{% elif target_dataset.type == "Publish" %}1200px{% else %}800px{% endif %}; background-color: #eeeeee; border: 1px solid black;"> + <table width="1600px" id="trait_table" class="table table-hover table-striped"> <thead> <tr> - <th style="width: 30px;"></th> + <th style="width: 30px; background-color: #eeeeee;"></th> {% for header in target_dataset.header_fields %} - {% if header == 'Max LRS' %} - <th style="text-align: right;">Max <br>LRS<a href="http://genenetwork.org//glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th> + {% if header == 'Year' %} + <th style="text-align: right; background-color: #eeeeee;">{{header}}</th> + {% elif header == 'Max LRS' %} + <th style="text-align: right; background-color: #eeeeee;">Max <br>LRS<a href="http://genenetwork.org//glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th> + {% elif header == 'Max LRS Location' %} + <th style="text-align: right; background-color: #eeeeee;">{{header}}</th> + {% elif header == 'Location' %} + <th style="text-align: right; background-color: #eeeeee;">{{header}}</th> + {% elif header == 'Mean' %} + <th style="text-align: right; background-color: #eeeeee;">{{header}}</th> {% elif header == 'Additive Effect' %} - <th style="text-align: right;">Additive<br>Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th> + <th style="text-align: right; background-color: #eeeeee;">Add <br>Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th> + {% elif header == 'Index' %} + <th style="text-align: right; background-color: #eeeeee; padding-left: 0px; margin-left: 0px;">{{header}}</th> + {% elif header == 'N' %} + <th style="text-align: right; background-color: #eeeeee;">{{header}}</th> {% else %} - <th>{{header}}</th> + <th style="background-color: #eeeeee;">{{header}}</th> {% endif %} {% endfor %} - {% if target_dataset.type == "ProbeSet" %} + {% if target_dataset.type == "ProbeSet" %} {% if corr_method == 'pearson' %} - <th>Sample r</th> - <th>N Cases</th> - <th>Sample p(r)</th> - <th>Lit Corr</th> - <th>Tissue r</th> - <th>Tissue p(r)</th> + <th style="text-align: right; background-color: #eeeeee;">Sample r</th> + <th style="text-align: right; background-color: #eeeeee;"> N</th> + <th style="text-align: right; background-color: #eeeeee;">Sample p(r)</th> + <th style="text-align: right; background-color: #eeeeee;">Lit r</th> + <th style="text-align: right; background-color: #eeeeee;">Tissue r</th> {% else %} - <th>Sample rho</th> - <th>N Cases</th> - <th>Sample p(rho)</th> - <th>Lit Corr</th> - <th>Tissue rho</th> - <th>Tissue p(rho)</th> + <th style="text-align: right; background-color: #eeeeee;">Sample rho</th> + <th style="text-align: right; background-color: #eeeeee;">N</th> + <th style="text-align: right; background-color: #eeeeee;">Sample p(rho)</th> + <th style="text-align: right; background-color: #eeeeee;">Lit r</th> + <th style="text-align: right; background-color: #eeeeee;">Tissue rho</th> {% endif %} {% elif target_dataset.type == "Publish" %} {% if corr_method == 'pearson' %} - <th>Sample r</th> - <th>N Cases</th> - <th>Sample p(r)</th> + <th style="text-align: right; background-color: #eeeeee;">Sample r</th> + <th style="text-align: right; background-color: #eeeeee;"> N</th> + <th style="text-align: right; background-color: #eeeeee;">Sample p(r)</th> {% else %} - <th>Sample rho</th> - <th>N Cases</th> - <th>Sample p(rho)</th> + <th style="text-align: right; background-color: #eeeeee;">Sample rho</th> + <th style="text-align: right; background-color: #eeeeee;"> N</th> + <th style="text-align: right; background-color: #eeeeee;">Sample p(rho)</th> {% endif %} {% elif target_dataset.type == "Geno" %} {% if corr_method == 'pearson' %} - <th>Sample r</th> - <th>N Cases</th> - <th>Sample p(r)</th> + <th style="text-align: right; background-color: #eeeeee;">Sample r</th> + <th style="text-align: right; background-color: #eeeeee;">N</th> + <th style="text-align: right; background-color: #eeeeee;">Sample p(r)</th> {% else %} - <th>Sample rho</th> - <th>N Cases</th> - <th>Sample p(rho)</th> + <th style="text-align: right; background-color: #eeeeee;">Sample rho</th> + <th style="text-align: right; background-color: #eeeeee;">N</th> + <th style="text-align: right; background-color: #eeeeee;">Sample p(rho)</th> {% endif %} {% endif %} </tr> @@ -91,58 +99,56 @@ <tbody> {% for trait in correlation_results %} <tr> - <TD><INPUT TYPE="checkbox" NAME="searchResult" class="checkbox trait_checkbox" style="transform: scale(1.5);" VALUE="{{ data_hmac('{}:{}'.format(trait.name, trait.dataset.name)) }}"> - </TD> - <TD align="right">{{ loop.index }}</TD> - <TD> + <td> <INPUT TYPE="checkbox" NAME="searchResult" class="checkbox trait_checkbox" style="transform: scale(1.5);" VALUE="{{ data_hmac('{}:{}'.format(trait.name, trait.dataset.name)) }}"></td> + <td align="right">{{ loop.index }}</td> + <td> <a href="{{ url_for('show_trait_page', trait_id = trait.name, dataset = dataset.name )}}"> {{ trait.name }} </a> - </TD> + </td> {% if target_dataset.type == 'ProbeSet' %} - <TD>{{ trait.symbol }}</TD> - <TD>{{ trait.description_display }}</TD> - <TD style="white-space: nowrap;">{{ trait.location_repr }}</TD> - <TD align="right">{{ '%0.3f' % trait.mean|float }}</TD> - <TD align="right">{{ '%0.3f' % trait.LRS_score_repr|float }}</TD> - <TD style="white-space: nowrap;">{{ trait.LRS_location_repr }}</TD> - <TD align="right">{{ '%0.3f' % trait.additive|float }}</TD> - <TD><a target="_blank" href="corr_scatter_plot?dataset_1={{dataset.name}}&dataset_2={{trait.dataset.name}}&trait_1={{this_trait.name}}&trait_2={{trait.name}}">{{'%0.3f'|format(trait.sample_r)}}</a></TD> - <TD>{{ trait.num_overlap }}</TD> - <TD>{{'%0.3e'|format(trait.sample_p)}}</TD> + <td>{{ trait.symbol }}</td> + <td>{{ trait.description_display }}</TD> + <td align="right"style="white-space: nowrap;">{{ trait.location_repr }}</td> + <td align="right">{{ '%0.3f' % trait.mean|float }}</td> + <td align="right" style="padding-right: 15px;">{% if trait.LRS_score_repr != "N/A" %}{{ '%0.1f' % trait.LRS_score_repr|float }}{% else %}N/A{% endif %}</td> + <td align="right" style="padding-right: 15px;">{{ trait.LRS_location_repr }}</td> + <td align="right" style="padding-right: 15px;">{% if trait.additive != "" %}{{ '%0.3f' % trait.additive|float }}{% else %}N/A{% endif %}</td> + <td align="right" style="padding-right: 15px;"><a target="_blank" href="corr_scatter_plot?dataset_1={{dataset.name}}&dataset_2={{trait.dataset.name}}&trait_1={{this_trait.name}}&trait_2={{trait.name}}">{{'%0.3f'|format(trait.sample_r)}}</a></td> + <td align="right" style="padding-right: 15px;">{{ trait.num_overlap }}</td> + <td align="right" style="padding-right: 15px;">{{'%0.3e'|format(trait.sample_p)}}</td> {% if trait.lit_corr == "" or trait.lit_corr == 0.000 %} - <TD>--</TD> + <td align="right" style="padding-right: 15px;">--</td> {% else %} - <TD>{{'%0.3f'|format(trait.lit_corr)}}</TD> + <td align="right" style="padding-right: 15px;">{{'%0.3f'|format(trait.lit_corr)}}</td> {% endif %} {% if trait.tissue_corr == "" or trait.tissue_corr == 0.000 %} - <TD>--</TD> + <td align="right" style="padding-right: 15px;">--</td> {% else %} - <TD>{{'%0.3f'|format(trait.tissue_corr)}}</TD> + <td align="right" style="padding-right: 15px;">{{'%0.3f'|format(trait.tissue_corr)}}</td> {% endif %} - <TD>{{'%0.3e'|format(trait.tissue_pvalue)}}</TD> {% elif target_dataset.type == "Publish" %} - <TD>{{ trait.description_display }}</TD> - <TD>{{ trait.authors }}</TD> - <TD> + <td>{{ trait.description_display }}</td> + <td>{{ trait.authors }}</td> + <td> <a href="{{ trait.pubmed_link }}"> {{ trait.pubmed_text }} </a> - </TD> - <TD>{{ trait.LRS_score_repr }}</TD> - <TD>{{ trait.LRS_location_repr }}</TD> - <TD>{{ '%0.3f' % trait.additive|float }}</TD> - <TD><a target="_blank" href="corr_scatter_plot?dataset_1={{dataset.name}}&dataset_2={{trait.dataset.name}}&trait_1={{this_trait.name}}&trait_2={{trait.name}}">{{'%0.3f'|format(trait.sample_r)}}</a></TD> - <TD>{{ trait.num_overlap }}</TD> - <TD>{{'%0.3e'|format(trait.sample_p)}}</TD> + </td> + <td align="right" style="padding-right: 15px;">{{ trait.LRS_score_repr }}</td> + <td align="right" style="padding-right: 15px;">{{ trait.LRS_location_repr }}</td> + <td align="right" style="padding-right: 15px;">{% if trait.additive != "" %}{{ '%0.3f' % trait.additive|float }}{% else %}N/A{% endif %}</td> + <td align="right" style="padding-right: 15px;"><a target="_blank" href="corr_scatter_plot?dataset_1={{dataset.name}}&dataset_2={{trait.dataset.name}}&trait_1={{this_trait.name}}&trait_2={{trait.name}}">{{'%0.3f'|format(trait.sample_r)}}</a></td> + <td align="right" style="padding-right: 15px;">{{ trait.num_overlap }}</td> + <td align="right" style="padding-right: 15px;">{{'%0.3e'|format(trait.sample_p)}}</td> {% elif target_dataset.type == "Geno" %} - <TD>{{ trait.location_repr }}</TD> - <TD><a target="_blank" href="corr_scatter_plot?dataset_1={{dataset.name}}&dataset_2={{trait.dataset.name}}&trait_1={{this_trait.name}}&trait_2={{trait.name}}">{{'%0.3f'|format(trait.sample_r)}}</a></TD> - <TD>{{ trait.num_overlap }}</TD> - <TD>{{'%0.3e'|format(trait.sample_p)}}</TD> + <td align="right" style="padding-right: 15px;">{{ trait.location_repr }}</TD> + <td align="right" style="padding-right: 15px;"><a target="_blank" href="corr_scatter_plot?dataset_1={{dataset.name}}&dataset_2={{trait.dataset.name}}&trait_1={{this_trait.name}}&trait_2={{trait.name}}">{{'%0.3f'|format(trait.sample_r)}}</a></td> + <td align="right" style="padding-right: 15px;">{{ trait.num_overlap }}</td> + <td align="right" style="padding-right: 15px;">{{'%0.3e'|format(trait.sample_p)}}</td> {% endif %} </tr> {% endfor %} @@ -161,12 +167,8 @@ <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.bootstrap.min.js"></script> <script language="javascript" type="text/javascript" src="/static/new/js_external/jszip.min.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/dataTables.naturalSort.js"></script> - <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.colResize.js"></script> - <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.colReorder.js"></script> <script language="javascript" type="text/javascript" src="/static/packages/DT_bootstrap/DT_bootstrap.js"></script> <script language="javascript" type="text/javascript" src="/static/packages/TableTools/media/js/TableTools.min.js"></script> - <script language="javascript" type="text/javascript" src="//cdn.datatables.net/fixedheader/2.1.2/js/dataTables.fixedHeader.min.js"></script> - <script language="javascript" type="text/javascript" src="//cdn.datatables.net/fixedcolumns/3.0.4/js/dataTables.fixedColumns.min.js"></script> <script language="javascript" type="text/javascript" src="/static/packages/underscore/underscore-min.js"></script> <script type="text/javascript" charset="utf-8"> function getValue(x) { @@ -229,15 +231,28 @@ console.time("Creating table"); {% if target_dataset.type == "ProbeSet" %} - - $('#trait_table').dataTable( { + "paging": false, + "buttons": [ + { + extend: 'csvHtml5', + text: 'Download CSV', + title: 'correlation_results', + fieldBoundary: '"', + exportOptions: { + columns: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + } + } + ], + "columnDefs": [ + { "targets": 0, "orderable": false } + ], "columns": [ { "type": "natural" }, { "type": "natural" }, { "type": "natural" }, { "type": "natural" }, - { "type": "natural" }, + { "type": "natural", "width": "20%" }, { "type": "natural" }, { "type": "natural" }, { "type": "natural" }, @@ -247,19 +262,14 @@ { "type": "natural" }, { "type": "natural" }, { "type": "natural" }, - { "type": "natural" }, { "type": "natural" } ], - "buttons": [ - 'csvHtml5' - ], - "sDom": "RZBtir", - "iDisplayLength": -1, + "order": [[10, "desc" ]], + "sDom": "Btir", + "autoWidth": false, "bDeferRender": true, - "bSortClasses": false, - //"scrollY": "700px", - //"scrollCollapse": false, - "paging": false + "scrollY": "800px", + "scrollCollapse": false } ); var table = $('#trait_table').DataTable(); @@ -267,12 +277,27 @@ {% elif target_dataset.type == "Publish" %} $('#trait_table').dataTable( { + "paging": false, + "buttons": [ + { + extend: 'csvHtml5', + text: 'Download CSV', + title: 'correlation_results', + fieldBoundary: '"', + exportOptions: { + columns: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] + } + } + ], + "columnDefs": [ + { "targets": 0, "orderable": false } + ], "columns": [ { "type": "natural" }, { "type": "natural" }, { "type": "natural" }, - { "type": "natural" }, - { "type": "natural" }, + { "type": "natural", "width": "25%" }, + { "type": "natural", "width": "10%" }, { "type": "natural" }, { "type": "natural" }, { "type": "natural" }, @@ -281,24 +306,30 @@ { "type": "natural" }, { "type": "natural" } ], - "buttons": [ - 'csvHtml5' - ], - "sDom": "RZBtir", - "iDisplayLength": -1, - "autoWidth": true, - "bLengthChange": true, + "order": [[9, "desc" ]], + "sDom": "Btir", + "autoWidth": false, "bDeferRender": true, - "bSortClasses": false, - "scrollY": "700px", - "scrollCollapse": false, - "colResize": { - "tableWidthFixed": false - }, - "paging": false + "scrollY": "800px", + "scrollCollapse": false } ); {% elif target_dataset.type == "Geno" %} $('#trait_table').dataTable( { + "paging": false, + "buttons": [ + { + extend: 'csvHtml5', + text: 'Download CSV', + title: 'correlation_results', + fieldBoundary: '"', + exportOptions: { + columns: [1, 2, 3, 4, 5, 6] + } + } + ], + "columnDefs": [ + { "targets": 0, "orderable": false } + ], "columns": [ { "type": "natural" }, { "type": "natural" }, @@ -308,21 +339,12 @@ { "type": "natural" }, { "type": "natural" } ], - "buttons": [ - 'csvHtml5' - ], - "sDom": "RZBtir", - "iDisplayLength": -1, - "autoWidth": true, - "bLengthChange": true, + "order": [[4, "desc" ]], + "sDom": "Btir", + "autoWidth": false, "bDeferRender": true, - "bSortClasses": false, - "scrollY": "700px", - "scrollCollapse": false, - "colResize": { - "tableWidthFixed": false - }, - "paging": false + "scrollY": "800px", + "scrollCollapse": false } ); {% endif %} console.timeEnd("Creating table"); diff --git a/wqflask/wqflask/templates/ctl_results.html b/wqflask/wqflask/templates/ctl_results.html new file mode 100644 index 00000000..a5cb1c08 --- /dev/null +++ b/wqflask/wqflask/templates/ctl_results.html @@ -0,0 +1,47 @@ +{% extends "base.html" %} +{% block title %}CTL results{% endblock %} + +{% block content %} <!-- Start of body --> +<div class="container"> + <h1>CTL Results</h1> + {{(request.form['trait_list'].split(',')|length -1)}} phenotypes as input<br> + <h3>Network Figure</h3> + <a href="/tmp/{{ results['imgurl1'] }}"> + <img alt="Embedded Image" src="data:image/png;base64, + {% for elem in results['imgdata1'] -%} + {% print("%c"|format(elem)) %} + {%- endfor %} + " /></a> + <h3>CTL/QTL Plots for individual traits</h3> + {% for r in range(2, (request.form['trait_list'].split(',')|length +1)) %} + <a href="/tmp/{{ results['imgurl' + r|string] }}"> + <img width=100 height=100 alt="Embedded Image" src="data:image/png;base64, + {% for elem in results['imgdata' + r|string] -%} + {% print("%c"|format(elem)) %} + {%- endfor %} + " /></a> + {% endfor %} + <h3>Tabular results</h3> + <table width="80%"> + <tr><th>trait</th><th>marker</th><th>trait</th><th>LOD</th><th>dCor</th></tr> + significant CTL:<br> + {% for r in range(results['ctlresult'][0]|length) %} + <tr> + {% for c in range(results['ctlresult']|length) %} + <td> + {% if c > 2 %} + {{results['ctlresult'][c][r]|float|round(2)}} + {% else %} + {{results['ctlresult'][c][r]}} + {% endif %} + </td> + {% endfor %} + </tr> + {% endfor %} + </table> + + + + +</div> +{% endblock %} diff --git a/wqflask/wqflask/templates/ctl_setup.html b/wqflask/wqflask/templates/ctl_setup.html new file mode 100644 index 00000000..9c0d7bea --- /dev/null +++ b/wqflask/wqflask/templates/ctl_setup.html @@ -0,0 +1,65 @@ +{% extends "base.html" %} +{% block title %}WCGNA analysis{% endblock %} + +{% block content %} <!-- Start of body --> +<div class="container"> + <h1>CTL analysis parameters</h1> + {{(request.form['trait_list'].split(',')|length -1)}} phenotypes as input + +<form action="/ctl_results" method="post" class="form-horizontal"> + <input type="hidden" name="trait_list" id="trait_list" value= "{{request.form['trait_list']}}"> + + <div class="dropdown"> + <label for="Strategy">Strategy</label> + <div class="col-sm-10"> + <select name="strategy" id="strategy"> + <option value="Exact">Exact</option> + <option value="Full">Full</option> + <option value="Pairwise">Pairwise</option> + </select> + </div> + </div> + + <div class="dropdown"> + <label for="Permutations">Number of permutation (Used when strategy is Full or Pairwise)</label> + <div class="col-sm-10"> + <select name="nperm" id="nperm"> + <option value="100">100</option> + <option value="1000" selected="selected">1000</option> + <option value="10000">10000</option> + </select> + </div> + </div> + + <div class="dropdown"> + <label for="Coefficient">Type of correlation coefficient</label> + <div class="col-sm-10"> + <select name="parametric" id="parametric"> + <option value="False">Spearman</option> + <option value="True">Pearson</option> + </select> + </div> + </div> + + + <div class="dropdown"> + <label for="Significance">Significance level</label> + <div class="col-sm-10"> + <select name="significance" id="significance"> + <option value="0.1">0.1</option> + <option value="0.05" selected="selected">0.05</option> + <option value="0.001">0.001</option> + </select> + </div> + </div> + <br> + <div class="form-group"> + <div class="col-sm-10"> + <input type="submit" class="btn btn-primary" value="Run CTL using these settings" /> + </div> + </div> + +</form> + +</div> +{% endblock %} diff --git a/wqflask/wqflask/templates/gsearch_gene.html b/wqflask/wqflask/templates/gsearch_gene.html index 0a1839a1..70cafcfe 100755 --- a/wqflask/wqflask/templates/gsearch_gene.html +++ b/wqflask/wqflask/templates/gsearch_gene.html @@ -2,16 +2,14 @@ {% block title %}Search Results{% endblock %} {% block css %} <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/css/jquery.dataTables.css" /> - <link rel="stylesheet" type="text/css" href="/static/packages/DT_bootstrap/DT_bootstrap.css" /> - <link rel="stylesheet" type="text/css" href="/static/packages/TableTools/media/css/TableTools.css" /> - <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/extensions/dataTables.fixedHeader.css" > - <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/fixedcolumns/3.0.4/css/dataTables.fixedColumns.css"> + <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/extensions/buttons.bootstrap.css" /> {% endblock %} {% block content %} <!-- Start of body --> <div class="container"> + <p>You searched for {{ terms }}.</p> <p>To study a record, click on its ID below.<br />Check records below and click Add button to add to selection.</p> <div> @@ -20,52 +18,71 @@ <button class="btn btn-default" id="deselect_all"><span class="glyphicon glyphicon-remove"></span> Deselect All</button> <button class="btn btn-default" id="invert"><span class="glyphicon glyphicon-resize-vertical"></span> Invert</button> <button class="btn btn-default" id="add" disabled ><span class="glyphicon glyphicon-plus-sign"></span> Add</button> - <button class="btn btn-primary pull-right"><span class="glyphicon glyphicon-download"></span> Download Table</button> <input type="text" id="searchbox" class="form-control" style="width: 180px; display: inline;" placeholder="Search This Table For ..."> <input type="text" id="select_top" class="form-control" style="width: 120px; display: inline;" placeholder="Select Top ..."> <br /> <br /> - <table width="2000px" class="table table-hover table-striped" id="trait_table"> + <div style="width: 2000px; background-color: #eeeeee; border: 1px solid black;"> + <table width="2000px" id="trait_table" class="table table-hover table-striped" > <thead> - <tr> - <th style="width: 30px;"></th> - <th>Index</th> - <th>Species</th> - <th>Group</th> - <th>Tissue</th> - <th>Dataset</th> - <th>Record</th> - <th>Symbol</th> - <th>Description</th> - <th>Location</th> - <th>Mean</th> - <th style="text-align: right;">Max <br>LRS<a href="http://genenetwork.org//glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th> - <th>Max LRS Location</th> - <th style="text-align: right;">Additive<br>Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th> - </tr> - </thead> + <tr> + <th style="background-color: #eeeeee;"></th> + <th style="background-color: #eeeeee;">Index</th> + <th style="background-color: #eeeeee;">Species</th> + <th style="background-color: #eeeeee;">Group</th> + <th style="background-color: #eeeeee;">Tissue</th> + <th style="background-color: #eeeeee;">Dataset</th> + <th style="background-color: #eeeeee;">Record</th> + <th style="background-color: #eeeeee;">Symbol</th> + <th style="background-color: #eeeeee;">Description</th> + <th style="background-color: #eeeeee;">Location</th> + <th style="background-color: #eeeeee;">Mean</th> + <th style="background-color: #eeeeee;">Max <br>LRS<a href="http://genenetwork.org/glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th> + <th style="background-color: #eeeeee;">Max LRS Location</th> + <th style="background-color: #eeeeee;">Additive<br>Effect<a href="http://genenetwork.org/glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th> + </tr> + </thead> <tbody> - {% for this_trait in trait_list %} - <TR id="trait:{{ this_trait.name }}:{{ this_trait.dataset.name }}"> - <TD><INPUT TYPE="checkbox" NAME="searchResult" class="checkbox trait_checkbox" style="transform: scale(1.5);" VALUE="{{ data_hmac('{}:{}'.format(this_trait.name, this_trait.dataset.name)) }}"></TD> - <TD>{{ loop.index }}</TD> - <TD>{{ this_trait.dataset.group.species }}</TD> - <TD>{{ this_trait.dataset.group.name }}</TD> - <TD>{{ this_trait.dataset.tissue }}</TD> - <TD>{{ this_trait.dataset.fullname }}</TD> - <TD><a href="{{ url_for('show_trait_page', trait_id = this_trait.name, dataset = this_trait.dataset.name)}}">{{ this_trait.name }}</a></TD> - <TD>{{ this_trait.symbol }}</TD> - <TD>{{ this_trait.description_display }}</TD> - <TD>{{ this_trait.location_repr }}</TD> - <TD align="right">{{ '%0.3f' % this_trait.mean|float }}</TD> - <TD align="right">{{ '%0.3f' % this_trait.LRS_score_repr|float }}</TD> - <TD>{{ this_trait.LRS_location_repr }}</TD> - <TD align="right">{{ '%0.3f' % this_trait.additive|float }}</TD> - </TR> - {% endfor %} + {% for this_trait in trait_list %} + <tr id="trait:{{ this_trait.name }}:{{ this_trait.dataset.name }}"> + <td><input type="checkbox" name="searchResult" class="checkbox trait_checkbox" style="transform: scale(1.5);" value="{{ data_hmac('{}:{}'.format(this_trait.name, this_trait.dataset.name)) }}"></td> + <td>{{ loop.index }}</td> + <td>{{ this_trait.dataset.group.species }}</td> + <td>{{ this_trait.dataset.group.name }}</td> + <td>{{ this_trait.dataset.tissue }}</td> + <td>{{ this_trait.dataset.name }}</td> + <td><a href="{{ url_for('show_trait_page', trait_id = this_trait.name, dataset = this_trait.dataset.name)}}">{{ this_trait.name }}</a></td> + <td>{{ this_trait.symbol }}</td> + <td>{{ this_trait.description_display }}</td> + <td align="right">{{ this_trait.location_repr }}</td> + <td align="right">{{ '%0.3f' % this_trait.mean|float }}</td> + <td align="right">{% if this_trait.LRS_score_repr != "N/A" %}{{ '%0.1f' % this_trait.LRS_score_repr|float }}{% else %}N/A{% endif %}</td> + <td align="right">{{ this_trait.LRS_location_repr }}</td> + <td align="right">{% if this_trait.additive != "" %}{{ '%0.3f' % this_trait.additive|float }}{% else %}N/A{% endif %}</td> + </tr> + {% endfor %} </tbody> - </table> + <tfoot> + <tr> + <th style="background-color: #eeeeee;"></th> + <th style="background-color: #eeeeee;">Index</th> + <th style="background-color: #eeeeee;">Species</th> + <th style="background-color: #eeeeee;">Group</th> + <th style="background-color: #eeeeee;">Tissue</th> + <th style="background-color: #eeeeee;">Dataset</th> + <th style="background-color: #eeeeee;">Record</th> + <th style="background-color: #eeeeee;">Symbol</th> + <th style="background-color: #eeeeee;">Description</th> + <th style="background-color: #eeeeee;">Location</th> + <th style="background-color: #eeeeee;">Mean</th> + <th style="background-color: #eeeeee;">Max <br>LRS<a href="http://genenetwork.org/glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th> + <th style="background-color: #eeeeee;">Max LRS Location</th> + <th style="background-color: #eeeeee;">Additive<br>Effect<a href="http://genenetwork.org/glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th> + </tr> + </tfoot> + </table> + </div> </div> </div> @@ -77,6 +94,10 @@ <script language="javascript" type="text/javascript" src="/static/new/javascript/search_results.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/jquery.dataTables.min.js"></script> + <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/dataTables.buttons.min.js"></script> + <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.html5.min.js"></script> + <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.bootstrap.min.js"></script> + <script language="javascript" type="text/javascript" src="/static/new/js_external/jszip.min.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/dataTables.naturalSort.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.colReorder.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.colResize.js"></script> @@ -98,42 +119,6 @@ } return parseFloat(x); } - - jQuery.fn.dataTableExt.oSort['cust-txt-asc'] = function (a, b) { - var x = getValue(a); - var y = getValue(b); - - if (x == 'N/A' || x == '') { - return 1; - } - else if (y == 'N/A' || y == '') { - return -1; - } - else { - return ((x < y) ? -1 : ((x > y) ? 1 : 0)); - } - }; - - jQuery.fn.dataTableExt.oSort['cust-txt-asc'] = function (a, b) { - var x = getValue(a); - var y = getValue(b); - - if (x == 'N/A' || x == '') { - return 1; - } - else if (y == 'N/A' || y == '') { - return -1; - } - else { - return ((x < y) ? -1 : ((x > y) ? 1 : 0)); - } - }; - - jQuery.fn.dataTableExt.oSort['cust-txt-desc'] = function (a, b) { - var x = getValue(a); - var y = getValue(b); - return ((x < y) ? 1 : ((x > y) ? -1 : 0)); - }; $.fn.dataTable.ext.order['dom-checkbox'] = function ( settings, col ) { @@ -152,32 +137,40 @@ console.time("Creating table"); $('#trait_table').DataTable( { + "paging": false, + "buttons": [ + { + extend: 'csvHtml5', + text: 'Download CSV', + title: 'search_results', + fieldBoundary: '"', + exportOptions: { + columns: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13] + } + } + ], "columns": [ { "type": "natural" }, { "type": "natural" }, { "type": "natural" }, - { "type": "cust-txt" }, - { "type": "natural" }, + { "type": "natural", "width": "8%" }, { "type": "natural" }, { "type": "natural" }, { "type": "natural" }, - { "type": "natural", "width": "15%" }, { "type": "natural" }, { "type": "natural" }, + { "type": "natural", "width": "8%" }, { "type": "natural" }, - { "type": "natural" }, - { "type": "cust-txt" } + { "type": "natural", "width": "5%" }, + { "type": "natural", "width": "8%" }, + { "type": "natural" } ], - "order": [[ 1, "asc" ]], - "sDom": "RZtir", + "order": [[1, "asc" ]], + "sDom": "Btir", "autoWidth": false, - "bLengthChange": true, "bDeferRender": true, - "scrollCollapse": false, - "colResize": { - "tableWidthFixed": false, - }, - "paging": false + "scrollY": "800px", + "scrollCollapse": false } ); console.timeEnd("Creating table"); diff --git a/wqflask/wqflask/templates/gsearch_pheno.html b/wqflask/wqflask/templates/gsearch_pheno.html index 2527bebf..9be0349f 100755 --- a/wqflask/wqflask/templates/gsearch_pheno.html +++ b/wqflask/wqflask/templates/gsearch_pheno.html @@ -4,6 +4,7 @@ <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/css/jquery.dataTables.css" /> <link rel="stylesheet" type="text/css" href="/static/packages/DT_bootstrap/DT_bootstrap.css" /> <link rel="stylesheet" type="text/css" href="/static/packages/TableTools/media/css/TableTools.css" /> + <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/extensions/buttons.bootstrap.css" /> <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/extensions/dataTables.fixedHeader.css" > <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/fixedcolumns/3.0.4/css/dataTables.fixedColumns.css"> {% endblock %} @@ -20,45 +21,61 @@ <button class="btn btn-default" id="deselect_all"><span class="glyphicon glyphicon-remove"></span> Deselect All</button> <button class="btn btn-default" id="invert"><span class="glyphicon glyphicon-resize-vertical"></span> Invert</button> <button class="btn btn-default" id="add" disabled ><span class="glyphicon glyphicon-plus-sign"></span> Add</button> - <button class="btn btn-primary pull-right"><span class="glyphicon glyphicon-download"></span> Download Table</button> <input type="text" id="searchbox" class="form-control" style="width: 200px; display: inline;" placeholder="Search This Table For ..."> <input type="text" id="select_top" class="form-control" style="width: 200px; display: inline;" placeholder="Select Top ..."> <br /> <br /> - <table class="table table-hover table-striped" id='trait_table' style="float: left;"> + <div style="width: 1500px; background-color: #eeeeee; border: 1px solid black;"> + <table width="1500px" id="trait_table" class="table table-hover table-striped"> <thead> <tr> - <th style="width: 30px;"></th> - <th>Index</th> - <th>Species</th> - <th>Group</th> - <th>Record</th> - <th>Description</th> - <th>Authors</th> - <th>Year</th> - <th style="text-align: right;">Max <br>LRS<a href="http://genenetwork.org//glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th> - <th>Max LRS Location</th> - <th style="text-align: right;">Additive<br>Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th> + <th style="background-color: #eeeeee;"></th> + <th style="background-color: #eeeeee;">Index</th> + <th style="background-color: #eeeeee;">Species</th> + <th style="background-color: #eeeeee;">Group</th> + <th style="background-color: #eeeeee;">Record</th> + <th style="background-color: #eeeeee;">Description</th> + <th style="background-color: #eeeeee;">Authors</th> + <th style="background-color: #eeeeee;">Year</th> + <th style="background-color: #eeeeee; text-align: right;">Max <br>LRS<a href="http://genenetwork.org//glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th> + <th style="background-color: #eeeeee;">Max LRS Location</th> + <th style="background-color: #eeeeee; text-align: right;">Additive<br>Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th> </tr> </thead> <tbody> {% for this_trait in trait_list %} <TR id="trait:{{ this_trait.name }}:{{ this_trait.dataset.name }}"> - <TD><INPUT TYPE="checkbox" NAME="searchResult" class="checkbox trait_checkbox" style="transform: scale(1.5);" VALUE="{{ data_hmac('{}:{}'.format(this_trait.name, this_trait.dataset.name)) }}"></TD> - <TD>{{ loop.index }}</TD> - <TD>{{ this_trait.dataset.group.species }}</TD> - <TD>{{ this_trait.dataset.group.name }}</TD> - <TD><a href="{{ url_for('show_trait_page', trait_id = this_trait.name, dataset = this_trait.dataset.name)}}">{{ this_trait.name }}</a></TD> - <TD>{{ this_trait.description_display }}</TD> - <TD>{{ this_trait.authors }}</TD> - <TD><a href="{{ this_trait.pubmed_link }}">{{ this_trait.pubmed_text }}</a></TD> - <TD>{{ this_trait.LRS_score_repr }}</TD> - <TD>{{ this_trait.LRS_location_repr }}</TD> - <TD>{{ '%0.3f' % this_trait.additive|float }}</TD> + <td><INPUT TYPE="checkbox" NAME="searchResult" class="checkbox trait_checkbox" style="transform: scale(1.5);" VALUE="{{ data_hmac('{}:{}'.format(this_trait.name, this_trait.dataset.name)) }}"></td> + <td>{{ loop.index }}</td> + <td>{{ this_trait.dataset.group.species }}</td> + <td>{{ this_trait.dataset.group.name }}</td> + <td><a href="{{ url_for('show_trait_page', trait_id = this_trait.name, dataset = this_trait.dataset.name)}}">{{ this_trait.name }}</a></td> + <td>{{ this_trait.description_display }}</td> + <td>{{ this_trait.authors }}</td> + <td><a href="{{ this_trait.pubmed_link }}">{{ this_trait.pubmed_text }}</a></td> + <td align="right">{% if this_trait.LRS_score_repr != "N/A" %}{{ '%0.1f' % this_trait.LRS_score_repr|float }}{% else %}N/A{% endif %}</td> + <td align="right">{{ this_trait.LRS_location_repr }}</td> + <td align="right">{% if this_trait.additive != "" %}{{ this_trait.additive }}{% else %}N/A{% endif %}</td> </TR> {% endfor %} </tbody> + <tfoot> + <tr> + <th style="background-color: #eeeeee;"></th> + <th style="background-color: #eeeeee;">Index</th> + <th style="background-color: #eeeeee;">Species</th> + <th style="background-color: #eeeeee;">Group</th> + <th style="background-color: #eeeeee;">Record</th> + <th style="background-color: #eeeeee;">Description</th> + <th style="background-color: #eeeeee;">Authors</th> + <th style="background-color: #eeeeee;">Year</th> + <th style="background-color: #eeeeee; text-align: right;">Max <br>LRS<a href="http://genenetwork.org//glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th> + <th style="background-color: #eeeeee;">Max LRS Location</th> + <th style="background-color: #eeeeee; text-align: right;">Additive<br>Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th> + </tr> + </tfoot> </table> + </div> </div> </div> @@ -70,6 +87,10 @@ <script language="javascript" type="text/javascript" src="/static/new/javascript/search_results.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/jquery.dataTables.min.js"></script> + <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/dataTables.buttons.min.js"></script> + <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.html5.min.js"></script> + <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.bootstrap.min.js"></script> + <script language="javascript" type="text/javascript" src="/static/new/js_external/jszip.min.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/dataTables.naturalSort.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.colReorder.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.colResize.js"></script> @@ -123,29 +144,37 @@ console.time("Creating table"); $('#trait_table').DataTable( { + "paging": false, + "buttons": [ + { + extend: 'csvHtml5', + text: 'Download CSV', + title: 'search_results', + fieldBoundary: '"', + exportOptions: { + columns: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + } + } + ], "columns": [ - { "bSortClasses": false }, - { "type": "natural" }, - { "type": "natural" }, { "type": "natural" }, { "type": "natural" }, - { "type": "natural", "width": "20%"}, { "type": "natural" }, { "type": "natural" }, { "type": "natural" }, + { "type": "natural", "width": "30%"}, + { "type": "natural", "width": "25%"}, { "type": "natural" }, + { "type": "natural", "width": "8%"}, + { "type": "natural", "width": "12%"}, { "type": "natural" } ], - "order": [[ 1, "asc" ]], - "sDom": "RZtir", + "order": [[1, "asc" ]], + "sDom": "Btir", "autoWidth": false, - "bLengthChange": true, "bDeferRender": true, - "scrollCollapse": false, - "colResize": { - "tableWidthFixed": false, - }, - "paging": false + "scrollY": "800px", + "scrollCollapse": false } ); console.timeEnd("Creating table"); }); diff --git a/wqflask/wqflask/templates/index_page.html b/wqflask/wqflask/templates/index_page.html index 5d658bc7..9e029911 100755 --- a/wqflask/wqflask/templates/index_page.html +++ b/wqflask/wqflask/templates/index_page.html @@ -143,7 +143,7 @@ highly expressed genes (15 to 16 log2 units) AND with peak <a href="http://www.genenetwork.org/glossary.html#L" target="_blank">LRS</a> linkage between 23 and 46.</li> - <li><b>RIF=mitochondrial</b> searches RNA databases for <a href="http://www.ncbi.nlm.nih.gov/projects/GeneRIF/GeneRIFhelp.html" target="_blank"> + <li><b>RIF=mitochondrial</b> searches RNA databases for <a href="https://en.wikipedia.org/wiki/GeneRIF" target="_blank"> GeneRIF</a> links.</li> <li><b>WIKI=nicotine</b> searches <a href="http://www.genenetwork.org/webqtl/main.py?FormID=geneWiki" target="_blank"> @@ -207,12 +207,12 @@ <li><a href="http://galaxy.genenetwork.org/" target="_blank">Galaxy</a> at UTHSC</li> - <li>GeneNetwork at <a href="http://ec2.genenetwork.org/" target="_blank">Amazon + <li>GeneNetwork 1 at <a href="http://ec2.genenetwork.org/" target="_blank">Amazon Cloud (EC2)</a></li> - <li>GeneNetwork Source Code at <a href="http://sourceforge.net/projects/genenetwork/" target="_blank">SourceForge</a></li> + <li>GeneNetwork 1 Source Code at <a href="http://sourceforge.net/projects/genenetwork/" target="_blank">SourceForge</a></li> - <li>GeneNetwork Source Code at <a href="https://github.com/genenetwork/genenetwork" target="_blank">GitHub</a></li> + <li>GeneNetwork 2 Source Code at <a href="https://github.com/genenetwork/genenetwork2" target="_blank">GitHub</a></li> </ul> <h3>GN1 Mirror and development sites</h3> diff --git a/wqflask/wqflask/templates/marker_regression_gn1.html b/wqflask/wqflask/templates/marker_regression_gn1.html index 9f7dd41f..978ea55f 100644 --- a/wqflask/wqflask/templates/marker_regression_gn1.html +++ b/wqflask/wqflask/templates/marker_regression_gn1.html @@ -3,88 +3,240 @@ {% block css %} <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/css/jquery.dataTables.css" /> <link rel="stylesheet" type="text/css" href="/static/packages/DT_bootstrap/DT_bootstrap.css" /> + + <link rel="stylesheet" type="text/css" href="/static/new/css/marker_regression.css" /> + <link rel="stylesheet" type="text/css" href="/static/new/css/panelutil.css" /> {% endblock %} {% from "base_macro.html" import header %} {% block content %} - {{ header("Whole Genome Mapping Results", - '{}: {}'.format(this_trait.name, this_trait.description_fmt)) }} - <div class="container"> <form method="post" target="_blank" action="/marker_regression" name="marker_regression" id="marker_regression_form"> <input type="hidden" name="temp_uuid" value="{{ temp_uuid }}"> <input type="hidden" name="trait_id" value="{{ this_trait.name }}"> <input type="hidden" name="dataset" value="{{ dataset.name }}"> + <input type="hidden" name="method" value="{{ mapping_method }}"> {% for sample in dataset.group.samplelist %} <input type="hidden" name="value:{{ sample }}" value="{{ vals[loop.index - 1] }}"> {% endfor %} <input type="hidden" name="maf"> - <input type="hidden" name="method" value="{{ mapping_method }}"> <input type="hidden" name="selected_chr" value="{{ selectedChr }}"> - <input type="hidden" name="manhattan_plot"> - <input type="hidden" name="num_perm"> + <input type="hidden" name="manhattan_plot" value="{{ manhattan_plot }}"> + <input type="hidden" name="num_perm" value="{{ nperm }}"> + <input type="hidden" name="perm_results" value=""> + <input type="hidden" name="num_bootstrap" value="{{ nboot }}"> <input type="hidden" name="do_control" value="{{ doControl }}"> <input type="hidden" name="control_marker" value="{{ controlLocus }}"> <input type="hidden" name="mapmethod_rqtl_geno" value="{{ mapmethod_rqtl_geno }}"> <input type="hidden" name="mapmodel_rqtl_geno" value="{{ mapmodel_rqtl_geno }}"> <input type="hidden" name="pair_scan" value="{{ pair_scan }}"> - <div id="chart_container"> - <div class="qtlcharts" id="topchart"> - {{ gifmap|safe }} - <img src="/static/output/{{ filename }}.jpeg" usemap="#WebQTLImageMap"> + + <div class="container"> + <div class="col-xs-5"> + <h2>Map Viewer: Whole Genome</h2><br> + <b>Population:</b> {{ dataset.group.species|capitalize }} {{ dataset.group.name }}<br> + <b>Database:</b> {{ dataset.fullname }}<br> + {% if dataset.type == "ProbeSet" %}<b>Trait ID:</b>{% else %}<b>Record ID:</b>{% endif %} <a href="/show_trait?trait_id={{ this_trait.name }}&dataset={{ dataset.name }}">{{ this_trait.name }}</a><br> + {% if dataset.type == "ProbeSet" %} + <b>Gene Symbol:</b> <i>{{ this_trait.symbol }}</i><br> + <b>Location:</b> Chr {{ this_trait.chr }} @ {{ this_trait.mb }} Mb + {% endif %} + </div> + <div id="gn1_map_options" class="col-xs-5" style="outline: 3px double #AAAAAA; padding: 10px; margin: 10px;"> + <div class="col-xs-8" style="padding: 0px;"> + <table> + <tr> + <td><b>Chr: </b></td> + <td> + <select name="chromosomes" size="1"> + {% for chr in ChrList %} + <option value="{{ chr[1] }}" {% if (chr[1] + 1) == selectedChr %}selected{% endif %}>{{ chr[0] }}</option> + {% endfor %} + </select> + <button type="button" class="btn btn-primary" style="padding-bottom: 2px; padding-top: 2px;" onclick="javascript:remap();">Remap</button> + </td> + </tr> + <tr> + <td><b>View: </b></td> + <td style="padding: 5px;"> + <input type="text" name="startMb" size="10" value="{% if startMb != -1 %}{{ startMb }}{% endif %}"> to <input type="text" name="endMb" size="10" value="{% if endMb != -1 %}{{ endMb }}{% endif %}"> + </td> + </tr> + <tr> + <td><b>Units: </b></td> + <td style="padding: 5px;"> + <label class="radio-inline"> + <input type="radio" name="LRSCheck" value="LRS" {% if LRS_LOD == "LRS" %}checked{% endif %}>LRS + </label> + <label class="radio-inline"> + <input type="radio" name="LRSCheck" value="LOD" {% if LRS_LOD == "LOD" %}checked{% endif %}>LOD + </label> + <a href="http://genenetwork.org/glossary.html#LOD" target="_blank"> + <sup style="color:#f00"> ?</sup> + </a> + </td> + </tr> + <tr> + <td></td> + <td style="padding: 5px;"> + <input type="text" name="lrsMax" value="{{ '%0.1f' | format(lrsMax|float) }}" size="3"> <span style="font-size: 12px;">units on the y-axis (0 for default)</span> + </td> + </tr> + <tr> + <td><b>Width: </b></td> + <td> + <input type="text" name="graphWidth" value="{% if graphWidth is defined %}{{ graphWidth }}{% else %}1600{% endif %}" size="5"><span style="font-size: 12px;"> pixels (minimum=900)</span> + </td> + </tr> + </table> + </div> + <div class="col-xs-4" style="padding: 0px;"> + {% if (mapping_method == "reaper" or mapping_method == "rqtl_geno") and nperm > 0 %} + <input type="checkbox" name="permCheck" class="checkbox" style="display: inline; margin-top: 0px;" {% if permChecked|upper == "ON" %}value="ON" checked{% endif %}> <span style="font-size: 12px;">Permutation Test + <a href="http://genenetwork.org/glossary.html#Permutation" target="_blank"> + <sup style="color:#f00"> ?</sup> + </a> + <br> + {% endif %} + {% if mapping_method == "reaper" and nboot > 0 %} + <input type="checkbox" name="bootCheck" class="checkbox" style="display: inline; margin-top: 0px;" {% if bootChecked|upper == "ON" %}value="ON" checked{% endif %}> <span style="font-size: 12px;">Bootstrap Test + <a href="http://genenetwork.org/glossary.html#bootstrap" target="_blank"> + <sup style="color:#f00"> ?</sup> + </a> + <br> + {% endif %} + {% if mapping_method == "reaper" %} + <input type="checkbox" name="additiveCheck" class="checkbox" style="display: inline; margin-top: 0px;" {% if additiveChecked|upper == "ON" %}value="ON" checked{% endif %}> <span style="font-size: 12px;">Allele Effects + <a href="http://genenetwork.org/glossary.html#additive" target="_blank"> + <sup style="color:#f00"> ?</sup> + </a> + <br> + {% endif %} + <input type="checkbox" name="showSNP" class="checkbox" style="display: inline; margin-top: 0px;" {% if SNPChecked|upper == "ON" %}value="ON" checked{% endif %}> <span style="font-size: 12px;">SNP Track </span> + <a href="http://genenetwork.org/glossary.html#snpSeismograph" target="_blank"> + <sup style="color:#f00"> ?</sup> + </a> + <span style="color:red;">*</span> + <br> + <input type="checkbox" name="showGenes" class="checkbox" style="display: inline; margin-top: 0px;" {% if geneChecked|upper == "ON" %}value="ON" checked{% endif %}> <span style="font-size: 12px;">Gene Track </span> <span style="color:red;">*</span><br> + {% if plotScale != "morgan" %} + <input type="checkbox" name="haplotypeAnalystCheck" class="checkbox" style="display: inline; margin-top: 0px;" {% if haplotypeAnalystChecked|upper == "ON" %}value="ON" checked{% endif %}> <span style="font-size: 12px;">Haplotype Analyst </span> <span style="color:red;">*</span><br> + {% endif %} + <input type="checkbox" name="viewLegend" class="checkbox" style="display: inline; margin-top: 0px;" {% if legendChecked|upper == "ON" %}value="ON" checked{% endif %}> <span style="font-size: 12px;">Legend </span> + </div> + <div class="col-xs-12" align="center" style="padding: 5px;"> + <span style="color:red;">*</span> <span style="font-size: 12px;">only apply to single chromosome physical mapping</span> + </div> + </div> + </div> + + <div class="tabbable" style="margin: 10px;"> + <ul class="nav nav-tabs"> + <li id="gn1_map_tab"> + <a href="#gn1_map" data-toggle="tab" aria-expanded="true">GN1 Map</a> + </li> + {% if mapping_method != "gemma" %} + <li id="vector_map_tab"> + <a href="#vector_map" data-toggle="tab" {% if mapping_method != "gemma" %}aria-expanded="false"{% else %}aria-expanded="true"{% endif %}>Vector Map</a> + </li> + {% endif %} + </ul> + <div class="tab-content"> + <div class="tab-pane active" id="gn1_map"> + <div class="qtlcharts"> + {{ gifmap|safe }} + <img src="/generated/{{ filename }}.jpeg" usemap="#WebQTLImageMap"> + {% if additiveChecked|upper == "ON" %} + <br> + <span style="white-space: nowrap;">A positive additive coefficient (green line) indicates that {{ dataset.group.parlist[1] }} alleles increase trait values. In contrast, a negative additive coefficient (orange line) indicates that {{ dataset.group.parlist[0] }} alleles increase trait values.</span> + {% endif %} + {% if nperm > 0 and permChecked == "ON" %} + <br><br> + <img src="/generated/{{ perm_filename }}.gif"> + <br><br> + Total of {{ nperm }} permutations <a href="javascript:export_perm_data();" target="_blank" >Download Permutation Results</a> + <br> + {% endif %} + </div> + </div> + {% if mapping_method != "gemma" %} + <div class="tab-pane {% if mapping_method == "gemma" %}active{% endif %}" id="vector_map"> + <div id="chart_container"> + <div class="qtlcharts" id="topchart"></div> + </div> </div> + {% endif %} + </div> </div> + </form> <div style="width:48%;"> - <h2> - Results - </h2> - <table id="qtl_results" class="table table-hover table-striped"> - <thead> - <tr> - <th></th> - <th>Index</th> - <th>{{ LRS_LOD }}</th> - <th>Chr</th> - {% if plotScale == "centimorgan" %} - <th>cM</th> - {% else %} - <th>Mb</th> - {% endif %} - <th>Locus</th> - </tr> - </thead> - <tbody> - {% for marker in qtlresults %} - {% if (LRS_LOD == "LOD" and marker.lod_score|float > cutoff|float) or - (LRS_LOD == "LRS" and marker.lrs_value|float > cutoff|float) %} - <tr> - <td> - <input type="checkbox" name="selectCheck" - class="checkbox edit_sample_checkbox" - value="{{ marker.name }}" checked="checked"> - </td> - <Td align="right">{{ loop.index }}</Td> - {% if LRS_LOD == "LOD" %} - <td>{{ '%0.2f' | format(marker.lod_score|float) }}</td> - {% else %} - <td>{{ '%0.2f' | format(marker.lrs_value|float) }}</td> - {% endif %} - <td>{{marker.chr}}</td> - <td>{{ '%0.6f' | format(marker.Mb|float) }}</td> - <td> - {{ marker.name }} - <!--<a href="{{ url_for('show_trait_page', - trait_id = marker.name, - dataset = dataset.name - )}}"> - {{ marker.name }} - </a>--> - </td> - </tr> - {% endif %} - {% endfor %} - </tbody> - </table> + {% if selectedChr == -1 %} + <h2>Results</h2> + <table id="qtl_results" class="table table-hover table-striped"> + <thead> + <tr> + <th></th> + <th>Index</th> + <th>{{ LRS_LOD }}</th> + <th>Chr</th> + {% if plotScale == "centimorgan" %} + <th>cM</th> + {% else %} + <th>Mb</th> + {% endif %} + <th>Locus</th> + </tr> + </thead> + <tbody> + {% for marker in trimmed_markers %} + <tr> + <td> + <input type="checkbox" name="selectCheck" + class="checkbox edit_sample_checkbox" + value="{{ marker.name }}" checked="checked"> + </td> + <td align="right">{{ loop.index }}</td> + {% if LRS_LOD == "LOD" %} + {% if 'lod_score' in marker %} + <td>{{ '%0.2f' | format(marker.lod_score|float) }}</td> + {% else %} + <td>{{ '%0.2f' | format(marker.lrs_value|float / 4.16) }}</td> + {% endif %} + {% else %} + {% if 'lod_score' in marker %} + <td>{{ '%0.2f' | format(marker.lod_score|float * 4.16) }}</td> + {% else %} + <td>{{ '%0.2f' | format(marker.lrs_value|float) }}</td> + {% endif %} + {% endif %} + <td>{{marker.chr}}</td> + <td>{{ '%0.6f' | format(marker.Mb|float) }}</td> + <td>{{ marker.name }}</td> + </tr> + {% endfor %} + </tbody> + </table> + {% elif selectedChr > -1 %} + <h2>Interval Analyst</h2> + <table id="interval_analyst" class="table table-hover table-striped"> + <thead> + <tr> + {% for header in gene_table_header %} + <th>{{ header|safe }}</th> + {% endfor %} + </tr> + </thead> + <tbody> + {% for row in gene_table_body %} + <tr> + {% for n in range(row|length) %} + <td>{{ row[n]|safe }}</td> + {% endfor %} + </tr> + {% endfor %} + </tbody> + </table> + {% endif %} </div> </div> @@ -94,8 +246,10 @@ {% block js %} + <script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script> <script type="text/javascript" src="/static/new/js_external/underscore-min.js"></script> <script type="text/javascript" src="/static/new/js_external/underscore.string.min.js"></script> + <script type="text/javascript" src="/static/new/js_external/d3-tip.min.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/jquery.dataTables.js"></script> <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/dataTables.buttons.min.js"></script> @@ -110,6 +264,13 @@ js_data = {{ js_data | safe }} </script> + {% if mapping_method != "gemma" %} + <script language="javascript" type="text/javascript" src="/static/new/javascript/panelutil.js"></script> + <script language="javascript" type="text/javascript" src="/static/new/javascript/chr_lod_chart.js"></script> + <script language="javascript" type="text/javascript" src="/static/new/javascript/lod_chart.js"></script> + <script language="javascript" type="text/javascript" src="/static/new/javascript/create_lodchart.js"></script> + {% endif %} + <script type="text/javascript" charset="utf-8"> $(document).ready( function () { console.time("Creating table"); @@ -122,6 +283,7 @@ { "type": "natural" }, { "type": "natural", "sWidth": "30%"} ], + "order": [[1, "asc"]], "buttons": [ 'csv' ], @@ -134,17 +296,62 @@ "scrollCollapse": true, "paging": false } ); - console.timeEnd("Creating table"); + + $('#interval_analyst').dataTable( { + "columnDefs": [ { + "targets": 0, + "sortable": false + }], + "order": [[3, "asc"]], + "sDom": "RZtir", + "iDisplayLength": -1, + "autoWidth": true, + "bDeferRender": true, + "bSortClasses": false, + "paging": false + } ); + + $('#vector_map_tab').click(function(){ + $('div#gn1_map_options').hide(); + }); + + $('#gn1_map_tab').click(function(){ + $('div#gn1_map_options').show(); + }); }); chrView = function(this_chr, chr_mb_list) { - $('input[name=selected_chr]').val(this_chr + 1) + $('input[name=selected_chr]').val(this_chr) $('input[name=chr_mb_list]').val(chr_mb_list) return $('#marker_regression_form').submit(); }; + rangeView = function(this_chr, start_mb, end_mb) { + $('input[name=selected_chr]').val(this_chr) + $('input[name=startMb]').val(start_mb) + $('input[name=endMb]').val(end_mb) + //$('input[name=mb_range]').val(start_mb + "," + end_mb) + + return $('#marker_regression_form').submit(); + }; + + remap = function() { + $('input[name=selected_chr]').val($('select[name=chromosomes]').val()); + return $('#marker_regression_form').submit(); + }; + + export_perm_data = function() { + var num_perm, perm_data; + num_perm = js_data.num_perm + perm_data = js_data.perm_results + json_perm_data = JSON.stringify(perm_data); + $('input[name=perm_results]').val(json_perm_data); + $('#marker_regression_form').attr('action', '/export_perm_data'); + return $('#marker_regression_form').submit(); + }; + </script> {% endblock %} diff --git a/wqflask/wqflask/templates/pair_scan_results.html b/wqflask/wqflask/templates/pair_scan_results.html index ab4a36bb..1ccb2b27 100644 --- a/wqflask/wqflask/templates/pair_scan_results.html +++ b/wqflask/wqflask/templates/pair_scan_results.html @@ -44,7 +44,7 @@ </tr> </thead> <tbody> - {% for marker in filtered_markers %} + {% for marker in trimmed_markers %} <tr> <td>{{loop.index}}</td> <td>{{marker.name}}</td> diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html index 02365b1d..02c97862 100755 --- a/wqflask/wqflask/templates/search_result_page.html +++ b/wqflask/wqflask/templates/search_result_page.html @@ -2,6 +2,7 @@ {% block title %}Search Results{% endblock %} {% block css %} <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/css/jquery.dataTables.css" /> + <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/scroller/1.4.1/css/scroller.dataTables.min.css"> <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/extensions/dataTables.fixedHeader.css" > <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/fixedcolumns/3.0.4/css/dataTables.fixedColumns.css"> <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/extensions/buttons.bootstrap.css" /> @@ -20,44 +21,30 @@ to find all records {% for word in search_terms %} {% if word.key|lower == "rif" %} - with <u>GeneRIF</u> containing <strong>{{ word.search_term[0] }}</strong>{% if not loop.last %} and {% endif %} + with <u>GeneRIF</u> containing <strong>{{ word.search_term[0] }}</strong>{% if loop.last %}.{% else %} and {% endif %} {% elif word.key|lower == "go" %} - with <u>Gene Ontology ID</u> <strong>{{ word.search_term[0] }}</strong>{% if not loop.last %} and {% endif %} + with <u>Gene Ontology ID</u> <strong>{{ word.search_term[0] }}</strong>{% if loop.last %}.{% else %} and {% endif %} {% elif word.key|lower == "wiki" %} - with <u>GeneWiki</u> containing <strong>{{ word.search_term[0] }}</strong>{% if not loop.last %} and {% endif %} + with <u>GeneWiki</u> containing <strong>{{ word.search_term[0] }}</strong>{% if loop.last %}.{% else %} and {% endif %} {% elif word.key|lower == "mean" %} - with <u>MEAN</u> between <strong>{{ word.search_term[0] }}</strong> and <strong>{{ word.search_term[1] }}</strong>{% if not loop.last %} and {% endif %} + with <u>MEAN</u> between <strong>{{ word.search_term[0] }}</strong> and <strong>{{ word.search_term[1] }}</strong>{% if loop.last %}.{% else %} and {% endif %} {% elif word.key|lower == "lrs" or word.key|lower == "translrs" or word.key|lower == "cislrs" %} {% if word.search_term|length == 1 %} - with {% if word.key|lower == "translrs" %}trans{% elif word.key|lower == "cislrs" %}cis{% endif %}LRS {% if word.separator == ">" %} greater than {% elif word.separator == "<" %} less than {% elif word.separator == ">=" %} greater than or equal to {% elif word.separator == "<=" %} less than or equal to {% endif %} <strong>{{ word.search_term[0] }}</strong>{% if not loop.last %} and {% endif %} + with {% if word.key|lower == "translrs" %}trans{% elif word.key|lower == "cislrs" %}cis{% endif %}LRS {% if word.separator == ">" %} greater than {% elif word.separator == "<" %} less than {% elif word.separator == ">=" %} greater than or equal to {% elif word.separator == "<=" %} less than or equal to {% endif %} <strong>{{ word.search_term[0] }}</strong>{% if loop.last %}.{% else %} and {% endif %} {% elif word.search_term|length == 2 %} - with <u>LRS</u> between <strong>{{ word.search_term[0] }}</strong> and <strong>{{ word.search_term[1] }}</strong>{% if not loop.last %} and {% endif %} + with <u>LRS</u> between <strong>{{ word.search_term[0] }}</strong> and <strong>{{ word.search_term[1] }}</strong>{% if loop.last %}.{% else %} and {% endif %} {% elif word.search_term|length == 3 %} - with <u>LRS</u> between <strong>{{ word.search_term[0] }}</strong> and <strong>{{ word.search_term[1] }}</strong> on chromosome <strong>{{ word.search_term[2] }}</strong>{% if not loop.last %} and {% endif %} + with <u>LRS</u> between <strong>{{ word.search_term[0] }}</strong> and <strong>{{ word.search_term[1] }}</strong> on chromosome <strong>{{ word.search_term[2] }}</strong>{% if loop.last %}.{% else %} and {% endif %} {% elif word.search_term|length == 5 %} - with <u>LRS</u> between <strong>{{ word.search_term[0] }}</strong> and <strong>{{ word.search_term[1] }}</strong> on chromosome <strong>{{ word.search_term[2] }}</strong> between <strong>{{ word.search_term[3] }}</strong> and <strong>{{ word.search_term[4] }}</strong> Mb{% if not loop.last %} and {% endif %} + with <u>LRS</u> between <strong>{{ word.search_term[0] }}</strong> and <strong>{{ word.search_term[1] }}</strong> on chromosome <strong>{{ word.search_term[2] }}</strong> between <strong>{{ word.search_term[3] }}</strong> and <strong>{{ word.search_term[4] }}</strong> Mb{% if loop.last %}.{% else %} and {% endif %} {% endif %} {% elif word.key|lower == "position" %} - with <u>target genes</u> on chromosome <strong>{% if word.search_term[0].split('chr')|length > 1 %}{{ word.search_term[0].split('chr')[1] }}{% elif word.search_term[0].split('CHR')|length > 1 %}{{ word.search_term[0].split('CHR')[1] }}{% else %}{{ word.search_term[0] }}{% endif %}</strong> between <strong>{{ word.search_term[1] }}</strong> and <strong>{{ word.search_term[2] }}</strong> Mb{% if not loop.last %} and {% endif %} + with <u>target genes</u> on chromosome <strong>{% if word.search_term[0].split('chr')|length > 1 %}{{ word.search_term[0].split('chr')[1] }}{% elif word.search_term[0].split('CHR')|length > 1 %}{{ word.search_term[0].split('CHR')[1] }}{% else %}{{ word.search_term[0] }}{% endif %}</strong> between <strong>{{ word.search_term[1] }}</strong> and <strong>{{ word.search_term[2] }}</strong> Mb{% if loop.last %}.{% else %} and {% endif %} {% else %} - with {{ word.key|lower }} matching {{ word.search_term[0] }} + that match the term {{ word.search_term[0] }}. {% endif %} - <!--<strong>{{word.search_term[0]}}</strong> {% if not loop.last %} or {% endif %}--> - {% endfor %}. - - </p> - - <!-- - <ul> - {% if search_terms %} - <li> - {% for word in search_terms %} - <strong>{{word.search_term[0]}}</strong> {% if not loop.last %} or {% endif %} {% endfor %} - </li> - {% endif %} - </ul> - --> + </p> <p>To study a record, click on its ID below. Check records below and click Add button to add to selection.</p> @@ -88,18 +75,18 @@ {% endif %} --> - <div id="table_container"> + <div id="table_container" style="background-color: #eeeeee; border: 1px solid black;"> <table class="table table-hover table-striped" id='trait_table' {% if dataset.type == 'Geno' %}width="400px"{% endif %} style="float: left;"> <thead> <tr> - <th style="width: 30px;"></th> + <th style="background-color: #eeeeee;"></th> {% for header in header_fields %} {% if header == 'Max LRS' %} - <th style="text-align: right;">Max <br>LRS</th> + <th style="background-color: #eeeeee; text-align: right;">Max<br>LRS</th> {% elif header == 'Additive Effect' %} - <th style="text-align: right;">Additive<br>Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th> + <th style="background-color: #eeeeee; text-align: right;">Additive<br>Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th> {% else %} - <th>{{header}}</th> + <th style="background-color: #eeeeee;">{{header}}</th> {% endif %} {% endfor %} </tr> @@ -144,7 +131,22 @@ </TR> {% endfor %} </tbody> - + {% if trait_list|length > 20 %} + <tfoot> + <tr> + <th style="width: 30px;"></th> + {% for header in header_fields %} + {% if header == 'Max LRS' %} + <th style="text-align: right;">Max<br>LRS</th> + {% elif header == 'Additive Effect' %} + <th style="text-align: right;">Additive<br>Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th> + {% else %} + <th>{{header}}</th> + {% endif %} + {% endfor %} + </tr> + </tfoot> + {% endif %} </table> </div> </div> @@ -161,13 +163,14 @@ <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/1.10.8/js/jquery.dataTables.min.js"></script> <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/dataTables.buttons.min.js"></script> + <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/scroller/1.4.1/js/dataTables.scroller.min.js"></script> <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.html5.min.js"></script> <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.bootstrap.min.js"></script> <script language="javascript" type="text/javascript" src="/static/new/js_external/jszip.min.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/dataTables.naturalSort.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.colResize.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.colReorder.js"></script> - <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.fixedHeader.js"></script> + <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.fixedHeader.min.js"></script> <script language="javascript" type="text/javascript" src="//cdn.datatables.net/fixedcolumns/3.0.4/js/dataTables.fixedColumns.min.js"></script> <script type="text/javascript" charset="utf-8"> @@ -219,6 +222,7 @@ console.time("Creating table"); {% if dataset.type == 'ProbeSet' %} + //ZS: Need to make sort by symbol, also need to make sure blank symbol fields at the bottom and symbols starting with numbers below letters $('#trait_table').DataTable( { "columns": [ { "type": "natural" }, @@ -234,13 +238,21 @@ ], "order": [[1, "asc" ]], "buttons": [ - 'csv' + { + extend: 'csvHtml5', + text: 'Download CSV', + title: 'search_results', + fieldBoundary: '"', + exportOptions: { + columns: [1, 2, 3, 4, 5, 6, 7, 8, 9] + } + } ], "sDom": "RZBtir", "iDisplayLength": -1, "bDeferRender": true, "bSortClasses": false, - "scrollY": "700px", + "scrollY": true, "scrollCollapse": false, "paging": false } ); @@ -260,7 +272,15 @@ ], "order": [[1, "asc" ]], "buttons": [ - 'csv' + { + extend: 'csvHtml5', + text: 'Download CSV', + title: 'search_results', + fieldBoundary: '"', + exportOptions: { + columns: [1, 2, 3, 4, 5, 6, 7] + } + } ], "sDom": "RZBtir", "iDisplayLength": -1, @@ -281,7 +301,15 @@ ], "order": [[1, "asc" ]], "buttons": [ - 'csv' + { + extend: 'csvHtml5', + text: 'Download CSV', + title: 'search_results', + fieldBoundary: '"', + exportOptions: { + columns: [1, 2, 3] + } + } ], "sDom": "RZBtir", "iDisplayLength": -1, diff --git a/wqflask/wqflask/templates/show_trait.html b/wqflask/wqflask/templates/show_trait.html index 29239adb..1890cf3f 100755 --- a/wqflask/wqflask/templates/show_trait.html +++ b/wqflask/wqflask/templates/show_trait.html @@ -7,9 +7,8 @@ <link rel="stylesheet" type="text/css" href="/static/new/css/prob_plot.css" /> <link rel="stylesheet" type="text/css" href="/static/new/css/scatter-matrix.css" /> <link rel="stylesheet" type="text/css" href="/static/new/css/d3-tip.min.css" /> - <link rel="stylesheet" type="text/css" href="/static/new/packages/nvd3/nv.d3.min.css" /> + <link rel="stylesheet" type="text/css" href="/static/new/packages/nvd3/nv.d3.css" /> <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/css/jquery.dataTables.css" /> - <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/extensions/buttons.bootstrap.css" /> <link rel="stylesheet" type="text/css" href="/static/new/packages/noUiSlider/nouislider.css" /> <link rel="stylesheet" type="text/css" href="/static/new/packages/noUiSlider/nouislider.pips.css" /> <link rel="stylesheet" type="text/css" href="/static/packages/DT_bootstrap/DT_bootstrap.css" /> @@ -17,15 +16,20 @@ {% endblock %} {% block content %} <!-- Start of body --> +<!-- {% if this_trait.dataset.type != 'Geno' %} {{ header("{}".format(this_trait.name_header_fmt), '{}: {}'.format(this_trait.name, this_trait.description_fmt)) }} {% else %} {{ header("{}".format(this_trait.name_header_fmt)) }} {% endif %} +--> + <div class="container"> + <h2>Trait Data and Analysis for <b>{{ this_trait.name }}</b></h2> + <h3>{{ this_trait.description_fmt }}</h3> + </div> - - <form method="post" target="_blank" action="/corr_compute" name="trait_page" id="trait_data_form" + <form method="post" action="/corr_compute" target="_blank" name="trait_page" id="trait_data_form" class="form-horizontal"> <div id="hidden_inputs"> <input type="hidden" name="trait_hmac" value="{{ data_hmac('{}:{}'.format(this_trait.name, dataset.name)) }}"> @@ -37,40 +41,50 @@ <input type="hidden" name="temp_uuid" id="temp_uuid" value="{{ temp_uuid }}"> <div class="container"> - - {% include 'show_trait_details.html' %} <div class="panel-group" id="accordion"> <div class="panel panel-default"> - <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseOne"> + <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseOne" aria-expanded="true"> + <h3 class="panel-title"> + <span class="glyphicon glyphicon-chevron-down"></span> Details and Links + </h3> + </div> + <div id="collapseOne" class="panel-collapse collapse" aria-expanded="true"> + <div class="panel-body"> + {% include 'show_trait_details.html' %} + </div> + </div> + </div> + <div class="panel panel-default"> + <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseTwo"> <h3 class="panel-title"> <span class="glyphicon glyphicon-chevron-down"></span> Statistics </h3> </div> - <div id="collapseOne" class="panel-collapse collapse in"> + <div id="collapseTwo" class="panel-collapse collapse in"> <div class="panel-body"> {% include 'show_trait_statistics.html' %} </div> </div> </div> <div class="panel panel-default"> - <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseTwo"> + <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseThree"> <h3 class="panel-title"> <span class="glyphicon glyphicon-chevron-down"></span> Calculate Correlations </h3> </div> - <div id="collapseTwo" class="panel-collapse collapse in"> + <div id="collapseThree" class="panel-collapse collapse in"> <div class="panel-body"> {% include 'show_trait_calculate_correlations.html' %} </div> </div> </div> <div class="panel panel-default"> - <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseThree"> + <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseFour"> <h3 class="panel-title"> <span class="glyphicon glyphicon-chevron-down"></span> Mapping Tools </h3> </div> - <div id="collapseThree" class="panel-collapse collapse in"> + <div id="collapseFour" class="panel-collapse collapse in"> <div class="panel-body"> {% include 'show_trait_mapping_tools.html' %} </div> @@ -78,12 +92,12 @@ </div> </div> <div class="panel panel-default"> - <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseFour" aria-expanded="true"> + <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseFive" aria-expanded="true"> <h3 class="panel-title"> <span class="glyphicon glyphicon-chevron-up"></span> Review and Edit Data </h3> </div> - <div id="collapseFour" class="panel-collapse collapse" aria-expanded="true"> + <div id="collapseFive" class="panel-collapse collapse" aria-expanded="true"> <div class="panel-body"> {% include 'show_trait_edit_data.html' %} </div> @@ -134,10 +148,6 @@ <script language="javascript" type="text/javascript" src="/static/new/packages/jsPDF/jspdf.plugin.from_html.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/jquery.dataTables.js"></script> - <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/dataTables.buttons.min.js"></script> - <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.html5.min.js"></script> - <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.bootstrap.min.js"></script> - <script language="javascript" type="text/javascript" src="/static/new/js_external/jszip.min.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/dataTables.scientific.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/dataTables.naturalSort.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.colResize.js"></script> @@ -198,12 +208,12 @@ { "type": "natural" }, { "type": "cust-txt" }, { "bSortable": false }, - { "type": "cust-txt" } + { "type": "cust-txt" }{% if sample_groups[0].attributes|length > 0 %},{% endif %} + {% for attribute in sample_groups[0].attributes %} + { "type": "natural" }{% if loop.index < sample_groups[0].attributes|length %},{% endif %} + {% endfor %} ], - "buttons": [ - 'csv' - ], - "sDom": "RZBtr", + "sDom": "RZtr", "iDisplayLength": -1, "autoWidth": false, "bLengthChange": true, @@ -224,12 +234,12 @@ { "bSortable": false }, { "type": "natural" }, null, - { "type": "cust-txt" } - ], - "buttons": [ - 'csv' + { "type": "cust-txt" }{% if sample_groups[0].attributes|length > 0 %},{% endif %} + {% for attribute in sample_groups[0].attributes %} + { "type": "natural" }{% if loop.index < sample_groups[0].attributes|length %},{% endif %} + {% endfor %} ], - "sDom": "RZBtr", + "sDom": "RZtr", "iDisplayLength": -1, "autoWidth": false, "bLengthChange": true, @@ -244,42 +254,33 @@ } ); {% endif %} - console.log("SAMPLE GROUP TYPES:", js_data.sample_group_types) if (Object.keys(js_data.sample_group_types).length > 1) { $('#stats_table').DataTable( { - "columns": [ - { "bSortable": false }, - { "bSortable": false }, - { "bSortable": false }, - { "bSortable": false } + "columnDefs": [ + { "orderable": false, "targets": [0, 1, 2, 3] } ], - "sDom": "RZtr", + "order": [], + "sDom": "tr", "iDisplayLength": -1, "autoWidth": false, "bLengthChange": true, "bDeferRender": true, "bSortClasses": false, - "colResize": { - "tableWidthFixed": false - }, "paging": false } ); } else { $('#stats_table').DataTable( { - "columns": [ - { "bSortable": false }, - { "bSortable": false } + "columnDefs": [ + { "orderable": false, "targets": [0, 1] } ], - "sDom": "RZtr", + "order": [], + "sDom": "tr", "iDisplayLength": -1, "autoWidth": false, "bLengthChange": true, "bDeferRender": true, "bSortClasses": false, - "colResize": { - "tableWidthFixed": false - }, "paging": false } ); diff --git a/wqflask/wqflask/templates/show_trait_calculate_correlations.html b/wqflask/wqflask/templates/show_trait_calculate_correlations.html index a7edbc48..0e15ce9c 100755 --- a/wqflask/wqflask/templates/show_trait_calculate_correlations.html +++ b/wqflask/wqflask/templates/show_trait_calculate_correlations.html @@ -63,7 +63,7 @@ </div> </div> - <div class="form-group"> + <div id="corr_sample_method" class="form-group"> <label for="corr_sample_method" class="col-xs-1 control-label">Type</label> <div class="col-xs-2 controls"> <select name="corr_sample_method" class="form-control"> @@ -90,19 +90,22 @@ </div> <div class="form-group"> <label class="col-xs-1 control-label">Range</label> - <div class="col-xs-3 controls"> + <div class="col-xs-4 controls"> <input name="p_range_lower" value="" type="hidden"> <input name="p_range_upper" value="" type="hidden"> - <div id="p_range_slider" ></div> - <span style="font: 400 12px Arial; color: #888; display: block; margin: 15px 0;" id="p_range_lower"></span> - <span style="font: 400 12px Arial; color: #888; display: block; margin: 15px 0;" id="p_range_upper"></span> + <span style="display: inline;"> + <div id="p_range_slider" style="width: 200px;"></div> + <span style="font: 400 12px Arial; color: #888; display: inline; margin: 25px 0; width: 20px;" id="p_range_lower"></span> + <span> </span> + <span style="font: 400 12px Arial; color: #888; display: inline; margin: 15px 0; width: 20px;" id="p_range_upper"></span> + </span> </div> </div> <div class="form-group"> <label for="corr_sample_method" class="col-xs-1 control-label"></label> <div class="col-xs-4 controls"> - <button class="btn submit_special btn-primary" data-url="/corr_compute" title="Compute Correlation"> + <button class="btn corr_compute submit_special btn-primary" data-url="/corr_compute" title="Compute Correlation"> <i class="icon-ok-circle icon-white"></i> Compute </button> </div> @@ -112,30 +115,30 @@ <label for="descriptions" class="col-xs-1 control-label"></label> <div class="col-xs-6 controls"> <span id="sample_r_desc" class="correlation_desc fs12"> - The <a href="/correlationAnnotation.html#sample_r" target="_blank">Sample Correlation</a> + The <a href="http://genenetwork.org/correlationAnnotation.html#genetic_r">Sample Correlation</a> is computed between trait data and any other traits in the sample database selected above. Use - <a href="/glossary.html#Correlations" target="_blank">Spearman + <a href="http://www.genenetwork.org/glossary.html#Correlations">Spearman Rank</a> when the sample size is small (<20) or when there are influential outliers. </span> <span id="lit_r_desc" style="display: none;" class="correlation_desc fs12"> - The <a href="/correlationAnnotation.html" target="_blank">Literature Correlation</a> + The <a href="http://genenetwork.org/correlationAnnotation.html#literatureCorr">Literature Correlation</a> (Lit r) between this gene and all other genes is computed<br> - using the <a href="https://grits.eecs.utk.edu/sgo/sgo.html" target="_blank"> + using the <a href="https://grits.eecs.utk.edu/sgo/sgo.html"> Semantic Gene Organizer</a> and human, rat, and mouse data from PubMed. Values are ranked by Lit r, but Sample r and Tissue r are also displayed.<br> - <a href="/glossary.html#Literature" target="_blank">More on using Lit r</a> + <a href="http://genenetwork.org/glossary.html#Literature">More on using Lit r</a> </span> <span id="tissue_r_desc" style="display: none;" class="correlation_desc fs12"> - The <a href="/webqtl/main.py?FormID=tissueCorrelation" target="_blank">Tissue Correlation</a> + The <a href="http://genenetwork.org/webqtl/main.py?FormID=tissueCorrelation">Tissue Correlation</a> (Tissue r) estimates the similarity of expression of two genes or transcripts across different cells, tissues, or organs - (<a href="/correlationAnnotation.html#tissue_r" target="_blank">glossary</a>). + (<a href="http://genenetwork.org/correlationAnnotation.html#tissueCorr">glossary</a>). Tissue correlations are generated by analyzing expression in multiple samples usually taken from single cases.<br> <strong>Pearson</strong> and <strong>Spearman Rank</strong> correlations have been diff --git a/wqflask/wqflask/templates/show_trait_details.html b/wqflask/wqflask/templates/show_trait_details.html index 16c5dc47..d5fb0cf2 100755 --- a/wqflask/wqflask/templates/show_trait_details.html +++ b/wqflask/wqflask/templates/show_trait_details.html @@ -1,71 +1,81 @@ -<dl class="dl-horizontal"> - <dt>Species</dt> - <dd>{{ this_trait.dataset.group.species }}</dd> - <dt>Group</dt> - <dd>{{ this_trait.dataset.group.name }}</dd> - <dt>Tissue</dt> - <dd>{{ this_trait.dataset.tissue }}</dd> +<table class="table"> + <tr> + <td>Species</td> + <td>{{ this_trait.dataset.group.species }}</td> + </tr> + <tr> + <td>Group</td> + <td>{{ this_trait.dataset.group.name }}</td> + </tr> + <tr> + <td>Tissue</td> + <td>{{ this_trait.dataset.tissue }}</td> + </tr> {% if this_trait.dataset.type == 'ProbeSet' %} - <dt>Aliases</dt> - <dd>{{ this_trait.alias_fmt }}</dd> + <tr> + <td>Aliases</td> + <td>{{ this_trait.alias_fmt|replace(",",";") }}</td> + </tr> {% endif %} - {% if this_trait.dataset.type != 'Publish' %} - <dt>Location</dt> - <dd>{{ this_trait.location_fmt }}</dd> + <tr> + <td>Location</td> + <td>{{ this_trait.location_fmt }}</td> + </tr> {% endif %} - - <dt>Database</dt> - <dd> - <a href="{{ url_for('static', filename='dbdoc/' + dataset.fullname + '.html') }}" target="_blank"> - {{ dataset.name }} - </a> - </dd> - + <tr> + <td>Database</td> + <td> + <a href="http://genenetwork.org/dbdoc/{{ dataset.name }}.html"> + {{ dataset.fullname }} + </a> + </td> + </tr> {% if this_trait.probe_set_specificity %} - <dt> - <a href="/blatInfo.html" target="_blank" - title="Values higher than 2 for the specificity are good"> - BLAT Specificity - </a> - </dt> - <dd>{{ "%0.3f" | format(this_trait.probe_set_specificity|float) }}</dd> + <tr> + <td>Target Score</td> + <td> + <a href="http://genenetwork.org/blatInfo.html" title="Values higher than 2 for the specificity are good"> + BLAT Specificity + </a>: + {{ "%0.3f" | format(this_trait.probe_set_specificity|float) }} + + {% if this_trait.probe_set_blat_score %} + Score: {{ "%0.3f" | format(this_trait.probe_set_blat_score|float) }} + {% endif %} + </td> + </tr> {% endif %} - {% if this_trait.probe_set_blat_score %} - <dt>BLAT Score</dt> - <dd>{{ "%0.3f" | format(this_trait.probe_set_blat_score|float) }}</dd> - {% endif %} - <dt>Resource Links</dt> - {% if this_trait.dataset.type == 'ProbeSet' %} - <dd> - {% if this_trait.geneid != None %} - <a href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=gene&cmd=Retrieve&dopt=Graphics&list_uids={{ this_trait.geneid }}" target="_blank" title="Info from NCBI Entrez Gene"> - Gene - </a> - + <tr> + <td>Resource Links</td> + <td> + {% if this_trait.geneid != None %} + <a href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=gene&cmd=Retrieve&dopt=Graphics&list_uids={{ this_trait.geneid }}" title="Info from NCBI Entrez Gene"> + Gene + </a> + + {% endif %} + {% if this_trait.omim != None %} + <a href="http://www.ncbi.nlm.nih.gov/omim/{{ this_trait.omim }}" title="Summary from On Mendelion Inheritance in Man"> + OMIM + </a> + + {% endif %} + {% if this_trait.genbankid != None %} + <a href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=Nucleotide&cmd=search&doptcmdl=DocSum&term={{ this_trait.genbankid }}" title="Find the original GenBank sequence used to design the probes"> + GenBank + </a> + + {% endif %} + {% if this_trait.symbol != None %} + <a href="http://www.genotation.org/Getd2g.pl?gene_list={{ this_trait.symbol }}" title="Related descriptive, genomic, clinical, functional and drug-therapy information"> + Genotation + </a> + {% endif %} - {% if this_trait.omim != None %} - <a href="http://www.ncbi.nlm.nih.gov/omim/{{ this_trait.omim }}" target="_blank" title="Summary from On Mendelion Inheritance in Man"> - OMIM - </a> - - {% endif %} - {% if this_trait.genbankid != None %} - <a href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=Nucleotide&cmd=search&doptcmdl=DocSum&term={{ this_trait.genbankid }}" target="_blank" title="Find the original GenBank sequence used to design the probes"> - GenBank - </a> - - {% endif %} - {% if this_trait.symbol != None %} - <a href="http://www.genotation.org/Getd2g.pl?gene_list={{ this_trait.symbol }}" target="_blank" title="Related descriptive, genomic, clinical, functional and drug-therapy information"> - Genotation - </a> - - {% endif %} - </dd> - {% endif %} -</dl> - + </td> + </tr> +</table> <div style="margin-bottom:15px;" class="btn-toolbar"> <div class="btn-group"> @@ -76,40 +86,40 @@ </a> {% if this_trait.dataset.type == 'ProbeSet' %} {% if this_trait.symbol != None %} - <a href="#redirect" onclick="window.open('http://www.genenetwork.org/webqtl/main.py?cmd=sch&gene={{ this_trait.symbol }}&alias=1&species={{ species_name }}')"> + <a href="http://www.genenetwork.org/webqtl/main.py?cmd=sch&gene={{ this_trait.symbol }}&alias=1&species={{ species_name }}"> <button type="button" class="btn btn-default" title="Find similar expression data"> <i class="icon-search"></i> Find </button> </a> {% endif %} {% if UCSC_BLAT_URL != "" %} - <a href="#redirect" onclick="window.open('{{ UCSC_BLAT_URL }}')"> + <a href="{{ UCSC_BLAT_URL }}"> <button type="button" class="btn btn-default" title="Check probe locations at UCSC"> <i class="icon-ok"></i> Verify </button> </a> {% endif %} {% if this_trait.symbol != None %} - <a href="#redirect" onclick="window.open('http://genenetwork.org/webqtl/main.py?FormID=geneWiki&symbol={{ this_trait.symbol }}')"> + <a href="http://genenetwork.org/webqtl/main.py?FormID=geneWiki&symbol={{ this_trait.symbol }}"> <button type="button" class="btn btn-default" title="Write or review comments about this gene"> <i class="icon-edit"></i> GeneWiki </button> </a> - <a href="#redirect" onclick="window.open('http://genenetwork.org/webqtl/main.py?FormID=SnpBrowserResultPage&submitStatus=1&diffAlleles=True&customStrain=True&geneName={{ this_trait.symbol }}')"> + <a href="http://genenetwork.org/webqtl/main.py?FormID=SnpBrowserResultPage&submitStatus=1&diffAlleles=True&customStrain=True&geneName={{ this_trait.symbol }}"> <button type="button" class="btn btn-default" title="View SNPs and Indels"> <i class="icon-road"></i> SNPs </button> </a> {% endif %} {% if UTHSC_BLAT_URL != "" %} - <a href="#redirect" onclick="window.open('{{ UTHSC_BLAT_URL }}')"> + <a href="{{ UTHSC_BLAT_URL }}"> <button type="button" class="btn btn-default" title="View probes, SNPs, and RNA-seq at UTHSC"> <i class="icon-eye-close"></i> RNA-seq </button> </a> {% endif %} {% if show_probes == "True" %} - <a href="#redirect" onclick="window.open('http://genenetwork.org/webqtl/main.py?FormID=showProbeInfo&database={{ this_trait.dataset.name }}&ProbeSetID={{ this_trait.name }}&CellID={{ this_trait.cellid }}&RISet={{ dataset.group.name }}&incparentsf1=ON')"> + <a href="http://genenetwork.org/webqtl/main.py?FormID=showProbeInfo&database={{ this_trait.dataset.name }}&ProbeSetID={{ this_trait.name }}&CellID={{ this_trait.cellid }}&RISet={{ dataset.group.name }}&incparentsf1=ON"> <button type="button" class="btn btn-default" title="Check sequence of probes"> <i class="icon-list"></i> Probes </button> diff --git a/wqflask/wqflask/templates/show_trait_edit_data.html b/wqflask/wqflask/templates/show_trait_edit_data.html index d39df976..ff5f0c87 100755 --- a/wqflask/wqflask/templates/show_trait_edit_data.html +++ b/wqflask/wqflask/templates/show_trait_edit_data.html @@ -75,22 +75,22 @@ <!--<div id="edit_sample_lists">--> {% for sample_type in sample_groups %} - <div class="sample_group" style="width:50%;"> + <div class="sample_group" style="width:{{ trait_table_width }}%;"> <h3>{{ sample_type.header }}</h3> - + <div id="table_container" style="background-color: #eeeeee; border: 1px solid black;"> <table class="table-hover table-striped" id="samples_{{ sample_type.sample_group_type }}" style="float: left;"> <thead> <tr> - <th></th> - <th>Index</th> - <th>Sample</th> - <th>Value</th> + <th style="background-color: #eeeeee;"></th> + <th style="background-color: #eeeeee;">Index</th> + <th style="background-color: #eeeeee;">Sample</th> + <th style="background-color: #eeeeee;">Value</th> {% if sample_type.se_exists() %} - <th> </th> - <th>SE</th> + <th style="background-color: #eeeeee;"> </th> + <th style="background-color: #eeeeee;">SE</th> {% endif %} {% for attribute in sample_type.attributes|sort() %} - <th> + <th style="background-color: #eeeeee;"> {{ sample_type.attributes[attribute].name }} </th> {% endfor %} @@ -144,6 +144,7 @@ {% endfor %} </tbody> </table> + </div> </div> {% endfor %} <!--</div>--> diff --git a/wqflask/wqflask/templates/show_trait_mapping_tools.html b/wqflask/wqflask/templates/show_trait_mapping_tools.html index c23cb010..3d9c2521 100755 --- a/wqflask/wqflask/templates/show_trait_mapping_tools.html +++ b/wqflask/wqflask/templates/show_trait_mapping_tools.html @@ -6,13 +6,13 @@ <ul class="nav nav-pills"> {% if use_pylmm_rqtl and not use_plink_gemma and dataset.group.species != "human" %} <li class="active"> - <a href="#pylmm" data-toggle="tab">pyLMM</a> + <a href="#interval_mapping" data-toggle="tab">Interval Mapping</a> </li> <li> - <a href="#rqtl_geno" data-toggle="tab">R/qtl</a> + <a href="#pylmm" data-toggle="tab">pyLMM</a> </li> <li> - <a href="#interval_mapping" data-toggle="tab">Interval Mapping</a> + <a href="#rqtl_geno" data-toggle="tab">R/qtl</a> </li> {% endif %} {% if use_plink_gemma %} @@ -30,7 +30,89 @@ <div class="tab-content"> {% if use_pylmm_rqtl and not use_plink_gemma and dataset.group.species != "human" %} - <div class="tab-pane active" id="pylmm"> + <div class="tab-pane active" id="interval_mapping"> + <div style="margin-top: 20px" class="form-horizontal"> + <div class="mapping_method_fields form-group"> + <label for="mapping_permutations" class="col-xs-3 control-label">Permutations</label> + <div style="margin-left: 20px;" class="col-xs-4 controls"> + <input name="num_perm_reaper" value="2000" type="text" class="form-control"> + </div> + </div> + <div class="mapping_method_fields form-group"> + <label for="mapping_bootstraps" class="col-xs-3 control-label">Bootstraps</label> + <div style="margin-left: 20px;" class="col-xs-4 controls"> + <input name="num_bootstrap" value="2000" type="text" class="form-control"> + </div> + </div> + <div class="mapping_method_fields form-group"> + <label for="control_for" class="col-xs-3 control-label">Control for</label> + <div style="margin-left: 20px;" class="col-xs-4 controls"> + {% if dataset.type == 'ProbeSet' and this_trait.locus_chr != "" %} + <input name="control_reaper" value="{{ nearest_marker }}" type="text" style="width: 160px;" class="form-control" /> + {% else %} + <input name="control_reaper" value="" type="text" class="form-control" /> + {% endif %} + <label class="radio-inline"> + <input type="radio" name="do_control_reaper" value="true"> + Yes + </label> + <label class="radio-inline"> + <input type="radio" name="do_control_reaper" value="false" checked=""> + No + </label> + </div> + </div> + +<!-- + <div class="mapping_method_fields form-group"> + <label for="mapping_bootstraps" class="col-xs-3 control-label" title="Bootstrapping Resamples">Bootstrap Test (n=2000)</label> + <div class="col-xs-4 controls"> + <label> + <input type="checkbox" name="bootCheck" id="bootCheck"> Bootstrap Test (n=2000) + </label> + </div> + </div> + + <div class="mapping_method_fields form-group"> + <label style="text-align:left;" class="col-xs-12 control-label">Display Additive Effect</label> + <div class="col-xs-12 controls" id="display_additive_effect"> + <label class="radio-inline"> + <input type="radio" name="display_additive" id="display_additive" value="yes" checked=""> + Yes + </label> + <label class="radio-inline"> + <input type="radio" name="display_additive" id="display_additive" value="no"> + No + </label> + </div> + </div> +--> + + + <div class="mapping_method_fields form-group"> + <label style="text-align:left;" class="col-xs-12 control-label">Marker Regr.</label> + <div class="col-xs-12 controls"> + <label class="radio-inline"> + <input type="radio" name="manhattan_plot_reaper" value="True"> + Yes + </label> + <label class="radio-inline"> + <input type="radio" name="manhattan_plot_reaper" value="False" checked=""> + No + </label> + </div> + </div> + <div class="form-group"> + <div style="padding-left:15px;" class="controls"> + <button id="interval_mapping_compute" class="btn submit_special btn-primary" data-url="/marker_regression" title="Compute Interval Mapping"> + <i class="icon-ok-circle icon-white"></i> Compute + </button> + </div> + </div> + <!--<div id="alert_placeholder"></div>--> + </div> + </div> + <div class="tab-pane" id="pylmm"> <div style="margin-top: 20px" class="form-horizontal"> <div class="mapping_method_fields form-group"> <label for="mapping_permutations" class="col-xs-3 control-label">Permutations</label> @@ -66,11 +148,11 @@ <label style="text-align:left;" class="col-xs-12 control-label">Manhattan Plot</label> <div class="col-xs-12 controls"> <label class="radio-inline"> - <input type="radio" name="manhattan_plot_pylmm" value="true"> + <input type="radio" name="manhattan_plot_pylmm" value="True"> Yes </label> <label class="radio-inline"> - <input type="radio" name="manhattan_plot_pylmm" value="false" checked=""> + <input type="radio" name="manhattan_plot_pylmm" value="False" checked=""> No </label> </div> @@ -160,11 +242,11 @@ <label style="text-align:left;" class="col-xs-12 control-label">Manhattan Plot</label> <div class="col-xs-12 controls"> <label class="radio-inline"> - <input type="radio" name="manhattan_plot_rqtl" value="true"> + <input type="radio" name="manhattan_plot_rqtl" value="True"> Yes </label> <label class="radio-inline"> - <input type="radio" name="manhattan_plot_rqtl" value="false" checked=""> + <input type="radio" name="manhattan_plot_rqtl" value="False" checked=""> No </label> </div> @@ -179,85 +261,13 @@ </div> </div> </div> - <div class="tab-pane" id="interval_mapping"> - <div style="margin-top: 20px" class="form-horizontal"> - <div class="mapping_method_fields form-group"> - <label for="mapping_permutations" class="col-xs-3 control-label">Permutations</label> - <div style="margin-left: 20px;" class="col-xs-4 controls"> - <input name="num_perm_reaper" value="2000" type="text" class="form-control"> - </div> - </div> - <div class="mapping_method_fields form-group"> - <label for="control_for" class="col-xs-3 control-label">Control for</label> - <div style="margin-left: 20px;" class="col-xs-4 controls"> - {% if dataset.type == 'ProbeSet' and this_trait.locus_chr != "" %} - <input name="control_reaper" value="{{ nearest_marker }}" type="text" style="width: 160px;" class="form-control" /> - {% else %} - <input name="control_reaper" value="" type="text" class="form-control" /> - {% endif %} - <label class="radio-inline"> - <input type="radio" name="do_control_reaper" value="true"> - Yes - </label> - <label class="radio-inline"> - <input type="radio" name="do_control_reaper" value="false" checked=""> - No - </label> - </div> - </div> -<!-- - <div class="mapping_method_fields form-group"> - <label for="mapping_bootstraps" class="col-xs-3 control-label" title="Bootstrapping Resamples">Bootstrap</label> - <div style="margin-left: 20px;" class="col-xs-4 controls"> - <input name="mapping_bootstraps" value="2000" type="text" class="form-control"> - </div> - </div> - - <div class="mapping_method_fields form-group"> - <label style="text-align:left;" class="col-xs-12 control-label">Display Additive Effect</label> - <div class="col-xs-12 controls" id="display_additive_effect"> - <label class="radio-inline"> - <input type="radio" name="display_additive" id="display_additive" value="yes" checked=""> - Yes - </label> - <label class="radio-inline"> - <input type="radio" name="display_additive" id="display_additive" value="no"> - No - </label> - </div> - </div> ---> - - <div class="mapping_method_fields form-group"> - <label style="text-align:left;" class="col-xs-12 control-label">Manhattan Plot</label> - <div class="col-xs-12 controls"> - <label class="radio-inline"> - <input type="radio" name="manhattan_plot_reaper" value="true"> - Yes - </label> - <label class="radio-inline"> - <input type="radio" name="manhattan_plot_reaper" value="false" checked=""> - No - </label> - </div> - </div> - <div class="form-group"> - <div style="padding-left:15px;" class="controls"> - <button id="interval_mapping_compute" class="btn submit_special btn-primary" data-url="/marker_regression" title="Compute Interval Mapping"> - <i class="icon-ok-circle icon-white"></i> Compute - </button> - </div> - </div> - <!--<div id="alert_placeholder"></div>--> - </div> - </div> {% endif %} {% if use_plink_gemma %} <div class="tab-pane" id="plink"> <div style="padding: 20px" class="form-horizontal"> <div class="mapping_method_fields form-group"> - <label for="maf_plink" class="col-xs-2 control-label">Minor allele threshold</label> - <div style="margin-left: 20px;" class="col-xs-2 controls"> + <label for="maf_plink" class="col-xs-3 control-label">Minor allele threshold</label> + <div style="margin-left: 20px;" class="col-xs-3 controls"> <input name="maf_plink" value="0.01" type="text" class="form-control"> </div> </div> @@ -276,8 +286,8 @@ <div class="tab-pane" id="gemma"> <div style="padding: 20px" class="form-horizontal"> <div class="mapping_method_fields form-group"> - <label for="maf_gemma" class="col-xs-2 control-label">Minor allele threshold</label> - <div style="margin-left: 20px;" class="col-xs-2 controls"> + <label for="maf_gemma" class="col-xs-3 control-label">Minor allele threshold</label> + <div style="margin-left: 20px;" class="col-xs-3 controls"> <input name="maf_gemma" value="0.01" type="text" class="form-control"> </div> </div> diff --git a/wqflask/wqflask/templates/show_trait_statistics.html b/wqflask/wqflask/templates/show_trait_statistics.html index 2183dd30..3ee8bdea 100755 --- a/wqflask/wqflask/templates/show_trait_statistics.html +++ b/wqflask/wqflask/templates/show_trait_statistics.html @@ -26,8 +26,7 @@ <div class="tab-content"> <div class="tab-pane active" id="stats_tab"> <div style="padding: 20px" class="form-horizontal"> - <table id="stats_table" style="width: 300px; float: left;" class="table table-hover table-striped"></table> - + <table border="1" id="stats_table" style="width: 300px; float: left;" class="table table-hover table-striped cell-border"></table> </div> </div> <div class="tab-pane" id="histogram_tab"> @@ -109,8 +108,8 @@ </div> <div> - More about <a href="http://en.wikipedia.org/wiki/Normal_probability_plot" target="_blank">Normal Probability Plots</a> and more - about interpreting these plots from the <a href="/glossary.html#normal_probability" target="_blank">glossary</a> + More about <a href="http://en.wikipedia.org/wiki/Normal_probability_plot">Normal Probability Plots</a> and more + about interpreting these plots from the <a href="http://genenetwork.org/glossary.html#normal_probability">glossary</a> </div> </div> diff --git a/wqflask/wqflask/templates/wgcna_setup.html b/wqflask/wqflask/templates/wgcna_setup.html index 8ab8c4a0..b4a5730d 100644 --- a/wqflask/wqflask/templates/wgcna_setup.html +++ b/wqflask/wqflask/templates/wgcna_setup.html @@ -17,36 +17,36 @@ {% else %} <form action="/wgcna_results" method="post" class="form-horizontal"> <input type="hidden" name="trait_list" id="trait_list" value= "{{request.form['trait_list']}}"> - <div class="form-group"> + <div class="form-group"> <label for="SoftThresholds"> Soft threshold: </label> <div class="col-sm-10"> <input type="text" class="form-inline" name="SoftThresholds" id="SoftThresholds" value="1,2,3,4,5,6,7,8,9"> </div> </div> - <div class="form-group"> + <div class="form-group"> <label for="MinModuleSize"> Minimum module size: </label> <div class="col-sm-10"> <input type="text" class="form-inline" name="MinModuleSize" id="MinModuleSize" value="30"> </div> </div> - <div class="form-group"> + <div class="form-group"> <label for="TOMtype"> TOMtype: </label> <div class="col-sm-10"> <input type="text" class="form-inline" name="TOMtype" id="TOMtype" value="unsigned"> </div> - </div> - <div class="form-group"> + </div> + <div class="form-group"> <label for="mergeCutHeight"> mergeCutHeight: </label> <div class="col-sm-10"> <input type="text" class="form-inline" name="mergeCutHeight" id="mergeCutHeight" value="0.25"> </div> - </div> - <div class="form-group"> + </div> + <div class="form-group"> <div class="col-sm-10"> <input type="submit" class="btn btn-primary" value="Run WGCNA using these settings" /> </div> - </div> - </form> + </div> + </form> {% endif %} </div> {% endblock %} diff --git a/wqflask/wqflask/update_search_results.py b/wqflask/wqflask/update_search_results.py new file mode 100644 index 00000000..ffd7fd51 --- /dev/null +++ b/wqflask/wqflask/update_search_results.py @@ -0,0 +1,129 @@ +from __future__ import absolute_import, print_function, division + +import json + +from flask import Flask, g +from base.data_set import create_dataset +from base.trait import GeneralTrait +from dbFunction import webqtlDatabaseFunction + +from utility.benchmark import Bench + +class GSearch(object): + + def __init__(self, kw): + self.type = kw['type'] + self.terms = kw['terms'] + #self.row_range = kw['row_range'] + if self.type == "gene": + sql = """ + SELECT + Species.`Name` AS species_name, + InbredSet.`Name` AS inbredset_name, + Tissue.`Name` AS tissue_name, + ProbeSetFreeze.Name AS probesetfreeze_name, + ProbeSet.Name AS probeset_name, + ProbeSet.Symbol AS probeset_symbol, + ProbeSet.`description` AS probeset_description, + ProbeSet.Chr AS chr, + ProbeSet.Mb AS mb, + ProbeSetXRef.Mean AS mean, + ProbeSetXRef.LRS AS lrs, + ProbeSetXRef.`Locus` AS locus, + ProbeSetXRef.`pValue` AS pvalue, + ProbeSetXRef.`additive` AS additive + FROM Species, InbredSet, ProbeSetXRef, ProbeSet, ProbeFreeze, ProbeSetFreeze, Tissue + WHERE InbredSet.`SpeciesId`=Species.`Id` + AND ProbeFreeze.InbredSetId=InbredSet.`Id` + AND ProbeFreeze.`TissueId`=Tissue.`Id` + AND ProbeSetFreeze.ProbeFreezeId=ProbeFreeze.Id + AND ( MATCH (ProbeSet.Name,ProbeSet.description,ProbeSet.symbol,alias,GenbankId, UniGeneId, Probe_Target_Description) AGAINST ('%s' IN BOOLEAN MODE) ) + AND ProbeSet.Id = ProbeSetXRef.ProbeSetId + AND ProbeSetXRef.ProbeSetFreezeId=ProbeSetFreeze.Id + AND ProbeSetFreeze.public > 0 + ORDER BY species_name, inbredset_name, tissue_name, probesetfreeze_name, probeset_name + LIMIT 6000 + """ % (self.terms) + with Bench("Running query"): + re = g.db.execute(sql).fetchall() + self.trait_list = [] + with Bench("Creating trait objects"): + for line in re: + dataset = create_dataset(line[3], "ProbeSet", get_samplelist=False) + trait_id = line[4] + #with Bench("Building trait object"): + this_trait = GeneralTrait(dataset=dataset, name=trait_id, get_qtl_info=True, get_sample_info=False) + self.trait_list.append(this_trait) + + elif self.type == "phenotype": + sql = """ + SELECT + Species.`Name`, + InbredSet.`Name`, + PublishFreeze.`Name`, + PublishXRef.`Id`, + Phenotype.`Post_publication_description`, + Publication.`Authors`, + Publication.`Year`, + PublishXRef.`LRS`, + PublishXRef.`Locus`, + PublishXRef.`additive` + FROM Species,InbredSet,PublishFreeze,PublishXRef,Phenotype,Publication + WHERE PublishXRef.`InbredSetId`=InbredSet.`Id` + AND PublishFreeze.`InbredSetId`=InbredSet.`Id` + AND InbredSet.`SpeciesId`=Species.`Id` + AND PublishXRef.`PhenotypeId`=Phenotype.`Id` + AND PublishXRef.`PublicationId`=Publication.`Id` + AND (Phenotype.Post_publication_description REGEXP "[[:<:]]%s[[:>:]]" + OR Phenotype.Pre_publication_description REGEXP "[[:<:]]%s[[:>:]]" + OR Phenotype.Pre_publication_abbreviation REGEXP "[[:<:]]%s[[:>:]]" + OR Phenotype.Post_publication_abbreviation REGEXP "[[:<:]]%s[[:>:]]" + OR Phenotype.Lab_code REGEXP "[[:<:]]%s[[:>:]]" + OR Publication.PubMed_ID REGEXP "[[:<:]]%s[[:>:]]" + OR Publication.Abstract REGEXP "[[:<:]]%s[[:>:]]" + OR Publication.Title REGEXP "[[:<:]]%s[[:>:]]" + OR Publication.Authors REGEXP "[[:<:]]%s[[:>:]]" + OR PublishXRef.Id REGEXP "[[:<:]]%s[[:>:]]") + ORDER BY Species.`Name`, InbredSet.`Name`, PublishXRef.`Id` + LIMIT 6000 + """ % (self.terms, self.terms, self.terms, self.terms, self.terms, self.terms, self.terms, self.terms, self.terms, self.terms) + re = g.db.execute(sql).fetchall() + self.trait_list = [] + with Bench("Creating trait objects"): + for line in re: + dataset = create_dataset(line[2], "Publish") + trait_id = line[3] + this_trait = GeneralTrait(dataset=dataset, name=trait_id, get_qtl_info=True, get_sample_info=False) + self.trait_list.append(this_trait) + + self.results = self.convert_to_json() + + def convert_to_json(self): + json_dict = {} + #json_dict['draw'] = self.draw, + json_dict['recordsTotal'] = len(self.trait_list), + json_dict['data'] = [] + + for i, trait in enumerate(self.trait_list): + trait_row = { "checkbox": "<INPUT TYPE=\"checkbox\" NAME=\"searchResult\" class=\"checkbox trait_checkbox\" style=\"transform: scale(1.5);\" VALUE=\"{}:{}\">".format(trait.name, trait.dataset.name), + "index": i+1, + "species": trait.dataset.group.species, + "group": trait.dataset.group.name, + "tissue": trait.dataset.tissue, + "dataset": trait.dataset.fullname, + "record": "<a href=\"/show_trait?trait_id=" + trait.name + "&dataset=" + trait.dataset.name + "\" target=\"_blank\">" + trait.name + "</a>", + "symbol": trait.symbol, + "description": trait.description_display, + "location": trait.location_repr, + "mean": trait.mean, + "max_lrs": trait.LRS_score_repr, + "max_lrs_location": trait.LRS_location_repr, + "additive_effect": trait.additive} + json_dict['data'].append(trait_row) + + json_results = json.dumps(json_dict) + return json_results + + + + diff --git a/wqflask/wqflask/user_manager.py b/wqflask/wqflask/user_manager.py index e16a397d..e334a9aa 100755 --- a/wqflask/wqflask/user_manager.py +++ b/wqflask/wqflask/user_manager.py @@ -12,6 +12,7 @@ import os import hashlib import datetime import time +import logging import uuid import hashlib @@ -141,6 +142,9 @@ class UserSession(object): """Actual sqlalchemy record""" # Only look it up once if needed, then store it try: + logging.basicConfig() + logging.getLogger('sqlalchemy.pool').setLevel(logging.DEBUG) + # Already did this before return self.db_object except AttributeError: diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 89b7ba43..df1f77bc 100755..100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -30,10 +30,11 @@ import sqlalchemy from wqflask import app from flask import (render_template, request, make_response, Response, - Flask, g, config, jsonify, redirect, url_for) + Flask, g, config, jsonify, redirect, url_for, send_from_directory) from wqflask import search_results from wqflask import gsearch +from wqflask import update_search_results from wqflask import docs from wqflask import news from base.data_set import DataSet # Used by YAML in marker_regression @@ -48,10 +49,13 @@ from wqflask.correlation_matrix import show_corr_matrix from wqflask.correlation import corr_scatter_plot from wqflask.wgcna import wgcna_analysis +from wqflask.ctl import ctl_analysis from utility import temp_data +from utility.tools import TEMPDIR from base import webqtlFormData +from base.webqtlConfig import GENERATED_IMAGE_DIR from utility.benchmark import Bench from pprint import pformat as pf @@ -96,7 +100,7 @@ def tmp_page(img_path): print("img_path:", img_path) initial_start_vars = request.form print("initial_start_vars:", initial_start_vars) - imgfile = open(webqtlConfig.TMPDIR + img_path, 'rb') + imgfile = open(GENERATED_IMAGE_DIR + img_path, 'rb') imgdata = imgfile.read() imgB64 = imgdata.encode("base64") bytesarray = array.array('B', imgB64) @@ -151,9 +155,7 @@ def search_page(): Redis.set(key, pickle.dumps(result, pickle.HIGHEST_PROTOCOL)) Redis.expire(key, 60*60) - if result['quick']: - return render_template("quick_search.html", **result) - elif result['search_term_exists']: + if result['search_term_exists']: return render_template("search_result_page.html", **result) else: return render_template("search_error.html") @@ -166,12 +168,27 @@ def gsearchact(): return render_template("gsearch_gene.html", **result) elif type == "phenotype": return render_template("gsearch_pheno.html", **result) + +@app.route("/gsearch_updating", methods=('POST',)) +def gsearch_updating(): + print("REQUEST ARGS:", request.values) + result = update_search_results.GSearch(request.args).__dict__ + return result['results'] + # type = request.args['type'] + # if type == "gene": + # return render_template("gsearch_gene_updating.html", **result) + # elif type == "phenotype": + # return render_template("gsearch_pheno.html", **result) @app.route("/docedit") def docedit(): doc = docs.Docs(request.args['entry']) return render_template("docedit.html", **doc.__dict__) +@app.route('/generated/<filename>') +def generated_file(filename): + return send_from_directory(GENERATED_IMAGE_DIR,filename) + @app.route("/help") def help(): doc = docs.Docs("help") @@ -190,6 +207,18 @@ def wcgna_results(): result = wgcna.process_results(wgcnaA) # After the analysis is finished store the result return render_template("wgcna_results.html", **result) # Display them using the template +@app.route("/ctl_setup", methods=('POST',)) +def ctl_setup(): + print("In ctl, request.form is:", request.form) # We are going to get additional user input for the analysis + return render_template("ctl_setup.html", **request.form) # Display them using the template + +@app.route("/ctl_results", methods=('POST',)) +def ctl_results(): + print("In ctl, request.form is:", request.form) + ctl = ctl_analysis.CTL() # Start R, load the package and pointers and create the analysis + ctlA = ctl.run_analysis(request.form) # Start the analysis, a ctlA object should be a separate long running thread + result = ctl.process_results(ctlA) # After the analysis is finished store the result + return render_template("ctl_results.html", **result) # Display them using the template @app.route("/news") def news_route(): @@ -236,13 +265,15 @@ def export_trait_excel(): for i, row in enumerate(sample_data): worksheet.write(i, 0, row[0]) worksheet.write(i, 1, row[1]) + if len(row) > 2: + worksheet.write(i, 2, row[2]) workbook.close() excel_data = buff.getvalue() buff.close() return Response(excel_data, mimetype='application/vnd.ms-excel', - headers={"Content-Disposition":"attachment;filename=test.xlsx"}) + headers={"Content-Disposition":"attachment;filename=sample_data.xlsx"}) @app.route('/export_trait_csv', methods=('POST',)) def export_trait_csv(): @@ -262,7 +293,30 @@ def export_trait_csv(): return Response(csv_data, mimetype='text/csv', - headers={"Content-Disposition":"attachment;filename=test.csv"}) + headers={"Content-Disposition":"attachment;filename=sample_data.csv"}) + +@app.route('/export_perm_data', methods=('POST',)) +def export_perm_data(): + """CSV file consisting of the permutation data for the mapping results""" + num_perm = float(request.form['num_perm']) + perm_data = json.loads(request.form['perm_results']) + + buff = StringIO.StringIO() + writer = csv.writer(buff) + writer.writerow(["Suggestive LRS (p=0.63) = " + str(perm_data[int(num_perm*0.37-1)])]) + writer.writerow(["Significant LRS (p=0.05) = " + str(perm_data[int(num_perm*0.95-1)])]) + writer.writerow(["Highly Significant LRS (p=0.01) = " + str(perm_data[int(num_perm*0.99-1)])]) + writer.writerow("") + writer.writerow([str(num_perm) + " Permutations"]) + writer.writerow("") + for item in perm_data: + writer.writerow([item]) + csv_data = buff.getvalue() + buff.close() + + return Response(csv_data, + mimetype='text/csv', + headers={"Content-Disposition":"attachment;filename=perm_data.csv"}) @app.route("/show_trait") def show_trait_page(): @@ -339,17 +393,35 @@ def marker_regression_page(): 'trait_id', 'dataset', 'method', + 'trimmed_markers', 'selected_chr', + 'chromosomes', 'mapping_scale', 'score_type', 'suggestive', + 'significant', 'num_perm', + 'permCheck', + 'perm_output', + 'num_bootstrap', + 'bootCheck', + 'bootstrap_results', + 'LRSCheck', 'maf', 'manhattan_plot', 'control_marker', 'control_marker_db', 'do_control', 'pair_scan', + 'startMb', + 'endMb', + 'graphWidth', + 'lrsMax', + 'additiveCheck', + 'showSNP', + 'showGenes', + 'viewLegend', + 'haplotypeAnalystCheck', 'mapmethod_rqtl_geno', 'mapmodel_rqtl_geno' ) @@ -376,42 +448,56 @@ def marker_regression_page(): result = pickle.loads(result) else: print("Cache miss!!!") - template_vars = marker_regression.MarkerRegression(start_vars, temp_uuid) + with Bench("Total time in MarkerRegression"): + template_vars = marker_regression.MarkerRegression(start_vars, temp_uuid) template_vars.js_data = json.dumps(template_vars.js_data, default=json_default_handler, indent=" ") result = template_vars.__dict__ - #print("initial result:", result['qtl_results']) - #for item in template_vars.__dict__.keys(): - # print(" ---**--- {}: {}".format(type(template_vars.__dict__[item]), item)) - - gn1_template_vars = marker_regression_gn1.MarkerRegression(result).__dict__ - - #qtl_length = len(result['js_data']['qtl_results']) - #print("qtl_length:", qtl_length) - pickled_result = pickle.dumps(result, pickle.HIGHEST_PROTOCOL) - print("pickled result length:", len(pickled_result)) - Redis.set(key, pickled_result) - Redis.expire(key, 1*60) - - with Bench("Rendering template"): - if result['pair_scan'] == True: - img_path = result['pair_scan_filename'] - print("img_path:", img_path) - initial_start_vars = request.form - print("initial_start_vars:", initial_start_vars) - imgfile = open('/home/zas1024/tmp/' + img_path, 'rb') - imgdata = imgfile.read() - imgB64 = imgdata.encode("base64") - bytesarray = array.array('B', imgB64) - result['pair_scan_array'] = bytesarray - rendered_template = render_template("pair_scan_results.html", **result) + if result['pair_scan']: + with Bench("Rendering template"): + img_path = result['pair_scan_filename'] + print("img_path:", img_path) + initial_start_vars = request.form + print("initial_start_vars:", initial_start_vars) + imgfile = open(TEMPDIR + img_path, 'rb') + imgdata = imgfile.read() + imgB64 = imgdata.encode("base64") + bytesarray = array.array('B', imgB64) + result['pair_scan_array'] = bytesarray + rendered_template = render_template("pair_scan_results.html", **result) else: - #rendered_template = render_template("marker_regression.html", **result) - rendered_template = render_template("marker_regression_gn1.html", **gn1_template_vars) + #for item in template_vars.__dict__.keys(): + # print(" ---**--- {}: {}".format(type(template_vars.__dict__[item]), item)) + + gn1_template_vars = marker_regression_gn1.MarkerRegression(result).__dict__ + + pickled_result = pickle.dumps(result, pickle.HIGHEST_PROTOCOL) + print("pickled result length:", len(pickled_result)) + Redis.set(key, pickled_result) + Redis.expire(key, 1*60) + + with Bench("Rendering template"): + rendered_template = render_template("marker_regression_gn1.html", **gn1_template_vars) + + # with Bench("Rendering template"): + # if result['pair_scan'] == True: + # img_path = result['pair_scan_filename'] + # print("img_path:", img_path) + # initial_start_vars = request.form + # print("initial_start_vars:", initial_start_vars) + # imgfile = open(TEMPDIR + '/' + img_path, 'rb') + # imgdata = imgfile.read() + # imgB64 = imgdata.encode("base64") + # bytesarray = array.array('B', imgB64) + # result['pair_scan_array'] = bytesarray + # rendered_template = render_template("pair_scan_results.html", **result) + # else: + # rendered_template = render_template("marker_regression.html", **result) + # rendered_template = render_template("marker_regression_gn1.html", **gn1_template_vars) return rendered_template @@ -432,7 +518,7 @@ def export_pdf(): svg_xml = request.form.get("data", "Invalid data") print("svg_xml:", svg_xml) filename = request.form.get("filename", "interval_map_pdf") - filepath = "/home/zas1024/gene/wqflask/output/"+filename + filepath = GENERATED_IMAGE_DIR+filename pdf_file = cairosvg.svg2pdf(bytestring=svg_xml) response = Response(pdf_file, mimetype="application/pdf") response.headers["Content-Disposition"] = "attachment; filename=%s"%filename diff --git a/wqflask/wqflask/wgcna/wgcna_analysis.py b/wqflask/wqflask/wgcna/wgcna_analysis.py index f23b1417..880a1cb2 100644 --- a/wqflask/wqflask/wgcna/wgcna_analysis.py +++ b/wqflask/wqflask/wgcna/wgcna_analysis.py @@ -6,7 +6,7 @@ import scipy as sp # SciPy import rpy2.robjects as ro # R Objects import rpy2.rinterface as ri -from base import webqtlConfig # For paths and stuff +from base.webqtlConfig import GENERATED_IMAGE_DIR from utility import webqtlUtil # Random number for the image import base64 @@ -86,8 +86,8 @@ class WGCNA(object): trait = t[0] # R uses vectors every single element is a vector for s in uStrainsR: strain = s[0] # R uses vectors every single element is a vector - rM.rx[strain, trait] = self.input[trait].get(strain) # Update the matrix location #DEBUG: print(trait, strain, " in python: ", self.input[trait].get(strain), "in R:", rM.rx(strain,trait)[0]) + rM.rx[strain, trait] = self.input[trait].get(strain) # Update the matrix location sys.stdout.flush() self.results = {} @@ -127,8 +127,8 @@ class WGCNA(object): # The iconic WCGNA plot of the modules in the hanging tree self.results['imgurl'] = webqtlUtil.genRandStr("WGCNAoutput_") + ".png" - self.results['imgloc'] = webqtlConfig.TMPDIR + self.results['imgurl'] - r_png(self.results['imgloc'], width=1000, height=600) + self.results['imgloc'] = GENERATED_IMAGE_DIR + self.results['imgurl'] + r_png(self.results['imgloc'], width=1000, height=600, type='cairo-png') mergedColors = self.r_labels2colors(network[1]) self.r_plotDendroAndColors(network[5][0], mergedColors, "Module colors", dendroLabels = False, hang = 0.03, addGuide = True, guideHang = 0.05) r_dev_off() |