Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • svl
    Member
    • Sep 2009
    • 43

    esembl compara perl api help needed!

    Hi everyone,

    I'm trying to work with the ensembl perl api, but seem to be unable to do what I want. API -> http://www.ensembl.org/info/data/api.html

    What I want is this:
    I have a set of genomic positions from snp-calling. For each of the positions I want to know how conserved these single positions are compared to/in other species. So I figured I use the Compara API, which contains whole genome alignments, and some of the code here: http://www.ensembl.org/info/docs/api..._tutorial.html So basically I am looking for something like:

    $bases_for_pos_1 = $alignment_human2mouse->getBases($human_position1)
    $bases_for_pos_2 = $alignment_human2mouse->getBases($human_position2)
    etc...(simplified, not real compara code)

    The problem:
    I can retrieve a 'GenomicAlignBlock' which contains the position I am looking for, but also a whole lot of surrounding sequence and I wander how I can get just the bases (from human and the other species) at the specific position...? Or even just whether they are equal or not.

    Anyone?

    -Stef
  • whsqwghlm
    Member
    • Jun 2009
    • 14

    #2
    You may be best posting on the ensembl-dev mailing list, but here is a guesstimate;

    First you need to restrict the Bio::EnsEMBL::Compara::GenomicAlignBlock to the region that you are interested in, using the restrict_between_reference_positions method (see http://www.ensembl.org/info/docs/Pdo...ock.html#POD31)

    You can then call the slice method on the returned GenomicAlignBlock to return the genomic region of the reference. The returned Bio::EnsEMBL::Slice has a seq method to pull the sequence. The non-reference(s) can be accessed in a similar way.

    Comment

    • svl
      Member
      • Sep 2009
      • 43

      #3
      Originally posted by whsqwghlm View Post
      using the restrict_between_reference_positions method
      Thank you! Works like a charm. Although I still don't see why they didn't include a method to directly pull one base-pair from the alignment, it seems so useful to me But anyhow my code is a little less long and more straight forward now.

      You can then call the slice method on the returned GenomicAlignBlock to return the genomic region of the reference
      This is not even needed, there is a method "alignment_strings" that returns the sequences (in my case 1 letter long) as an array of strings directly.

      thanks again!

      Comment

      Latest Articles

      Collapse

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by SEQadmin2, Yesterday, 11:58 AM
      0 responses
      10 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 06-05-2026, 10:09 AM
      0 responses
      25 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 06-04-2026, 08:59 AM
      0 responses
      35 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 06-02-2026, 12:03 PM
      0 responses
      58 views
      0 reactions
      Last Post SEQadmin2  
      Working...