Skip to content

Commit

Permalink
Remove deprecated pandas .ix from WGS
Browse files Browse the repository at this point in the history
  • Loading branch information
kclem committed Nov 1, 2021
1 parent 3e6c281 commit eea442a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CRISPResso2/CRISPRessoWGSCORE.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=[]
Expand Down Expand Up @@ -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]:
Expand Down Expand Up @@ -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'])
Expand Down

0 comments on commit eea442a

Please sign in to comment.