handling missing dir for data_extraction.py

This commit is contained in:
Tanushree Tunstall 2020-11-12 13:21:06 +00:00
parent b0b9e91af7
commit f9fd74812a
3 changed files with 51 additions and 17 deletions

View file

@ -41,9 +41,9 @@ datadir = homedir + '/' + 'git/Data'
#=======
in_filename = 'aa_codes.csv'
infile = datadir + '/' + in_filename
print('Input filename:', in_filename
, '\nInput path:', datadir
, '\n============================================================')
#print('Input filename:', in_filename
# , '\nInput path:', datadir
# , '\n============================================================')
#%% Read input file
aa_table = pd.read_csv(infile) #20, 6
@ -67,11 +67,11 @@ my_aa.index
# using 'index' creates a dict of dicts
# using 'records' creates a list of dicts
my_aa_dict = my_aa.to_dict('index') #20, with 5 subkeys
print('Printing my_aa_dict:', my_aa_dict.keys())
#print('Printing my_aa_dict:', my_aa_dict.keys())
#FIXME : use the below in all code
low_3letter_dict = my_aa.to_dict('index') #20, with 5 subkeys
print('Printing lower-case 3 letter aa dict:',low_3letter_dict.keys())
#print('Printing lower-case 3 letter aa dict:',low_3letter_dict.keys())
#------------------------
#2) 1-letter code as key
@ -81,7 +81,7 @@ aa_1let.columns
aa_1let.index
oneletter_aa_dict = aa_1let.to_dict('index') #20, with 5 subkeys
print('Printing one letter aa dict:', oneletter_aa_dict.keys())
#print('Printing one letter aa dict:', oneletter_aa_dict.keys())
#------------------------
#3) amino acid name as key
@ -91,7 +91,7 @@ aa_name.columns
aa_name.index
aa_name_dict = aa_name.to_dict('index') #20, with 5 subkeys
print('Printing amino acid names aa dict:', aa_name_dict.keys())
#print('Printing amino acid names aa dict:', aa_name_dict.keys())
#------------------------
#3) 3 letter uppercase as key
@ -101,7 +101,7 @@ aa_up3let.columns
aa_up3let.index
up_3letter_aa_dict = aa_up3let.to_dict('index') #20, with 5 subkeys
print('Printing upper case 3 letter aa dict:', up_3letter_aa_dict.keys())
#print('Printing upper case 3 letter aa dict:', up_3letter_aa_dict.keys())
#================================================
# dict of aa with their corresponding properties