Skip to content

Commit d5c3901

Browse files
authored
Merge pull request #568 from AmpliconSuite/python3-12
Python3-12
2 parents 903c2c5 + 7330b8e commit d5c3901

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

caper/caper/sample_plot.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ def plot(db_handle, sample, sample_name, project_name, filter_plots=False):
213213
y_array = [round(item, 2) for item in y_array]
214214

215215
amplicon_df = pd.DataFrame()
216+
rows_buffer = []
216217
for ind, row in amplicon.iterrows():
217218
locs = row["Location"]
218219
for element in locs:
@@ -237,7 +238,7 @@ def plot(db_handle, sample, sample_name, project_name, filter_plots=False):
237238
row['Feature Position'] = int(float(locsplit[0])) - offset//2
238239
row['Y-axis'] = 95
239240
curr_updated_loc += str(locsplit[0]) + "-"
240-
amplicon_df = amplicon_df.append(row)
241+
rows_buffer.append(row.copy())
241242

242243
else:
243244
if relative_width > max_width:
@@ -248,14 +249,17 @@ def plot(db_handle, sample, sample_name, project_name, filter_plots=False):
248249
row['Feature Position'] = spos + k * abs_step
249250
row['Y-axis'] = 95
250251
curr_updated_loc += str(int(row['Feature Position']))
251-
amplicon_df = amplicon_df.append(row)
252+
rows_buffer.append(row.copy())
252253

253254
row['Feature Position'] = int(float(locsplit[1])) + offset//2
254255
row['Y-axis'] = 95
255256
curr_updated_loc += str(int(row['Feature Position']))
256-
amplicon_df = amplicon_df.append(row)
257+
rows_buffer.append(row.copy())
258+
259+
if rows_buffer:
260+
amplicon_df = pd.concat([amplicon_df, pd.DataFrame(rows_buffer)], ignore_index=True)
261+
rows_buffer = []
257262

258-
259263
amplicon_df['Feature Maximum Copy Number'] = amplicon_df['Feature_maximum_copy_number']
260264
amplicon_df['Feature Median Copy Number'] = amplicon_df['Feature_median_copy_number']
261265
for i in range(len(amplicon_df['AA_amplicon_number'].unique())):

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ networkx==3.1
4949
numpy>=1.23.2
5050
oauthlib==3.2.0
5151
packaging==21.3
52-
pandas==1.4.3
52+
pandas==2.2.0
5353
patsy==1.0.1
5454
periodictable==1.6.1
5555
Pillow==9.2.0
@@ -75,7 +75,7 @@ tenacity==8.1.0
7575
threadpoolctl==3.1.0
7676
tinycss2==1.1.1
7777
tqdm==4.64.1
78-
tzdata==2022.1
78+
tzdata==2024.1
7979
tzlocal==4.2
8080
urllib3==1.26.11
8181
uuid==1.30

0 commit comments

Comments
 (0)