fusion bug
parent
befe5b7693
commit
b4c9ee1186
|
|
@ -286,17 +286,17 @@ class PostProcess:
|
|||
filter_sum_pos_df['Validated'] = 1
|
||||
filter_sum_pos_df = filter_sum_pos_df.fillna('.')
|
||||
|
||||
grouped_df = filter_sum_pos_df.groupby(['POS', 'REF', 'ALT'])
|
||||
grouped_df = filter_sum_pos_df.groupby(['POS', 'REF', 'FUSION'])
|
||||
# 对每个分组进行操作
|
||||
for group_name, group_data in grouped_df:
|
||||
pos, ref, alt = group_name
|
||||
if any(group_data['AMP_mut_level'] == 'I'):
|
||||
filter_condition = (filter_sum_pos_df['POS'] == pos) & \
|
||||
(filter_sum_pos_df['REF'] == ref) & \
|
||||
(filter_sum_pos_df['ALT'] == alt)
|
||||
(filter_sum_pos_df['FUSION'] == alt)
|
||||
filter_sum_pos_df.loc[filter_condition, 'AMP_mut_level'] = 'I'
|
||||
|
||||
pos_dict = filter_sum_pos_df.set_index(['POS', 'REF', 'ALT'])['AMP_mut_level'].to_dict()
|
||||
pos_dict = filter_sum_pos_df.set_index(['POS', 'REF', 'FUSION'])['AMP_mut_level'].to_dict()
|
||||
filter_sum_pos_res = filter_sum_pos_df.to_dict('records')
|
||||
|
||||
filter_sum = os.path.join(self.path, 'fusion',
|
||||
|
|
@ -309,7 +309,7 @@ class PostProcess:
|
|||
filter_sum_df['Validated'] = 1
|
||||
level_dict = dict()
|
||||
level_dict.update(pos_dict)
|
||||
filter_sum_df['AMP_mut_level'] = filter_sum_df.set_index(['POS', 'REF', 'ALT']).index.map(level_dict)
|
||||
filter_sum_df['AMP_mut_level'] = filter_sum_df.set_index(['POS', 'REF', 'FUSION']).index.map(level_dict)
|
||||
filter_sum_df = filter_sum_df.fillna('.')
|
||||
filter_sum_res = filter_sum_df.to_dict('records')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue