diff options
author | Zachary Sloan | 2013-01-18 16:58:28 -0600 |
---|---|---|
committer | Zachary Sloan | 2013-01-18 16:58:28 -0600 |
commit | 8aeff9b91d078a40a50d13f6393a1f1dabf62aa4 (patch) | |
tree | 88f11e9a92b94030aa814bde999e63f630899e0a /wqflask/base/trait.py | |
parent | d39b691994a395c45fa242de6d64d12a5470af10 (diff) | |
download | genenetwork2-8aeff9b91d078a40a50d13f6393a1f1dabf62aa4.tar.gz |
Renamed CorrelationPage.py to show_corr_results.py
Worked with correlation code; got to the code that
begins to do the actual correlations
Created a function "get_dataset_and_trait" in
the new file "helper_functions.py" because the
code initializing the dataset and trait objects
was repeated in multiple places
Diffstat (limited to 'wqflask/base/trait.py')
-rwxr-xr-x | wqflask/base/trait.py | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index 241bf2ab..2af4bc24 100755 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -314,27 +314,27 @@ class GeneralTrait: #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: - junk = float(self.geneid) - geneidIsNumber = 1 - except: - geneidIsNumber = 0 - - 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 + #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] |