about summary refs log tree commit diff
path: root/wqflask/wqflask
diff options
context:
space:
mode:
authorBonfaceKilz2021-04-30 12:52:55 +0300
committerBonfaceKilz2021-04-30 13:45:15 +0300
commitbd702e59d7a426fe351d34367bf824683c655696 (patch)
tree95994298c5dc29e527a0646cd99a248c7bbd8a66 /wqflask/wqflask
parentd1bc52a0d8e1219f377e804c3f27a3543d234fcb (diff)
downloadgenenetwork2-bd702e59d7a426fe351d34367bf824683c655696.tar.gz
autopep8: Fix W291, W292, W293, W391
Diffstat (limited to 'wqflask/wqflask')
-rw-r--r--wqflask/wqflask/__init__.py2
-rw-r--r--wqflask/wqflask/api/mapping.py2
-rw-r--r--wqflask/wqflask/api/router.py14
-rw-r--r--wqflask/wqflask/collect.py1
-rw-r--r--wqflask/wqflask/comparison_bar_chart/comparison_bar_chart.py7
-rw-r--r--wqflask/wqflask/correlation/corr_scatter_plot.py4
-rw-r--r--wqflask/wqflask/correlation/show_corr_results.py1
-rw-r--r--wqflask/wqflask/correlation_matrix/show_corr_matrix.py2
-rw-r--r--wqflask/wqflask/ctl/ctl_analysis.py3
-rw-r--r--wqflask/wqflask/db_info.py2
-rw-r--r--wqflask/wqflask/docs.py2
-rw-r--r--wqflask/wqflask/export_traits.py4
-rw-r--r--wqflask/wqflask/external_tools/send_to_webgestalt.py2
-rw-r--r--wqflask/wqflask/heatmap/heatmap.py2
-rw-r--r--wqflask/wqflask/interval_analyst/GeneUtil.py24
-rw-r--r--wqflask/wqflask/marker_regression/qtlreaper_mapping.py10
-rw-r--r--wqflask/wqflask/marker_regression/rqtl_mapping.py2
-rw-r--r--wqflask/wqflask/resource_manager.py2
-rw-r--r--wqflask/wqflask/search_results.py1
-rw-r--r--wqflask/wqflask/server_side.py2
-rw-r--r--wqflask/wqflask/snp_browser/snp_browser.py7
-rw-r--r--wqflask/wqflask/user_login.py42
-rw-r--r--wqflask/wqflask/user_session.py2
23 files changed, 63 insertions, 77 deletions
diff --git a/wqflask/wqflask/__init__.py b/wqflask/wqflask/__init__.py
index 712517a3..a2bf3085 100644
--- a/wqflask/wqflask/__init__.py
+++ b/wqflask/wqflask/__init__.py
@@ -50,4 +50,4 @@ from wqflask import db_info
 from wqflask import user_login
 from wqflask import user_session
 
-import wqflask.views 
+import wqflask.views
diff --git a/wqflask/wqflask/api/mapping.py b/wqflask/wqflask/api/mapping.py
index c22b44a9..e4a3fb77 100644
--- a/wqflask/wqflask/api/mapping.py
+++ b/wqflask/wqflask/api/mapping.py
@@ -140,5 +140,3 @@ def initialize_parameters(start_vars, dataset, this_trait):
             mapping_params['perm_check'] = False
 
     return mapping_params
-
-
diff --git a/wqflask/wqflask/api/router.py b/wqflask/wqflask/api/router.py
index e7dfa4e0..f7d52ca3 100644
--- a/wqflask/wqflask/api/router.py
+++ b/wqflask/wqflask/api/router.py
@@ -59,13 +59,13 @@ def get_species_info(species_name, file_format="json"):
                               WHERE (Name="{0}" OR FullName="{0}" OR SpeciesName="{0}");""".format(species_name))
 
     the_species = results.fetchone()
-    species_dict = { 
+    species_dict = {
       "Id": the_species[0],
       "Name": the_species[1],
       "FullName": the_species[2],
       "TaxonomyId": the_species[3]
     }
-    
+
     return flask.jsonify(species_dict)
 
 
@@ -639,7 +639,7 @@ def trait_sample_data(dataset_name, trait_name, file_format="json"):
 
             return flask.jsonify(sample_list)
         else:
-            return return_error(code=204, source=request.url_rule.rule, title="No Results", details="") 
+            return return_error(code=204, source=request.url_rule.rule, title="No Results", details="")
 
 
 @app.route("/api/v_{}/trait/<path:dataset_name>/<path:trait_name>".format(version))
@@ -685,7 +685,7 @@ def get_trait_info(dataset_name, trait_name, file_format="json"):
         # ZS: Check if the user input the dataset_name as BXDPublish, etc (which is always going to be the group name + "Publish"
         if "Publish" in dataset_name:
             dataset_name = dataset_name.replace("Publish", "")
-        
+
         group_id = get_group_id(dataset_name)
         pheno_query = """
                          SELECT
@@ -898,7 +898,7 @@ def get_dataset_trait_ids(dataset_name, start_vars):
         data_type = "Publish"
         dataset_name = dataset_name.replace("Publish", "")
         dataset_id = get_group_id(dataset_name)
-        
+
         query = """
                          SELECT
                              PublishXRef.PhenotypeId, PublishXRef.Id, InbredSet.InbredSetCode
@@ -949,9 +949,9 @@ def get_samplelist(dataset_name):
                WHERE StrainXRef.StrainId = Strain.Id AND
                      StrainXRef.InbredSetId = {}
             """.format(group_id)
-    
+
     results = g.db.execute(query).fetchall()
-    
+
     samplelist = [result[0] for result in results]
 
     return samplelist
diff --git a/wqflask/wqflask/collect.py b/wqflask/wqflask/collect.py
index 1fcf15f0..9fd89524 100644
--- a/wqflask/wqflask/collect.py
+++ b/wqflask/wqflask/collect.py
@@ -239,4 +239,3 @@ def change_collection_name():
     g.user_session.change_collection_name(collection_id, new_name)
 
     return new_name
-
diff --git a/wqflask/wqflask/comparison_bar_chart/comparison_bar_chart.py b/wqflask/wqflask/comparison_bar_chart/comparison_bar_chart.py
index 0fabb833..d86c8e16 100644
--- a/wqflask/wqflask/comparison_bar_chart/comparison_bar_chart.py
+++ b/wqflask/wqflask/comparison_bar_chart/comparison_bar_chart.py
@@ -45,7 +45,7 @@ class ComparisonBarChart:
         # ZS: Getting initial group name before verifying all traits are in the same group in the following loop
         this_group = self.trait_list[0][1].group.name
         for trait_db in self.trait_list:
-            
+
             if trait_db[1].group.name != this_group:
                 self.insufficient_shared_samples = True
                 break
@@ -53,7 +53,7 @@ class ComparisonBarChart:
                 this_group = trait_db[1].group.name
             this_trait = trait_db[0]
             self.traits.append(this_trait)
-            
+
             this_sample_data = this_trait.data
 
             for sample in this_sample_data:
@@ -79,7 +79,7 @@ class ComparisonBarChart:
             self.js_data = dict(traits=[trait.name for trait in self.traits],
                                 samples=self.all_sample_list,
                                 sample_data=self.sample_data,)
-        
+
     def get_trait_db_obs(self, trait_db_list):
 
         self.trait_list = []
@@ -95,4 +95,3 @@ class ComparisonBarChart:
             self.trait_list.append((trait_ob, dataset_ob))
 
         #print("trait_list:", self.trait_list)
-
diff --git a/wqflask/wqflask/correlation/corr_scatter_plot.py b/wqflask/wqflask/correlation/corr_scatter_plot.py
index f9a0ea11..4f756f58 100644
--- a/wqflask/wqflask/correlation/corr_scatter_plot.py
+++ b/wqflask/wqflask/correlation/corr_scatter_plot.py
@@ -68,7 +68,7 @@ class CorrScatterPlot:
             slope_string = '%.3E' % slope
         else:
             slope_string = '%.3f' % slope
-        
+
         x_buffer = (max(vals_1) - min(vals_1)) * 0.1
         y_buffer = (max(vals_2) - min(vals_2)) * 0.1
 
@@ -82,7 +82,7 @@ class CorrScatterPlot:
         ry = stats.rankdata(vals_2)
         self.rdata = []
         self.rdata.append(rx.tolist())
-        self.rdata.append(ry.tolist())        
+        self.rdata.append(ry.tolist())
         srslope, srintercept, srr_value, srp_value, srstd_err = stats.linregress(
             rx, ry)
 
diff --git a/wqflask/wqflask/correlation/show_corr_results.py b/wqflask/wqflask/correlation/show_corr_results.py
index e75c4a85..8ee24246 100644
--- a/wqflask/wqflask/correlation/show_corr_results.py
+++ b/wqflask/wqflask/correlation/show_corr_results.py
@@ -680,4 +680,3 @@ def get_header_fields(data_type, corr_method):
                                 'Sample p(r)']
 
     return header_fields
-
diff --git a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py
index aefb4453..59469428 100644
--- a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py
+++ b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py
@@ -324,7 +324,7 @@ def sortEigenVectors(vector):
             A.append(item[0])
             B.append(item[1])
         sum = reduce(lambda x, y: x + y, A, 0.0)
-        A = [x * 100.0 / sum for x in A] 
+        A = [x * 100.0 / sum for x in A]
         return [A, B]
     except:
         return []
diff --git a/wqflask/wqflask/ctl/ctl_analysis.py b/wqflask/wqflask/ctl/ctl_analysis.py
index 48a82435..f4eafbe7 100644
--- a/wqflask/wqflask/ctl/ctl_analysis.py
+++ b/wqflask/wqflask/ctl/ctl_analysis.py
@@ -66,7 +66,7 @@ class CTL:
 
     def addNode(self, gt):
         node_dict = {'data': {'id': str(gt.name) + ":" + str(gt.dataset.name),
-                                'sid': str(gt.name), 
+                                'sid': str(gt.name),
                                 'dataset': str(gt.dataset.name),
                                 'label': gt.name,
                                 'symbol': gt.symbol,
@@ -238,4 +238,3 @@ class CTL:
         self.render_image(self.results)
         sys.stdout.flush()
         return(dict(template_vars))
-
diff --git a/wqflask/wqflask/db_info.py b/wqflask/wqflask/db_info.py
index c7558ed8..8d28fef0 100644
--- a/wqflask/wqflask/db_info.py
+++ b/wqflask/wqflask/db_info.py
@@ -135,5 +135,3 @@ def process_query_results(results):
     }
 
     return info_ob
-
-
diff --git a/wqflask/wqflask/docs.py b/wqflask/wqflask/docs.py
index fc93248a..0a1a597d 100644
--- a/wqflask/wqflask/docs.py
+++ b/wqflask/wqflask/docs.py
@@ -20,7 +20,7 @@ class Docs:
             self.title = self.entry.capitalize()
             self.content = ""
         else:
-            
+
             self.title = result[0]
             self.content = result[1].decode("utf-8")
 
diff --git a/wqflask/wqflask/export_traits.py b/wqflask/wqflask/export_traits.py
index 5bd54f9d..2c180d49 100644
--- a/wqflask/wqflask/export_traits.py
+++ b/wqflask/wqflask/export_traits.py
@@ -1,6 +1,6 @@
 import csv
 import xlsxwriter
-import io 
+import io
 import datetime
 import itertools
 
@@ -20,7 +20,7 @@ def export_search_results_csv(targs):
 
     table_data = json.loads(targs['export_data'])
     table_rows = table_data['rows']
-    
+
     now = datetime.datetime.now()
     time_str = now.strftime('%H:%M_%d%B%Y')
     if 'file_name' in targs:
diff --git a/wqflask/wqflask/external_tools/send_to_webgestalt.py b/wqflask/wqflask/external_tools/send_to_webgestalt.py
index fd12562f..fcd943ba 100644
--- a/wqflask/wqflask/external_tools/send_to_webgestalt.py
+++ b/wqflask/wqflask/external_tools/send_to_webgestalt.py
@@ -48,7 +48,7 @@ class SendToWebGestalt:
 
             id_type = "entrezgene"
 
-            self.hidden_vars = { 
+            self.hidden_vars = {
                              'gene_list': "\n".join(gene_id_list),
                              'id_type': "entrezgene",
                              'ref_set': "genome",
diff --git a/wqflask/wqflask/heatmap/heatmap.py b/wqflask/wqflask/heatmap/heatmap.py
index aa11caa8..02eb66e5 100644
--- a/wqflask/wqflask/heatmap/heatmap.py
+++ b/wqflask/wqflask/heatmap/heatmap.py
@@ -125,7 +125,7 @@ class Heatmap:
                                                                                                                     webqtlConfig.GENERATED_IMAGE_DIR,
                                                                                                                     output_filename)
 
-            os.system(reaper_command)                                                                                                        
+            os.system(reaper_command)
 
             reaper_results = parse_reaper_output(output_filename)
 
diff --git a/wqflask/wqflask/interval_analyst/GeneUtil.py b/wqflask/wqflask/interval_analyst/GeneUtil.py
index cadff080..e624a146 100644
--- a/wqflask/wqflask/interval_analyst/GeneUtil.py
+++ b/wqflask/wqflask/interval_analyst/GeneUtil.py
@@ -10,7 +10,7 @@ def loadGenes(chrName, diffCol, startMb, endMb, 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 = {}
 	results = g.db.execute("""
@@ -21,7 +21,7 @@ def loadGenes(chrName, diffCol, startMb, endMb, species='mouse'):
 
 	for item in results:
 		speciesDict[item[0]] = item[1]
-	
+
 	# List current Species and other Species
 	speciesId = speciesDict[species]
 	otherSpecies = [[X, speciesDict[X]] for X in list(speciesDict.keys())]
@@ -45,7 +45,7 @@ def loadGenes(chrName, diffCol, startMb, endMb, species='mouse'):
 			newdict = {}
 			for j, item in enumerate(fetchFields):
 				newdict[item] = result[j]
-			# count SNPs if possible	
+			# count SNPs if possible
 			if diffCol and species == 'mouse':
 				newdict["snpCount"] = g.db.execute("""
                                         SELECT count(*)
@@ -58,17 +58,17 @@ def loadGenes(chrName, diffCol, startMb, endMb, species='mouse'):
 					(newdict["TxEnd"] - newdict["TxStart"]) / 1000.0
 			else:
 				newdict["snpDensity"] = newdict["snpCount"] = 0
-			
+
 			try:
 				newdict['GeneLength'] = 1000.0 * (newdict['TxEnd'] - newdict['TxStart'])
 			except:
 				pass
-			
+
 			# load gene from other Species by the same name
 			for item in otherSpecies:
 				othSpec, othSpecId = item
 				newdict2 = {}
-				
+
 				resultsOther = g.db.execute("SELECT %s FROM GeneList WHERE SpeciesId = %d AND geneSymbol= '%s' LIMIT 1" % (", ".join(fetchFields),
                                                                                                                            othSpecId,
                                                                                                                            newdict["GeneSymbol"])).fetchone()
@@ -76,8 +76,8 @@ def loadGenes(chrName, diffCol, startMb, endMb, species='mouse'):
 				if resultsOther:
 					for j, item in enumerate(fetchFields):
 						newdict2[item] = resultsOther[j]
-							
-					# count SNPs if possible, could be a separate function	
+
+					# count SNPs if possible, could be a separate function
 					if diffCol and othSpec == 'mouse':
 						newdict2["snpCount"] = g.db.execute("""
                                                     SELECT count(*)
@@ -91,17 +91,15 @@ def loadGenes(chrName, diffCol, startMb, endMb, species='mouse'):
 							(newdict2["TxEnd"] - newdict2["TxStart"]) / 1000.0
 					else:
 						newdict2["snpDensity"] = newdict2["snpCount"] = 0
-						
+
 					try:
 						newdict2['GeneLength'] = 1000.0 * \
 							(newdict2['TxEnd'] - newdict2['TxStart'])
 					except:
 						pass
-						
+
 				newdict['%sGene' % othSpec] = newdict2
-				
+
 			GeneList.append(newdict)
 
 	return GeneList
-
-
diff --git a/wqflask/wqflask/marker_regression/qtlreaper_mapping.py b/wqflask/wqflask/marker_regression/qtlreaper_mapping.py
index f932498f..c51b7a9a 100644
--- a/wqflask/wqflask/marker_regression/qtlreaper_mapping.py
+++ b/wqflask/wqflask/marker_regression/qtlreaper_mapping.py
@@ -34,7 +34,7 @@ def run_reaper(this_trait, this_dataset, samples, vals, json_data, num_perm, boo
 
         opt_list = []
         if boot_check and num_bootstrap > 0:
-            bootstrap_filename = (f"{this_dataset.group.name}_BOOTSTRAP_" + 
+            bootstrap_filename = (f"{this_dataset.group.name}_BOOTSTRAP_" +
                 ''.join(random.choice(string.ascii_uppercase + string.digits)
                         for _ in range(6))
                 )
@@ -44,8 +44,8 @@ def run_reaper(this_trait, this_dataset, samples, vals, json_data, num_perm, boo
             opt_list.append(
                 f"--bootstrap_output {webqtlConfig.GENERATED_IMAGE_DIR}{bootstrap_filename}.txt")
         if num_perm > 0:
-            permu_filename = ("{this_dataset.group.name}_PERM_" + 
-            ''.join(random.choice(string.ascii_uppercase + 
+            permu_filename = ("{this_dataset.group.name}_PERM_" +
+            ''.join(random.choice(string.ascii_uppercase +
                 string.digits) for _ in range(6))
             )
             opt_list.append("-n " + str(num_perm))
@@ -56,7 +56,7 @@ def run_reaper(this_trait, this_dataset, samples, vals, json_data, num_perm, boo
         if manhattan_plot != True:
             opt_list.append("--interval 1")
 
-        reaper_command = (REAPER_COMMAND + 
+        reaper_command = (REAPER_COMMAND +
         ' --geno {0}/{1}.geno --traits {2}/gn2/{3}.txt {4} -o {5}{6}.txt'.format(flat_files('genotype'),
 
                                                                               genofile_name,
@@ -81,7 +81,7 @@ def run_reaper(this_trait, this_dataset, samples, vals, json_data, num_perm, boo
         suggestive = permu_vals[int(num_perm * 0.37 - 1)]
         significant = permu_vals[int(num_perm * 0.95 - 1)]
 
-    return (marker_obs, permu_vals, suggestive, significant, bootstrap_vals, 
+    return (marker_obs, permu_vals, suggestive, significant, bootstrap_vals,
         [output_filename, permu_filename, bootstrap_filename])
 
 
diff --git a/wqflask/wqflask/marker_regression/rqtl_mapping.py b/wqflask/wqflask/marker_regression/rqtl_mapping.py
index 741d6c23..b3c9fddf 100644
--- a/wqflask/wqflask/marker_regression/rqtl_mapping.py
+++ b/wqflask/wqflask/marker_regression/rqtl_mapping.py
@@ -300,7 +300,7 @@ def add_categorical_covar(cross, covar_as_string, i):
       ro.r('the_cross$pheno <- cbind(pheno, ' + \
            col_name + ' = newcovar[,' + str(x) + '])')
       col_names.append(col_name)
-      #logger.info("loop" + str(x) + "done"); 
+      #logger.info("loop" + str(x) + "done");
 
     logger.info("returning from add_categorical_covar")
     return ro.r["the_cross"], col_names
diff --git a/wqflask/wqflask/resource_manager.py b/wqflask/wqflask/resource_manager.py
index 36d4cd61..61f3b202 100644
--- a/wqflask/wqflask/resource_manager.py
+++ b/wqflask/wqflask/resource_manager.py
@@ -142,5 +142,5 @@ def get_group_names(group_masks):
         group_name = get_group_info(group_id)['name']
         this_mask['name'] = group_name
         group_masks_with_names[group_id] = this_mask
-    
+
     return group_masks_with_names
diff --git a/wqflask/wqflask/search_results.py b/wqflask/wqflask/search_results.py
index 273a97a4..0d2fb2f8 100644
--- a/wqflask/wqflask/search_results.py
+++ b/wqflask/wqflask/search_results.py
@@ -343,4 +343,3 @@ def get_aliases(symbol_list, species):
         search_terms.append(the_search_term)
 
     return search_terms
-
diff --git a/wqflask/wqflask/server_side.py b/wqflask/wqflask/server_side.py
index 8b3a4faa..8ca3a9eb 100644
--- a/wqflask/wqflask/server_side.py
+++ b/wqflask/wqflask/server_side.py
@@ -30,7 +30,7 @@ class ServerSideTable:
         self.rows_count = rows_count
         self.table_rows = table_rows
         self.header_data_names = header_data_names
-        
+
         self.sort_rows()
         self.paginate_rows()
 
diff --git a/wqflask/wqflask/snp_browser/snp_browser.py b/wqflask/wqflask/snp_browser/snp_browser.py
index e98cfb71..5b7a663c 100644
--- a/wqflask/wqflask/snp_browser/snp_browser.py
+++ b/wqflask/wqflask/snp_browser/snp_browser.py
@@ -494,10 +494,10 @@ class SnpBrowser:
                         function_details = function_details + ", Coding Region Unknown"
 
                     self.empty_columns['function_details'] = "true"
-                    
+
                 #[snp_href, chr, mb_formatted, alleles, snp_source_cell, conservation_score, gene_name_cell, transcript_href, exon, domain_1, domain_2, function, function_details]
 
-                base_color_dict = {"A": "#C33232", "C": "#1569C7", "T": "#CFCF32", "G": "#32C332", 
+                base_color_dict = {"A": "#C33232", "C": "#1569C7", "T": "#CFCF32", "G": "#32C332",
                                    "t": "#FF6", "c": "#5CB3FF", "a": "#F66", "g": "#CF9", ":": "#FFFFFF", "-": "#FFFFFF", "?": "#FFFFFF"}
 
                 the_bases = []
@@ -735,7 +735,7 @@ def get_header_list(variant_type, strains, species=None, empty_columns=None):
             if empty_columns['function_details'] == "false":
                 empty_field_count += 1
                 header_fields[0].remove('Details')
-        
+
         for col in empty_columns.keys():
             if empty_columns[col] == "false":
                 header_data_names.remove(col)
@@ -952,4 +952,3 @@ def check_if_in_gene(species_id, chr, mb):
         return [result[0], result[1]]
     else:
         return ""
-
diff --git a/wqflask/wqflask/user_login.py b/wqflask/wqflask/user_login.py
index 708d43d2..bfaed9c2 100644
--- a/wqflask/wqflask/user_login.py
+++ b/wqflask/wqflask/user_login.py
@@ -45,10 +45,10 @@ def encode_password(pass_gen_fields, unencrypted_password):
         salt = pass_gen_fields['salt']
     else:
         salt = bytes(pass_gen_fields['salt'], "utf-8")
-    encrypted_password = pbkdf2.pbkdf2_hex(str(unencrypted_password), 
+    encrypted_password = pbkdf2.pbkdf2_hex(str(unencrypted_password),
                                            salt,
-                                           pass_gen_fields['iterations'], 
-                                           pass_gen_fields['keylength'], 
+                                           pass_gen_fields['iterations'],
+                                           pass_gen_fields['keylength'],
                                            pass_gen_fields['hashfunc'])
 
     pass_gen_fields.pop("unencrypted_password", None)
@@ -111,7 +111,7 @@ def get_signed_session_id(user):
     key = UserSession.user_cookie_name + ":" + session_id
     Redis.hmset(key, session)
     Redis.expire(key, THREE_DAYS)
-    
+
     return session_id_signed
 
 
@@ -207,7 +207,7 @@ def login():
                     UserSession.user_cookie_name, session_id_signed, max_age=None)
             else:
                 flash("Something went unexpectedly wrong.", "alert-danger")
-                response = make_response(redirect(url_for('index_page')))  
+                response = make_response(redirect(url_for('index_page')))
             return response
         else:
             user_details = get_user_by_unique_column(
@@ -276,13 +276,13 @@ def github_oauth2():
     user_details = get_user_by_unique_column("github_id", github_user["id"])
     if user_details == None:
         user_details = {
-            "user_id": str(uuid.uuid4()), 
-            "name": github_user["name"].encode("utf-8") if github_user["name"] else "None", 
+            "user_id": str(uuid.uuid4()),
+            "name": github_user["name"].encode("utf-8") if github_user["name"] else "None",
             "github_id": github_user["id"],
-            "user_url": github_user["html_url"].encode("utf-8"), 
-            "login_type": "github", 
-            "organization": "", 
-            "active": 1, 
+            "user_url": github_user["html_url"].encode("utf-8"),
+            "login_type": "github",
+            "organization": "",
+            "active": 1,
             "confirmed": 1
         }
         save_user(user_details, user_details["user_id"])
@@ -308,8 +308,8 @@ def orcid_oauth2():
     url = "/n/login"
     if code:
         data = {
-            "client_id": ORCID_CLIENT_ID, 
-            "client_secret": ORCID_CLIENT_SECRET, 
+            "client_id": ORCID_CLIENT_ID,
+            "client_secret": ORCID_CLIENT_SECRET,
             "grant_type": "authorization_code",
             "redirect_uri": GN2_BRANCH_URL + "n/login/orcid_oauth2",
             "code": code
@@ -321,13 +321,13 @@ def orcid_oauth2():
         user_details = get_user_by_unique_column("orcid", result_dict["orcid"])
         if user_details == None:
             user_details = {
-                "user_id": str(uuid4()), 
-                "name": result_dict["name"], 
-                "orcid": result_dict["orcid"], 
-                "user_url": "%s/%s" % ("/".join(ORCID_AUTH_URL.split("/")[:-2]), result_dict["orcid"]), 
-                "login_type": "orcid", 
-                "organization": "", 
-                "active": 1, 
+                "user_id": str(uuid4()),
+                "name": result_dict["name"],
+                "orcid": result_dict["orcid"],
+                "user_url": "%s/%s" % ("/".join(ORCID_AUTH_URL.split("/")[:-2]), result_dict["orcid"]),
+                "login_type": "orcid",
+                "organization": "",
+                "active": 1,
                 "confirmed": 1
             }
             save_user(user_details, user_details["user_id"])
@@ -374,7 +374,7 @@ def send_forgot_password_email(verification_email):
     key_prefix = "forgot_password_code"
     subject = "GeneNetwork password reset"
     fromaddr = "no-reply@genenetwork.org"
-    
+
     verification_code = str(uuid.uuid4())
     key = key_prefix + ":" + verification_code
 
diff --git a/wqflask/wqflask/user_session.py b/wqflask/wqflask/user_session.py
index 6ccb2e80..963288b3 100644
--- a/wqflask/wqflask/user_session.py
+++ b/wqflask/wqflask/user_session.py
@@ -318,5 +318,3 @@ class UserSession:
         # And more importantly delete the redis record
         Redis.delete(self.redis_key)
         self.logged_in = False
-
-