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.