def setUp(self): self.left_flanking = '/Users/jane/Desktop/ismap_v2/gold_standard_files/9262_1#29_ISAba1_left_final.fastq' self.empty_right_flanking = '/Users/jane/Desktop/ismap_v2/gold_standard_files/empty_files/9262_1#29_ISAba1_right_final.fastq' ref_seqs = ismap_v2.get_sequences(['/Users/jane/Desktop/ismap_v2/refs/CP010781.gbk'], 'genbank') self.ref = ref_seqs[0] self.query_single = ['/Users/jane/Desktop/ismap_v2/queries/ISAba1.fasta'] self.query_records = ismap_v2.get_sequences(self.query_single, 'fasta') self.is_query = self.query_records[0] self.sample = '9262_1#29' self.main_out_folder = '/Users/jane/Desktop/ismap_v2/test_results/9262_1#29/' self.tmp_folder = '/Users/jane/Desktop/ismap_v2/test_results/9262_1#29/ISAba1/tmp' self.out_folder = '/Users/jane/Desktop/ismap_v2/test_results/9262_1#29/ISAba1/' # make the output directories if not os.path.exists(self.tmp_folder): os.makedirs(self.tmp_folder)
def setUp(self): self.left_flanking = '/Users/jane/Desktop/ismap_v2/gold_standard_files/9262_1#29_ISAba1_left_final.fastq' self.empty_right_flanking = '/Users/jane/Desktop/ismap_v2/gold_standard_files/empty_files/9262_1#29_ISAba1_right_final.fastq' ref_seqs = ismap_v2.get_sequences( ['/Users/jane/Desktop/ismap_v2/refs/CP010781.gbk'], 'genbank') self.ref = ref_seqs[0] self.query_single = [ '/Users/jane/Desktop/ismap_v2/queries/ISAba1.fasta' ] self.query_records = ismap_v2.get_sequences(self.query_single, 'fasta') self.is_query = self.query_records[0] self.sample = '9262_1#29' self.main_out_folder = '/Users/jane/Desktop/ismap_v2/test_results/9262_1#29/' self.tmp_folder = '/Users/jane/Desktop/ismap_v2/test_results/9262_1#29/ISAba1/tmp' self.out_folder = '/Users/jane/Desktop/ismap_v2/test_results/9262_1#29/ISAba1/' # make the output directories if not os.path.exists(self.tmp_folder): os.makedirs(self.tmp_folder)
def setUp(self): # set up reads self.test_reads = [pathlib.Path('/Users/jane/Desktop/ismap_v2/reads/9262_1#29_1.fastq.gz'), pathlib.Path('/Users/jane/Desktop/ismap_v2/reads/9262_1#29_2.fastq.gz')] self.read_groups = read_grouping.group_reads(self.test_reads) self.sample = self.read_groups.paired[0] # set up IS query self.query_single = ['/Users/jane/Desktop/ismap_v2/queries/ISAba1.fasta'] self.query_records = ismap_v2.get_sequences(self.query_single, 'fasta') self.is_query = self.query_records[0] # set up output self.output = '/Users/jane/Desktop/ismap_v2/test_results/9262_1#29'
def test_get_seqs_01(self): # check that when we give valid files, we return a list object self.assertIsInstance(ismap_v2.get_sequences(self.query_single, 'fasta'), list) self.assertIsInstance(ismap_v2.get_sequences(self.query_list, 'fasta'), list) self.assertIsInstance(ismap_v2.get_sequences(self.query_multi, 'fasta'), list) self.assertIsInstance(ismap_v2.get_sequences(self.genome_single, 'genbank'), list) self.assertIsInstance(ismap_v2.get_sequences(self.genome_list, 'genbank'), list) self.assertIsInstance(ismap_v2.get_sequences(self.genome_multi, 'genbank'), list)
def setUp(self): # set up reads self.test_reads = [ pathlib.Path( '/Users/jane/Desktop/ismap_v2/reads/9262_1#29_1.fastq.gz'), pathlib.Path( '/Users/jane/Desktop/ismap_v2/reads/9262_1#29_2.fastq.gz') ] self.read_groups = read_grouping.group_reads(self.test_reads) self.sample = self.read_groups.paired[0] # set up IS query self.query_single = [ '/Users/jane/Desktop/ismap_v2/queries/ISAba1.fasta' ] self.query_records = ismap_v2.get_sequences(self.query_single, 'fasta') self.is_query = self.query_records[0] # set up output self.output = '/Users/jane/Desktop/ismap_v2/test_results/9262_1#29'
def test_get_seqs_01(self): # check that when we give valid files, we return a list object self.assertIsInstance( ismap_v2.get_sequences(self.query_single, 'fasta'), list) self.assertIsInstance(ismap_v2.get_sequences(self.query_list, 'fasta'), list) self.assertIsInstance( ismap_v2.get_sequences(self.query_multi, 'fasta'), list) self.assertIsInstance( ismap_v2.get_sequences(self.genome_single, 'genbank'), list) self.assertIsInstance( ismap_v2.get_sequences(self.genome_list, 'genbank'), list) self.assertIsInstance( ismap_v2.get_sequences(self.genome_multi, 'genbank'), list)
def test_get_seqs_02(self): # check that if the list is empty, we print a useful error with self.assertRaises(ismap_v2.NoSeqError): ismap_v2.get_sequences([], 'fasta')