1 # -*-Perl-*- Test Harness script for Bioperl
9 test_begin(-tests => 28);
12 use_ok('Bio::SeqFeature::Gene::Transcript');
13 use_ok('Bio::SeqFeature::Gene::UTR');
14 use_ok('Bio::SeqFeature::Gene::Exon');
15 use_ok('Bio::SeqFeature::Gene::Poly_A_site');
16 use_ok('Bio::SeqFeature::Gene::GeneStructure');
17 use_ok('Bio::Location::Fuzzy');
21 my ( $seqio, $geneseq, $gene, $transcript, $poly_A_site1, $poly_A_site2,
22 $fiveprimeUTR, $exon);
24 # tests for Bio::SeqFeature::Gene::* objects
25 # using information from acc: AB077698 as a guide
27 ok $seqio = Bio::SeqIO->new(
29 -file => test_input_file('AB077698.gb'),
32 ok $geneseq = $seqio->next_seq();
34 ok $gene = Bio::SeqFeature::Gene::GeneStructure->new(
41 ok $transcript = Bio::SeqFeature::Gene::Transcript->new(
47 '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",
49 'protein_id' => 'BAB85648.1',
53 ok $poly_A_site1 = Bio::SeqFeature::Gene::Poly_A_site->new(
54 -primary => 'polyA_site',
58 'note' => "Encoded on BAC clone RP5-842K24 (AL050310); PolyA_site#2 used by CHCR EST clone DKFZp434G2222 (AL133625)"
62 ok $poly_A_site2 = Bio::SeqFeature::Gene::Poly_A_site->new(
63 -primary => 'polyA_site',
67 'note' => "Encoded on BAC clone RP5-842K24 (AL050310); PolyA_site#1 used by CHCR EST clone PLACE1010202 (AK002178)",
71 ok $fiveprimeUTR = Bio::SeqFeature::Gene::UTR->new(-primary => "utr5prime");
72 ok $fiveprimeUTR->location(
73 Bio::Location::Fuzzy->new(
78 ok my $threeprimeUTR = Bio::SeqFeature::Gene::UTR->new(
79 -primary => "utr3prime",
84 # Did a quick est2genome against genomic DNA (this is on Chr X) to
85 # get the gene structure by hand since it is not in the file
88 ok $exon = Bio::SeqFeature::Gene::Exon->new(
93 ok $geneseq->add_SeqFeature($exon);
95 ok $geneseq->add_SeqFeature($fiveprimeUTR);
96 ok $geneseq->add_SeqFeature($threeprimeUTR);
97 ok $geneseq->add_SeqFeature($poly_A_site1);
98 ok $geneseq->add_SeqFeature($poly_A_site2);
100 ok $transcript->add_utr($fiveprimeUTR, 'utr5prime');
101 ok $transcript->add_utr($threeprimeUTR, 'utr3prime');
103 ok $transcript->add_exon($exon);
105 # API only supports a single poly-A site per transcript at this point
106 $transcript->poly_A_site($poly_A_site2);
107 $geneseq->add_SeqFeature($transcript);
108 $gene->add_transcript($transcript);
109 $geneseq->add_SeqFeature($gene);
111 my ($t) = $gene->transcripts(); # get 1st transcript
113 is($t->mrna->length, 1693, 'mRNA spliced length');
114 is($gene->utrs, 2, 'has 2 UTRs');