예제 #1
0
파일: test.py 프로젝트: baranwa2/seqc
 def test_remote_from_samfile(self, platform='in_drop_v2'):
     test_name = 'test_remote_%s' % platform
     self.check_parameters()
     argv = [
         'run',
         platform,
         '-o',
         REMOTE_OUTPUT,
         '-u',
         UPLOAD % (self.bucket, test_name),
         '-i',
         INDEX,
         '-e',
         self.email,
         '-a',
         SAMFILE % platform,
         '-k',
         self.rsa_key,
         '--instance-type',
         'r5.2xlarge',
         '--debug',
         # '--spot-bid', '1.0'
     ]
     if platform != 'drop_seq':
         argv += ['--barcode-files', PLATFORM_BARCODES % platform]
     main.main(argv)
예제 #2
0
    def test_using_local_dataset(self, platform="ten_x_v2"):
        # must NOT end with a slash
        file_prefix = "test"
        output_prefix = os.path.join(self.path_temp, file_prefix)

        params = [
            ("run", platform),
            ("--local", ),
            ("--output-prefix", output_prefix),
            ("--index", dataset_local.index),
            ("--barcode-files", dataset_local.barcodes % platform),
            ("--barcode-fastq", dataset_local.barcode_fastq % platform),
            ("--genomic-fastq", dataset_local.genomic_fastq % platform),
            ("--star-args", "runRNGseed=0"),
        ]

        argv = [element for tupl in params for element in tupl]

        if platform != "drop_seq":
            argv += ["--barcode-files", dataset_local.barcodes % platform]

        main.main(argv)

        # get output file list
        files = get_output_file_list(self.test_id, self.path_temp)

        # check if each expected file is found in the list of files generated
        for file in expected_output_files(file_prefix):
            self.assertIn(file, files)
예제 #3
0
파일: test.py 프로젝트: baranwa2/seqc
 def test_remote_from_raw_fastq(self, platform='ten_x_v2'):
     test_name = 'test_remote_%s' % platform
     self.check_parameters()
     argv = [
         'run', platform, '-o', REMOTE_OUTPUT, '-u',
         UPLOAD % (self.bucket, test_name), '-i', INDEX, '-e', self.email,
         '-b', BARCODE_FASTQ % platform, '-g', GENOMIC_FASTQ % platform,
         '--instance-type', 'c4.large', '--spot-bid', '1.0', '-k',
         self.rsa_key, '--debug'
     ]
     if platform != 'drop_seq':
         argv += ['--barcode-files', PLATFORM_BARCODES % platform]
     main.main(argv)
예제 #4
0
    def test_remote_from_raw_fastq(self, platform="ten_x_v2"):
        output_prefix = "from-raw-fastq"
        # must end with a slash
        test_folder = f"seqc/run-{platform}-{self.test_id}/"

        params = [
            ("run", platform),
            ("--output-prefix", "from-raw-fastq"),
            ("--upload-prefix", f"s3://{self.s3_bucket}/{test_folder}"),
            ("--index", dataset_s3.index),
            ("--email", self.email),
            ("--barcode-fastq", dataset_s3.barcode_fastq % platform),
            ("--genomic-fastq", dataset_s3.genomic_fastq % platform),
            ("--instance-type", "r5.2xlarge"),
            ("--spot-bid", "1.0"),
            ("--rsa-key", self.rsa_key),
            ("--debug",),
            ("--remote-update",),
            ("--ami-id", self.ami_id),
            ("--user-tags", f"TestID:{self.test_id}"),
        ]

        argv = [element for tupl in params for element in tupl]

        if platform != "drop_seq":
            argv += ["--barcode-files", dataset_s3.barcodes % platform]

        main.main(argv)

        # wait until terminated
        # get output file list
        files = get_output_file_list(self.test_id, self.s3_bucket, test_folder)

        # check for the exact same filenames
        self.assertSetEqual(files, expected_output_files(output_prefix))

        # check for success message in seqc_log.txt
        has_success_msg = check_for_success_msg(
            s3_seqc_log_uri="s3://{}/{}".format(
                self.s3_bucket, os.path.join(test_folder, "seqc_log.txt")
            ),
            path_temp=self.path_temp,
        )

        self.assertTrue(
            has_success_msg, msg="Unable to find the success message in the log"
        )
예제 #5
0
파일: test.py 프로젝트: baranwa2/seqc
 def test_local(self, platform='in_drop_v2'):
     """test seqc after pre-downloading all files"""
     with open('seqc_log.txt', 'w') as f:
         f.write(
             'Dummy log. nose2 captures input, so no log is produced. This causes '
             'pipeline errors.\n')
     test_name = 'test_no_aws_%s' % platform
     makedirs(LOCAL_OUTPUT % test_name)
     if self.email is None:
         self.email = input(
             'please provide an email address for SEQC to mail results: ')
     argv = [
         'run', platform, '-o', test_name, '-i', INDEX, '-b',
         BARCODE_FASTQ % platform, '-g', GENOMIC_FASTQ % platform,
         '--barcode-files', PLATFORM_BARCODES % platform, '-e', self.email,
         '--local'
     ]
     main.main(argv)
     os.remove('./seqc_log.txt')  # clean up the dummy log we made.
예제 #6
0
def test_generate_api(merged_data):
    output_stem = os.path.join(tempfile.mkdtemp(), 'test_notebooks')
    args = ['notebook', 'generate', '-o', output_stem, '-i', merged_data]
    main.main(args)
예제 #7
0
def test_merge_api(testing_data):
    output_filename = os.path.join(tempfile.mkdtemp(), 'test_notebooks.ipynb')
    args = ['notebook', 'merge', '-o', output_filename, '-i'] + testing_data
    main.main(args)