Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #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


    • #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

      • seqadmin
        Latest Developments in Precision Medicine
        by seqadmin



        Technological advances have led to drastic improvements in the field of precision medicine, enabling more personalized approaches to treatment. This article explores four leading groups that are overcoming many of the challenges of genomic profiling and precision medicine through their innovative platforms and technologies.

        Somatic Genomics
        “We have such a tremendous amount of genetic diversity that exists within each of us, and not just between us as individuals,”...
        05-24-2024, 01:16 PM
      • seqadmin
        Recent Advances in Sequencing Analysis Tools
        by seqadmin


        The sequencing world is rapidly changing due to declining costs, enhanced accuracies, and the advent of newer, cutting-edge instruments. Equally important to these developments are improvements in sequencing analysis, a process that converts vast amounts of raw data into a comprehensible and meaningful form. This complex task requires expertise and the right analysis tools. In this article, we highlight the progress and innovation in sequencing analysis by reviewing several of the...
        05-06-2024, 07:48 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, Yesterday, 06:55 AM
      0 responses
      12 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 05-30-2024, 03:16 PM
      0 responses
      24 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 05-29-2024, 01:32 PM
      0 responses
      28 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 05-24-2024, 07:15 AM
      0 responses
      215 views
      0 likes
      Last Post seqadmin  
      Working...
      X