Skip to content

Commit

Permalink
add func to view sample coverages after wex
Browse files Browse the repository at this point in the history
  • Loading branch information
eaton-lab committed Nov 25, 2024
1 parent 9bbdf98 commit d66b4ea
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ipyrad/analysis/window_extracter.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,13 @@ def _write_to_nex(self):
with open(self.outfile, 'w') as out:
out.write("".join(lines))

def get_sample_stats(self):
"""Return dataframe with nsites and %missing per sample."""
data = pd.DataFrame(index=self.allnames, columns=["nsites", "percent_missing"])
data["nsites"] = np.sum(self.seqarr != 78, axis=1)
data["percent_missing"] = data["nsites"] / self.seqarr.shape[1]
return data



@njit()
Expand Down

0 comments on commit d66b4ea

Please sign in to comment.