saving work for today

This commit is contained in:
Tanushree Tunstall 2020-04-07 17:57:34 +01:00
parent 569b7c6c7f
commit 49a38dd1ae

View file

@ -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
#=======================================================================