aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base/trait.py
diff options
context:
space:
mode:
authorBonfaceKilz2021-04-29 21:57:16 +0300
committerGitHub2021-04-29 21:57:16 +0300
commit4c8c5390bdba594c217d7ca0114a80a6b3634e24 (patch)
treeb48693555b97fd21e37b263591685af75a2a4b45 /wqflask/base/trait.py
parentbab514be0f0d01fc192638b8e7ccd5909b842b23 (diff)
parent881090ff15a5a563bccefcbd08d373c88a64aa31 (diff)
downloadgenenetwork2-4c8c5390bdba594c217d7ca0114a80a6b3634e24.tar.gz
Merge pull request #566 from BonfaceKilz/Feature/Add-upload-data-forms
Chore/Cosmetic-changes
Diffstat (limited to 'wqflask/base/trait.py')
-rw-r--r--wqflask/base/trait.py70
1 files changed, 1 insertions, 69 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index b4b4452a..5574128d 100644
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -51,7 +51,7 @@ def create_trait(**kw):
return None
-class GeneralTrait(object):
+class GeneralTrait:
"""
Trait class defines a trait in webqtl, can be either Microarray,
Published phenotype, genotype, or user input trait
@@ -345,74 +345,6 @@ def jsonable(trait):
return dict()
-def jsonable_table_row(trait, dataset_name, index):
- """Return a list suitable for json and intended to be displayed in a table
-
- Actual turning into json doesn't happen here though"""
-
- dataset = create_dataset(dataset_name)
-
- if dataset.type == "ProbeSet":
- if trait.mean == "":
- mean = "N/A"
- else:
- mean = "%.3f" % round(float(trait.mean), 2)
- if trait.additive == "":
- additive = "N/A"
- else:
- additive = "%.3f" % round(float(trait.additive), 2)
- return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="' + hmac.data_hmac('{}:{}'.format(str(trait.name), dataset.name)) + '">',
- index,
- '<a href="/show_trait?trait_id=' +
- str(trait.name)+'&dataset='+dataset.name +
- '">'+str(trait.name)+'</a>',
- trait.symbol,
- trait.description_display,
- trait.location_repr,
- mean,
- trait.LRS_score_repr,
- trait.LRS_location_repr,
- additive]
- elif dataset.type == "Publish":
- if trait.additive == "":
- additive = "N/A"
- else:
- additive = "%.2f" % round(float(trait.additive), 2)
- if trait.pubmed_id:
- return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="' + hmac.data_hmac('{}:{}'.format(str(trait.name), dataset.name)) + '">',
- index,
- '<a href="/show_trait?trait_id=' +
- str(trait.name)+'&dataset='+dataset.name +
- '">'+str(trait.name)+'</a>',
- trait.description_display,
- trait.authors,
- '<a href="' + trait.pubmed_link + '">' + trait.pubmed_text + '</href>',
- trait.LRS_score_repr,
- trait.LRS_location_repr,
- additive]
- else:
- return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="' + hmac.data_hmac('{}:{}'.format(str(trait.name), dataset.name)) + '">',
- index,
- '<a href="/show_trait?trait_id=' +
- str(trait.name)+'&dataset='+dataset.name +
- '">'+str(trait.name)+'</a>',
- trait.description_display,
- trait.authors,
- trait.pubmed_text,
- trait.LRS_score_repr,
- trait.LRS_location_repr,
- additive]
- elif dataset.type == "Geno":
- return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="' + hmac.data_hmac('{}:{}'.format(str(trait.name), dataset.name)) + '">',
- index,
- '<a href="/show_trait?trait_id=' +
- str(trait.name)+'&dataset='+dataset.name +
- '">'+str(trait.name)+'</a>',
- trait.location_repr]
- else:
- return dict()
-
-
def retrieve_trait_info(trait, dataset, get_qtl_info=False):
assert dataset, "Dataset doesn't exist"