[Bioperl-l] Genbank files

BForde b.m.forde at umail.ucc.ie
Tue Dec 13 11:03:50 UTC 2011


Than you for the replies. 

My script (below) reads in a list of locus_tags from a tab delimited text
file. Compares these locus_tags to the locus_tags in  a genbank file and
where they are equal adds new features.
the line
$feat->add_tag_value()
needs to be defined. In the bioperl wiki this variable appears to be defined
by giving it coordinates etc (creating a new feature). I wish to add
features to CDS key when the locus_tags are identical. Is this possible?

use strict; 
use Bio::SeqIO; 

my @V; 
open (LIST1, 'list') ||die; 
while (<LIST1>){ 
    push @V, (split(/\t/, $_))[0]; 
} 
close(LIST1); 

my $seqio_object = Bio::SeqIO->new(-file=>"Contig100.gb"); 
my $seq_object = $seqio_object->next_seq; 

for my $feat_object ($seq_object->get_SeqFeatures){ 
    if ($feat_object->primary_tag eq "CDS"){ 
        if ($feat_object->has_tag('locus_tag')){ 
            for my $V3 ($feat_object->get_tag_values('locus_tag')){ 
                for my $V1 (@V) { 
                    if ($V1 eq $V3){ 
                        ADD NEW FEATURES 
                        
                    }     
                } 
            } 
        } 
    } 
} 
  
The script works down as far as the comparison point where locus_tags in the
genbankfile "Contig100.gb" are compared against a list of locus_tags from a
delimited txt file. 


regards 

Brian 

Jason Stajich-5 wrote:
> 
> $feature->add_tag_value('color','blue');
> 
> On Dec 9, 2011, at 8:52 AM, BForde wrote:
> 
>> 
>> Hello all,
>> 
>> I am new to Bioperl so I apologise if this is stupid question. 
>> 
>> For CDS features I which to add additional qualifiers e.g. /colour and
>> /note
>> qualifiers. I have looked at the BioPerl wiki but am still unsure as how
>> to
>> do this?
>> 
>> regards
>> 
>> Brian
>> -- 
>> View this message in context:
>> http://old.nabble.com/Genbank-files-tp32941955p32941955.html
>> Sent from the Perl - Bioperl-L mailing list archive at Nabble.com.
>> 
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
> 
> Jason Stajich
> jason.stajich at gmail.com
> jason at bioperl.org
> 
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
> 
> 

-- 
View this message in context: http://old.nabble.com/Genbank-files-tp32941955p32965574.html
Sent from the Perl - Bioperl-L mailing list archive at Nabble.com.




More information about the Bioperl-l mailing list