Skip to content

Commit

Permalink
remove ALT contigs to avoid error when plotting Manhattan
Browse files Browse the repository at this point in the history
  • Loading branch information
LindoNkambule committed Jan 27, 2025
1 parent 2de61ab commit 9a21fbe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gwaspy/preimp_qc/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ def manhattan_plot(pvals, significance_threshold: float = -np.log10(5E-08), titl
data['position'] = data['position'].astype(int)
data['chromosome'] = data['chromosome'].str.replace('chr', '')
data['chromosome'].replace({"X": 23, "Y": 24, "MT": 25, "M":25}, inplace=True)
chroms = [f'{i}' for i in range(1, 26)]
data = data[data['chromosome'].isin(chroms)] # removes ALT contigs
data['chromosome'] = data['chromosome'].astype(int)
data.dropna(subset=['p'], inplace=True) # drop NAs as log10(val) won't work

Expand Down

0 comments on commit 9a21fbe

Please sign in to comment.