bio 1.3.1 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +2105 -3728
- data/KNOWN_ISSUES.rdoc +35 -3
- data/README.rdoc +8 -2
- data/RELEASE_NOTES.rdoc +166 -0
- data/bin/bioruby +4 -1
- data/bioruby.gemspec +146 -1
- data/bioruby.gemspec.erb +3 -1
- data/doc/ChangeLog-before-1.3.1 +3961 -0
- data/doc/Tutorial.rd +154 -22
- data/doc/Tutorial.rd.html +125 -68
- data/lib/bio.rb +21 -6
- data/lib/bio/appl/bl2seq/report.rb +11 -202
- data/lib/bio/appl/blast/format0.rb +0 -193
- data/lib/bio/appl/blast/report.rb +2 -147
- data/lib/bio/appl/blast/wublast.rb +0 -208
- data/lib/bio/appl/fasta.rb +4 -19
- data/lib/bio/appl/fasta/format10.rb +0 -14
- data/lib/bio/appl/genscan/report.rb +0 -176
- data/lib/bio/appl/hmmer.rb +1 -15
- data/lib/bio/appl/hmmer/report.rb +0 -100
- data/lib/bio/appl/meme/mast.rb +156 -0
- data/lib/bio/appl/meme/mast/report.rb +91 -0
- data/lib/bio/appl/meme/motif.rb +48 -0
- data/lib/bio/appl/psort.rb +0 -111
- data/lib/bio/appl/psort/report.rb +1 -45
- data/lib/bio/appl/pts1.rb +2 -4
- data/lib/bio/appl/sosui/report.rb +5 -54
- data/lib/bio/appl/targetp/report.rb +1 -104
- data/lib/bio/appl/tmhmm/report.rb +0 -36
- data/lib/bio/command.rb +94 -10
- data/lib/bio/data/aa.rb +1 -77
- data/lib/bio/data/codontable.rb +1 -95
- data/lib/bio/data/na.rb +1 -26
- data/lib/bio/db/aaindex.rb +1 -38
- data/lib/bio/db/fasta.rb +1 -134
- data/lib/bio/db/fasta/format_qual.rb +204 -0
- data/lib/bio/db/fasta/qual.rb +102 -0
- data/lib/bio/db/fastq.rb +645 -0
- data/lib/bio/db/fastq/fastq_to_biosequence.rb +40 -0
- data/lib/bio/db/fastq/format_fastq.rb +175 -0
- data/lib/bio/db/genbank/genbank.rb +1 -86
- data/lib/bio/db/gff.rb +0 -17
- data/lib/bio/db/go.rb +4 -72
- data/lib/bio/db/kegg/common.rb +112 -0
- data/lib/bio/db/kegg/compound.rb +29 -20
- data/lib/bio/db/kegg/drug.rb +74 -34
- data/lib/bio/db/kegg/enzyme.rb +26 -5
- data/lib/bio/db/kegg/genes.rb +128 -15
- data/lib/bio/db/kegg/genome.rb +3 -41
- data/lib/bio/db/kegg/glycan.rb +19 -24
- data/lib/bio/db/kegg/orthology.rb +16 -56
- data/lib/bio/db/kegg/reaction.rb +81 -28
- data/lib/bio/db/kegg/taxonomy.rb +1 -52
- data/lib/bio/db/litdb.rb +1 -16
- data/lib/bio/db/phyloxml/phyloxml.xsd +582 -0
- data/lib/bio/db/phyloxml/phyloxml_elements.rb +1174 -0
- data/lib/bio/db/phyloxml/phyloxml_parser.rb +954 -0
- data/lib/bio/db/phyloxml/phyloxml_writer.rb +228 -0
- data/lib/bio/db/prosite.rb +2 -95
- data/lib/bio/db/rebase.rb +5 -6
- data/lib/bio/db/sanger_chromatogram/abif.rb +120 -0
- data/lib/bio/db/sanger_chromatogram/chromatogram.rb +133 -0
- data/lib/bio/db/sanger_chromatogram/chromatogram_to_biosequence.rb +32 -0
- data/lib/bio/db/sanger_chromatogram/scf.rb +210 -0
- data/lib/bio/io/das.rb +0 -44
- data/lib/bio/io/ddbjxml.rb +1 -181
- data/lib/bio/io/flatfile.rb +1 -7
- data/lib/bio/io/flatfile/autodetection.rb +6 -0
- data/lib/bio/io/keggapi.rb +0 -442
- data/lib/bio/io/ncbirest.rb +130 -132
- data/lib/bio/io/ncbisoap.rb +2 -1
- data/lib/bio/io/pubmed.rb +0 -88
- data/lib/bio/location.rb +0 -73
- data/lib/bio/pathway.rb +0 -171
- data/lib/bio/sequence.rb +18 -1
- data/lib/bio/sequence/adapter.rb +3 -0
- data/lib/bio/sequence/format.rb +16 -0
- data/lib/bio/sequence/quality_score.rb +205 -0
- data/lib/bio/tree.rb +70 -5
- data/lib/bio/util/restriction_enzyme/single_strand.rb +3 -2
- data/lib/bio/util/sirna.rb +1 -23
- data/lib/bio/version.rb +1 -1
- data/sample/demo_aaindex.rb +67 -0
- data/sample/demo_aminoacid.rb +101 -0
- data/sample/demo_bl2seq_report.rb +220 -0
- data/sample/demo_blast_report.rb +285 -0
- data/sample/demo_codontable.rb +119 -0
- data/sample/demo_das.rb +105 -0
- data/sample/demo_ddbjxml.rb +212 -0
- data/sample/demo_fasta_remote.rb +51 -0
- data/sample/demo_fastaformat.rb +105 -0
- data/sample/demo_genbank.rb +132 -0
- data/sample/demo_genscan_report.rb +202 -0
- data/sample/demo_gff1.rb +49 -0
- data/sample/demo_go.rb +98 -0
- data/sample/demo_hmmer_report.rb +149 -0
- data/sample/demo_kegg_compound.rb +57 -0
- data/sample/demo_kegg_drug.rb +65 -0
- data/sample/demo_kegg_genome.rb +74 -0
- data/sample/demo_kegg_glycan.rb +72 -0
- data/sample/demo_kegg_orthology.rb +62 -0
- data/sample/demo_kegg_reaction.rb +66 -0
- data/sample/demo_kegg_taxonomy.rb +92 -0
- data/sample/demo_keggapi.rb +502 -0
- data/sample/demo_litdb.rb +42 -0
- data/sample/demo_locations.rb +99 -0
- data/sample/demo_ncbi_rest.rb +130 -0
- data/sample/demo_nucleicacid.rb +49 -0
- data/sample/demo_pathway.rb +196 -0
- data/sample/demo_prosite.rb +120 -0
- data/sample/demo_psort.rb +138 -0
- data/sample/demo_psort_report.rb +70 -0
- data/sample/demo_pubmed.rb +118 -0
- data/sample/demo_sirna.rb +63 -0
- data/sample/demo_sosui_report.rb +89 -0
- data/sample/demo_targetp_report.rb +135 -0
- data/sample/demo_tmhmm_report.rb +68 -0
- data/sample/pmfetch.rb +13 -4
- data/sample/pmsearch.rb +15 -4
- data/sample/test_phyloxml_big.rb +205 -0
- data/test/bioruby_test_helper.rb +61 -0
- data/test/data/KEGG/1.1.1.1.enzyme +935 -0
- data/test/data/KEGG/C00025.compound +102 -0
- data/test/data/KEGG/D00063.drug +104 -0
- data/test/data/KEGG/G00024.glycan +47 -0
- data/test/data/KEGG/G01366.glycan +18 -0
- data/test/data/KEGG/K02338.orthology +902 -0
- data/test/data/KEGG/R00006.reaction +14 -0
- data/test/data/fastq/README.txt +109 -0
- data/test/data/fastq/error_diff_ids.fastq +20 -0
- data/test/data/fastq/error_double_qual.fastq +22 -0
- data/test/data/fastq/error_double_seq.fastq +22 -0
- data/test/data/fastq/error_long_qual.fastq +20 -0
- data/test/data/fastq/error_no_qual.fastq +20 -0
- data/test/data/fastq/error_qual_del.fastq +20 -0
- data/test/data/fastq/error_qual_escape.fastq +20 -0
- data/test/data/fastq/error_qual_null.fastq +0 -0
- data/test/data/fastq/error_qual_space.fastq +21 -0
- data/test/data/fastq/error_qual_tab.fastq +21 -0
- data/test/data/fastq/error_qual_unit_sep.fastq +20 -0
- data/test/data/fastq/error_qual_vtab.fastq +20 -0
- data/test/data/fastq/error_short_qual.fastq +20 -0
- data/test/data/fastq/error_spaces.fastq +20 -0
- data/test/data/fastq/error_tabs.fastq +21 -0
- data/test/data/fastq/error_trunc_at_plus.fastq +19 -0
- data/test/data/fastq/error_trunc_at_qual.fastq +19 -0
- data/test/data/fastq/error_trunc_at_seq.fastq +18 -0
- data/test/data/fastq/error_trunc_in_plus.fastq +19 -0
- data/test/data/fastq/error_trunc_in_qual.fastq +20 -0
- data/test/data/fastq/error_trunc_in_seq.fastq +18 -0
- data/test/data/fastq/error_trunc_in_title.fastq +17 -0
- data/test/data/fastq/illumina_full_range_as_illumina.fastq +8 -0
- data/test/data/fastq/illumina_full_range_as_sanger.fastq +8 -0
- data/test/data/fastq/illumina_full_range_as_solexa.fastq +8 -0
- data/test/data/fastq/illumina_full_range_original_illumina.fastq +8 -0
- data/test/data/fastq/longreads_as_illumina.fastq +40 -0
- data/test/data/fastq/longreads_as_sanger.fastq +40 -0
- data/test/data/fastq/longreads_as_solexa.fastq +40 -0
- data/test/data/fastq/longreads_original_sanger.fastq +120 -0
- data/test/data/fastq/misc_dna_as_illumina.fastq +16 -0
- data/test/data/fastq/misc_dna_as_sanger.fastq +16 -0
- data/test/data/fastq/misc_dna_as_solexa.fastq +16 -0
- data/test/data/fastq/misc_dna_original_sanger.fastq +16 -0
- data/test/data/fastq/misc_rna_as_illumina.fastq +16 -0
- data/test/data/fastq/misc_rna_as_sanger.fastq +16 -0
- data/test/data/fastq/misc_rna_as_solexa.fastq +16 -0
- data/test/data/fastq/misc_rna_original_sanger.fastq +16 -0
- data/test/data/fastq/sanger_full_range_as_illumina.fastq +8 -0
- data/test/data/fastq/sanger_full_range_as_sanger.fastq +8 -0
- data/test/data/fastq/sanger_full_range_as_solexa.fastq +8 -0
- data/test/data/fastq/sanger_full_range_original_sanger.fastq +8 -0
- data/test/data/fastq/solexa_full_range_as_illumina.fastq +8 -0
- data/test/data/fastq/solexa_full_range_as_sanger.fastq +8 -0
- data/test/data/fastq/solexa_full_range_as_solexa.fastq +8 -0
- data/test/data/fastq/solexa_full_range_original_solexa.fastq +8 -0
- data/test/data/fastq/wrapping_as_illumina.fastq +12 -0
- data/test/data/fastq/wrapping_as_sanger.fastq +12 -0
- data/test/data/fastq/wrapping_as_solexa.fastq +12 -0
- data/test/data/fastq/wrapping_original_sanger.fastq +24 -0
- data/test/data/meme/db +0 -0
- data/test/data/meme/mast +0 -0
- data/test/data/meme/mast.out +13 -0
- data/test/data/meme/meme.out +3 -0
- data/test/data/phyloxml/apaf.xml +666 -0
- data/test/data/phyloxml/bcl_2.xml +2097 -0
- data/test/data/phyloxml/made_up.xml +144 -0
- data/test/data/phyloxml/ncbi_taxonomy_mollusca_short.xml +65 -0
- data/test/data/phyloxml/phyloxml_examples.xml +415 -0
- data/test/data/sanger_chromatogram/test_chromatogram_abif.ab1 +0 -0
- data/test/data/sanger_chromatogram/test_chromatogram_scf_v2.scf +0 -0
- data/test/data/sanger_chromatogram/test_chromatogram_scf_v3.scf +0 -0
- data/test/functional/bio/appl/test_pts1.rb +7 -5
- data/test/functional/bio/io/test_ensembl.rb +4 -3
- data/test/functional/bio/io/test_pubmed.rb +9 -3
- data/test/functional/bio/io/test_soapwsdl.rb +5 -4
- data/test/functional/bio/io/test_togows.rb +5 -4
- data/test/functional/bio/sequence/test_output_embl.rb +6 -4
- data/test/functional/bio/test_command.rb +54 -5
- data/test/runner.rb +5 -3
- data/test/unit/bio/appl/bl2seq/test_report.rb +5 -4
- data/test/unit/bio/appl/blast/test_ncbioptions.rb +4 -2
- data/test/unit/bio/appl/blast/test_report.rb +5 -4
- data/test/unit/bio/appl/blast/test_rpsblast.rb +5 -4
- data/test/unit/bio/appl/gcg/test_msf.rb +5 -5
- data/test/unit/bio/appl/genscan/test_report.rb +8 -9
- data/test/unit/bio/appl/hmmer/test_report.rb +5 -4
- data/test/unit/bio/appl/iprscan/test_report.rb +6 -5
- data/test/unit/bio/appl/mafft/test_report.rb +6 -5
- data/test/unit/bio/appl/meme/mast/test_report.rb +46 -0
- data/test/unit/bio/appl/meme/test_mast.rb +103 -0
- data/test/unit/bio/appl/meme/test_motif.rb +38 -0
- data/test/unit/bio/appl/paml/codeml/test_rates.rb +5 -4
- data/test/unit/bio/appl/paml/codeml/test_report.rb +5 -4
- data/test/unit/bio/appl/paml/test_codeml.rb +5 -4
- data/test/unit/bio/appl/sim4/test_report.rb +5 -4
- data/test/unit/bio/appl/sosui/test_report.rb +6 -5
- data/test/unit/bio/appl/targetp/test_report.rb +5 -3
- data/test/unit/bio/appl/test_blast.rb +5 -4
- data/test/unit/bio/appl/test_fasta.rb +4 -2
- data/test/unit/bio/appl/test_pts1.rb +4 -2
- data/test/unit/bio/appl/tmhmm/test_report.rb +6 -5
- data/test/unit/bio/data/test_aa.rb +5 -3
- data/test/unit/bio/data/test_codontable.rb +5 -4
- data/test/unit/bio/data/test_na.rb +5 -3
- data/test/unit/bio/db/biosql/tc_biosql.rb +5 -1
- data/test/unit/bio/db/embl/test_common.rb +4 -2
- data/test/unit/bio/db/embl/test_embl.rb +6 -6
- data/test/unit/bio/db/embl/test_embl_rel89.rb +6 -6
- data/test/unit/bio/db/embl/test_embl_to_bioseq.rb +7 -8
- data/test/unit/bio/db/embl/test_sptr.rb +6 -8
- data/test/unit/bio/db/embl/test_uniprot.rb +6 -5
- data/test/unit/bio/db/fasta/test_format_qual.rb +346 -0
- data/test/unit/bio/db/kegg/test_compound.rb +146 -0
- data/test/unit/bio/db/kegg/test_drug.rb +194 -0
- data/test/unit/bio/db/kegg/test_enzyme.rb +241 -0
- data/test/unit/bio/db/kegg/test_genes.rb +32 -4
- data/test/unit/bio/db/kegg/test_glycan.rb +260 -0
- data/test/unit/bio/db/kegg/test_orthology.rb +50 -0
- data/test/unit/bio/db/kegg/test_reaction.rb +96 -0
- data/test/unit/bio/db/pdb/test_pdb.rb +4 -2
- data/test/unit/bio/db/sanger_chromatogram/test_abif.rb +76 -0
- data/test/unit/bio/db/sanger_chromatogram/test_scf.rb +98 -0
- data/test/unit/bio/db/test_aaindex.rb +6 -6
- data/test/unit/bio/db/test_fasta.rb +5 -46
- data/test/unit/bio/db/test_fastq.rb +829 -0
- data/test/unit/bio/db/test_gff.rb +4 -2
- data/test/unit/bio/db/test_lasergene.rb +7 -5
- data/test/unit/bio/db/test_medline.rb +4 -2
- data/test/unit/bio/db/test_newick.rb +6 -6
- data/test/unit/bio/db/test_nexus.rb +4 -2
- data/test/unit/bio/db/test_phyloxml.rb +769 -0
- data/test/unit/bio/db/test_phyloxml_writer.rb +328 -0
- data/test/unit/bio/db/test_prosite.rb +6 -5
- data/test/unit/bio/db/test_qual.rb +63 -0
- data/test/unit/bio/db/test_rebase.rb +5 -3
- data/test/unit/bio/db/test_soft.rb +7 -6
- data/test/unit/bio/io/flatfile/test_autodetection.rb +6 -7
- data/test/unit/bio/io/flatfile/test_buffer.rb +6 -5
- data/test/unit/bio/io/flatfile/test_splitter.rb +4 -4
- data/test/unit/bio/io/test_ddbjxml.rb +4 -3
- data/test/unit/bio/io/test_ensembl.rb +5 -3
- data/test/unit/bio/io/test_fastacmd.rb +4 -3
- data/test/unit/bio/io/test_flatfile.rb +6 -5
- data/test/unit/bio/io/test_soapwsdl.rb +4 -3
- data/test/unit/bio/io/test_togows.rb +4 -2
- data/test/unit/bio/sequence/test_aa.rb +5 -3
- data/test/unit/bio/sequence/test_common.rb +4 -2
- data/test/unit/bio/sequence/test_compat.rb +4 -2
- data/test/unit/bio/sequence/test_dblink.rb +5 -3
- data/test/unit/bio/sequence/test_na.rb +4 -2
- data/test/unit/bio/sequence/test_quality_score.rb +330 -0
- data/test/unit/bio/shell/plugin/test_seq.rb +5 -3
- data/test/unit/bio/test_alignment.rb +5 -3
- data/test/unit/bio/test_command.rb +4 -3
- data/test/unit/bio/test_db.rb +5 -3
- data/test/unit/bio/test_feature.rb +4 -2
- data/test/unit/bio/test_location.rb +4 -2
- data/test/unit/bio/test_map.rb +5 -3
- data/test/unit/bio/test_pathway.rb +4 -2
- data/test/unit/bio/test_reference.rb +4 -2
- data/test/unit/bio/test_sequence.rb +5 -3
- data/test/unit/bio/test_shell.rb +5 -3
- data/test/unit/bio/test_tree.rb +6 -6
- data/test/unit/bio/util/restriction_enzyme/analysis/test_calculated_cuts.rb +4 -2
- data/test/unit/bio/util/restriction_enzyme/analysis/test_cut_ranges.rb +4 -2
- data/test/unit/bio/util/restriction_enzyme/analysis/test_sequence_range.rb +4 -2
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_aligned_strands.rb +4 -2
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair.rb +4 -2
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair_in_enzyme_notation.rb +4 -2
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations.rb +4 -2
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations_in_enzyme_notation.rb +4 -2
- data/test/unit/bio/util/restriction_enzyme/single_strand/test_cut_locations_in_enzyme_notation.rb +4 -2
- data/test/unit/bio/util/restriction_enzyme/test_analysis.rb +4 -2
- data/test/unit/bio/util/restriction_enzyme/test_cut_symbol.rb +4 -2
- data/test/unit/bio/util/restriction_enzyme/test_double_stranded.rb +4 -2
- data/test/unit/bio/util/restriction_enzyme/test_single_strand.rb +17 -13
- data/test/unit/bio/util/restriction_enzyme/test_single_strand_complement.rb +17 -13
- data/test/unit/bio/util/restriction_enzyme/test_string_formatting.rb +4 -2
- data/test/unit/bio/util/test_color_scheme.rb +5 -3
- data/test/unit/bio/util/test_contingency_table.rb +5 -3
- data/test/unit/bio/util/test_restriction_enzyme.rb +4 -2
- data/test/unit/bio/util/test_sirna.rb +6 -4
- metadata +147 -2
@@ -5,7 +5,7 @@
|
|
5
5
|
# Mitsuteru C. Nakao <n@bioruby.org>
|
6
6
|
# License:: The Ruby License
|
7
7
|
#
|
8
|
-
# $Id
|
8
|
+
# $Id:$
|
9
9
|
#
|
10
10
|
# == A Report classes for PSORT Systems
|
11
11
|
#
|
@@ -411,47 +411,3 @@ module Bio
|
|
411
411
|
|
412
412
|
end # module Bio
|
413
413
|
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
# testing code
|
419
|
-
|
420
|
-
if __FILE__ == $0
|
421
|
-
|
422
|
-
|
423
|
-
while entry = $<.gets(Bio::PSORT::PSORT2::Report::DELIMITER)
|
424
|
-
|
425
|
-
puts "\n ==> a = Bio::PSORT::PSORT2::Report.parser(entry)"
|
426
|
-
a = Bio::PSORT::PSORT2::Report.parser(entry)
|
427
|
-
|
428
|
-
puts "\n ==> a.entry_id "
|
429
|
-
p a.entry_id
|
430
|
-
puts "\n ==> a.scl "
|
431
|
-
p a.scl
|
432
|
-
puts "\n ==> a.pred "
|
433
|
-
p a.pred
|
434
|
-
puts "\n ==> a.prob "
|
435
|
-
p a.prob
|
436
|
-
p a.prob.keys.sort.map {|k| k.rjust(4)}.inspect.gsub('"','')
|
437
|
-
p a.prob.keys.sort.map {|k| a.prob[k].to_s.rjust(4) }.inspect.gsub('"','')
|
438
|
-
|
439
|
-
puts "\n ==> a.k "
|
440
|
-
p a.k
|
441
|
-
puts "\n ==> a.definition"
|
442
|
-
p a.definition
|
443
|
-
puts "\n ==> a.seq"
|
444
|
-
p a.seq
|
445
|
-
|
446
|
-
puts "\n ==> a.features.keys.sort "
|
447
|
-
p a.features.keys.sort
|
448
|
-
|
449
|
-
a.features.keys.sort.each do |key|
|
450
|
-
puts "\n ==> a.features['#{key}'] "
|
451
|
-
puts a.features[key]
|
452
|
-
end
|
453
|
-
|
454
|
-
|
455
|
-
end
|
456
|
-
|
457
|
-
end
|
data/lib/bio/appl/pts1.rb
CHANGED
@@ -41,7 +41,7 @@ require 'bio/command'
|
|
41
41
|
# == References
|
42
42
|
#
|
43
43
|
# * The PTS1 predictor
|
44
|
-
# http://mendel.imp.ac.at/
|
44
|
+
# http://mendel.imp.ac.at/pts1/
|
45
45
|
#
|
46
46
|
# * Neuberger G, Maurer-Stroh S, Eisenhaber B, Hartig A, Eisenhaber F.
|
47
47
|
# Motif refinement of the peroxisomal targeting signal 1 and evaluation
|
@@ -90,8 +90,7 @@ class PTS1
|
|
90
90
|
# serv_fungi_specific = Bio::PTS1.new(2) # See Bio::PTS1::FUNCTION.
|
91
91
|
#
|
92
92
|
def initialize(func = 'METAZOA-specific')
|
93
|
-
@
|
94
|
-
@cgi_path = "/sat/pts1/cgi-bin/pts1.cgi"
|
93
|
+
@uri = "http://mendel.imp.ac.at/jspcgi/cgi-bin/pts1/pts1.cgi"
|
95
94
|
@output = nil
|
96
95
|
@function = function(func)
|
97
96
|
end
|
@@ -145,7 +144,6 @@ class PTS1
|
|
145
144
|
@form_data = {'function' => @function.values.join(''),
|
146
145
|
'sequence' => seq.seq,
|
147
146
|
'name' => seq.definition }
|
148
|
-
@uri = URI.parse(["http:/", @host, @cgi_path].join('/'))
|
149
147
|
|
150
148
|
result = Bio::Command.post_form(@uri, @form_data)
|
151
149
|
@output = Report.new(result.body)
|
@@ -5,13 +5,14 @@
|
|
5
5
|
# Mitsuteru C. Nakao <n@bioruby.org>
|
6
6
|
# License:: The Ruby License
|
7
7
|
#
|
8
|
-
# $Id
|
8
|
+
# $Id:$
|
9
9
|
#
|
10
10
|
# == Example
|
11
11
|
#
|
12
12
|
# == References
|
13
13
|
#
|
14
|
-
# * http://
|
14
|
+
# * http://bp.nuap.nagoya-u.ac.jp/sosui/
|
15
|
+
# * http://bp.nuap.nagoya-u.ac.jp/sosui/sosui_submit.html
|
15
16
|
#
|
16
17
|
|
17
18
|
|
@@ -22,7 +23,8 @@ module Bio
|
|
22
23
|
# = SOSUI output report parsing class
|
23
24
|
#
|
24
25
|
# == References
|
25
|
-
# * http://
|
26
|
+
# * http://bp.nuap.nagoya-u.ac.jp/sosui/
|
27
|
+
# * http://bp.nuap.nagoya-u.ac.jp/sosui/sosui_submit.html
|
26
28
|
class Report
|
27
29
|
|
28
30
|
# Delimiter
|
@@ -98,54 +100,3 @@ module Bio
|
|
98
100
|
end # module Bio
|
99
101
|
|
100
102
|
|
101
|
-
|
102
|
-
if __FILE__ == $0
|
103
|
-
|
104
|
-
begin
|
105
|
-
require 'pp'
|
106
|
-
alias p pp
|
107
|
-
rescue LoadError
|
108
|
-
end
|
109
|
-
|
110
|
-
|
111
|
-
sample = <<HOGE
|
112
|
-
>HOGE1
|
113
|
-
MEMBRANE PROTEIN
|
114
|
-
NUMBER OF TM HELIX = 6
|
115
|
-
TM 1 12- 34 SECONDARY LLVPILLPEKCYDQLFVQWDLLH
|
116
|
-
TM 2 36- 58 PRIMARY PCLKILLSKGLGLGIVAGSLLVK
|
117
|
-
TM 3 102- 124 SECONDARY SWGEALFLMLQTITICFLVMHYR
|
118
|
-
TM 4 126- 148 PRIMARY QTVKGVAFLACYGLVLLVLLSPL
|
119
|
-
TM 5 152- 174 SECONDARY TVVTLLQASNVPAVVVGRLLQAA
|
120
|
-
TM 6 214- 236 SECONDARY AGTFVVSSLCNGLIAAQLLFYWN
|
121
|
-
|
122
|
-
>HOGE2
|
123
|
-
SOLUBLE PROTEIN
|
124
|
-
|
125
|
-
HOGE
|
126
|
-
|
127
|
-
def hoge(ent)
|
128
|
-
puts '==='
|
129
|
-
puts ent
|
130
|
-
puts '==='
|
131
|
-
sosui = Bio::SOSUI::Report.new(ent)
|
132
|
-
p [:entry_id, sosui.entry_id]
|
133
|
-
p [:prediction, sosui.prediction]
|
134
|
-
p [:tmhs.size, sosui.tmhs]
|
135
|
-
pp [:tmhs, sosui.tmh]
|
136
|
-
end
|
137
|
-
|
138
|
-
sample.split(/#{Bio::SOSUI::Report::DELIMITER}/).each {|ent|
|
139
|
-
hoge(ent)
|
140
|
-
}
|
141
|
-
|
142
|
-
exit if ARGV.size == 0
|
143
|
-
|
144
|
-
while ent = $<.gets(Bio::SOSUI::Report::DELIMITER)
|
145
|
-
hoge(ent)
|
146
|
-
end
|
147
|
-
|
148
|
-
end
|
149
|
-
|
150
|
-
|
151
|
-
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# Mitsuteru C. Nakao <n@bioruby.org>
|
6
6
|
# License:: The Ruby License
|
7
7
|
#
|
8
|
-
# $Id
|
8
|
+
# $Id:$
|
9
9
|
#
|
10
10
|
# == Description
|
11
11
|
#
|
@@ -162,106 +162,3 @@ module Bio
|
|
162
162
|
|
163
163
|
end # moudel Bio
|
164
164
|
|
165
|
-
|
166
|
-
|
167
|
-
if __FILE__ == $0
|
168
|
-
|
169
|
-
begin
|
170
|
-
require 'pp'
|
171
|
-
alias p pp
|
172
|
-
rescue LoadError
|
173
|
-
end
|
174
|
-
|
175
|
-
|
176
|
-
plant = <<HOGE
|
177
|
-
|
178
|
-
### ### ### T A R G E T P 1.0 prediction results ### ### ###
|
179
|
-
|
180
|
-
# Number of input sequences: 1
|
181
|
-
# Cleavage site predictions not included.
|
182
|
-
# Using PLANT networks.
|
183
|
-
|
184
|
-
# Name Length cTP mTP SP other Loc. RC
|
185
|
-
#----------------------------------------------------------------------------------
|
186
|
-
MGI_2141503 640 0.031 0.161 0.271 0.844 _ 3
|
187
|
-
#----------------------------------------------------------------------------------
|
188
|
-
# cutoff 0.00 0.00 0.00 0.00
|
189
|
-
|
190
|
-
|
191
|
-
HOGE
|
192
|
-
|
193
|
-
plant_c = <<HOGE
|
194
|
-
|
195
|
-
### ### ### T A R G E T P 1.0 prediction results ### ### ###
|
196
|
-
|
197
|
-
# Number of input sequences: 1
|
198
|
-
# Cleavage site predictions included.
|
199
|
-
# Using PLANT networks.
|
200
|
-
|
201
|
-
# Name Length cTP mTP SP other Loc. RC TPlen
|
202
|
-
#----------------------------------------------------------------------------------
|
203
|
-
MGI_2141503 640 0.031 0.161 0.271 0.844 _ 3 -
|
204
|
-
#----------------------------------------------------------------------------------
|
205
|
-
# cutoff 0.00 0.00 0.00 0.00
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
HOGE
|
210
|
-
|
211
|
-
non_plant_c = <<HOGE
|
212
|
-
|
213
|
-
### ### ### T A R G E T P 1.0 prediction results ### ### ###
|
214
|
-
|
215
|
-
# Number of input sequences: 1
|
216
|
-
# Cleavage site predictions included.
|
217
|
-
# Using NON-PLANT networks.
|
218
|
-
|
219
|
-
# Name Length mTP SP other Loc. RC TPlen
|
220
|
-
#--------------------------------------------------------------------------
|
221
|
-
MGI_96083 2187 0.292 0.053 0.746 _ 3 -
|
222
|
-
#--------------------------------------------------------------------------
|
223
|
-
# cutoff 0.00 0.00 0.00
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
HOGE
|
228
|
-
|
229
|
-
|
230
|
-
def hoge(e)
|
231
|
-
puts e
|
232
|
-
ent = Bio::TargetP::Report.new(e)
|
233
|
-
pp ent
|
234
|
-
|
235
|
-
p [:entry_id, ent.entry_id]
|
236
|
-
p [:name, ent.name]
|
237
|
-
p [:version, ent.version]
|
238
|
-
p [:query_sequnces, ent.query_sequences]
|
239
|
-
p [:cleavage_site_prediction, ent.cleavage_site_prediction]
|
240
|
-
p [:networks, ent.networks]
|
241
|
-
p [:query_len, ent.query_len]
|
242
|
-
p [:prediction, ent.prediction]
|
243
|
-
p [:pred_Name, ent.pred['Name']]
|
244
|
-
p [:pred_SP, ent.pred['SP']]
|
245
|
-
p [:pred_mTP, ent.pred['mTP']]
|
246
|
-
p [:cutoff, ent.cutoff]
|
247
|
-
p [:loc, ent.loc]
|
248
|
-
p [:rc, ent.rc]
|
249
|
-
|
250
|
-
puts '=='
|
251
|
-
end
|
252
|
-
|
253
|
-
|
254
|
-
[plant, plant_c, non_plant_c].each {|e|
|
255
|
-
hoge(e)
|
256
|
-
}
|
257
|
-
|
258
|
-
exit if ARGV.size == 0
|
259
|
-
|
260
|
-
while ent = $<.gets(Bio::TargetP::Report::DELIMITER)
|
261
|
-
hoge(ent)
|
262
|
-
end
|
263
|
-
|
264
|
-
end
|
265
|
-
|
266
|
-
|
267
|
-
|
@@ -193,39 +193,3 @@ module Bio
|
|
193
193
|
|
194
194
|
end # module Bio
|
195
195
|
|
196
|
-
|
197
|
-
if __FILE__ == $0
|
198
|
-
|
199
|
-
begin
|
200
|
-
require 'pp'
|
201
|
-
alias p pp
|
202
|
-
rescue LoadError
|
203
|
-
end
|
204
|
-
|
205
|
-
Bio::TMHMM.reports(ARGF.read) do |ent|
|
206
|
-
puts '==>'
|
207
|
-
puts ent.to_s
|
208
|
-
pp ent
|
209
|
-
|
210
|
-
p [:entry_id, ent.entry_id]
|
211
|
-
p [:query_len, ent.query_len]
|
212
|
-
p [:predicted_tmhs, ent.predicted_tmhs]
|
213
|
-
p [:tmhs_size, ent.tmhs.size]
|
214
|
-
p [:exp_aas_in_tmhs, ent.exp_aas_in_tmhs]
|
215
|
-
p [:exp_first_60aa, ent.exp_first_60aa]
|
216
|
-
p [:total_prob_of_N_in, ent.total_prob_of_N_in]
|
217
|
-
|
218
|
-
ent.tmhs.each do |t|
|
219
|
-
p t
|
220
|
-
p [:entry_id, t.entry_id]
|
221
|
-
p [:version, t.version]
|
222
|
-
p [:status, t.status]
|
223
|
-
p [:range, t.range]
|
224
|
-
p [:pos, t.pos]
|
225
|
-
end
|
226
|
-
|
227
|
-
p [:helix, ent.helix]
|
228
|
-
p ent.tmhs.map {|t| t if t.status == 'TMhelix' }.compact
|
229
|
-
end
|
230
|
-
|
231
|
-
end
|
data/lib/bio/command.rb
CHANGED
@@ -357,22 +357,33 @@ module Command
|
|
357
357
|
|
358
358
|
# Backport of Dir.mktmpdir in Ruby 1.9.
|
359
359
|
#
|
360
|
-
# Same as Dir.mktmpdir(prefix_suffix) in Ruby 1.9
|
361
|
-
# prefix must be a String, nil, or omitted.
|
360
|
+
# Same as Dir.mktmpdir(prefix_suffix) in Ruby 1.9.
|
362
361
|
#
|
363
362
|
# ---
|
364
363
|
# *Arguments*:
|
365
|
-
# * (optional)
|
364
|
+
# * (optional) <em>prefix_suffix</em>: String (or Array, etc.)
|
365
|
+
# * (optional) <em>tmpdir</em>: String: temporary directory's path
|
366
366
|
#
|
367
|
-
def mktmpdir(
|
368
|
-
prefix = prefix.to_str
|
367
|
+
def mktmpdir(prefix_suffix = nil, tmpdir = nil, &block)
|
369
368
|
begin
|
370
|
-
Dir.mktmpdir(
|
369
|
+
Dir.mktmpdir(prefix_suffix, tmpdir, &block)
|
371
370
|
rescue NoMethodError
|
372
|
-
|
373
|
-
#
|
374
|
-
# ***** Below is excerpted from Ruby 1.9.0's lib/tmpdir.rb ****
|
371
|
+
# backported from Ruby 1.9.2-preview1.
|
372
|
+
# ***** Below is excerpted from Ruby 1.9.2-preview1's lib/tmpdir.rb ****
|
375
373
|
# ***** Be careful about copyright. ****
|
374
|
+
case prefix_suffix
|
375
|
+
when nil
|
376
|
+
prefix = "d"
|
377
|
+
suffix = ""
|
378
|
+
when String
|
379
|
+
prefix = prefix_suffix
|
380
|
+
suffix = ""
|
381
|
+
when Array
|
382
|
+
prefix = prefix_suffix[0]
|
383
|
+
suffix = prefix_suffix[1]
|
384
|
+
else
|
385
|
+
raise ArgumentError, "unexpected prefix_suffix: #{prefix_suffix.inspect}"
|
386
|
+
end
|
376
387
|
tmpdir ||= Dir.tmpdir
|
377
388
|
t = Time.now.strftime("%Y%m%d")
|
378
389
|
n = nil
|
@@ -396,10 +407,83 @@ module Command
|
|
396
407
|
else
|
397
408
|
path
|
398
409
|
end
|
399
|
-
# ***** Above is excerpted from Ruby 1.9.
|
410
|
+
# ***** Above is excerpted from Ruby 1.9.2-preview1's lib/tmpdir.rb ****
|
400
411
|
end
|
401
412
|
end
|
402
413
|
|
414
|
+
# Bio::Command::Tmpdir is a wrapper class to handle temporary directory
|
415
|
+
# like Tempfile class. A temporary directory is created when the object
|
416
|
+
# of the class is created, and automatically removed when the object
|
417
|
+
# is destroyed by GC.
|
418
|
+
#
|
419
|
+
# BioRuby library internal use only.
|
420
|
+
class Tmpdir
|
421
|
+
|
422
|
+
# Returns finalizer object for Tmpdir class.
|
423
|
+
# Internal use only. Users should not call this method directly.
|
424
|
+
#
|
425
|
+
# Acknowledgement: The essense of the code is taken from tempfile.rb
|
426
|
+
# in Ruby 1.8.7.
|
427
|
+
#
|
428
|
+
# ---
|
429
|
+
# *Arguments*:
|
430
|
+
# * (required) _data_: Array containing internal data
|
431
|
+
# *Returns*:: Proc object
|
432
|
+
def self.callback(data)
|
433
|
+
pid = $$
|
434
|
+
lambda {
|
435
|
+
path, = *data
|
436
|
+
if pid == $$
|
437
|
+
$stderr.print "removing ", path, " ..." if $DEBUG
|
438
|
+
if path and !path.empty? and
|
439
|
+
File.directory?(path) and
|
440
|
+
!File.symlink?(path) then
|
441
|
+
Bio::Command.remove_entry_secure(path)
|
442
|
+
$stderr.print "done\n" if $DEBUG
|
443
|
+
else
|
444
|
+
$stderr.print "skipped\n" if $DEBUG
|
445
|
+
end
|
446
|
+
end
|
447
|
+
}
|
448
|
+
end
|
449
|
+
|
450
|
+
# Creates a new Tmpdir object.
|
451
|
+
# The arguments are the same as Bio::Command.mktmpdir.
|
452
|
+
#
|
453
|
+
# ---
|
454
|
+
# *Arguments*:
|
455
|
+
# * (optional) <em>prefix_suffix</em>: String (or Array)
|
456
|
+
# * (optional) <em>tmpdir</em>: String: temporary directory's path
|
457
|
+
# *Returns*:: Tmpdir object
|
458
|
+
def initialize(prefix_suffix = nil, tmpdir = nil)
|
459
|
+
@data = []
|
460
|
+
@clean_proc = self.class.callback(@data)
|
461
|
+
ObjectSpace.define_finalizer(self, @clean_proc)
|
462
|
+
@data.push(@path = Bio::Command.mktmpdir(prefix_suffix, tmpdir).freeze)
|
463
|
+
end
|
464
|
+
|
465
|
+
# Path to the temporay directory
|
466
|
+
#
|
467
|
+
# *Returns*:: String
|
468
|
+
def path
|
469
|
+
@path || raise(IOError, 'removed temporary directory')
|
470
|
+
end
|
471
|
+
|
472
|
+
# Removes the temporary directory.
|
473
|
+
#
|
474
|
+
# *Returns*:: nil
|
475
|
+
def close!
|
476
|
+
# raise error if path is nil
|
477
|
+
self.path
|
478
|
+
# finilizer object is called to remove the directory
|
479
|
+
@clean_proc.call
|
480
|
+
# unregister finalizer
|
481
|
+
ObjectSpace.undefine_finalizer(self)
|
482
|
+
# @data and @path is removed
|
483
|
+
@data = @path = nil
|
484
|
+
end
|
485
|
+
end #class Tmpdir
|
486
|
+
|
403
487
|
# Same as OpenURI.open_uri(uri).read
|
404
488
|
# and
|
405
489
|
# it uses proxy if an environment variable (same as OpenURI.open_uri)
|
data/lib/bio/data/aa.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
# Toshiaki Katayama <k@bioruby.org>
|
6
6
|
# License:: The Ruby License
|
7
7
|
#
|
8
|
-
# $Id
|
8
|
+
# $Id:$
|
9
9
|
#
|
10
10
|
|
11
11
|
module Bio
|
@@ -271,79 +271,3 @@ end
|
|
271
271
|
end # module Bio
|
272
272
|
|
273
273
|
|
274
|
-
if __FILE__ == $0
|
275
|
-
|
276
|
-
puts "### aa = Bio::AminoAcid.new"
|
277
|
-
aa = Bio::AminoAcid.new
|
278
|
-
|
279
|
-
puts "# Bio::AminoAcid['A']"
|
280
|
-
p Bio::AminoAcid['A']
|
281
|
-
puts "# aa['A']"
|
282
|
-
p aa['A']
|
283
|
-
|
284
|
-
puts "# Bio::AminoAcid.name('A'), Bio::AminoAcid.name('Ala')"
|
285
|
-
p Bio::AminoAcid.name('A'), Bio::AminoAcid.name('Ala')
|
286
|
-
puts "# aa.name('A'), aa.name('Ala')"
|
287
|
-
p aa.name('A'), aa.name('Ala')
|
288
|
-
|
289
|
-
puts "# Bio::AminoAcid.to_1('alanine'), Bio::AminoAcid.one('alanine')"
|
290
|
-
p Bio::AminoAcid.to_1('alanine'), Bio::AminoAcid.one('alanine')
|
291
|
-
puts "# aa.to_1('alanine'), aa.one('alanine')"
|
292
|
-
p aa.to_1('alanine'), aa.one('alanine')
|
293
|
-
puts "# Bio::AminoAcid.to_1('Ala'), Bio::AminoAcid.one('Ala')"
|
294
|
-
p Bio::AminoAcid.to_1('Ala'), Bio::AminoAcid.one('Ala')
|
295
|
-
puts "# aa.to_1('Ala'), aa.one('Ala')"
|
296
|
-
p aa.to_1('Ala'), aa.one('Ala')
|
297
|
-
puts "# Bio::AminoAcid.to_1('A'), Bio::AminoAcid.one('A')"
|
298
|
-
p Bio::AminoAcid.to_1('A'), Bio::AminoAcid.one('A')
|
299
|
-
puts "# aa.to_1('A'), aa.one('A')"
|
300
|
-
p aa.to_1('A'), aa.one('A')
|
301
|
-
|
302
|
-
puts "# Bio::AminoAcid.to_3('alanine'), Bio::AminoAcid.three('alanine')"
|
303
|
-
p Bio::AminoAcid.to_3('alanine'), Bio::AminoAcid.three('alanine')
|
304
|
-
puts "# aa.to_3('alanine'), aa.three('alanine')"
|
305
|
-
p aa.to_3('alanine'), aa.three('alanine')
|
306
|
-
puts "# Bio::AminoAcid.to_3('Ala'), Bio::AminoAcid.three('Ala')"
|
307
|
-
p Bio::AminoAcid.to_3('Ala'), Bio::AminoAcid.three('Ala')
|
308
|
-
puts "# aa.to_3('Ala'), aa.three('Ala')"
|
309
|
-
p aa.to_3('Ala'), aa.three('Ala')
|
310
|
-
puts "# Bio::AminoAcid.to_3('A'), Bio::AminoAcid.three('A')"
|
311
|
-
p Bio::AminoAcid.to_3('A'), Bio::AminoAcid.three('A')
|
312
|
-
puts "# aa.to_3('A'), aa.three('A')"
|
313
|
-
p aa.to_3('A'), aa.three('A')
|
314
|
-
|
315
|
-
puts "# Bio::AminoAcid.one2three('A')"
|
316
|
-
p Bio::AminoAcid.one2three('A')
|
317
|
-
puts "# aa.one2three('A')"
|
318
|
-
p aa.one2three('A')
|
319
|
-
|
320
|
-
puts "# Bio::AminoAcid.three2one('Ala')"
|
321
|
-
p Bio::AminoAcid.three2one('Ala')
|
322
|
-
puts "# aa.three2one('Ala')"
|
323
|
-
p aa.three2one('Ala')
|
324
|
-
|
325
|
-
puts "# Bio::AminoAcid.one2name('A')"
|
326
|
-
p Bio::AminoAcid.one2name('A')
|
327
|
-
puts "# aa.one2name('A')"
|
328
|
-
p aa.one2name('A')
|
329
|
-
|
330
|
-
puts "# Bio::AminoAcid.name2one('alanine')"
|
331
|
-
p Bio::AminoAcid.name2one('alanine')
|
332
|
-
puts "# aa.name2one('alanine')"
|
333
|
-
p aa.name2one('alanine')
|
334
|
-
|
335
|
-
puts "# Bio::AminoAcid.three2name('Ala')"
|
336
|
-
p Bio::AminoAcid.three2name('Ala')
|
337
|
-
puts "# aa.three2name('Ala')"
|
338
|
-
p aa.three2name('Ala')
|
339
|
-
|
340
|
-
puts "# Bio::AminoAcid.name2three('alanine')"
|
341
|
-
p Bio::AminoAcid.name2three('alanine')
|
342
|
-
puts "# aa.name2three('alanine')"
|
343
|
-
p aa.name2three('alanine')
|
344
|
-
|
345
|
-
puts "# Bio::AminoAcid.to_re('BZACDEFGHIKLMNPQRSTVWYU')"
|
346
|
-
p Bio::AminoAcid.to_re('BZACDEFGHIKLMNPQRSTVWYU')
|
347
|
-
|
348
|
-
end
|
349
|
-
|