Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • parsing bam

    Hi,

    I recently concatenated many 200nt sequences to the end of each other; these sequences were from different parts of genome. Then I fed this to Geneious as a reference sequences and mapped sequencing reads (each read = 70nt) to it. I exported the results as a bam file. Now I need to write a Perl script that parses the bam file and finds out whether or not each of those initial sequences (the 200nt ones that were concatenated) is covered in sequencing reads. I have read the Bio:B::Sam tutorial on CPAN but I am still stuck. Here is all the code I have written so far:
    Code:
    use Bio::DB::Sam;
    my $sam = Bio::DB::Sam -> new (-fasta => ... , -bam => ...) ;
    my $segment;
    ($id)=$sam -> seq_ids;
    while ($i < $sam->length($id)) { 
    $segment =$ sam -> segment($id , $i ,$i +200) ;
    
    # What should I write here?  
    
    $i +=200; 
    }
    I would appreciate your help, since CPAN manual only confuses me.

  • #2
    What do you mean by covered? Do you mean the coverage across every position of a 200nt fragment is at least 1X?

    If so its a pretty simple problem to solve. If you don't care about speed you could use mpileup to check if each of the 200 positions for a given range are covered by at least 1 70nt read.

    If you like to program, then you could use any of the various samtools bindings to PERL, C, C++,etc. You would open the BAM and step through each position to see if there is at least 1 read returned. Maybe there is even a faster way to do it, but either of the above two suggestions would work.

    Comment


    • #3
      Thanks for the suggestion. I used the pileup method in Perl and it worked fine.

      Comment

      Latest Articles

      Collapse

      • seqadmin
        Choosing Between NGS and qPCR
        by seqadmin



        Next-generation sequencing (NGS) and quantitative polymerase chain reaction (qPCR) are essential techniques for investigating the genome, transcriptome, and epigenome. In many cases, choosing the appropriate technique is straightforward, but in others, it can be more challenging to determine the most effective option. A simple distinction is that smaller, more focused projects are typically better suited for qPCR, while larger, more complex datasets benefit from NGS. However,...
        10-18-2024, 07:11 AM
      • seqadmin
        Non-Coding RNA Research and Technologies
        by seqadmin




        Non-coding RNAs (ncRNAs) do not code for proteins but play important roles in numerous cellular processes including gene silencing, developmental pathways, and more. There are numerous types including microRNA (miRNA), long ncRNA (lncRNA), circular RNA (circRNA), and more. In this article, we discuss innovative ncRNA research and explore recent technological advancements that improve the study of ncRNAs.

        Nobel Prize for MicroRNA Discovery
        This week,...
        10-07-2024, 08:07 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, Today, 06:58 AM
      0 responses
      8 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, Yesterday, 08:43 AM
      0 responses
      18 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 10-17-2024, 07:29 AM
      0 responses
      52 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 10-15-2024, 06:35 AM
      0 responses
      40 views
      0 likes
      Last Post seqadmin  
      Working...
      X