def handle_io(self):
        id = 0
        output = open(self.outputfile, "a")
        with open(self.inputfile, "r") as input:
            block_gen = islice(input, 1, None, 2)
            for i, line in enumerate(block_gen):
                if i % 2:
                    qscore = line.rstrip()
                else:
                    read = line.rstrip()
                    continue
                trimmed_read, trimmed_qscore = self.scanadapt(
                    self.adaptmotifs, read, qscore)
                if self.minsize <= len(trimmed_read) <= self.maxsize:
                    if (self.Nmode == "reject") and ("N" in trimmed_read):
                        continue
                    id += 1
                    self.write_output(id, trimmed_read, trimmed_qscore, output)
            output.close()
Open input file, pass read sequence and read qscore to clipping function.
dataset/ETHPy150Open ARTbio/tools-artbio/tools/yac_clipper/yac.py/Clip.handle_io