Skip to content
Snippets Groups Projects
Commit da3e24a5 authored by Ashrith Sagar Yedlapalli's avatar Ashrith Sagar Yedlapalli :speech_balloon:
Browse files

c0.15.30

parent 13a0a830
No related branches found
No related tags found
No related merge requests found
......@@ -44,31 +44,29 @@ class BAlaS:
return df_ddg
def replot_filter(self, threshold):
def replot_filter(self, mutation_lock=[], lower_threshold=0, upper_threshold=1):
"""Filter out based on ddG thresholds"""
# Remove mutation_lock positions.
df = self.df_ddg
# ddg_pos = df[df['ddGs'] > 0]
# print("Positive DDG values:\n", ddg_pos.sort_values('ddGs', ascending=False))
drop_positions = [int(x)-1 for x in mutation_lock if True]
df = df.drop(drop_positions)
# ddg_neg = df[df['ddGs'] < 0]
# print("Negative DDG values:\n", ddg_neg.sort_values('ddGs', ascending=True))
# print("Ascending DDG values:\n", df.sort_values('ddGs', ascending=True))
df = df[df['ddGs'] > 0]
ddg_threshold = df[df['ddGs'] < threshold]
print("DDG values for less than threshold", threshold, "kCal/mol:\n",
df = df[df['ddGs'] > lower_threshold]
ddg_threshold = df[df['ddGs'] < upper_threshold]
print("DDG values for between", lower_threshold,
"and", upper_threshold, "kCal/mol:\n",
ddg_threshold.sort_values('ddGs', ascending=True))
self.ddg_threshold = ddg_threshold
return ddg_threshold
def replot_get_positions(self, count=5, mutation_lock=[]):
def replot_get_positions(self, count=5):
"""Get positions from filtered ddG thresholds"""
ddg_threshold_sorted = self.ddg_threshold.sort_values('ddGs', ascending=True)
df_ResNumber = ddg_threshold_sorted[['ResNumber']]
df_ResNumber_clipped = df_ResNumber.head(count)
df_ResNumber_clipped.reset_index()
positions = []
for index, ResNumber in df_ResNumber_clipped.iterrows():
......@@ -420,8 +418,8 @@ def main():
if args.alaninescan:
bude = BAlaS()
df_ddg = bude.replot_read(args.alaninescan)
ddg_preferences = bude.replot_filter(1)
positions = bude.replot_get_positions(args.mutation_count, mutations_obj.mutation_lock)
ddg_preferences = bude.replot_filter(mutation_lock, 0, 1)
positions = bude.replot_get_positions(args.mutation_count)
muts = to_mut_obj(sequence, positions)
mutations_obj = mutater(sequence=sequence, mutations=muts, mutation_lock=[])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment