From eea442a763e0c6c41da16a15d6e11ddf6d222dc8 Mon Sep 17 00:00:00 2001 From: kclem Date: Mon, 1 Nov 2021 11:25:55 -0400 Subject: [PATCH] Remove deprecated pandas .ix from WGS --- CRISPResso2/CRISPRessoWGSCORE.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CRISPResso2/CRISPRessoWGSCORE.py b/CRISPResso2/CRISPRessoWGSCORE.py index d9eac5b4..730b9015 100644 --- a/CRISPResso2/CRISPRessoWGSCORE.py +++ b/CRISPResso2/CRISPRessoWGSCORE.py @@ -123,7 +123,7 @@ def clean_filename(filename): def find_overlapping_genes(row, df_genes): - df_genes_overlapping=df_genes.ix[(df_genes.chrom==row.chr_id) & + df_genes_overlapping=df_genes.loc[(df_genes.chrom==row.chr_id) & (df_genes.txStart<=row.bpend) & (row.bpstart<=df_genes.txEnd)] genes_overlapping=[] @@ -460,7 +460,7 @@ def rreplace(s, old, new): #check or create names for idx, row in df_regions.iterrows(): if pd.isnull(row.Name): - df_regions.ix[idx, 'Name']='_'.join(map(str, [row['chr_id'], row['bpstart'], row['bpend']])) + df_regions.iloc[idx,]['Name']='_'.join(map(str, [row['chr_id'], row['bpstart'], row['bpend']])) if not len(df_regions.Name.unique())==df_regions.shape[0]: @@ -501,7 +501,7 @@ def rreplace(s, old, new): m in re.finditer(current_guide_seq, row.sequence)]+[m.start() + offset_rc for m in re.finditer(CRISPRessoShared.reverse_complement(current_guide_seq), row.sequence)] if not cut_points: - df_regions.ix[idx, 'sgRNA']='' + df_regions.iloc[idx,:]['sgRNA']='' info('Cannot find guide ' + str(row.sgRNA) + ' in amplicon ' + str(idx) + ' (' + str(row) + ')') df_regions['bpstart'] = pd.to_numeric(df_regions['bpstart'])