Skip to content

Commit

Permalink
generalise test featuretype
Browse files Browse the repository at this point in the history
  • Loading branch information
haessar committed Oct 4, 2024
1 parent 8d65dc2 commit 596c494
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tests/test_output_formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
from peaks2utr.models import Feature, UTR
from peaks2utr.utils import get_output_filename

NCRNA_FEATURETYPE = "tRNA"


class TestOutputFormatting(unittest.TestCase):

Expand All @@ -27,7 +25,7 @@ def setUp(self):
strand=strand, attributes={"ID": ["gene1:mRNA"], "Parent": [gene_id]})
self.ncRNA_gene_gff = Feature(chr, id=ncRNA_gene_id, featuretype=FeatureTypes.NonCodingGene[0], start=start, end=end, strand=strand,
attributes={"ID": [ncRNA_gene_id]})
self.ncRNA_feature_gff = Feature(chr, id=ncRNA_gene_id+":t1", featuretype=NCRNA_FEATURETYPE, start=start, end=end,
self.ncRNA_feature_gff = Feature(chr, id=ncRNA_gene_id+":t1", featuretype=FeatureTypes.NonCodingTranscript[0], start=start, end=end,
strand=strand, attributes={"ID": [ncRNA_gene_id+":t1"], "Parent": [ncRNA_gene_id]})
self.gene_gtf = Feature(chr, id=gene_id, featuretype=FeatureTypes.Gene[0], source="gffutils_derived",
start=start, end=end, strand=strand, attributes={"gene_id": [gene_id]},
Expand All @@ -38,7 +36,7 @@ def setUp(self):
self.ncRNA_gene_gtf = Feature(chr, id=ncRNA_gene_id, featuretype=FeatureTypes.NonCodingGene[0], source="gffutils_derived",
start=start, end=end, strand=strand, attributes={"gene_id": [ncRNA_gene_id]},
dialect=GFFUTILS_GTF_DIALECT)
self.ncRNA_feature_gtf = Feature(chr, id=ncRNA_gene_id+".t1", featuretype=NCRNA_FEATURETYPE, start=start, end=end,
self.ncRNA_feature_gtf = Feature(chr, id=ncRNA_gene_id+".t1", featuretype=FeatureTypes.NonCodingTranscript[0], start=start, end=end,
strand=strand, attributes={"transcript_id": [ncRNA_gene_id+".t1"], "gene_id": [ncRNA_gene_id]},
dialect=GFFUTILS_GTF_DIALECT)
self.utr = UTR(start=start, end=end)
Expand Down Expand Up @@ -134,7 +132,7 @@ def test_gtf_to_gff_ncRNA_retention(self):
self.args.gtf_in = True
self.args.gtf_out = False
expected_gene = ["chr1", "gffutils_derived", "ncRNA_gene", "1000", "2000", ".", "+", ".", "ID=ncRNA_gene1"]
expected_feature_0 = ["chr1", ".", "tRNA", "1000", "2000", ".", "+", ".", "ID=ncRNA_gene1.t1;Parent=ncRNA_gene1"]
expected_feature_0 = ["chr1", ".", "ncRNA", "1000", "2000", ".", "+", ".", "ID=ncRNA_gene1.t1;Parent=ncRNA_gene1"]
annotations = AnnotationsDict(args=self.args)
annotations.update({
self.ncRNA_gene_gtf.id: {"gene": self.ncRNA_gene_gtf, "feature_0": self.ncRNA_feature_gtf}
Expand All @@ -148,7 +146,7 @@ def test_gff_to_gtf_ncRNA_retention(self):
self.args.gtf_out = True
expected_gene = ["chr1", ".", "ncRNA_gene", "1000", "2000", ".", "+", ".",
'gene_id "ncRNA_gene1";']
expected_feature_0 = ["chr1", ".", "tRNA", "1000", "2000", ".", "+", ".",
expected_feature_0 = ["chr1", ".", "ncRNA", "1000", "2000", ".", "+", ".",
'gene_id "ncRNA_gene1"; transcript_id "ncRNA_gene1:t1";']
annotations = AnnotationsDict(args=self.args)
annotations.update({
Expand Down

0 comments on commit 596c494

Please sign in to comment.