Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • Get query sequence at specified positions in ref (bio::perl)

    Hi,
    I'm trying to get the bases from a query that aligns to a specified location in the reference sequence.

    For example, given the three alignments below,

    Code:
         12345678
    Ref1 ACGTACGT
         |||||| |
    Qry1 ACGTA[COLOR="Red"]CT[/COLOR]T (Read is has a mismatch)
    
         12345678
    Ref1 ACGTACGT
         | ||| ||
    Qry2 A-GTA[COLOR="red"]GG[/COLOR]T (Read has a deletion and a mismatch)
    
         1 2345678
    Ref1 A-CGTACGT
         | |||| ||
    Qry3 AACGTA[COLOR="red"]AG[/COLOR]T (Read has an insertion and a mismatch)
    I want to do something like (I'm using Bio::Perl and Bio:B::Sam)

    Code:
    my $start = 6;
    my $end = 7;
    $sam->fetch('Ref1',
     sub
     {
        my $a = shift;
        print $a->query->name,"\t";
        print $a->[B][COLOR="DarkRed"]some_magical_function[/COLOR][/B]($start,$end),"\n";
     });
    ... which should output

    Code:
    Qry1  CT
    Qry2  GG
    Qry3  AG
    I suppose this can be achieved by parsing the cigar string or the padded_alignment (($ref,$matches,$query)=$a->padded_alignment;), but was wondering if there is a function that does this already.

    Thanks.

  • #2
    In case anyone is interested in this problem: see http://seqanswers.com/forums/showthread.php?p=88600

    Comment

    Latest Articles

    Collapse

    • seqadmin
      Advancing Precision Medicine for Rare Diseases in Children
      by seqadmin




      Many organizations study rare diseases, but few have a mission as impactful as Rady Children’s Institute for Genomic Medicine (RCIGM). “We are all about changing outcomes for children,” explained Dr. Stephen Kingsmore, President and CEO of the group. The institute’s initial goal was to provide rapid diagnoses for critically ill children and shorten their diagnostic odyssey, a term used to describe the long and arduous process it takes patients to obtain an accurate...
      12-16-2024, 07:57 AM
    • seqadmin
      Recent Advances in Sequencing Technologies
      by seqadmin



      Innovations in next-generation sequencing technologies and techniques are driving more precise and comprehensive exploration of complex biological systems. Current advancements include improved accessibility for long-read sequencing and significant progress in single-cell and 3D genomics. This article explores some of the most impactful developments in the field over the past year.

      Long-Read Sequencing
      Long-read sequencing has seen remarkable advancements,...
      12-02-2024, 01:49 PM

    ad_right_rmr

    Collapse

    News

    Collapse

    Topics Statistics Last Post
    Started by seqadmin, 12-17-2024, 10:28 AM
    0 responses
    26 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 12-13-2024, 08:24 AM
    0 responses
    42 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 12-12-2024, 07:41 AM
    0 responses
    28 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 12-11-2024, 07:45 AM
    0 responses
    42 views
    0 likes
    Last Post seqadmin  
    Working...
    X