Skip to content

Commit

Permalink
Handle MT values as NaN to avoid string comparison
Browse files Browse the repository at this point in the history
This change ensures that MT (Mitochondria) values are
treated as -1 to mean NaN (Not a Number),
improving the speed by eliminating string comparisons.
  • Loading branch information
jylee-bcm committed Jul 9, 2024
1 parent 0c6e6f1 commit aab49cc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions run/add_c_nc.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ def add_c_nc(score, ref):
bl = clin_nc.new_start.values
bc= clin_nc.new_chr.values

bc[bc=='MT'] = -1 # Treat MT chromosome as NaN values to avoid string comparison
bc = bc.astype(int)

i, j = np.where((a[:, None] >= bl) & (a[:, None] <= bh) &(ac[:, None]==bc))

cln=pd.concat([
Expand Down

0 comments on commit aab49cc

Please sign in to comment.