Bio::DB::Universal: move into its own distribution
[bioperl-live.git] / examples / db / gb2features.pl
blobcf9152181930fbb2c3ed3efcf974255a044653af
1 #!/usr/bin/perl
2 # Author: Damien Mattei C.N.R.S / U.N.S.A - UMR 6549
3 # example: ./idfetch.pl AP001266
5 use Bio::DB::GenBank;
7 $gb = new Bio::DB::GenBank();
9 # this returns a Seq object :
10 $seq1 = $gb->get_Seq_by_acc($ARGV[0]);
11 print $seq1->display_id() . "\n" ;
14 foreach $feat ($seq1->all_SeqFeatures()) {
16 #print $feat->primary_tag . " " . $feat->source_tag() . "\n" ;
18 print "Feature from ", $feat->start, " to ",
19 $feat->end, " Primary tag ", $feat->primary_tag,
20 ", produced by ", $feat->source_tag(), "\n";
22 if( $feat->strand == 0 ) {
23 print "Feature applicable to either strand\n";
24 } else {
25 print "Feature on strand ", $feat->strand,"\n"; # -1,1
28 foreach $tag ( $feat->all_tags() ) {
29 print "Feature has tag ", $tag, " with values, ",
30 join(' ',$feat->each_tag_value($tag)), "\n";
33 print "new feature\n" if $feat->has_tag('new');
38 exit;
40 __END__
42 It will display something like that:
44 [dmattei@pclgmch2 gmap]$ ./idfetch.pl AP001266
45 AP001266
46 Feature from 1 to 168978 Primary tag source, produced by
47 EMBL/GenBank/SwissProt
48 Feature on strand 1
49 Feature has tag chromosome with values, 11
50 Feature has tag map with values, 11q13
51 Feature has tag clone with values, RP11-770G2
52 Feature has tag organism with values, Homo sapiens
53 Feature has tag db_xref with values, taxon:9606
54 Feature from 1 to 31550 Primary tag misc_feature, produced by
55 EMBL/GenBank/SwissProt
56 Feature on strand 1
57 Feature has tag note with values, assembly_fragment
58 Feature from 31651 to 48510 Primary tag misc_feature, produced by
59 EMBL/GenBank/SwissProt
60 Feature on strand 1
61 Feature has tag note with values, assembly_fragment
62 Feature from 48611 to 64044 Primary tag misc_feature, produced by
63 EMBL/GenBank/SwissProt
64 Feature on strand 1
65 Feature has tag note with values, assembly_fragment
66 Feature from 64145 to 78208 Primary tag misc_feature, produced by
67 EMBL/GenBank/SwissProt
68 Feature on strand 1
69 Feature has tag note with values, assembly_fragment
70 Feature from 78309 to 89008 Primary tag misc_feature, produced by
71 EMBL/GenBank/SwissProt
72 Feature on strand 1
73 Feature has tag note with values, assembly_fragment
74 Feature from 89109 to 99704 Primary tag misc_feature, produced by
75 EMBL/GenBank/SwissProt
76 Feature on strand 1
77 Feature has tag note with values, assembly_fragment
78 Feature from 99805 to 107965 Primary tag misc_feature, produced by
79 EMBL/GenBank/SwissProt
80 Feature on strand 1
81 Feature has tag note with values, assembly_fragment
82 Feature from 108066 to 116032 Primary tag misc_feature, produced by
83 EMBL/GenBank/SwissProt
84 Feature on strand 1
85 Feature has tag note with values, assembly_fragment
86 Feature from 116133 to 124010 Primary tag misc_feature, produced by
87 EMBL/GenBank/SwissProt
88 Feature on strand 1
89 Feature has tag note with values, assembly_fragment
90 Feature from 124111 to 130494 Primary tag misc_feature, produced by
91 EMBL/GenBank/SwissProt
92 Feature on strand 1
93 Feature has tag note with values, assembly_fragment
94 Feature from 130595 to 136072 Primary tag misc_feature, produced by
95 EMBL/GenBank/SwissProt
96 Feature on strand 1
97 Feature has tag note with values, assembly_fragment
98 Feature from 136173 to 139649 Primary tag misc_feature, produced by
99 EMBL/GenBank/SwissProt
100 Feature on strand 1
101 Feature has tag note with values, assembly_fragment
102 Feature from 139750 to 144590 Primary tag misc_feature, produced by
103 EMBL/GenBank/SwissProt
104 Feature on strand 1
105 Feature has tag note with values, assembly_fragment
106 Feature from 144691 to 148482 Primary tag misc_feature, produced by
107 EMBL/GenBank/SwissProt
108 Feature on strand 1
109 Feature has tag note with values, assembly_fragment
110 Feature from 148583 to 152279 Primary tag misc_feature, produced by
111 EMBL/GenBank/SwissProt
112 Feature on strand 1
113 Feature has tag note with values, assembly_fragment
114 Feature from 152380 to 153632 Primary tag misc_feature, produced by
115 EMBL/GenBank/SwissProt
116 Feature on strand 1
117 Feature has tag note with values, assembly_fragment clone_end:T7
118 vector_side:left
119 Feature from 153733 to 155746 Primary tag misc_feature, produced by
120 EMBL/GenBank/SwissProt
121 Feature on strand 1
122 Feature has tag note with values, assembly_fragment
123 Feature from 155847 to 156405 Primary tag misc_feature, produced by
124 EMBL/GenBank/SwissProt
125 Feature on strand 1
126 Feature has tag note with values, assembly_fragment clone_end:SP6
127 vector_side:right
128 Feature from 156506 to 158398 Primary tag misc_feature, produced by
129 EMBL/GenBank/SwissProt
130 Feature on strand 1
131 Feature has tag note with values, assembly_fragment
132 Feature from 158499 to 161333 Primary tag misc_feature, produced by
133 EMBL/GenBank/SwissProt
134 Feature on strand 1
135 Feature has tag note with values, assembly_fragment
136 Feature from 161434 to 163304 Primary tag misc_feature, produced by
137 EMBL/GenBank/SwissProt
138 Feature on strand 1
139 Feature has tag note with values, assembly_fragment
140 Feature from 163405 to 164604 Primary tag misc_feature, produced by
141 EMBL/GenBank/SwissProt
142 Feature on strand 1
143 Feature has tag note with values, assembly_fragment
144 Feature from 164705 to 166693 Primary tag misc_feature, produced by
145 EMBL/GenBank/SwissProt
146 Feature on strand 1
147 Feature has tag note with values, assembly_fragment
148 Feature from 166794 to 168978 Primary tag misc_feature, produced by
149 EMBL/GenBank/SwissProt
150 Feature on strand 1
151 Feature has tag note with values, assembly_fragment