Example #1
0
    def _check_results(self):
        self._check_no_error_results()

        se_mats_jc_path = os.path.join(self._out_dir, 'SE.MATS.JC.txt')
        se_mats_jc_header, se_mats_jc_rows, error = output_parser.parse_mats_jc(
            se_mats_jc_path)
        self.assertFalse(error)
        self._check_se_mats_jc_header(se_mats_jc_header)
        self.assertEqual(len(se_mats_jc_rows), 2)
        se_mats_jc_row_0 = se_mats_jc_rows[0]
        self._check_row(se_mats_jc_row_0, '1,3', '1,0', '0,2', '1,2', 2)
        se_mats_jc_row_1 = se_mats_jc_rows[1]
        self._check_row(se_mats_jc_row_1, '0,2', '1,1', '0,1', '1,1', 2)

        se_mats_jcec_path = os.path.join(self._out_dir, 'SE.MATS.JCEC.txt')
        se_mats_jcec_header, se_mats_jcec_rows, error = output_parser.parse_mats_jcec(
            se_mats_jcec_path)
        self.assertFalse(error)
        self._check_se_mats_jcec_header(se_mats_jcec_header)
        self.assertEqual(len(se_mats_jcec_rows), 2)
        se_mats_jcec_row_0 = se_mats_jcec_rows[0]
        self._check_row(se_mats_jcec_row_0, '2,4', '1,0', '0,3', '1,2', 2)
        se_mats_jcec_row_1 = se_mats_jcec_rows[1]
        self._check_row(se_mats_jcec_row_1, '1,4', '1,1', '1,4', '1,1', 2)

        status_path = os.path.join(self._out_dir, 'tmp', 'JC_SE',
                                   'pairadise_status.txt')
        self.assertTrue(os.path.exists(status_path))
Example #2
0
    def _get_matched_se_mats_jcec_rows(self, gtf_rows):
        matched_rows = [None for _ in range(len(gtf_rows))]

        se_mats_jcec_path = os.path.join(self._out_dir, 'SE.MATS.JCEC.txt')
        se_mats_jcec_header, se_mats_jcec_rows, error = output_parser.parse_mats_jcec(
            se_mats_jcec_path)
        self.assertFalse(error)
        self.assertEqual(len(se_mats_jcec_rows), len(gtf_rows))
        gtf_ids = [r['ID'] for r in gtf_rows]
        for mats_row in se_mats_jcec_rows:
            idx = gtf_ids.index(mats_row['ID'])
            matched_rows[idx] = mats_row

        self.assertTrue(all(matched_rows))
        return matched_rows
Example #3
0
    def _check_results(self):
        self._check_no_error_results()

        se_mats_jc_path = os.path.join(self._out_dir, 'SE.MATS.JC.txt')
        se_mats_jc_header, se_mats_jc_rows, error = output_parser.parse_mats_jc(
            se_mats_jc_path)
        self.assertFalse(error)
        self._check_se_mats_jc_header(se_mats_jc_header)
        self.assertEqual(len(se_mats_jc_rows), 1)
        se_mats_jc_row_0 = se_mats_jc_rows[0]
        self._check_row(se_mats_jc_row_0, '1,3', '1,1', '0,1', '2,3', 2)

        se_mats_jcec_path = os.path.join(self._out_dir, 'SE.MATS.JCEC.txt')
        se_mats_jcec_header, se_mats_jcec_rows, error = output_parser.parse_mats_jcec(
            se_mats_jcec_path)
        self.assertFalse(error)
        self._check_se_mats_jcec_header(se_mats_jcec_header)
        self.assertEqual(len(se_mats_jcec_rows), 1)
        se_mats_jcec_row_0 = se_mats_jcec_rows[0]
        self._check_row(se_mats_jcec_row_0, '2,6', '1,1', '0,2', '2,3', 2)
Example #4
0
    def _check_results(self):
        self._check_no_error_results()

        se_mats_jc_path = os.path.join(self._out_dir, 'SE.MATS.JC.txt')
        se_mats_jc_header, se_mats_jc_rows, error = output_parser.parse_mats_jc(
            se_mats_jc_path)
        self.assertFalse(error)
        self._check_se_mats_jc_header(se_mats_jc_header)
        self.assertEqual(len(se_mats_jc_rows), 3)
        se_mats_jc_row_0 = se_mats_jc_rows[0]
        self._check_row(se_mats_jc_row_0, '1,0', '1,0', '1,0', '1,0', 2)
        se_mats_jc_row_1 = se_mats_jc_rows[1]
        self._check_row(se_mats_jc_row_1,
                        '0,1',
                        '0,1',
                        '1,0',
                        '1,0',
                        2,
                        expect_nan_pvalue=True)
        se_mats_jc_row_2 = se_mats_jc_rows[2]
        self._check_row(se_mats_jc_row_2, '0,1', '0,1', '0,1', '0,1', 2)

        se_mats_jcec_path = os.path.join(self._out_dir, 'SE.MATS.JCEC.txt')
        se_mats_jcec_header, se_mats_jcec_rows, error = output_parser.parse_mats_jcec(
            se_mats_jcec_path)
        self.assertFalse(error)
        self._check_se_mats_jcec_header(se_mats_jcec_header)
        self.assertEqual(len(se_mats_jcec_rows), 3)
        se_mats_jcec_row_0 = se_mats_jcec_rows[0]
        self._check_row(se_mats_jcec_row_0, '2,0', '1,0', '2,0', '1,0', 2)
        se_mats_jcec_row_1 = se_mats_jcec_rows[1]
        self._check_row(se_mats_jcec_row_1,
                        '0,2',
                        '0,1',
                        '2,0',
                        '1,0',
                        2,
                        expect_nan_pvalue=True)
        se_mats_jcec_row_2 = se_mats_jcec_rows[2]
        self._check_row(se_mats_jcec_row_2, '0,2', '0,1', '0,2', '0,1', 2)
Example #5
0
    def _check_results(self):
        self._check_no_error_results()

        se_mats_jc_path = os.path.join(self._out_dir, 'SE.MATS.JC.txt')
        se_mats_jc_header, se_mats_jc_rows, error = output_parser.parse_mats_jc(
            se_mats_jc_path)
        self.assertFalse(error)
        self._check_se_mats_jc_header(se_mats_jc_header)
        self.assertEqual(len(se_mats_jc_rows), 2)
        for row in se_mats_jc_rows:
            self.assertIn(row['exonStart_0base'], ['200', '1200'])
            if row['exonStart_0base'] == '200':
                self.assertEqual(row['IJC_SAMPLE_1'], '1,1')
                self.assertEqual(row['SJC_SAMPLE_1'], '1,1')
                self.assertEqual(row['strand'], '+')
            elif row['exonStart_0base'] == '1200':
                self.assertEqual(row['IJC_SAMPLE_1'], '1,1')
                self.assertEqual(row['SJC_SAMPLE_1'], '1,1')
                self.assertEqual(row['strand'], '-')

        se_mats_jcec_path = os.path.join(self._out_dir, 'SE.MATS.JCEC.txt')
        se_mats_jcec_header, se_mats_jcec_rows, error = (
            output_parser.parse_mats_jcec(se_mats_jcec_path))
        self.assertFalse(error)
        self._check_se_mats_jcec_header(se_mats_jcec_header)
        self.assertEqual(len(se_mats_jcec_rows), 2)
        for row in se_mats_jcec_rows:
            self.assertIn(row['exonStart_0base'], ['200', '1200'])
            if row['exonStart_0base'] == '200':
                self.assertEqual(row['IJC_SAMPLE_1'], '2,2')
                self.assertEqual(row['SJC_SAMPLE_1'], '1,1')
                self.assertEqual(row['strand'], '+')
            elif row['exonStart_0base'] == '1200':
                self.assertEqual(row['IJC_SAMPLE_1'], '2,2')
                self.assertEqual(row['SJC_SAMPLE_1'], '1,1')
                self.assertEqual(row['strand'], '-')
Example #6
0
    def _check_results_deferred_stat(self):
        self._check_no_error_results()

        se_mats_jc_path = os.path.join(self._out_dir_all, 'SE.MATS.JC.txt')
        se_mats_jc_header, se_mats_jc_rows, error = output_parser.parse_mats_jc(
            se_mats_jc_path)
        self.assertFalse(error)
        self._check_se_mats_jc_header(se_mats_jc_header)
        self.assertEqual(len(se_mats_jc_rows), 2)
        for row in se_mats_jc_rows:
            self.assertIn(row['exonStart_0base'], ['200', '800'])
            if row['exonStart_0base'] == '200':
                self.assertEqual(row['IJC_SAMPLE_1'], '10,15')
                self.assertEqual(row['SJC_SAMPLE_1'], '10,5')
                self.assertEqual(row['IJC_SAMPLE_2'], '10,10')
                self.assertEqual(row['SJC_SAMPLE_2'], '0,0')
                tests.util.assert_within_bounds(self, float(row['PValue']), 0,
                                                1)
                tests.util.assert_within_bounds(self, float(row['FDR']), 0, 1)
                self.assertEqual(self._read_floats(row['IncLevel1']),
                                 [0.333, 0.6])
                self.assertEqual(self._read_floats(row['IncLevel2']),
                                 [1.0, 1.0])
                self.assertEqual(float(row['IncLevelDifference']), -0.533)
            elif row['exonStart_0base'] == '800':
                self.assertEqual(row['IJC_SAMPLE_1'], '10,10')
                self.assertEqual(row['SJC_SAMPLE_1'], '0,0')
                self.assertEqual(row['IJC_SAMPLE_2'], '10,15')
                self.assertEqual(row['SJC_SAMPLE_2'], '10,5')
                tests.util.assert_within_bounds(self, float(row['PValue']), 0,
                                                1)
                tests.util.assert_within_bounds(self, float(row['FDR']), 0, 1)
                self.assertEqual(self._read_floats(row['IncLevel1']),
                                 [1.0, 1.0])
                self.assertEqual(self._read_floats(row['IncLevel2']),
                                 [0.333, 0.6])
                self.assertEqual(float(row['IncLevelDifference']), 0.533)

        se_mats_jcec_path = os.path.join(self._out_dir_all, 'SE.MATS.JCEC.txt')
        se_mats_jcec_header, se_mats_jcec_rows, error = (
            output_parser.parse_mats_jcec(se_mats_jcec_path))
        self.assertFalse(error)
        self._check_se_mats_jcec_header(se_mats_jcec_header)
        self.assertEqual(len(se_mats_jcec_rows), 2)
        for row in se_mats_jcec_rows:
            self.assertIn(row['exonStart_0base'], ['200', '800'])
            if row['exonStart_0base'] == '200':
                self.assertEqual(row['IJC_SAMPLE_1'], '20,30')
                self.assertEqual(row['SJC_SAMPLE_1'], '10,5')
                self.assertEqual(row['IJC_SAMPLE_2'], '20,20')
                self.assertEqual(row['SJC_SAMPLE_2'], '0,0')
                tests.util.assert_within_bounds(self, float(row['PValue']), 0,
                                                1)
                tests.util.assert_within_bounds(self, float(row['FDR']), 0, 1)
                self.assertEqual(self._read_floats(row['IncLevel1']),
                                 [0.397, 0.664])
                self.assertEqual(self._read_floats(row['IncLevel2']),
                                 [1.0, 1.0])
                self.assertEqual(float(row['IncLevelDifference']), -0.47)

        mxe_mats_jc_path = os.path.join(self._out_dir_all, 'MXE.MATS.JC.txt')
        mxe_mats_jc_header, mxe_mats_jc_rows, error = (
            output_parser.parse_mats_jc(mxe_mats_jc_path))
        self.assertFalse(error)
        self._check_mxe_mats_jc_header(mxe_mats_jc_header)
        self.assertEqual(len(mxe_mats_jc_rows), 1)
        tests.util.assert_within_bounds(self,
                                        float(mxe_mats_jc_rows[0]['FDR']), 0,
                                        1)

        mxe_mats_jcec_path = os.path.join(self._out_dir_all,
                                          'MXE.MATS.JCEC.txt')
        mxe_mats_jcec_header, mxe_mats_jcec_rows, error = (
            output_parser.parse_mats_jcec(mxe_mats_jcec_path))
        self.assertFalse(error)
        self._check_mxe_mats_jcec_header(mxe_mats_jcec_header)
        self.assertEqual(len(mxe_mats_jcec_rows), 1)
        tests.util.assert_within_bounds(self,
                                        float(mxe_mats_jcec_rows[0]['FDR']), 0,
                                        1)

        a5ss_mats_jc_path = os.path.join(self._out_dir_all, 'A5SS.MATS.JC.txt')
        a5ss_mats_jc_header, a5ss_mats_jc_rows, error = (
            output_parser.parse_mats_jc(a5ss_mats_jc_path))
        self.assertFalse(error)
        self._check_a35ss_mats_jc_header(a5ss_mats_jc_header)
        self.assertEqual(len(a5ss_mats_jc_rows), 1)
        tests.util.assert_within_bounds(self,
                                        float(a5ss_mats_jc_rows[0]['FDR']), 0,
                                        1)

        a5ss_mats_jcec_path = os.path.join(self._out_dir_all,
                                           'A5SS.MATS.JCEC.txt')
        a5ss_mats_jcec_header, a5ss_mats_jcec_rows, error = (
            output_parser.parse_mats_jcec(a5ss_mats_jcec_path))
        self.assertFalse(error)
        self._check_a35ss_mats_jcec_header(a5ss_mats_jcec_header)
        self.assertEqual(len(a5ss_mats_jcec_rows), 1)
        tests.util.assert_within_bounds(self,
                                        float(a5ss_mats_jcec_rows[0]['FDR']),
                                        0, 1)

        a3ss_mats_jc_path = os.path.join(self._out_dir_all, 'A3SS.MATS.JC.txt')
        a3ss_mats_jc_header, a3ss_mats_jc_rows, error = (
            output_parser.parse_mats_jc(a3ss_mats_jc_path))
        self.assertFalse(error)
        self._check_a35ss_mats_jc_header(a3ss_mats_jc_header)
        self.assertEqual(len(a3ss_mats_jc_rows), 1)
        tests.util.assert_within_bounds(self,
                                        float(a3ss_mats_jc_rows[0]['FDR']), 0,
                                        1)

        a3ss_mats_jcec_path = os.path.join(self._out_dir_all,
                                           'A3SS.MATS.JCEC.txt')
        a3ss_mats_jcec_header, a3ss_mats_jcec_rows, error = (
            output_parser.parse_mats_jcec(a3ss_mats_jcec_path))
        self.assertFalse(error)
        self._check_a35ss_mats_jcec_header(a3ss_mats_jcec_header)
        self.assertEqual(len(a3ss_mats_jcec_rows), 1)
        tests.util.assert_within_bounds(self,
                                        float(a3ss_mats_jcec_rows[0]['FDR']),
                                        0, 1)

        ri_mats_jc_path = os.path.join(self._out_dir_all, 'RI.MATS.JC.txt')
        ri_mats_jc_header, ri_mats_jc_rows, error = output_parser.parse_mats_jc(
            ri_mats_jc_path)
        self.assertFalse(error)
        self._check_ri_mats_jc_header(ri_mats_jc_header)
        self.assertEqual(len(ri_mats_jc_rows), 1)
        tests.util.assert_within_bounds(self, float(ri_mats_jc_rows[0]['FDR']),
                                        0, 1)

        ri_mats_jcec_path = os.path.join(self._out_dir_all, 'RI.MATS.JCEC.txt')
        ri_mats_jcec_header, ri_mats_jcec_rows, error = (
            output_parser.parse_mats_jcec(ri_mats_jcec_path))
        self.assertFalse(error)
        self._check_ri_mats_jcec_header(ri_mats_jcec_header)
        self.assertEqual(len(ri_mats_jcec_rows), 1)
        tests.util.assert_within_bounds(self,
                                        float(ri_mats_jcec_rows[0]['FDR']), 0,
                                        1)
Example #7
0
    def _check_results_fixed(self):
        self._check_no_error_results()

        se_mats_jc_path = os.path.join(self._out_dir_fixed, 'SE.MATS.JC.txt')
        se_mats_jc_header, se_mats_jc_rows, error = output_parser.parse_mats_jc(
            se_mats_jc_path)
        self.assertFalse(error)
        self._check_se_mats_jc_header(se_mats_jc_header)
        self.assertEqual(len(se_mats_jc_rows), 4)
        for row in se_mats_jc_rows:
            self.assertIn(row['exonStart_0base'],
                          ['200', '1200', '3600', '4600'])
            if row['exonStart_0base'] == '200':
                self.assertEqual(row['IJC_SAMPLE_1'], '1,1')
                self.assertEqual(row['SJC_SAMPLE_1'], '1,1')
                self.assertEqual(row['IJC_SAMPLE_2'], '0,1')
                self.assertEqual(row['SJC_SAMPLE_2'], '0,1')
                self.assertEqual(row['IncFormLen'], '98')
                self.assertEqual(row['SkipFormLen'], '49')
            if row['exonStart_0base'] == '1200':
                self.assertEqual(row['IJC_SAMPLE_1'], '0,0')
                self.assertEqual(row['SJC_SAMPLE_1'], '0,0')
                self.assertEqual(row['IJC_SAMPLE_2'], '0,1')
                self.assertEqual(row['SJC_SAMPLE_2'], '0,0')

        se_mats_jcec_path = os.path.join(self._out_dir_fixed,
                                         'SE.MATS.JCEC.txt')
        se_mats_jcec_header, se_mats_jcec_rows, error = (
            output_parser.parse_mats_jcec(se_mats_jcec_path))
        self.assertFalse(error)
        self._check_se_mats_jcec_header(se_mats_jcec_header)
        self.assertEqual(len(se_mats_jcec_rows), 4)
        for row in se_mats_jcec_rows:
            self.assertIn(row['exonStart_0base'],
                          ['200', '1200', '3600', '4600'])
            if row['exonStart_0base'] == '200':
                self.assertEqual(row['IJC_SAMPLE_1'], '2,2')
                self.assertEqual(row['SJC_SAMPLE_1'], '1,1')
                self.assertEqual(row['IJC_SAMPLE_2'], '0,2')
                self.assertEqual(row['SJC_SAMPLE_2'], '0,1')
                self.assertEqual(row['IncFormLen'], '149')
                self.assertEqual(row['SkipFormLen'], '49')
            if row['exonStart_0base'] == '1200':
                self.assertEqual(row['IJC_SAMPLE_1'], '0,0')
                self.assertEqual(row['SJC_SAMPLE_1'], '0,0')
                self.assertEqual(row['IJC_SAMPLE_2'], '0,2')
                self.assertEqual(row['SJC_SAMPLE_2'], '0,0')

        mxe_mats_jc_path = os.path.join(self._out_dir_fixed, 'MXE.MATS.JC.txt')
        mxe_mats_jc_header, mxe_mats_jc_rows, error = (
            output_parser.parse_mats_jc(mxe_mats_jc_path))
        self.assertFalse(error)
        self._check_mxe_mats_jc_header(mxe_mats_jc_header)
        self.assertEqual(len(mxe_mats_jc_rows), 2)
        for row in mxe_mats_jc_rows:
            self.assertIn(row['1stExonStart_0base'], ['3200', '4200'])
            if row['1stExonStart_0base'] == '3200':
                self.assertEqual(row['IJC_SAMPLE_1'], '1,1')
                self.assertEqual(row['SJC_SAMPLE_1'], '1,1')
                self.assertEqual(row['IJC_SAMPLE_2'], '0,1')
                self.assertEqual(row['SJC_SAMPLE_2'], '0,1')
                self.assertEqual(row['IncFormLen'], '98')
                self.assertEqual(row['SkipFormLen'], '98')
            if row['1stExonStart_0base'] == '4200':
                self.assertEqual(row['IJC_SAMPLE_1'], '0,0')
                self.assertEqual(row['SJC_SAMPLE_1'], '0,0')
                self.assertEqual(row['IJC_SAMPLE_2'], '0,1')
                self.assertEqual(row['SJC_SAMPLE_2'], '0,0')

        mxe_mats_jcec_path = os.path.join(self._out_dir_fixed,
                                          'MXE.MATS.JCEC.txt')
        mxe_mats_jcec_header, mxe_mats_jcec_rows, error = (
            output_parser.parse_mats_jcec(mxe_mats_jcec_path))
        self.assertFalse(error)
        self._check_mxe_mats_jcec_header(mxe_mats_jcec_header)
        self.assertEqual(len(mxe_mats_jcec_rows), 2)
        for row in mxe_mats_jcec_rows:
            self.assertIn(row['1stExonStart_0base'], ['3200', '4200'])
            if row['1stExonStart_0base'] == '3200':
                self.assertEqual(row['IJC_SAMPLE_1'], '2,2')
                self.assertEqual(row['SJC_SAMPLE_1'], '1,1')
                self.assertEqual(row['IJC_SAMPLE_2'], '0,2')
                self.assertEqual(row['SJC_SAMPLE_2'], '0,1')
                self.assertEqual(row['IncFormLen'], '149')
                self.assertEqual(row['SkipFormLen'], '149')
            if row['1stExonStart_0base'] == '4200':
                self.assertEqual(row['IJC_SAMPLE_1'], '0,0')
                self.assertEqual(row['SJC_SAMPLE_1'], '0,0')
                self.assertEqual(row['IJC_SAMPLE_2'], '0,2')
                self.assertEqual(row['SJC_SAMPLE_2'], '0,0')

        a5ss_mats_jc_path = os.path.join(self._out_dir_fixed,
                                         'A5SS.MATS.JC.txt')
        a5ss_mats_jc_header, a5ss_mats_jc_rows, error = (
            output_parser.parse_mats_jc(a5ss_mats_jc_path))
        self.assertFalse(error)
        self._check_a35ss_mats_jc_header(a5ss_mats_jc_header)
        self.assertEqual(len(a5ss_mats_jc_rows), 2)
        for row in a5ss_mats_jc_rows:
            self.assertIn(row['longExonStart_0base'], ['6000', '7000'])
            if row['longExonStart_0base'] == '6000':
                self.assertEqual(row['IJC_SAMPLE_1'], '1,1')
                self.assertEqual(row['SJC_SAMPLE_1'], '1,1')
                self.assertEqual(row['IJC_SAMPLE_2'], '0,1')
                self.assertEqual(row['SJC_SAMPLE_2'], '0,1')
                self.assertEqual(row['IncFormLen'], '98')
                self.assertEqual(row['SkipFormLen'], '49')
            if row['longExonStart_0base'] == '7000':
                self.assertEqual(row['IJC_SAMPLE_1'], '0,0')
                self.assertEqual(row['SJC_SAMPLE_1'], '0,0')
                self.assertEqual(row['IJC_SAMPLE_2'], '0,1')
                self.assertEqual(row['SJC_SAMPLE_2'], '0,0')

        a5ss_mats_jcec_path = os.path.join(self._out_dir_fixed,
                                           'A5SS.MATS.JCEC.txt')
        a5ss_mats_jcec_header, a5ss_mats_jcec_rows, error = (
            output_parser.parse_mats_jcec(a5ss_mats_jcec_path))
        self.assertFalse(error)
        self._check_a35ss_mats_jcec_header(a5ss_mats_jcec_header)
        self.assertEqual(len(a5ss_mats_jcec_rows), 2)
        for row in a5ss_mats_jcec_rows:
            self.assertIn(row['longExonStart_0base'], ['6000', '7000'])
            if row['longExonStart_0base'] == '6000':
                self.assertEqual(row['IJC_SAMPLE_1'], '1,1')
                self.assertEqual(row['SJC_SAMPLE_1'], '1,1')
                self.assertEqual(row['IJC_SAMPLE_2'], '0,1')
                self.assertEqual(row['SJC_SAMPLE_2'], '0,1')
                self.assertEqual(row['IncFormLen'], '149')
                self.assertEqual(row['SkipFormLen'], '49')
            if row['longExonStart_0base'] == '7000':
                self.assertEqual(row['IJC_SAMPLE_1'], '0,0')
                self.assertEqual(row['SJC_SAMPLE_1'], '0,0')
                self.assertEqual(row['IJC_SAMPLE_2'], '0,1')
                self.assertEqual(row['SJC_SAMPLE_2'], '0,0')

        a3ss_mats_jc_path = os.path.join(self._out_dir_fixed,
                                         'A3SS.MATS.JC.txt')
        a3ss_mats_jc_header, a3ss_mats_jc_rows, error = (
            output_parser.parse_mats_jc(a3ss_mats_jc_path))
        self.assertFalse(error)
        self._check_a35ss_mats_jc_header(a3ss_mats_jc_header)
        self.assertEqual(len(a3ss_mats_jc_rows), 2)
        for row in a3ss_mats_jc_rows:
            self.assertIn(row['longExonStart_0base'], ['9200', '10200'])
            if row['longExonStart_0base'] == '9200':
                self.assertEqual(row['IJC_SAMPLE_1'], '1,1')
                self.assertEqual(row['SJC_SAMPLE_1'], '1,1')
                self.assertEqual(row['IJC_SAMPLE_2'], '0,1')
                self.assertEqual(row['SJC_SAMPLE_2'], '0,1')
                self.assertEqual(row['IncFormLen'], '98')
                self.assertEqual(row['SkipFormLen'], '49')
            if row['longExonStart_0base'] == '10200':
                self.assertEqual(row['IJC_SAMPLE_1'], '0,0')
                self.assertEqual(row['SJC_SAMPLE_1'], '0,0')
                self.assertEqual(row['IJC_SAMPLE_2'], '0,1')
                self.assertEqual(row['SJC_SAMPLE_2'], '0,0')

        a3ss_mats_jcec_path = os.path.join(self._out_dir_fixed,
                                           'A3SS.MATS.JCEC.txt')
        a3ss_mats_jcec_header, a3ss_mats_jcec_rows, error = (
            output_parser.parse_mats_jcec(a3ss_mats_jcec_path))
        self.assertFalse(error)
        self._check_a35ss_mats_jcec_header(a3ss_mats_jcec_header)
        self.assertEqual(len(a3ss_mats_jcec_rows), 2)
        for row in a3ss_mats_jcec_rows:
            self.assertIn(row['longExonStart_0base'], ['9200', '10200'])
            if row['longExonStart_0base'] == '9200':
                self.assertEqual(row['IJC_SAMPLE_1'], '1,1')
                self.assertEqual(row['SJC_SAMPLE_1'], '1,1')
                self.assertEqual(row['IJC_SAMPLE_2'], '0,1')
                self.assertEqual(row['SJC_SAMPLE_2'], '0,1')
                self.assertEqual(row['IncFormLen'], '149')
                self.assertEqual(row['SkipFormLen'], '49')
            if row['longExonStart_0base'] == '10200':
                self.assertEqual(row['IJC_SAMPLE_1'], '0,0')
                self.assertEqual(row['SJC_SAMPLE_1'], '0,0')
                self.assertEqual(row['IJC_SAMPLE_2'], '0,1')
                self.assertEqual(row['SJC_SAMPLE_2'], '0,0')

        ri_mats_jc_path = os.path.join(self._out_dir_fixed, 'RI.MATS.JC.txt')
        ri_mats_jc_header, ri_mats_jc_rows, error = output_parser.parse_mats_jc(
            ri_mats_jc_path)
        self.assertFalse(error)
        self._check_ri_mats_jc_header(ri_mats_jc_header)
        self.assertEqual(len(ri_mats_jc_rows), 2)
        for row in ri_mats_jc_rows:
            self.assertIn(row['riExonStart_0base'], ['12000', '13000'])
            if row['riExonStart_0base'] == '12000':
                self.assertEqual(row['IJC_SAMPLE_1'], '2,2')
                self.assertEqual(row['SJC_SAMPLE_1'], '1,1')
                self.assertEqual(row['IJC_SAMPLE_2'], '0,2')
                self.assertEqual(row['SJC_SAMPLE_2'], '0,1')
                self.assertEqual(row['IncFormLen'], '98')
                self.assertEqual(row['SkipFormLen'], '49')
            if row['riExonStart_0base'] == '13000':
                self.assertEqual(row['IJC_SAMPLE_1'], '0,0')
                self.assertEqual(row['SJC_SAMPLE_1'], '0,0')
                self.assertEqual(row['IJC_SAMPLE_2'], '0,2')
                self.assertEqual(row['SJC_SAMPLE_2'], '0,0')

        ri_mats_jcec_path = os.path.join(self._out_dir_fixed,
                                         'RI.MATS.JCEC.txt')
        ri_mats_jcec_header, ri_mats_jcec_rows, error = (
            output_parser.parse_mats_jcec(ri_mats_jcec_path))
        self.assertFalse(error)
        self._check_ri_mats_jcec_header(ri_mats_jcec_header)
        self.assertEqual(len(ri_mats_jcec_rows), 2)
        for row in ri_mats_jcec_rows:
            self.assertIn(row['riExonStart_0base'], ['12000', '13000'])
            if row['riExonStart_0base'] == '12000':
                self.assertEqual(row['IJC_SAMPLE_1'], '2,2')
                self.assertEqual(row['SJC_SAMPLE_1'], '1,1')
                self.assertEqual(row['IJC_SAMPLE_2'], '0,2')
                self.assertEqual(row['SJC_SAMPLE_2'], '0,1')
                self.assertEqual(row['IncFormLen'], '249')
                self.assertEqual(row['SkipFormLen'], '49')
            if row['riExonStart_0base'] == '13000':
                self.assertEqual(row['IJC_SAMPLE_1'], '0,0')
                self.assertEqual(row['SJC_SAMPLE_1'], '0,0')
                self.assertEqual(row['IJC_SAMPLE_2'], '0,2')
                self.assertEqual(row['SJC_SAMPLE_2'], '0,0')