Beispiel #1
0
    def test_no_read_files_in_list(self):
        """
        The file list in the sample sheet is invalid
        :return:
        """
        directory = path.join(path_to_module, "fake_dir_data")
        file_path = path.join(directory, "no_read_files.csv")

        with self.assertRaises(SampleSheetError):
            res = sample_parser._parse_samples(file_path)
Beispiel #2
0
    def test_no_forward_read(self):
        """
        No Valid files were found with names given in sample sheet
        :return:
        """
        directory = path.join(path_to_module, "fake_dir_data")
        file_path = path.join(directory, "no_forward.csv")

        with self.assertRaises(SampleSheetError):
            res = sample_parser._parse_samples(file_path)
Beispiel #3
0
    def test_no_reverse_read_with_comma(self):
        """
        The file list in the sample sheet is invalid
        :return:
        """
        directory = path.join(path_to_module, "fake_dir_data")
        file_path = path.join(directory, "no_reverse_with_comma.csv")

        res = sample_parser._parse_samples(file_path)
        # This should have an empty file reverse
        self.assertEqual(res[0]["File_Reverse"], "")
Beispiel #4
0
    def test_valid(self):
        """
        Given a valid sample sheet, parse correctly
        :return:
        """
        sheet_file = path.join(path_to_module, "fake_dir_data",
                               "SampleList_simple.csv")

        file_name_1 = "file_1.fastq.gz"
        file_name_2 = "file_2.fastq.gz"

        res = sample_parser._parse_samples(sheet_file)

        # Check we have 1 sample
        self.assertEqual(len(res), 1)
        # Check if data is correct
        self.assertEqual(res[0]["Sample_Name"], "my-sample-1")
        self.assertEqual(res[0]["Project_ID"], "75")
        self.assertEqual(res[0]["File_Forward"], file_name_1)
        self.assertEqual(res[0]["File_Reverse"], file_name_2)