[Bioperl-l] Coordinate converter?
dan.bolser at gmail.com
Wed Jul 14 12:33:47 EDT 2010
Brilliant! Thanks Jason.
I found the example in the docs a bit confusing, so here is my version
(hopefully to be built into an AGP object):
my $ctg = Bio::Location::Simple->
new( -seq_id => 'ctg', -start => 1, -end => 999, -strand => +1 );
my $ctg_on_chr = Bio::Location::Simple->
new( -seq_id => 'chr', -start => 2001, -end => 2999, -strand => -1 );
my $agp = Bio::Coordinate::Pair->
new( -in => $ctg,
-out => $ctg_on_chr
my $match_on_ctg = Bio::Location::Simple->
new( -seq_id => 'hit', -start => 25, -end => 125, -strand => +1 );
print_loc( $agp->map( $match_on_ctg ) );
which gives: "chr 2875 2975 -1"
I know the algorithm is simple, but it's not so simple to type it out,
base perfect and bug free every time you need it.
On 13 July 2010 23:41, Jason Stajich <jason at bioperl.org> wrote:
> Dan Bolser wrote, On 7/13/10 10:15 AM:
>> When one sequence exists in the context of another larger sequence
>> (with a precise start, end and strand), what is the easiest way to
>> convert coordinates between the two sequences?
>> I'm guessing there is an object I can load with the appropriate
>> information with a conversion method? However, I'm stuck for details.
>> I have implemented sub-sequences as features, but I'm not sure what to do
>> Thanks for any hints,
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
More information about the Bioperl-l