Ejemplo n.º 1
0
    def test_from_file_mismatch_0(self):
        """Read barcodes from file, no mismatches.

        Result: file 1, 3 and UNKNOWN contain one read, file 4 contains two.
        """
        demux([self._input], self._barcodes, False, None, None, None, 0, True)
        assert len(self._handles) == 4
        assert self._md5_check('./demultiplex_UNKNOWN.fq',
                               '7a2889d04b4e8514ca01ea6c75884cd6')
Ejemplo n.º 2
0
    def test_from_file_mismatch_1(self):
        """Read barcodes from file, one mismatch.

        Result: file 1-3 contain one read, file 4 contains two and UNKNOWN is
        empty. Notably file 2 is not empty although the barcode is shorter.
        """
        demux([self._input], self._barcodes, False, None, None, None, 1, True)
        assert len(self._handles) == 4
        assert self._md5_check('./demultiplex_2.fq',
                               '7a2889d04b4e8514ca01ea6c75884cd6')
Ejemplo n.º 3
0
    def test_x_from_file_mismatch_0(self):
        """Read barcodes from file, no mismatches, HiSeq X headers.

        Result: file 1-3 contain one sequence, file 4 contains two and UNKNOWN
        is empty.
        """
        demux([self._input_x], self._barcodes, False, None, None, None, 0,
              True)
        assert len(self._handles) == 4
        assert self._md5_check('./demultiplex_x_1.fq',
                               '3f013cddfedf1b5b1ad5d01913692333')
        assert self._md5_check('./demultiplex_x_4.fq',
                               'a044932ca48decaba985032ecf725753')
Ejemplo n.º 4
0
 def test_wrong_barcode_format(self):
     handle = make_fake_file('', 'ACTA\nACTC\nACTG\nACTT\n')
     try:
         demux([self._input], handle, False, None, None, None, 0, False)
     except ValueError as error:
         assert str(error) == 'invalid barcodes file format'