Skip to content

Commit

Permalink
Added testing for split_genomic_fasta_to_nascent
Browse files Browse the repository at this point in the history
  • Loading branch information
Yenaled committed Jan 19, 2023
1 parent 55cb906 commit d48dad1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/fixtures/fasta/nascent.fa
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
>GENE_C gene_id:GENE_C gene_name:GENE_C_NAME chr:2 start:2 end:14 strand:-
TAATCAGATCCGA
>GENE_B gene_id:GENE_B gene_name:GENE_B_NAME chr:2 start:1 end:10 strand:+
ATCGGATCTG
>GENE_A gene_id:GENE_A gene_name:GENE_A_NAME chr:1 start:1 end:2 strand:+
CA
>GENE_D gene_id:GENE_D gene_name:GENE_D_NAME chr:1 start:1 end:2 strand:+
CA
1 change: 1 addition & 0 deletions tests/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def setUpClass(cls):
cls.fasta2_path = os.path.join(cls.fasta_dir, 'not_sorted.fa')
cls.cdna_fasta_path = os.path.join(cls.fasta_dir, 'cdna.fa')
cls.intron_fasta_path = os.path.join(cls.fasta_dir, 'intron.fa')
cls.nascent_fasta_path = os.path.join(cls.fasta_dir, 'nascent.fa')

cls.fastq_dir = os.path.join(cls.fixtures_dir, 'fastq')
cls.fastq_path = os.path.join(cls.fastq_dir, 'small.fastq')
Expand Down
10 changes: 10 additions & 0 deletions tests/test_fasta.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,13 @@ def test_split_genomic_fasta_to_intron(self):
self.fasta2_path, path, gene_infos, transcript_infos, flank=1
)
self.assertTrue(mixins.files_equal(self.intron_fasta_path, path))

def test_split_genomic_fasta_to_nascent(self):
path = os.path.join(self.temp_dir, 'test.fa')
gene_infos, transcript_infos = gtf.genes_and_transcripts_from_gtf(
self.gtf_path, use_version=False
)
fasta.split_genomic_fasta_to_nascent(
self.fasta2_path, path, gene_infos
)
self.assertTrue(mixins.files_equal(self.nascent_fasta_path, path))

0 comments on commit d48dad1

Please sign in to comment.