From 34d962fe1e0dd5e30f067e7a30fcbd8931f2aacb Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 4 Jun 2019 11:20:28 -0500 Subject: Added GeneMANIA link Fixed issue that caused error when creating UCSC RefSeq link Fixed issue that sometimes caused an error for phenotype searches Changed some text on collections page --- wqflask/base/webqtlConfig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'wqflask/base') diff --git a/wqflask/base/webqtlConfig.py b/wqflask/base/webqtlConfig.py index b14cc4b0..a08acb0a 100644 --- a/wqflask/base/webqtlConfig.py +++ b/wqflask/base/webqtlConfig.py @@ -43,6 +43,7 @@ HOMOLOGENE_ID = "http://www.ncbi.nlm.nih.gov/homologene/?term=%s" GENOTATION_URL = "http://www.genotation.org/Getd2g.pl?gene_list=%s" GTEX_URL = "https://www.gtexportal.org/home/gene/%s" GENEBRIDGE_URL = "https://www.systems-genetics.org/modules_by_gene/%s?organism=%s" +GENEMANIA_URL = "https://genemania.org/search/%s/%s" UCSC_REFSEQ = "http://genome.cse.ucsc.edu/cgi-bin/hgTracks?db=%s&hgg_gene=%s&hgg_chrom=chr%s&hgg_start=%s&hgg_end=%s" BIOGPS_URL = "http://biogps.org/?org=%s#goto=genereport&id=%s" STRING_URL = "http://string-db.org/newstring_cgi/show_network_section.pl?identifier=%s" @@ -87,4 +88,3 @@ if not valid_path(JSON_GENODIR): PORTADDR = "http://50.16.251.170" INFOPAGEHREF = '/dbdoc/%s.html' CGIDIR = '/webqtl/' #XZ: The variable name 'CGIDIR' should be changed to 'PYTHONDIR' -SCRIPTFILE = 'main.py' -- cgit v1.2.3 From 66c6bbfcbbd5fb23145ec09956f4809e5f701bec Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 5 Jun 2019 13:01:36 -0500 Subject: Fixed issue that caused interval mapping to not work because the python implementation of the reaper Dataset object doesn't include the addinterval method (so for those situations I still use reaper) Fixed issue where the last chromosome wasn't displayed for mapping results (though still need to fix issue where points are drawn too far to the right when a specific range is viewed) --- wqflask/base/data_set.py | 9 +- wqflask/utility/gen_geno_ob.py | 270 +++++++++++---------- .../marker_regression/display_mapping_results.py | 6 +- .../wqflask/marker_regression/qtlreaper_mapping.py | 2 +- 4 files changed, 147 insertions(+), 140 deletions(-) (limited to 'wqflask/base') diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index b324ac74..1fd1792e 100644 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -384,7 +384,7 @@ class DatasetGroup(object): [result.extend(l) for l in lists if l] return result - def read_genotype_file(self): + def read_genotype_file(self, use_reaper=False): '''Read genotype from .geno file instead of database''' #genotype_1 is Dataset Object without parents and f1 #genotype_2 is Dataset Object with parents and f1 (not for intercross) @@ -396,9 +396,12 @@ class DatasetGroup(object): full_filename = str(locate(self.genofile, 'genotype')) else: full_filename = str(locate(self.name + '.geno', 'genotype')) - #genotype_1.read(full_filename) - genotype_1 = gen_geno_ob.genotype(full_filename) + if use_reaper: + genotype_1 = reaper.Dataset() + genotype_1.read(full_filename) + else: + genotype_1 = gen_geno_ob.genotype(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) diff --git a/wqflask/utility/gen_geno_ob.py b/wqflask/utility/gen_geno_ob.py index 5824b0b3..5172369f 100644 --- a/wqflask/utility/gen_geno_ob.py +++ b/wqflask/utility/gen_geno_ob.py @@ -1,135 +1,137 @@ -from __future__ import absolute_import, division, print_function - -class genotype(object): - """ - Replacement for reaper.Dataset so we can remove qtlreaper use while still generating mapping output figure - """ - - def __init__(self, filename): - self.group = None - self.type = "riset" - self.prgy = [] - self.nprgy = 0 - self.mat = -1 - self.pat = 1 - self.het = 0 - self.unk = "U" - self.filler = False - self.mb_exists = False - - #ZS: This is because I'm not sure if some files switch the column that contains Mb/cM positions; might be unnecessary - self.cm_column = 2 - self.mb_column = 3 - - self.chromosomes = [] - - self.read_file(filename) - - def __iter__(self): - return iter(self.chromosomes) - - def __getitem__(self, index): - return self.chromosomes[index] - - def __len__(self): - return len(self.chromosomes) - - def read_file(self, filename): - - with open(filename, 'r') as geno_file: - lines = geno_file.readlines() - - this_chr = "" #ZS: This is so it can track when the chromosome changes as it iterates through markers - chr_ob = None - for line in lines: - if line[0] == "#": - continue - elif line[0] == "@": - label = line.split(":")[0][1:] - if label == "name": - self.group = line.split(":")[1] - elif label == "filler": - if line.split(":")[1] == "yes": - self.filler = True - elif label == "type": - self.type = line.split(":")[1] - elif label == "mat": - self.mat = line.split(":")[1] - elif label == "pat": - self.pat = line.split(":")[1] - elif label == "het": - self.het = line.split(":")[1] - elif label == "unk": - self.unk = line.split(":")[1] - else: - continue - elif line[:3] == "Chr": - header_row = line.split("\t") - if header_row[2] == "Mb": - self.mb_exists = True - self.mb_column = 2 - self.cm_column = 3 - elif header_row[3] == "Mb": - self.mb_exists = True - self.mb_column = 3 - elif header_row[2] == "cM": - self.cm_column = 2 - - if self.mb_exists: - self.prgy = header_row[4:] - else: - self.prgy = header_row[3:] - self.nprgy = len(self.prgy) - else: - if line.split("\t")[0] != this_chr: - if this_chr != "": - self.chromosomes.append(chr_ob) - this_chr = line.split("\t")[0] - chr_ob = Chr(line.split("\t")[0], self) - chr_ob.add_marker(line.split("\t")) - -class Chr(object): - def __init__(self, name, geno_ob): - self.name = name - self.loci = [] - self.mb_exists = geno_ob.mb_exists - self.cm_column = geno_ob.cm_column - self.mb_column = geno_ob.mb_column - self.geno_ob = geno_ob - - def __iter__(self): - return iter(self.loci) - - def __getitem__(self, index): - return self.loci[index] - - def __len__(self): - return len(self.loci) - - def add_marker(self, marker_row): - self.loci.append(Locus(marker_row, self.geno_ob)) - -class Locus(object): - def __init__(self, marker_row, geno_ob): - self.chr = marker_row[0] - self.name = marker_row[1] - self.cM = float(marker_row[geno_ob.cm_column]) - self.Mb = float(marker_row[geno_ob.mb_column]) if geno_ob.mb_exists else None - - geno_table = { - geno_ob.mat: -1, - geno_ob.pat: 1, - geno_ob.het: 0, - geno_ob.unk: "U" - } - - self.genotype = [] - if geno_ob.mb_exists: - start_pos = 4 - else: - start_pos = 3 - for allele in marker_row[start_pos:]: - if allele in geno_table.keys(): - self.genotype.append(geno_table[allele]) - else: #ZS: Some genotype appears that isn't specified in the metadata, make it unknown +from __future__ import absolute_import, division, print_function + +class genotype(object): + """ + Replacement for reaper.Dataset so we can remove qtlreaper use while still generating mapping output figure + """ + + def __init__(self, filename): + self.group = None + self.type = "riset" + self.prgy = [] + self.nprgy = 0 + self.mat = -1 + self.pat = 1 + self.het = 0 + self.unk = "U" + self.filler = False + self.mb_exists = False + + #ZS: This is because I'm not sure if some files switch the column that contains Mb/cM positions; might be unnecessary + self.cm_column = 2 + self.mb_column = 3 + + self.chromosomes = [] + + self.read_file(filename) + + def __iter__(self): + return iter(self.chromosomes) + + def __getitem__(self, index): + return self.chromosomes[index] + + def __len__(self): + return len(self.chromosomes) + + def read_file(self, filename): + + with open(filename, 'r') as geno_file: + lines = geno_file.readlines() + + this_chr = "" #ZS: This is so it can track when the chromosome changes as it iterates through markers + chr_ob = None + for line in lines: + if line[0] == "#": + continue + elif line[0] == "@": + label = line.split(":")[0][1:] + if label == "name": + self.group = line.split(":")[1] + elif label == "filler": + if line.split(":")[1] == "yes": + self.filler = True + elif label == "type": + self.type = line.split(":")[1] + elif label == "mat": + self.mat = line.split(":")[1] + elif label == "pat": + self.pat = line.split(":")[1] + elif label == "het": + self.het = line.split(":")[1] + elif label == "unk": + self.unk = line.split(":")[1] + else: + continue + elif line[:3] == "Chr": + header_row = line.split("\t") + if header_row[2] == "Mb": + self.mb_exists = True + self.mb_column = 2 + self.cm_column = 3 + elif header_row[3] == "Mb": + self.mb_exists = True + self.mb_column = 3 + elif header_row[2] == "cM": + self.cm_column = 2 + + if self.mb_exists: + self.prgy = header_row[4:] + else: + self.prgy = header_row[3:] + self.nprgy = len(self.prgy) + else: + if line.split("\t")[0] != this_chr: + if this_chr != "": + self.chromosomes.append(chr_ob) + this_chr = line.split("\t")[0] + chr_ob = Chr(line.split("\t")[0], self) + chr_ob.add_marker(line.split("\t")) + + self.chromosomes.append(chr_ob) + +class Chr(object): + def __init__(self, name, geno_ob): + self.name = name + self.loci = [] + self.mb_exists = geno_ob.mb_exists + self.cm_column = geno_ob.cm_column + self.mb_column = geno_ob.mb_column + self.geno_ob = geno_ob + + def __iter__(self): + return iter(self.loci) + + def __getitem__(self, index): + return self.loci[index] + + def __len__(self): + return len(self.loci) + + def add_marker(self, marker_row): + self.loci.append(Locus(marker_row, self.geno_ob)) + +class Locus(object): + def __init__(self, marker_row, geno_ob): + self.chr = marker_row[0] + self.name = marker_row[1] + self.cM = float(marker_row[geno_ob.cm_column]) + self.Mb = float(marker_row[geno_ob.mb_column]) if geno_ob.mb_exists else None + + geno_table = { + geno_ob.mat: -1, + geno_ob.pat: 1, + geno_ob.het: 0, + geno_ob.unk: "U" + } + + self.genotype = [] + if geno_ob.mb_exists: + start_pos = 4 + else: + start_pos = 3 + for allele in marker_row[start_pos:]: + if allele in geno_table.keys(): + self.genotype.append(geno_table[allele]) + else: #ZS: Some genotype appears that isn't specified in the metadata, make it unknown self.genotype.append("U") \ No newline at end of file diff --git a/wqflask/wqflask/marker_regression/display_mapping_results.py b/wqflask/wqflask/marker_regression/display_mapping_results.py index 993fc2d9..e53e5279 100644 --- a/wqflask/wqflask/marker_regression/display_mapping_results.py +++ b/wqflask/wqflask/marker_regression/display_mapping_results.py @@ -236,9 +236,11 @@ class DisplayMappingResults(object): self.selectedChr = int(start_vars['selected_chr']) self.strainlist = start_vars['samples'] - self.genotype = self.dataset.group.read_genotype_file() + if self.mapping_method == "reaper" and self.manhattan_plot != True: - self.genotype = self.genotype.addinterval() + self.genotype = self.dataset.group.read_genotype_file(use_reaper=True) + else: + self.genotype = self.dataset.group.read_genotype_file() #Darwing Options try: diff --git a/wqflask/wqflask/marker_regression/qtlreaper_mapping.py b/wqflask/wqflask/marker_regression/qtlreaper_mapping.py index 35bed8d8..d58c59c8 100644 --- a/wqflask/wqflask/marker_regression/qtlreaper_mapping.py +++ b/wqflask/wqflask/marker_regression/qtlreaper_mapping.py @@ -2,7 +2,7 @@ import utility.logger logger = utility.logger.getLogger(__name__ ) def gen_reaper_results(this_trait, dataset, samples_before, trait_vals, json_data, num_perm, bootCheck, num_bootstrap, do_control, control_marker, manhattan_plot): - genotype = dataset.group.read_genotype_file() + genotype = dataset.group.read_genotype_file(use_reaper=True) if manhattan_plot != True: genotype = genotype.addinterval() -- cgit v1.2.3 From 172bf33d20d6f42650b415571c1185af4cbd22c5 Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 18 Jun 2019 15:39:36 -0500 Subject: Fixed issue with sorting involving 0's on trait page Fixed links to dataset info pages in search results and correlation results pages --- wqflask/base/data_set.py | 41 ++++++++++++++--------- wqflask/wqflask/templates/correlation_page.html | 4 +-- wqflask/wqflask/templates/search_result_page.html | 2 +- wqflask/wqflask/templates/show_trait.html | 4 +-- 4 files changed, 31 insertions(+), 20 deletions(-) (limited to 'wqflask/base') diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index 1fd1792e..4fee5c7a 100644 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -289,7 +289,6 @@ class DatasetGroup(object): self.parlist = None self.get_f1_parent_strains() - self.accession_id = self.get_accession_id() self.mapping_id, self.mapping_names = self.get_mapping_methods() self.species = webqtlDatabaseFunction.retrieve_species(self.name) @@ -299,20 +298,6 @@ class DatasetGroup(object): self._datasets = None self.genofile = None - def get_accession_id(self): - results = g.db.execute("""select InfoFiles.GN_AccesionId from InfoFiles, PublishFreeze, InbredSet where - InbredSet.Name = %s and - PublishFreeze.InbredSetId = InbredSet.Id and - InfoFiles.InfoPageName = PublishFreeze.Name and - PublishFreeze.public > 0 and - PublishFreeze.confidentiality < 1 order by - PublishFreeze.CreateTime desc""", (self.name)).fetchone() - - if results != None: - return str(results[0]) - else: - return "None" - def get_mapping_methods(self): mapping_id = g.db.execute("select MappingMethodId from InbredSet where Name= '%s'" % self.name).fetchone()[0] @@ -510,6 +495,7 @@ class DataSet(object): self.check_confidentiality() self.retrieve_other_names() self.group = DatasetGroup(self) # sets self.group and self.group_id and gets genotype + self.accession_id = self.get_accession_id() if get_samplelist == True: self.group.get_samplelist() self.species = species.TheSpecies(self) @@ -524,6 +510,31 @@ class DataSet(object): def riset(): Weve_Renamed_This_As_Group + def get_accession_id(self): + if self.type == "Publish": + results = g.db.execute("""select InfoFiles.GN_AccesionId from InfoFiles, PublishFreeze, InbredSet where + InbredSet.Name = %s and + PublishFreeze.InbredSetId = InbredSet.Id and + InfoFiles.InfoPageName = PublishFreeze.Name and + PublishFreeze.public > 0 and + PublishFreeze.confidentiality < 1 order by + PublishFreeze.CreateTime desc""", (self.group.name)).fetchone() + elif self.type == "Geno": + results = g.db.execute("""select InfoFiles.GN_AccesionId from InfoFiles, GenoFreeze, InbredSet where + InbredSet.Name = %s and + GenoFreeze.InbredSetId = InbredSet.Id and + InfoFiles.InfoPageName = GenoFreeze.ShortName and + GenoFreeze.public > 0 and + GenoFreeze.confidentiality < 1 order by + GenoFreeze.CreateTime desc""", (self.group.name)).fetchone() + else: + results = None + + if results != None: + return str(results[0]) + else: + return "None" + def retrieve_other_names(self): """This method fetches the the dataset names in search_result. diff --git a/wqflask/wqflask/templates/correlation_page.html b/wqflask/wqflask/templates/correlation_page.html index 7cc998bb..32f5e774 100644 --- a/wqflask/wqflask/templates/correlation_page.html +++ b/wqflask/wqflask/templates/correlation_page.html @@ -12,8 +12,8 @@
Values of record {{ this_trait.name }} in the {{ dataset.fullname }} - dataset were compared to all records in the {{ target_dataset.fullname }} +
Values of record {{ this_trait.name }} in the {{ dataset.fullname }} + dataset were compared to all records in the {{ target_dataset.fullname }} dataset. The top {{ return_number }} correlations ranked by the {{ formatted_corr_type }} are displayed. You can resort this list by clicking the headers. Select the Record ID to open the trait data and analysis page. diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html index 61a533f7..374347bd 100644 --- a/wqflask/wqflask/templates/search_result_page.html +++ b/wqflask/wqflask/templates/search_result_page.html @@ -13,7 +13,7 @@
We searched {{ dataset.fullname }} +
We searched {{ dataset.fullname }}
to find all records
{% for word in search_terms %}
{% if word.key|lower == "rif" %}
diff --git a/wqflask/wqflask/templates/show_trait.html b/wqflask/wqflask/templates/show_trait.html
index 378f91b1..d5473bca 100644
--- a/wqflask/wqflask/templates/show_trait.html
+++ b/wqflask/wqflask/templates/show_trait.html
@@ -183,10 +183,10 @@
var x = getValue(a);
var y = getValue(b);
- if (x == 'x' || x == '') {
+ if (x == 'x' || x === '') {
return 1;
}
- else if (y == 'x' || y == '') {
+ else if (y == 'x' || y === '') {
return -1;
}
else {
--
cgit v1.2.3
From 4a7c35204863066dc387637bd0f8af7d274cde55 Mon Sep 17 00:00:00 2001
From: zsloan
Date: Mon, 24 Jun 2019 12:09:35 -0500
Subject: Got non-LOCO GEMMA mapping working with gemma-wrapper (so caching
should work for that now)
Fixed position digits and row highlighting on interval analyst table
Updated default MAF to 0.05
Updated footer text
---
wqflask/base/data_set.py | 2 +-
.../marker_regression/display_mapping_results.py | 10 +--
wqflask/wqflask/marker_regression/gemma_mapping.py | 73 +++++++++++-----------
wqflask/wqflask/show_trait/show_trait.py | 2 +-
wqflask/wqflask/templates/base.html | 42 ++++++++-----
wqflask/wqflask/templates/mapping_results.html | 8 ++-
6 files changed, 74 insertions(+), 63 deletions(-)
(limited to 'wqflask/base')
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index 4fee5c7a..d766e284 100644
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -433,7 +433,7 @@ def datasets(group_name, this_group = None):
and InbredSet.Name like %s
and ProbeSetFreeze.public > %s
and ProbeSetFreeze.confidentiality < 1
- ORDER BY Tissue.Name)
+ ORDER BY Tissue.Name, ProbeSetFreeze.OrderList DESC)
''' % (group_name, webqtlConfig.PUBLICTHRESH,
group_name, webqtlConfig.PUBLICTHRESH,
"'" + group_name + "'", webqtlConfig.PUBLICTHRESH))
diff --git a/wqflask/wqflask/marker_regression/display_mapping_results.py b/wqflask/wqflask/marker_regression/display_mapping_results.py
index cafbf38c..41cdf819 100644
--- a/wqflask/wqflask/marker_regression/display_mapping_results.py
+++ b/wqflask/wqflask/marker_regression/display_mapping_results.py
@@ -2127,7 +2127,7 @@ class DisplayMappingResults(object):
tableIterationsCnt = tableIterationsCnt + 1
this_row = [] #container for the cells of each row
- selectCheck = HT.Input(type="checkbox", name="searchResult", value=theGO["GeneSymbol"], Class="checkbox trait_checkbox") #checkbox for each row
+ selectCheck = HT.Input(type="checkbox", name="selectCheck", value=theGO["GeneSymbol"], Class="checkbox trait_checkbox") #checkbox for each row
geneLength = (theGO["TxEnd"] - theGO["TxStart"])*1000.0
tenPercentLength = geneLength*0.0001
@@ -2213,7 +2213,7 @@ class DisplayMappingResults(object):
elif self.dataset.group.species == 'rat':
for gIndex, theGO in enumerate(geneCol):
this_row = [] #container for the cells of each row
- selectCheck = HT.Input(type="checkbox", name="searchResult", Class="checkbox", onClick="highlight(this)").__str__() #checkbox for each row
+ selectCheck = HT.Input(type="checkbox", name="selectCheck", Class="checkbox trait_checkbox").__str__() #checkbox for each row
#ZS: May want to get this working again later
#webqtlSearch = HT.Href(os.path.join(webqtlConfig.CGIDIR, webqtlConfig.SCRIPTFILE)+"?cmd=sch&gene=%s&alias=1&species=rat" % theGO["GeneSymbol"], ">>", target="_blank").__str__()
@@ -2240,14 +2240,14 @@ class DisplayMappingResults(object):
#Mouse Gene
if theGO['mouseGene']:
mouseChr = theGO['mouseGene']["Chromosome"]
- mouseTxStart = theGO['mouseGene']["TxStart"]
+ mouseTxStart = "%0.6f" % theGO['mouseGene']["TxStart"]
else:
mouseChr = mouseTxStart = ""
#the chromosomes for human 1 are 1qXX.XX
if theGO['humanGene']:
humanChr = theGO['humanGene']["Chromosome"]
- humanTxStart = theGO['humanGene']["TxStart"]
+ humanTxStart = "%0.6f" % theGO['humanGene']["TxStart"]
else:
humanChr = humanTxStart = ""
@@ -2258,7 +2258,7 @@ class DisplayMappingResults(object):
this_row = [selectCheck.__str__(),
str(gIndex+1),
geneSymbolNCBI,
- theGO["TxStart"],
+ "%0.6f" % theGO["TxStart"],
HT.Href(geneLengthURL, "%0.3f" % (geneLength*1000.0)).__str__(),
avgExprVal,
mouseChr,
diff --git a/wqflask/wqflask/marker_regression/gemma_mapping.py b/wqflask/wqflask/marker_regression/gemma_mapping.py
index 0f37e711..4e3c203d 100644
--- a/wqflask/wqflask/marker_regression/gemma_mapping.py
+++ b/wqflask/wqflask/marker_regression/gemma_mapping.py
@@ -73,50 +73,51 @@ def run_gemma(this_trait, this_dataset, samples, vals, covariates, use_loco, maf
gwa_output_filename)
else:
- generate_k_command = GEMMA_COMMAND + ' ' + GEMMAOPTS + ' -g %s/%s_geno.txt -p %s/gn2/%s.txt -a %s/%s_snps.txt -gk -outdir %s/gn2/ -o %s' % (flat_files('genotype/bimbam'),
- genofile_name,
- TEMPDIR,
- trait_filename,
- flat_files('genotype/bimbam'),
- genofile_name,
- TEMPDIR,
- k_output_filename)
- #generate_k_command = GEMMA_WRAPPER_COMMAND + ' --json -- ' + GEMMAOPTS + ' -g %s/%s_geno.txt -p %s/%s.txt -a %s/%s_snps.txt -gk > %s/gn2/%s.json' % (flat_files('genotype/bimbam'),
- # genofile_name,
- # flat_files('genotype/bimbam'),
- # trait_filename,
- # flat_files('genotype/bimbam'),
- # genofile_name,
- # TEMPDIR,
- # k_output_filename)
+ # generate_k_command = GEMMA_COMMAND + ' ' + GEMMAOPTS + ' -g %s/%s_geno.txt -p %s/gn2/%s.txt -a %s/%s_snps.txt -gk -outdir %s/gn2/ -o %s' % (flat_files('genotype/bimbam'),
+ # genofile_name,
+ # TEMPDIR,
+ # trait_filename,
+ # flat_files('genotype/bimbam'),
+ # genofile_name,
+ # TEMPDIR,
+ # k_output_filename)
+ generate_k_command = GEMMA_WRAPPER_COMMAND + ' --json -- ' + GEMMAOPTS + ' -g %s/%s_geno.txt -p %s/gn2/%s.txt -a %s/%s_snps.txt -gk > %s/gn2/%s.json' % (flat_files('genotype/bimbam'),
+ genofile_name,
+ TEMPDIR,
+ trait_filename,
+ flat_files('genotype/bimbam'),
+ genofile_name,
+ TEMPDIR,
+ k_output_filename)
logger.debug("k_command:" + generate_k_command)
os.system(generate_k_command)
- gemma_command = GEMMA_COMMAND + ' ' + GEMMAOPTS + ' -g %s/%s_geno.txt -p %s/gn2/%s.txt -a %s/%s_snps.txt -k %s/gn2/%s.cXX.txt -lmm 2 -maf %s' % (flat_files('genotype/bimbam'),
- genofile_name,
- TEMPDIR,
- trait_filename,
- flat_files('genotype/bimbam'),
- genofile_name,
- TEMPDIR,
- k_output_filename,
- maf)
+ # gemma_command = GEMMA_COMMAND + ' ' + GEMMAOPTS + ' -g %s/%s_geno.txt -p %s/gn2/%s.txt -a %s/%s_snps.txt -k %s/gn2/%s.cXX.txt -lmm 2 -maf %s' % (flat_files('genotype/bimbam'),
+ # genofile_name,
+ # TEMPDIR,
+ # trait_filename,
+ # flat_files('genotype/bimbam'),
+ # genofile_name,
+ # TEMPDIR,
+ # k_output_filename,
+ # maf)
- #gemma_command = GEMMA_WRAPPER_COMMAND + ' --json --input %s/gn2/%s.json -- ' % (TEMPDIR, k_output_filename) + GEMMAOPTS + ' -g %s/%s_geno.txt -p %s/%s_pheno.txt' % (flat_files('genotype/bimbam'),
- # genofile_name,
- # flat_files('genotype/bimbam'),
- # genofile_name)
+ gemma_command = GEMMA_WRAPPER_COMMAND + ' --json --input %s/gn2/%s.json -- ' % (TEMPDIR, k_output_filename) + GEMMAOPTS + ' -lmm 2 -g %s/%s_geno.txt -p %s/gn2/%s.txt' % (flat_files('genotype/bimbam'),
+ genofile_name,
+ TEMPDIR,
+ trait_filename)
if covariates != "":
- gemma_command += ' -c %s/%s_covariates.txt -outdir %s -o %s_output' % (flat_files('mapping'),
- this_dataset.group.name,
- webqtlConfig.GENERATED_IMAGE_DIR,
- genofile_name)
- else:
- gemma_command += ' -outdir %s -o %s_output' % (webqtlConfig.GENERATED_IMAGE_DIR,
- genofile_name)
+ gemma_command += ' -c %s/%s_covariates.txt' % (flat_files('mapping'), this_dataset.group.name)
+ # gemma_command += ' -c %s/%s_covariates.txt -outdir %s -o %s_output' % (flat_files('mapping'),
+ # this_dataset.group.name,
+ # webqtlConfig.GENERATED_IMAGE_DIR,
+ # genofile_name)
+ # else:
+ # gemma_command += ' -outdir %s -o %s_output' % (webqtlConfig.GENERATED_IMAGE_DIR,
+ # genofile_name)
logger.debug("gemma_command:" + gemma_command)
diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py
index e10b31c0..5178ece8 100644
--- a/wqflask/wqflask/show_trait/show_trait.py
+++ b/wqflask/wqflask/show_trait/show_trait.py
@@ -168,7 +168,7 @@ class ShowTrait(object):
hddn['control_marker'] = self.nearest_marker
#hddn['control_marker'] = self.nearest_marker1+","+self.nearest_marker2
hddn['do_control'] = False
- hddn['maf'] = 0.01
+ hddn['maf'] = 0.05
hddn['compare_traits'] = []
hddn['export_data'] = ""
hddn['export_format'] = "excel"
diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html
index 21fc99d3..3fd9faf5 100644
--- a/wqflask/wqflask/templates/base.html
+++ b/wqflask/wqflask/templates/base.html
@@ -127,27 +127,35 @@
GeneNetwork is supported by:
-GeneNetwork support from:
+Species and Group | +Species and Group | {{ this_trait.dataset.group.species }}, {{ this_trait.dataset.group.name }} |
Journal | -{{ this_trait.journal }} ({{ this_trait.year }}) | +{{ this_trait.journal }} ({% if this_trait.pubmed_id %}{{ this_trait.year }}{% else %}{{ this_trait.year }}{% endif %}) |
Aliases | -{{ this_trait.alias_fmt|replace(",",";") }} | +Wikidata: {{ this_trait.wikidata_alias_fmt|replace(",",";") }} |
+ | GeneNetwork: {{ this_trait.alias_fmt|replace(",",";") }} | +|