def get_unique_reads(self, ignore_haplotype=False, shallow=False):
if self.finalized:<EOL><INDENT>if ignore_haplotype:<EOL><INDENT>summat = self.sum(axis=self.Axis.HAPLOTYPE)<EOL>nnz_per_read = np.diff(summat.tocsr().indptr)<EOL>unique_reads = np.logical_and(nnz_per_read > <NUM_LIT:0>, nnz_per_read < <NUM_LIT:2>)<EOL><DEDENT>else:  <EOL><INDENT>alncnt_per_read = self.sum(axis=self.Axis.LOCUS).sum(axis=self.Axis.HAPLOTYPE)<EOL>unique_reads = np.logical_and(alncnt_per_read > <NUM_LIT:0>, alncnt_per_read < <NUM_LIT:2>)<EOL><DEDENT>return self.pull_alignments_from(unique_reads, shallow=shallow)<EOL><DEDENT>else:<EOL><INDENT>raise RuntimeError('<STR_LIT>')<EOL><DEDENT>
Pull out alignments of uniquely-aligning reads

:param ignore_haplotype: whether to regard allelic multiread as uniquely-aligning read
:param shallow: whether to copy sparse 3D matrix only or not
:return: a new AlignmentPropertyMatrix object that particular reads are