Class: TestEnsemblREST

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/test.rb

Instance Method Summary collapse

Instance Method Details

#test_archiveObject



32
33
34
35
# File 'lib/test.rb', line 32

def test_archive
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Archive::id_get('ENSG00000157764')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Archive::id_post(["ENSG00000157764", "ENSG00000248378"])}
end

#test_genetreeObject



44
45
46
47
48
49
50
51
# File 'lib/test.rb', line 44

def test_genetree
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Comparative::genetree('ENSGT00390000003602')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Comparative::genetree_member_id('ENSG00000157764')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Comparative::genetree_member_symbol('BRCA2')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Comparative::genomic_alignment_region('X:1000000..1000100:1')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Comparative::homology_ensemblgene('ENSG00000157764')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Comparative::homology_symbol('BRCA2')}
end

#test_infoObject



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/test.rb', line 53

def test_info
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Info::analysis}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Info::assembly_info}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Info::assembly_stats('X')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Info::biotypes}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Info::compara_methods}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Info::compara_species_sets('EPO')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Info::comparas}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Info::data}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Info::external_dbs}
	assert(EnsemblREST::Info::ping)
	assert_instance_of(String, EnsemblREST::Info::rest)
	assert_instance_of(Fixnum, EnsemblREST::Info::software)
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Info::species}
end

#test_lookupObject



69
70
71
72
73
74
# File 'lib/test.rb', line 69

def test_lookup
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Lookup::id('ENSG00000157764')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Lookup::symbol('BRCA2')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Lookup::id_post(["ENSG00000157764", "ENSG00000248378"])}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Lookup::symbol_post(["BRCA2", "BRAF"])}
end

#test_mapObject



37
38
39
40
41
42
# File 'lib/test.rb', line 37

def test_map
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Map::cdna("ENST00000288602", "100..300")}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Map::cds('ENST00000288602', '1..1000')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Map::map('X:1000000..1000100:1', 'GRCh37', 'GRCh38')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Map::translation('ENSP00000288602', '100..300')}
end

#test_ontoObject



76
77
78
79
80
81
82
83
84
85
# File 'lib/test.rb', line 76

def test_onto
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Ontology::ancestors('GO:0005667')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Ontology::ancestors_chart('GO:0005667')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Ontology::descendants('GO:0005667')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Ontology::id('GO:0005667')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Ontology::name("transcription factor complex")}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Taxonomy::classification('9606')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Taxonomy::id('9606')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Taxonomy::name('Homo%25')}
end

#test_overlapObject



87
88
89
90
91
# File 'lib/test.rb', line 87

def test_overlap
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Overlap::id('ENSG00000157764', 'gene')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Overlap::region('7:140424943-140624564', ['gene', 'transcript', 'cds', 'exon'])}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Overlap::translation('ENSP00000288602')}
end

#test_regulationObject



93
94
95
# File 'lib/test.rb', line 93

def test_regulation
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Regulation::id('ENSR00001348195')}
end

#test_sequenceObject



97
98
99
100
101
102
# File 'lib/test.rb', line 97

def test_sequence
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Sequence::id("ENSP00000288602")}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Sequence::region("X:1000000..1000100:1", 'human')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Sequence::id_post(["ENSG00000157764", "ENSG00000248378"])}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Sequence::region_post(["X:1000000..1000100:1", "ABBA01004489.1:1..100"])}
end

#test_variationObject



104
105
106
107
# File 'lib/test.rb', line 104

def test_variation
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Variation::id("rs116035550")}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Variation::post(["rs116035550", "COSM476"])}
end

#test_variationga4ghObject



109
110
111
112
113
# File 'lib/test.rb', line 109

def test_variationga4gh
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::GA4GH::gacallSet}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::GA4GH::gavariants(17191024, 17671934, '22', [70])}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::GA4GH::gavariantset}
end

#test_vepObject



115
116
117
118
119
120
121
# File 'lib/test.rb', line 115

def test_vep
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::VEP::hgvs_get('AGT:c.803T>C')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::VEP::id_get('COSM476')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::VEP::region_get('C', '9:22125503-22125502:1')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::VEP::id_post(["rs116035550", "COSM476" ])}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::VEP::region_post(["21  26960070  rs116645811 G A . . .", "21  26965148  rs1135638 G A . . ." ])}
end

#test_xrefObject



123
124
125
126
127
# File 'lib/test.rb', line 123

def test_xref
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Xref::external('BRCA2')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Xref::id('ENSG00000157764')}
	assert_nothing_raised(EnsemblREST::InvalidResponse, NoMethodError) {EnsemblREST::Xref::name('BRCA2')}
end