diff --git a/methylprep/files/sample_sheets.py b/methylprep/files/sample_sheets.py index 5369e5d..b2cad77 100644 --- a/methylprep/files/sample_sheets.py +++ b/methylprep/files/sample_sheets.py @@ -499,6 +499,7 @@ def build_meta_data(self, samples = None): cols = list(self.fields.values()) + ['Sample_ID'] meta_frame = pd.DataFrame(columns=cols) # row contains the renamed fields, and pulls in the original data from sample_sheet + rows = [] for sample in samples: row = {} for field in self.fields.keys(): @@ -511,5 +512,8 @@ def build_meta_data(self, samples = None): # add the UID that matches m_value/beta value pickles #... unless there's a GSM_ID too row['Sample_ID'] = f"{row['Sentrix_ID']}_{row['Sentrix_Position']}" - meta_frame = meta_frame.append(row, ignore_index=True) + rows.append(row) + + meta_frame = pd.DataFrame(columns=cols, data=rows) + return meta_frame diff --git a/methylprep/processing/infer_channel_switch.py b/methylprep/processing/infer_channel_switch.py index c9fd4e4..ed92618 100644 --- a/methylprep/processing/infer_channel_switch.py +++ b/methylprep/processing/infer_channel_switch.py @@ -168,8 +168,8 @@ def get_infer_channel_probes(manifest, green_idat, red_idat, debug=False): green_in_band['unmeth'] = oobR_meth # next, add the green-in-band to oobG and red-in-band to oobR - oobG_IG = oobG.append(green_in_band).sort_index() - oobR_IR = oobR.append(red_in_band).sort_index() + oobG_IG = pd.concat([oobG, green_in_band]).sort_index() + oobR_IR = pd.concat([oobR, red_in_band]).sort_index() # channel swap requires a way to update idats with illumina_ids lookupIR = probe_details_IR.merge( @@ -186,7 +186,8 @@ def get_infer_channel_probes(manifest, green_idat, red_idat, debug=False): right_index=True, suffixes=(False, False), )[['AddressA_ID','AddressB_ID']] - lookup = lookupIG.append(lookupIR).sort_index() + #lookup = lookupIG.append(lookupIR).sort_index() + lookup = pd.concat([lookupIG, lookupIR]).sort_index() if debug: return {'green': oobG_IG, 'red': oobR_IR, 'oobG': oobG, 'oobR':oobR, 'IG': green_in_band, 'IR': red_in_band, 'lookup': lookup}