code: def _exclude_region(self, contig, start, end, fout):
          '''Writes reads not mapping to the given region of contig, start and end as per python convention'''
          sam_reader = pysam.Samfile(self.bam, "rb")
          exclude_interval = pyfastaq.intervals.Interval(start, end - 1)
          for read in sam_reader.fetch(contig):
              read_interval = pyfastaq.intervals.Interval(read.pos, read.reference_end - 1)
              if not read_interval.intersects(exclude_interval):
                  print(mapping.aligned_read_to_read(read, ignore_quality=not self.fastq_out), file=foutf _exclude_region(self, contig, start, end, fout):
          '''Writes reads not mapping to the given region of contig, start and end as per python convention'''
          sam_reader = pysam.Samfile(self.bam, "rb")
          exclude_interval = pyfastaq.intervals.Interval(start, end - 1)
          for read in sam_reader.fetch(contig):
              read_interval = pyfastaq.intervals.Interval(read.pos, read.reference_end - 1)
              if not read_interval.intersects(exclude_interval):
                  print(mapping.aligned_read_to_read(read, ignore_quality=not self.fastq_out), file=fout)
docs: Writes reads not mapping to the given region of contig, start and end as per python convention