Ejemplo n.º 1
0
 def test_generate_intron_fasta_no_transcript(self):
     with self.assertRaises(Exception):
         out_path = os.path.join(
             tempfile.gettempdir(), '{}.fa'.format(uuid.uuid4())
         )
         fasta.generate_intron_fasta(
             self.sorted_fasta_path, self.gtf_no_transcript, out_path
         )
Ejemplo n.º 2
0
 def test_generate_intron_fasta(self):
     out_path = os.path.join(self.temp_dir, '{}.fa'.format(uuid.uuid4()))
     self.assertEqual(
         out_path,
         fasta.generate_intron_fasta(self.sorted_fasta_path,
                                     self.sorted_gtf_path,
                                     out_path,
                                     flank=1))
     with open(out_path, 'r') as f, open(self.split_intron_fasta_path,
                                         'r') as split:
         self.assertEqual(f.read(), split.read())
Ejemplo n.º 3
0
 def test_generate_intron_fasta_with_chromosomes(self):
     out_path = os.path.join(
         tempfile.gettempdir(), '{}.fa'.format(uuid.uuid4())
     )
     self.assertEqual(
         out_path,
         fasta.generate_intron_fasta(
             self.sorted_fasta_path,
             self.sorted_gtf_path,
             out_path,
             chromosomes={'1'},
             flank=1
         )
     )
     with open(out_path, 'r') as f, open(self.partial_intron_fasta_path,
                                         'r') as split:
         self.assertEqual(f.read(), split.read())
Ejemplo n.º 4
0
 def test_generate_intron_fasta_no_exon(self):
     with self.assertRaises(Exception):
         out_path = os.path.join(self.temp_dir,
                                 '{}.fa'.format(uuid.uuid4()))
         fasta.generate_intron_fasta(self.sorted_fasta_path,
                                     self.gtf_no_exon, out_path)