1 # -*-Perl-*- Test Harness script for Bioperl
10 test_begin(-tests => 28);
13 use_ok('Bio::SeqFeature::Gene::Transcript');
14 use_ok('Bio::SeqFeature::Gene::UTR');
15 use_ok('Bio::SeqFeature::Gene::Exon');
16 use_ok('Bio::SeqFeature::Gene::Poly_A_site');
17 use_ok('Bio::SeqFeature::Gene::GeneStructure');
18 use_ok('Bio::Location::Fuzzy');
22 my ( $seqio, $geneseq, $gene, $transcript, $poly_A_site1, $poly_A_site2,
23 $fiveprimeUTR, $exon);
25 # tests for Bio::SeqFeature::Gene::* objects
26 # using information from acc: AB077698 as a guide
28 ok $seqio = Bio::SeqIO->new(
30 -file => test_input_file('AB077698.gb'),
33 ok $geneseq = $seqio->next_seq();
35 ok $gene = Bio::SeqFeature::Gene::GeneStructure->new(
42 ok $transcript = Bio::SeqFeature::Gene::Transcript->new(
48 'note' => "Cys3His CCG1-Required Encoded on BAC clone RP5-842K24 (AL050310) The human CHCR (Cys3His CCG1-Required) protein is highly related to EXP/MBNL (Y13829, NM_021038, AF401998) and MBLL (NM_005757,AF061261), which together comprise the human Muscleblind family",
50 'protein_id' => 'BAB85648.1',
54 ok $poly_A_site1 = Bio::SeqFeature::Gene::Poly_A_site->new(
55 -primary => 'polyA_site',
59 'note' => "Encoded on BAC clone RP5-842K24 (AL050310); PolyA_site#2 used by CHCR EST clone DKFZp434G2222 (AL133625)"
63 ok $poly_A_site2 = Bio::SeqFeature::Gene::Poly_A_site->new(
64 -primary => 'polyA_site',
68 'note' => "Encoded on BAC clone RP5-842K24 (AL050310); PolyA_site#1 used by CHCR EST clone PLACE1010202 (AK002178)",
72 ok $fiveprimeUTR = Bio::SeqFeature::Gene::UTR->new(-primary => "utr5prime");
73 ok $fiveprimeUTR->location(
74 Bio::Location::Fuzzy->new(
79 ok my $threeprimeUTR = Bio::SeqFeature::Gene::UTR->new(
80 -primary => "utr3prime",
85 # Did a quick est2genome against genomic DNA (this is on Chr X) to
86 # get the gene structure by hand since it is not in the file
89 ok $exon = Bio::SeqFeature::Gene::Exon->new(
94 ok $geneseq->add_SeqFeature($exon);
96 ok $geneseq->add_SeqFeature($fiveprimeUTR);
97 ok $geneseq->add_SeqFeature($threeprimeUTR);
98 ok $geneseq->add_SeqFeature($poly_A_site1);
99 ok $geneseq->add_SeqFeature($poly_A_site2);
101 ok $transcript->add_utr($fiveprimeUTR, 'utr5prime');
102 ok $transcript->add_utr($threeprimeUTR, 'utr3prime');
104 ok $transcript->add_exon($exon);
106 # API only supports a single poly-A site per transcript at this point
107 $transcript->poly_A_site($poly_A_site2);
108 $geneseq->add_SeqFeature($transcript);
109 $gene->add_transcript($transcript);
110 $geneseq->add_SeqFeature($gene);
112 my ($t) = $gene->transcripts(); # get 1st transcript
114 is($t->mrna->length, 1693, 'mRNA spliced length');
115 is($gene->utrs, 2, 'has 2 UTRs');