Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • m4merg
    Member
    • Jul 2014
    • 21

    #1

    Bio-SamTools pileup method

    Hello
    Im trying to use Bio:: DB::Sam to get list of reads covering certain position .Sam file using pileup method using this code
    Code:
    use strict;
    use warnings;
    
    use Bio::DB::Sam;
    
    `samtools view -Sb $ARGV[0].sam > $ARGV[0].bam`;
    `samtools sort $ARGV[0].bam $ARGV[0].sorted`;
    `mv $ARGV[0].sorted.bam $ARGV[0].bam`;
    `samtools index $ARGV[0].bam`;
    
    my $sam = Bio::DB::Sam->new(
            -bam   => "$ARGV[0].bam",
            -fasta => "$ARGV[1]",
            );
    
    my $callback = sub {
            my ($seqid,$pos,$p) = @_;
            if ($pos eq "1240") {
                    for my $pileup (@$p) {
                            my $b   = $pileup->alignment;
                            print $b->qname,"\n";
                            }
                    }
            };
    
    $sam->pileup("GBA",$callback);
    exit;
    So this code only get names of reads which cover position 1240 in reference from $ARGV[0].sam file. The problem is that the output list of read neames is definitely not complete. I.e. pileup ignores some reads.
    Trying to find the root of problem i analysed reads which alignment starts from prosition 1209 (just for example) and found that only the first N of such reads assessed by puleup and the last M of reads are ignored. But after those not ignored N reads it doesnt ignore all reads starting from other positions (i.e. 1150,1048,1231 and any others). So as i understand the problem must be in some kind of sorting, but i havent found any information about sorting should be done in manual and i actually do sort .bam file.
    Also i found that using $sam->pileup("GBA:1239-1241",$callback) instead of $sam->pileup("GBA",$callback) makes another list of reads, which differs from the previous, but i could found any logic in these differrences
    So what's wrong?


    Here are link to some test data: Sam file - https://cloud.mail.ru/public/d9e9de482926/In.sam
    Reference - https://cloud.mail.ru/public/4394275..._gla_ids.fasta
    $: perl test.pl In gaa_gba_gla_ids.fasta > out
    Last edited by m4merg; 07-31-2014, 08:19 AM.

Latest Articles

Collapse

  • SEQadmin2
    Beyond CRISPR/Cas9: Understand, Choose, and Use the Right Genome Editing Tool
    by SEQadmin2



    CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).

    Despite this, “CRISPR helped turn genome editing from a specialized technique into
    ...
    07-31-2026, 11:01 AM
  • SEQadmin2
    Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
    by SEQadmin2


    Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

    The systematic characterization of the human proteome has
    ...
    07-20-2026, 11:48 AM

ad_right_rmr

Collapse

News

Collapse

Topics Statistics Last Post
Started by SEQadmin2, 08-06-2026, 07:41 AM
0 responses
15 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 08-03-2026, 10:13 AM
0 responses
31 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 07-31-2026, 02:55 AM
0 responses
41 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 07-24-2026, 12:17 PM
0 responses
26 views
0 reactions
Last Post SEQadmin2  
Working...