bio 1.4.1 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/ChangeLog +954 -0
  2. data/KNOWN_ISSUES.rdoc +40 -5
  3. data/README.rdoc +36 -35
  4. data/RELEASE_NOTES.rdoc +87 -59
  5. data/bioruby.gemspec +24 -2
  6. data/doc/RELEASE_NOTES-1.4.1.rdoc +104 -0
  7. data/doc/Tutorial.rd +162 -200
  8. data/doc/Tutorial.rd.html +149 -146
  9. data/lib/bio.rb +1 -0
  10. data/lib/bio/appl/blast.rb +1 -1
  11. data/lib/bio/appl/blast/ddbj.rb +26 -34
  12. data/lib/bio/appl/blast/genomenet.rb +21 -11
  13. data/lib/bio/db/embl/sptr.rb +193 -21
  14. data/lib/bio/db/fasta.rb +1 -1
  15. data/lib/bio/db/fastq.rb +14 -0
  16. data/lib/bio/db/fastq/format_fastq.rb +2 -2
  17. data/lib/bio/db/genbank/ddbj.rb +1 -2
  18. data/lib/bio/db/genbank/format_genbank.rb +1 -1
  19. data/lib/bio/db/medline.rb +1 -0
  20. data/lib/bio/db/newick.rb +3 -1
  21. data/lib/bio/db/pdb/pdb.rb +9 -9
  22. data/lib/bio/db/pdb/residue.rb +2 -2
  23. data/lib/bio/io/ddbjrest.rb +344 -0
  24. data/lib/bio/io/ncbirest.rb +121 -1
  25. data/lib/bio/location.rb +2 -2
  26. data/lib/bio/reference.rb +3 -4
  27. data/lib/bio/shell/plugin/entry.rb +7 -3
  28. data/lib/bio/shell/plugin/ncbirest.rb +5 -1
  29. data/lib/bio/util/restriction_enzyme.rb +3 -0
  30. data/lib/bio/util/restriction_enzyme/dense_int_array.rb +195 -0
  31. data/lib/bio/util/restriction_enzyme/range/sequence_range.rb +7 -7
  32. data/lib/bio/util/restriction_enzyme/range/sequence_range/calculated_cuts.rb +57 -18
  33. data/lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb +2 -2
  34. data/lib/bio/util/restriction_enzyme/sorted_num_array.rb +219 -0
  35. data/lib/bio/version.rb +1 -1
  36. data/sample/test_restriction_enzyme_long.rb +4403 -0
  37. data/test/data/fasta/EFTU_BACSU.fasta +8 -0
  38. data/test/data/genbank/CAA35997.gp +48 -0
  39. data/test/data/genbank/SCU49845.gb +167 -0
  40. data/test/data/litdb/1717226.litdb +13 -0
  41. data/test/data/pir/CRAB_ANAPL.pir +6 -0
  42. data/test/functional/bio/appl/blast/test_remote.rb +93 -0
  43. data/test/functional/bio/appl/test_blast.rb +61 -0
  44. data/test/functional/bio/io/test_ddbjrest.rb +47 -0
  45. data/test/functional/bio/test_command.rb +3 -3
  46. data/test/unit/bio/db/embl/test_sptr.rb +6 -6
  47. data/test/unit/bio/db/embl/test_uniprot_new_part.rb +208 -0
  48. data/test/unit/bio/db/genbank/test_common.rb +274 -0
  49. data/test/unit/bio/db/genbank/test_genbank.rb +401 -0
  50. data/test/unit/bio/db/genbank/test_genpept.rb +81 -0
  51. data/test/unit/bio/db/pdb/test_pdb.rb +3287 -11
  52. data/test/unit/bio/db/test_fasta.rb +34 -12
  53. data/test/unit/bio/db/test_fastq.rb +26 -0
  54. data/test/unit/bio/db/test_litdb.rb +95 -0
  55. data/test/unit/bio/db/test_medline.rb +1 -0
  56. data/test/unit/bio/db/test_nbrf.rb +82 -0
  57. data/test/unit/bio/db/test_newick.rb +22 -4
  58. data/test/unit/bio/test_reference.rb +35 -0
  59. data/test/unit/bio/util/restriction_enzyme/test_dense_int_array.rb +201 -0
  60. data/test/unit/bio/util/restriction_enzyme/test_sorted_num_array.rb +281 -0
  61. metadata +44 -38
@@ -0,0 +1,8 @@
1
+ >sp|P33166|EFTU_BACSU Elongation factor Tu;
2
+ MAKEKFDRSKSHANIGTIGHVDHGKTTLTAAITTVLHKKSGKGTAMAYDQIDGAPEERER
3
+ GITISTAHVEYETETRHYAHVDCPGHADYVKNMITGAAQMDGAILVVSAADGPMPQTREH
4
+ ILLSKNVGVPYIVVFLNKCDMVDDEELLELVEMEVRDLLSEYDFPGDDVPVVKGSALKAL
5
+ EGDAEWEAKIFELMDAVDEYIPTPERDTEKPFMMPVEDVFSITGRGTVATGRVERGQVKV
6
+ GDEVEIIGLQEENKKTTVTGVEMFRKLLDYAEAGDNIGALLRGVSREEIQRGQVLAKPGT
7
+ ITPHSKFKAEVYVLSKEEGGRHTPFFSNYRPQFYFRTTDVTGIIHLPEGVEMVMPGDNTE
8
+ MNVELISTIAIEEGTRFSIREGGRTVGSGVVSTITE
@@ -0,0 +1,48 @@
1
+ LOCUS CAA35997 100 aa linear MAM 12-SEP-1993
2
+ DEFINITION unnamed protein product [Bos taurus].
3
+ ACCESSION CAA35997
4
+ VERSION CAA35997.1 GI:8
5
+ DBSOURCE embl accession X51700.1
6
+ KEYWORDS .
7
+ SOURCE Bos taurus (cattle)
8
+ ORGANISM Bos taurus
9
+ Eukaryota; Metazoa; Chordata; Craniata; Vertebrata; Euteleostomi;
10
+ Mammalia; Eutheria; Laurasiatheria; Cetartiodactyla; Ruminantia;
11
+ Pecora; Bovidae; Bovinae; Bos.
12
+ REFERENCE 1 (residues 1 to 100)
13
+ AUTHORS Kiefer,M.C., Saphire,A.C.S., Bauer,D.M. and Barr,P.J.
14
+ JOURNAL Unpublished
15
+ REFERENCE 2 (residues 1 to 100)
16
+ AUTHORS Kiefer,M.C.
17
+ TITLE Direct Submission
18
+ JOURNAL Submitted (30-JAN-1990) Kiefer M.C., Chiron Corporation, 4560
19
+ Hortom St, Emeryville CA 94608-2916, U S A
20
+ COMMENT See <X15699> for Human sequence.
21
+ Data kindly reviewed (08-MAY-1990) by Kiefer M.C.
22
+ FEATURES Location/Qualifiers
23
+ source 1..100
24
+ /organism="Bos taurus"
25
+ /db_xref="taxon:9913"
26
+ /clone="bBGP-3"
27
+ /tissue_type="bone matrix"
28
+ /clone_lib="Zap-bb"
29
+ Protein 1..100
30
+ /name="unnamed protein product"
31
+ Region 33..97
32
+ /region_name="Gla"
33
+ /note="Vitamin K-dependent
34
+ carboxylation/gamma-carboxyglutamic (GLA) domain; cl02449"
35
+ /db_xref="CDD:141428"
36
+ CDS 1..100
37
+ /coded_by="X51700.1:28..330"
38
+ /note="bone Gla precursor (100 AA)"
39
+ /db_xref="GOA:P02820"
40
+ /db_xref="InterPro:IPR000294"
41
+ /db_xref="InterPro:IPR002384"
42
+ /db_xref="PDB:1Q3M"
43
+ /db_xref="UniProtKB/Swiss-Prot:P02820"
44
+ ORIGIN
45
+ 1 mrtpmllall alatlclagr adakpgdaes gkgaafvskq egsevvkrlr ryldhwlgap
46
+ 61 apypdplepk revcelnpdc deladhigfq eayrrfygpv
47
+ //
48
+
@@ -0,0 +1,167 @@
1
+ LOCUS SCU49845 5028 bp DNA linear PLN 23-MAR-2010
2
+ DEFINITION Saccharomyces cerevisiae TCP1-beta gene, partial cds; and Axl2p
3
+ (AXL2) and Rev7p (REV7) genes, complete cds.
4
+ ACCESSION U49845
5
+ VERSION U49845.1 GI:1293613
6
+ KEYWORDS .
7
+ SOURCE Saccharomyces cerevisiae (baker's yeast)
8
+ ORGANISM Saccharomyces cerevisiae
9
+ Eukaryota; Fungi; Dikarya; Ascomycota; Saccharomyceta;
10
+ Saccharomycotina; Saccharomycetes; Saccharomycetales;
11
+ Saccharomycetaceae; Saccharomyces.
12
+ REFERENCE 1 (bases 1 to 5028)
13
+ AUTHORS Roemer,T., Madden,K., Chang,J. and Snyder,M.
14
+ TITLE Selection of axial growth sites in yeast requires Axl2p, a novel
15
+ plasma membrane glycoprotein
16
+ JOURNAL Genes Dev. 10 (7), 777-793 (1996)
17
+ PUBMED 8846915
18
+ REFERENCE 2 (bases 1 to 5028)
19
+ AUTHORS Roemer,T.
20
+ TITLE Direct Submission
21
+ JOURNAL Submitted (22-FEB-1996) Biology, Yale University, New Haven, CT
22
+ 06520, USA
23
+ FEATURES Location/Qualifiers
24
+ source 1..5028
25
+ /organism="Saccharomyces cerevisiae"
26
+ /mol_type="genomic DNA"
27
+ /db_xref="taxon:4932"
28
+ /chromosome="IX"
29
+ mRNA <1..>206
30
+ /product="TCP1-beta"
31
+ CDS <1..206
32
+ /codon_start=3
33
+ /product="TCP1-beta"
34
+ /protein_id="AAA98665.1"
35
+ /db_xref="GI:1293614"
36
+ /translation="SSIYNGISTSGLDLNNGTIADMRQLGIVESYKLKRAVVSSASEA
37
+ AEVLLRVDNIIRARPRTANRQHM"
38
+ gene <687..>3158
39
+ /gene="AXL2"
40
+ mRNA <687..>3158
41
+ /gene="AXL2"
42
+ /product="Axl2p"
43
+ CDS 687..3158
44
+ /gene="AXL2"
45
+ /note="plasma membrane glycoprotein"
46
+ /codon_start=1
47
+ /product="Axl2p"
48
+ /protein_id="AAA98666.1"
49
+ /db_xref="GI:1293615"
50
+ /translation="MTQLQISLLLTATISLLHLVVATPYEAYPIGKQYPPVARVNESF
51
+ TFQISNDTYKSSVDKTAQITYNCFDLPSWLSFDSSSRTFSGEPSSDLLSDANTTLYFN
52
+ VILEGTDSADSTSLNNTYQFVVTNRPSISLSSDFNLLALLKNYGYTNGKNALKLDPNE
53
+ VFNVTFDRSMFTNEESIVSYYGRSQLYNAPLPNWLFFDSGELKFTGTAPVINSAIAPE
54
+ TSYSFVIIATDIEGFSAVEVEFELVIGAHQLTTSIQNSLIINVTDTGNVSYDLPLNYV
55
+ YLDDDPISSDKLGSINLLDAPDWVALDNATISGSVPDELLGKNSNPANFSVSIYDTYG
56
+ DVIYFNFEVVSTTDLFAISSLPNINATRGEWFSYYFLPSQFTDYVNTNVSLEFTNSSQ
57
+ DHDWVKFQSSNLTLAGEVPKNFDKLSLGLKANQGSQSQELYFNIIGMDSKITHSNHSA
58
+ NATSTRSSHHSTSTSSYTSSTYTAKISSTSAAATSSAPAALPAANKTSSHNKKAVAIA
59
+ CGVAIPLGVILVALICFLIFWRRRRENPDDENLPHAISGPDLNNPANKPNQENATPLN
60
+ NPFDDDASSYDDTSIARRLAALNTLKLDNHSATESDISSVDEKRDSLSGMNTYNDQFQ
61
+ SQSKEELLAKPPVQPPESPFFDPQNRSSSVYMDSEPAVNKSWRYTGNLSPVSDIVRDS
62
+ YGSQKTVDTEKLFDLEAPEKEKRTSRDVTMSSLDPWNSNISPSPVRKSVTPSPYNVTK
63
+ HRNRHLQNIQDSQSGKNGITPTTMSTSSSDDFVPVKDGENFCWVHSMEPDRRPSKKRL
64
+ VDFSNKSNVNVGQVKDIHGRIPEML"
65
+ gene complement(<3300..>4037)
66
+ /gene="REV7"
67
+ mRNA complement(<3300..>4037)
68
+ /gene="REV7"
69
+ /product="Rev7p"
70
+ CDS complement(3300..4037)
71
+ /gene="REV7"
72
+ /codon_start=1
73
+ /product="Rev7p"
74
+ /protein_id="AAA98667.1"
75
+ /db_xref="GI:1293616"
76
+ /translation="MNRWVEKWLRVYLKCYINLILFYRNVYPPQSFDYTTYQSFNLPQ
77
+ FVPINRHPALIDYIEELILDVLSKLTHVYRFSICIINKKNDLCIEKYVLDFSELQHVD
78
+ KDDQIITETEVFDEFRSSLNSLIMHLEKLPKVNDDTITFEAVINAIELELGHKLDRNR
79
+ RVDSLEEKAEIERDSNWVKCQEDENLPDNNGFQPPKIKLTSLVGSDVGPLIIHQFSEK
80
+ LISGDDKILNGVYSQYEEGESIFGSLF"
81
+ ORIGIN
82
+ 1 gatcctccat atacaacggt atctccacct caggtttaga tctcaacaac ggaaccattg
83
+ 61 ccgacatgag acagttaggt atcgtcgaga gttacaagct aaaacgagca gtagtcagct
84
+ 121 ctgcatctga agccgctgaa gttctactaa gggtggataa catcatccgt gcaagaccaa
85
+ 181 gaaccgccaa tagacaacat atgtaacata tttaggatat acctcgaaaa taataaaccg
86
+ 241 ccacactgtc attattataa ttagaaacag aacgcaaaaa ttatccacta tataattcaa
87
+ 301 agacgcgaaa aaaaaagaac aacgcgtcat agaacttttg gcaattcgcg tcacaaataa
88
+ 361 attttggcaa cttatgtttc ctcttcgagc agtactcgag ccctgtctca agaatgtaat
89
+ 421 aatacccatc gtaggtatgg ttaaagatag catctccaca acctcaaagc tccttgccga
90
+ 481 gagtcgccct cctttgtcga gtaattttca cttttcatat gagaacttat tttcttattc
91
+ 541 tttactctca catcctgtag tgattgacac tgcaacagcc accatcacta gaagaacaga
92
+ 601 acaattactt aatagaaaaa ttatatcttc ctcgaaacga tttcctgctt ccaacatcta
93
+ 661 cgtatatcaa gaagcattca cttaccatga cacagcttca gatttcatta ttgctgacag
94
+ 721 ctactatatc actactccat ctagtagtgg ccacgcccta tgaggcatat cctatcggaa
95
+ 781 aacaataccc cccagtggca agagtcaatg aatcgtttac atttcaaatt tccaatgata
96
+ 841 cctataaatc gtctgtagac aagacagctc aaataacata caattgcttc gacttaccga
97
+ 901 gctggctttc gtttgactct agttctagaa cgttctcagg tgaaccttct tctgacttac
98
+ 961 tatctgatgc gaacaccacg ttgtatttca atgtaatact cgagggtacg gactctgccg
99
+ 1021 acagcacgtc tttgaacaat acataccaat ttgttgttac aaaccgtcca tccatctcgc
100
+ 1081 tatcgtcaga tttcaatcta ttggcgttgt taaaaaacta tggttatact aacggcaaaa
101
+ 1141 acgctctgaa actagatcct aatgaagtct tcaacgtgac ttttgaccgt tcaatgttca
102
+ 1201 ctaacgaaga atccattgtg tcgtattacg gacgttctca gttgtataat gcgccgttac
103
+ 1261 ccaattggct gttcttcgat tctggcgagt tgaagtttac tgggacggca ccggtgataa
104
+ 1321 actcggcgat tgctccagaa acaagctaca gttttgtcat catcgctaca gacattgaag
105
+ 1381 gattttctgc cgttgaggta gaattcgaat tagtcatcgg ggctcaccag ttaactacct
106
+ 1441 ctattcaaaa tagtttgata atcaacgtta ctgacacagg taacgtttca tatgacttac
107
+ 1501 ctctaaacta tgtttatctc gatgacgatc ctatttcttc tgataaattg ggttctataa
108
+ 1561 acttattgga tgctccagac tgggtggcat tagataatgc taccatttcc gggtctgtcc
109
+ 1621 cagatgaatt actcggtaag aactccaatc ctgccaattt ttctgtgtcc atttatgata
110
+ 1681 cttatggtga tgtgatttat ttcaacttcg aagttgtctc cacaacggat ttgtttgcca
111
+ 1741 ttagttctct tcccaatatt aacgctacaa ggggtgaatg gttctcctac tattttttgc
112
+ 1801 cttctcagtt tacagactac gtgaatacaa acgtttcatt agagtttact aattcaagcc
113
+ 1861 aagaccatga ctgggtgaaa ttccaatcat ctaatttaac attagctgga gaagtgccca
114
+ 1921 agaatttcga caagctttca ttaggtttga aagcgaacca aggttcacaa tctcaagagc
115
+ 1981 tatattttaa catcattggc atggattcaa agataactca ctcaaaccac agtgcgaatg
116
+ 2041 caacgtccac aagaagttct caccactcca cctcaacaag ttcttacaca tcttctactt
117
+ 2101 acactgcaaa aatttcttct acctccgctg ctgctacttc ttctgctcca gcagcgctgc
118
+ 2161 cagcagccaa taaaacttca tctcacaata aaaaagcagt agcaattgcg tgcggtgttg
119
+ 2221 ctatcccatt aggcgttatc ctagtagctc tcatttgctt cctaatattc tggagacgca
120
+ 2281 gaagggaaaa tccagacgat gaaaacttac cgcatgctat tagtggacct gatttgaata
121
+ 2341 atcctgcaaa taaaccaaat caagaaaacg ctacaccttt gaacaacccc tttgatgatg
122
+ 2401 atgcttcctc gtacgatgat acttcaatag caagaagatt ggctgctttg aacactttga
123
+ 2461 aattggataa ccactctgcc actgaatctg atatttccag cgtggatgaa aagagagatt
124
+ 2521 ctctatcagg tatgaataca tacaatgatc agttccaatc ccaaagtaaa gaagaattat
125
+ 2581 tagcaaaacc cccagtacag cctccagaga gcccgttctt tgacccacag aataggtctt
126
+ 2641 cttctgtgta tatggatagt gaaccagcag taaataaatc ctggcgatat actggcaacc
127
+ 2701 tgtcaccagt ctctgatatt gtcagagaca gttacggatc acaaaaaact gttgatacag
128
+ 2761 aaaaactttt cgatttagaa gcaccagaga aggaaaaacg tacgtcaagg gatgtcacta
129
+ 2821 tgtcttcact ggacccttgg aacagcaata ttagcccttc tcccgtaaga aaatcagtaa
130
+ 2881 caccatcacc atataacgta acgaagcatc gtaaccgcca cttacaaaat attcaagact
131
+ 2941 ctcaaagcgg taaaaacgga atcactccca caacaatgtc aacttcatct tctgacgatt
132
+ 3001 ttgttccggt taaagatggt gaaaattttt gctgggtcca tagcatggaa ccagacagaa
133
+ 3061 gaccaagtaa gaaaaggtta gtagattttt caaataagag taatgtcaat gttggtcaag
134
+ 3121 ttaaggacat tcacggacgc atcccagaaa tgctgtgatt atacgcaacg atattttgct
135
+ 3181 taattttatt ttcctgtttt attttttatt agtggtttac agatacccta tattttattt
136
+ 3241 agtttttata cttagagaca tttaatttta attccattct tcaaatttca tttttgcact
137
+ 3301 taaaacaaag atccaaaaat gctctcgccc tcttcatatt gagaatacac tccattcaaa
138
+ 3361 attttgtcgt caccgctgat taatttttca ctaaactgat gaataatcaa aggccccacg
139
+ 3421 tcagaaccga ctaaagaagt gagttttatt ttaggaggtt gaaaaccatt attgtctggt
140
+ 3481 aaattttcat cttcttgaca tttaacccag tttgaatccc tttcaatttc tgctttttcc
141
+ 3541 tccaaactat cgaccctcct gtttctgtcc aacttatgtc ctagttccaa ttcgatcgca
142
+ 3601 ttaataactg cttcaaatgt tattgtgtca tcgttgactt taggtaattt ctccaaatgc
143
+ 3661 ataatcaaac tatttaagga agatcggaat tcgtcgaaca cttcagtttc cgtaatgatc
144
+ 3721 tgatcgtctt tatccacatg ttgtaattca ctaaaatcta aaacgtattt ttcaatgcat
145
+ 3781 aaatcgttct ttttattaat aatgcagatg gaaaatctgt aaacgtgcgt taatttagaa
146
+ 3841 agaacatcca gtataagttc ttctatatag tcaattaaag caggatgcct attaatggga
147
+ 3901 acgaactgcg gcaagttgaa tgactggtaa gtagtgtagt cgaatgactg aggtgggtat
148
+ 3961 acatttctat aaaataaaat caaattaatg tagcatttta agtataccct cagccacttc
149
+ 4021 tctacccatc tattcataaa gctgacgcaa cgattactat tttttttttc ttcttggatc
150
+ 4081 tcagtcgtcg caaaaacgta taccttcttt ttccgacctt ttttttagct ttctggaaaa
151
+ 4141 gtttatatta gttaaacagg gtctagtctt agtgtgaaag ctagtggttt cgattgactg
152
+ 4201 atattaagaa agtggaaatt aaattagtag tgtagacgta tatgcatatg tatttctcgc
153
+ 4261 ctgtttatgt ttctacgtac ttttgattta tagcaagggg aaaagaaata catactattt
154
+ 4321 tttggtaaag gtgaaagcat aatgtaaaag ctagaataaa atggacgaaa taaagagagg
155
+ 4381 cttagttcat cttttttcca aaaagcaccc aatgataata actaaaatga aaaggatttg
156
+ 4441 ccatctgtca gcaacatcag ttgtgtgagc aataataaaa tcatcacctc cgttgccttt
157
+ 4501 agcgcgtttg tcgtttgtat cttccgtaat tttagtctta tcaatgggaa tcataaattt
158
+ 4561 tccaatgaat tagcaatttc gtccaattct ttttgagctt cttcatattt gctttggaat
159
+ 4621 tcttcgcact tcttttccca ttcatctctt tcttcttcca aagcaacgat ccttctaccc
160
+ 4681 atttgctcag agttcaaatc ggcctctttc agtttatcca ttgcttcctt cagtttggct
161
+ 4741 tcactgtctt ctagctgttg ttctagatcc tggtttttct tggtgtagtt ctcattatta
162
+ 4801 gatctcaagt tattggagtc ttcagccaat tgctttgtat cagacaattg actctctaac
163
+ 4861 ttctccactt cactgtcgag ttgctcgttt ttagcggaca aagatttaat ctcgttttct
164
+ 4921 ttttcagtgt tagattgctc taattctttg agctgttctc tcagctcctc atatttttct
165
+ 4981 tgccatgact cagattctaa ttttaagcta ttcaatttct ctttgatc
166
+ //
167
+
@@ -0,0 +1,13 @@
1
+ CODE 1717226
2
+ TITLE Characterization of an Escherichia coli gene encoding
3
+ betaine aldehyde dehydrogenase (BADH). Structural similarity
4
+ to mammalian ALDHs and a plant BADH.
5
+ FIELD q (sequence analysis)
6
+ JOURNAL Gene
7
+ VOLUME Vol.103, No.1, 45-52 (1991)
8
+ KEYWORD *Betaine Aldehyde Dehydrogenase;;*betB Gene;E.coli;;
9
+ Seq Determination;1854bp;491AAs;;Hydropathy Plot;*EC1.2.1.8;;
10
+ Seq Comparison
11
+ AUTHOR Boyd,L.A.;Adam,L.;Pelcher,L.E.;McHughen,A.;Hirji,R.;
12
+ Selvaraj,G.
13
+ END
@@ -0,0 +1,6 @@
1
+ >P1;CRAB_ANAPL
2
+ ALPHA CRYSTALLIN B CHAIN (ALPHA(B)-CRYSTALLIN).
3
+ MDITIHNPLI RRPLFSWLAP SRIFDQIFGE HLQESELLPA SPSLSPFLMR
4
+ SPIFRMPSWL ETGLSEMRLE KDKFSVNLDV KHFSPEELKV KVLGDMVEIH
5
+ GKHEERQDEH GFIAREFNRK YRIPADVDPL TITSSLSLDG VLTVSAPRKQ
6
+ SDVPERSIPI TREEKPAIAG AQRK*
@@ -0,0 +1,93 @@
1
+ #
2
+ # = test/functional/bio/appl/blast/test_remote.rb - Unit test for Bio::Blast::Remote::Genomenet and Bio::Blast::Remote::DDBJ with network connection
3
+ #
4
+ # Copyright:: Copyright (C) 2011
5
+ # Naohisa Goto <ng@bioruby.org>
6
+ # License:: The Ruby License
7
+ #
8
+
9
+ # loading helper routine for testing bioruby
10
+ require 'pathname'
11
+ load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4,
12
+ 'bioruby_test_helper.rb')).cleanpath.to_s
13
+
14
+ # libraries needed for the tests
15
+ require 'test/unit'
16
+ require 'bio/sequence'
17
+ require 'bio/appl/blast'
18
+
19
+ module Bio
20
+ module FuncTestBlastRemote
21
+
22
+ module NetTestBlastRemoteCommon
23
+
24
+ Programs = %w( blastn tblastn tblastx blastp blastx ).freeze
25
+ Programs.each { |x| x.freeze }
26
+
27
+ def test_databases
28
+ Programs.each do |prog|
29
+ databases = nil
30
+ assert_nothing_raised {
31
+ databases = @klass.databases(prog)
32
+ }
33
+ assert_kind_of(Array, databases, "wrong data type for #{prog}")
34
+ assert(!databases.empty?, "no database found for #{prog}")
35
+ end
36
+ end
37
+
38
+ # sampling test for blastn database
39
+ def test_databases_blastn
40
+ databases = @klass.databases("blastn")
41
+ self.class::BLASTN_DBNAME_KEYWORDS.each do |re|
42
+ assert(databases.find { |x| re =~ x })
43
+ end
44
+ end
45
+
46
+ # sampling test for blastp database
47
+ def test_databases_blastp
48
+ databases = @klass.databases("blastp")
49
+ self.class::BLASTP_DBNAME_KEYWORDS.each do |re|
50
+ assert(databases.find { |x| re =~ x })
51
+ end
52
+ end
53
+
54
+ def test_database_description
55
+ Programs.each do |prog|
56
+ @klass.databases(prog).each do |db|
57
+ assert_kind_of(String, @klass.database_description(prog, db))
58
+ end
59
+ end
60
+ end
61
+ end #module NetTestBlastRemoteCommon
62
+
63
+ # This test class only contains tests for meta information.
64
+ # BLAST execution tests are written in ../test_blast.rb
65
+ class NetTestBlastRemoteGenomeNet < Test::Unit::TestCase
66
+
67
+ include NetTestBlastRemoteCommon
68
+
69
+ BLASTN_DBNAME_KEYWORDS = [ /genes/, /nt/ ]
70
+ BLASTP_DBNAME_KEYWORDS = [ /genes/, /uniprot/, /nr/ ]
71
+
72
+ def setup
73
+ @klass = Bio::Blast::Remote::GenomeNet
74
+ end
75
+ end #class NetTestBlastRemoteGenomeNet
76
+
77
+ # This test class only contains tests for meta information.
78
+ # BLAST execution tests are written in ../test_blast.rb
79
+ class NetTestBlastRemoteDDBJ < Test::Unit::TestCase
80
+
81
+ include NetTestBlastRemoteCommon
82
+
83
+ BLASTN_DBNAME_KEYWORDS = [ /ddbj/i, /nt/i ]
84
+ BLASTP_DBNAME_KEYWORDS = [ /uniprot/i, /pdb/i ]
85
+
86
+ def setup
87
+ @klass = Bio::Blast::Remote::DDBJ
88
+ end
89
+ end #class NetTestBlastRemoteDDBJ
90
+
91
+ end #module FuncTestBlastRemote
92
+ end #module Bio
93
+
@@ -0,0 +1,61 @@
1
+ #
2
+ # = test/functional/bio/appl/test_blast.rb - Unit test for Bio::Blast with network connection
3
+ #
4
+ # Copyright:: Copyright (C) 2011
5
+ # Naohisa Goto <ng@bioruby.org>
6
+ # License:: The Ruby License
7
+ #
8
+
9
+ # loading helper routine for testing bioruby
10
+ require 'pathname'
11
+ load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 3,
12
+ 'bioruby_test_helper.rb')).cleanpath.to_s
13
+
14
+ # libraries needed for the tests
15
+ require 'test/unit'
16
+ require 'bio/sequence'
17
+ require 'bio/appl/blast'
18
+
19
+ module Bio
20
+ module FunctTestBlast
21
+
22
+ module NetTestBlastCommonProteinQuery
23
+ filename = File.join(BioRubyTestDataPath, 'fasta', 'EFTU_BACSU.fasta')
24
+ QuerySequence = File.read(filename).freeze
25
+
26
+ def test_query
27
+ report = nil
28
+ assert_nothing_raised {
29
+ report = @blast.query(QuerySequence)
30
+ }
31
+ assert(report.hits.size > 0)
32
+ end
33
+ end #module NetTestBlastCommonProteinQuery
34
+
35
+ class NetTestBlast_GenomeNet < Test::Unit::TestCase
36
+ include NetTestBlastCommonProteinQuery
37
+
38
+ def setup
39
+ @blast = Bio::Blast.new('blastp', 'mine-aa eco',
40
+ [ '-e', '1e-10',
41
+ '-v', '10',
42
+ '-b', '10' ],
43
+ 'genomenet')
44
+ end
45
+ end #class NetTestBlast_GenomeNet
46
+
47
+ class NetTestBlast_DDBJ < Test::Unit::TestCase
48
+ include NetTestBlastCommonProteinQuery
49
+
50
+ def setup
51
+ @blast = Bio::Blast.new('blastp', 'SWISS',
52
+ ['-e', '1e-10',
53
+ '-v', '10',
54
+ '-b', '10' ],
55
+ 'ddbj')
56
+ end
57
+ end #class NetTestBlast_DDBJ
58
+
59
+ end #module FuncTestBlast
60
+ end #module Bio
61
+
@@ -0,0 +1,47 @@
1
+ #
2
+ # test/functional/bio/io/test_ddbjrest.rb - Functional test for Bio::DDBJ::REST
3
+ #
4
+ # Copyright:: Copyright (C) 2011
5
+ # Naohisa Goto <ng@bioruby.org>
6
+ # License:: The Ruby License
7
+ #
8
+
9
+ # loading helper routine for testing bioruby
10
+ require 'pathname'
11
+ load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 3,
12
+ 'bioruby_test_helper.rb')).cleanpath.to_s
13
+
14
+ # libraries needed for the tests
15
+ require 'bio/io/ddbjrest'
16
+ require 'test/unit'
17
+
18
+ module Bio
19
+ module NetTestDDBJREST
20
+
21
+ class TestDDBJ < Test::Unit::TestCase
22
+
23
+ def setup
24
+ @obj = Bio::DDBJ::REST::DDBJ.new
25
+ end
26
+
27
+ def test_countBasePair
28
+ text = @obj.countBasePair("AF237819")
29
+ expected = {
30
+ "a" => 47,
31
+ "t" => 38,
32
+ "g" => 48,
33
+ "c" => 38
34
+ }
35
+ h = {}
36
+ text.each_line do |line|
37
+ base, count, percent = line.split(/\t/)
38
+ count = count.to_i
39
+ h[base] = count if count > 0
40
+ end
41
+ assert_equal(expected, h)
42
+ end
43
+
44
+ end #class TestDDBJ
45
+
46
+ end #module NetTestDDBJREST
47
+ end #module Bio