From 49a38dd1ae23bb86df569115feb7b2d7a3bec39a Mon Sep 17 00:00:00 2001 From: Tanushree Tunstall Date: Tue, 7 Apr 2020 17:57:34 +0100 Subject: [PATCH] saving work for today --- scripts/kd_df.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/kd_df.py b/scripts/kd_df.py index 97184b0..4ee9825 100755 --- a/scripts/kd_df.py +++ b/scripts/kd_df.py @@ -43,6 +43,7 @@ arg_parser = argparse.ArgumentParser() #arg_parser.add_argument('-g', '--gene', help='gene name', default = 'pncA') # case sensitive arg_parser.add_argument('-d', '--drug', help='drug name', default = 'DRUGNAME') arg_parser.add_argument('-g', '--gene', help='gene name', default = 'geneName') +#arg_parser.add_argument('-p', '--plot', help='show plot', action='store_true') args = arg_parser.parse_args() #======================================================================= #%% variable assignment: input and output @@ -50,6 +51,7 @@ args = arg_parser.parse_args() #gene = 'pncA' drug = args.drug gene = args.gene +#plot = args.plot gene_match = gene + '_p.' #========== @@ -79,7 +81,7 @@ print('Output filename:', out_filename #%% end of variable assignment for input and output files #======================================================================= #%% kd values from fasta file and output csv -def kd_to_csv(inputfasta, outputkdcsv, windowsize, plot=False): +def kd_to_csv(inputfasta, outputkdcsv, windowsize): """ Calculate kd (hydropathy values) from input fasta file @@ -199,13 +201,13 @@ def kd_to_csv(inputfasta, outputkdcsv, windowsize, plot=False): # FIXME: save fig # extract just pdb if from 'id' to pass to title of plot # foo = re.match(r'(^[0-9]{1}\w{3})', id).groups(1) - if plot: - plot(kd_values, linewidth = 1.0) - #axis(xmin = 1, xmax = num_residues) - xlabel('Residue Number') - ylabel('Hydrophobicity') - title('K&D Hydrophobicity for ' + id) - show() +# if doplot: + plot(kd_values, linewidth = 1.0) + #axis(xmin = 1, xmax = num_residues) + xlabel('Residue Number') + ylabel('Hydrophobicity') + title('K&D Hydrophobicity for ' + id) + show() #%% end of function #=======================================================================