http://www.perlmonks.org?node_id=1079762


in reply to bioperl module to extract specific nucleotides given chromosome and exact location of that nucleotide

So you basically have some coordinates and want to check if anyone of the alleles matches the location given by the coordinates right ? But your coordinates don't tell about which chromosome these alleles are expected but what you can probably do is download the chromosomes in say FastA format and then use Bio::SeqIO using the subseq function.

here is the documentation to the module Bio::SeqIO

The subseq function requires a beginning and an end to what it is going to extract so probably you want to reformat your coordinates as follows

$seq->subseq(coordinate-1, coordinate+1)

to extract three bases with the middle one being the actual nucleotide you want to compare your alleles against.

Note that BioPerl can be a bit slow and therefore consider using something like sfetch or esl-sfetch which will again require providing beginning and end positions to what it is to extract


David R. Gergen said "We know that second terms have historically been marred by hubris and by scandal." and I am a four y.o. monk...
  • Comment on Re: bioperl module to extract specific nucleotides given chromosome and exact location of that nucleotide
  • Select or Download Code

Replies are listed 'Best First'.
Re^2: bioperl module to extract specific nucleotides given chromosome and exact location of that nucleotide
by xxArwaxx (Novice) on Mar 26, 2014 at 03:20 UTC
    I'll try this out and see! Still, more suggestions are welcomed! I was searching earlier and was able to find something that has to do with exact location being a method for a 'SeqFeature' object, and didn't have anything to do with chromosome number. I'm interested in finding allele1 and allele2 for that position.