saving work for today

This commit is contained in:
Tanushree Tunstall 2020-04-09 16:40:45 +01:00
parent e4df1c5095
commit 95147b577c
2 changed files with 7 additions and 8 deletions

View file

@ -110,17 +110,16 @@ def build_result_dict(web_result_raw):
mytext = mytext.replace('ange:\n', 'ange: ') mytext = mytext.replace('ange:\n', 'ange: ')
#print(mytext) #print(mytext)
# initiliase results_dict # initiliase result_dict
results_dict = {} result_dict = {}
for line in mytext.split('\n'): for line in mytext.split('\n'):
fields = line.split(':') fields = line.split(':')
#print(fields) #print(fields)
if len(fields) > 1: # since Mutaton information is empty if len(fields) > 1: # since Mutaton information is empty
dict_entry = dict([(x, y) for x, y in zip(fields[::2], fields[1::2])]) dict_entry = dict([(x, y) for x, y in zip(fields[::2], fields[1::2])])
results_dict.update(dict_entry) result_dict.update(dict_entry)
return results_dict return result_dict
#======================================================================= #=======================================================================
#%% call function #%% call function
#request_results(infile_url) #request_results(infile_url)

View file

@ -745,9 +745,9 @@ del(c1, c2, col_to_split1, col_to_split2, comp_gene_samples, dr_WF0, dr_df, dr_m
out_filename1 = gene.lower() + '_ambiguous_muts.csv' out_filename1 = gene.lower() + '_ambiguous_muts.csv'
outfile1 = outdir + '/' + out_filename1 outfile1 = outdir + '/' + out_filename1
print('Writing file: ambiguous muts', print('Writing file: ambiguous muts'
'\nFilename:', out_filename1, , '\nFilename:', out_filename1
'\nPath:', outdir) , '\nPath:', outdir)
#common_muts = ['gene_matchVal180Phe','gene_matchGln10Pro'] # test #common_muts = ['gene_matchVal180Phe','gene_matchGln10Pro'] # test
inspect = gene_LF1[gene_LF1['mutation'].isin(common_muts)] inspect = gene_LF1[gene_LF1['mutation'].isin(common_muts)]