-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Biotype so_term #364
Biotype so_term #364
Changes from 6 commits
83e6eaa
e20acc5
7968294
0488719
5415237
fc4990b
9cba50a
1f92aa6
fda81d9
3f95547
3d64a02
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
{ | ||
'port' => '3306', | ||
'driver' => 'mysql', | ||
'user' => 'test_user', | ||
'db_version' => 93, | ||
'pass' => 'passwd', | ||
'host' => 'localhost' | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
'driver' => 'SQLite', | ||
'dbdir' => '/home/tgrego/temp/', | ||
'user' => 'test_user', | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,19 +52,21 @@ is($biotype1->object_type, 'gene', 'Biotype is from Gene object'); | |
is($biotype1->name, 'protein_coding', 'Biotype name is protein_coding'); | ||
is($biotype1->biotype_group, 'coding', 'Biotype group is coding'); | ||
is($biotype1->so_acc, 'SO:0001217', 'Biotype protein_coding refers to SO:0001217'); | ||
is($biotype1->so_term, 'protein_coding_gene', 'Biotype protein_coding refers to SO term protein_coding_gene'); | ||
throws_ok { $biotype1->so_acc('test') } qr/so_acc must be a Sequence Ontology accession/, 'so_acc() requires a SO acc like string'; | ||
throws_ok { $biotype1->object_type('test') } qr/object_type must be gene or transcript/, 'object_type() must be gene or transcript'; | ||
|
||
# test transcript biotype object | ||
my $transcript = $gene->canonical_transcript; | ||
debug("transcript biotype"); | ||
is($transcript->biotype, 'protein_coding', "Trancript biotype is protein_coding"); | ||
is($transcript->biotype, 'protein_coding', "Transcript biotype is protein_coding"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would say this and the trailing-whitespace fixes in line 102 of this file + in line 41 of cds.t should go into a separate commit, those are a different logical change from the so_term thing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't want to edit commits just for this tiny thing, will keep attention to in the future commit separately when I spot those small issues. |
||
my $biotype2 = $transcript->get_Biotype; | ||
ok($biotype2->isa("Bio::EnsEMBL::Biotype"), "Biotype object retrieved successfully"); | ||
is($biotype2->object_type, 'transcript', 'Biotype is from Transcript object'); | ||
is($biotype2->name, 'protein_coding', 'Biotype name is protein_coding'); | ||
is($biotype2->biotype_group, 'coding', 'Biotype group is coding'); | ||
is($biotype2->so_acc, 'SO:0000234', 'Biotype protein_coding refers to SO:0000234'); | ||
is($biotype2->so_term, 'mRNA', 'Biotype protein_coding refers to SO term mRNA'); | ||
ok($transcript->set_Biotype('new_biotype'), "Can successfully set new_biotype"); | ||
throws_ok { $gene->set_Biotype() } qr/No argument provided/, 'set_Biotype() requires an argument'; | ||
|
||
|
@@ -77,6 +79,7 @@ is($biotype3->object_type, 'gene', 'Biotype is from Gene object'); | |
is($biotype3->name, 'tRNA', 'Biotype name is tRNA'); | ||
is($biotype3->biotype_group, 'snoncoding', 'Biotype group is snoncoding'); | ||
is($biotype3->so_acc, 'SO:0001263', 'Biotype tRNA refers to SO:0001263'); | ||
is($biotype3->so_term, 'ncRNA_gene', 'Biotype protein_coding refers to SO term ncRNA_gene'); | ||
|
||
# set biotype with term not in database | ||
debug("set biotype with term not in db"); | ||
|
@@ -87,6 +90,7 @@ is($biotype4->object_type, 'gene', 'Biotype is from Gene object'); | |
is($biotype4->name, 'dummy', 'Biotype name is dummy'); | ||
is($biotype4->biotype_group, undef, 'Biotype group is not set'); | ||
is($biotype4->so_acc, undef, 'Biotype SO acc is not set'); | ||
is($biotype4->so_term, undef, 'Biotype SO term is not set'); | ||
throws_ok { $gene->set_Biotype() } qr/No argument provided/, 'set_Biotype() requires an argument'; | ||
|
||
# test fetch biotypes of object_type gene | ||
|
@@ -95,7 +99,7 @@ my $biotypes1 = $biotype_adaptor->fetch_all_by_object_type('gene'); | |
is(ref $biotypes1, 'ARRAY', 'Got an array'); | ||
is(scalar @{$biotypes1}, '2', 'of size 2'); | ||
is_deeply($biotypes1, [$biotype1, $biotype3], 'with the correct objects'); | ||
my $warning1 = warning { | ||
my $warning1 = warning { | ||
$biotypes1 = $biotype_adaptor->fetch_all_by_object_type('none') }; | ||
like( $warning1, | ||
qr/No objects retrieved. Check if object_type 'none' is correct./, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not like using unless for complex conditions, I end up mentally substituting it with if not and propagating the negation to individual conditions. Maybe it's just me, though.