How Convert The Protein Sequence Coordinates To Exon Sequence Coordinates(Or Vice Versa) Using The Bioperl
2
0
Entering edit mode
11.1 years ago
Anupam ▴ 40

I have a large number protein sequences which I have downloaded from ENSEMBL. I want to convert the protein sequence coordinates to exon sequence coordinates(or vice versa) using the perl module Bio::Coordinate::GeneMapper. I have tried unsuccessfully for a few weeks. Can anyone tell me how to do it ?

protein coordinates exon bioperl • 3.4k views
ADD COMMENT
1
Entering edit mode
11.1 years ago

You may be able to do this using the Ensembl core API. Many examples are provided within the installation, overview, tutorial and documentation sections of the Ensembl API project. In particular, refer to these sections of the tutorial: 'Coordinates', 'Coordinate systems', 'Transform', and 'Transfer'.

ADD COMMENT
1
Entering edit mode
11.1 years ago
kmcarr00 ▴ 290

I have worked with Bio::Coordinate::GeneMapper once in the past and I found there were a couple of "gotchas" (I won't call them bugs, but....). In my use case I had SNP locations identified by NGS and wanted to determine what, if any, amino acid substitutions these would cause, so I had to map from chromosomal coordinate to CDS, then pull the associated codon, etc, etc.

First gotcha, I could not create a mapper instance in the way described in the documentation. The example given suggests you can create a new mapper thusly:

my $mapper = Bio::Coordinate::GeneMapper->new( -in     => 'chr',
                                               -out    => 'peptide',
                                               -cds    => $cds,
                                               -exons  => @exons,
                                               -nozero => 'in&out');

This did not work for me. I found that I had to instantiate the mapper with the 'in' and 'out' and then add the 'cds' and 'exons' after:

my $mapper = Bio::Coordinate::GeneMapper->new( -in     => 'chr',
                                               -out    => 'peptide',
                                               -nozero => 'in&out');

$mapper->cds($cds);
$mapper->exons(@exons);

I also found that there appeared to be an "off by one" error, so to get my SNP coordinate to line up with the appropriate coordinate in the CDS I had to either add or subtract one from the true position depending on whether the CDS was on the minus or plus strand, respectively.

my $snpPos = $trueSnpPos;    
my $revStrand = ($cds->strand() == -1) ? 1 : 0;
$revStrand ? $snpPos++ : $snpPos--;

I don't know if these tips will help in your case; best of luck.

ADD COMMENT

Login before adding your answer.

Traffic: 2078 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6