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
        Current Approaches to Protein Sequencing
        by seqadmin


        Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
        04-04-2024, 04:25 PM
      • seqadmin
        Strategies for Sequencing Challenging Samples
        by seqadmin


        Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
        03-22-2024, 06:39 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, 04-11-2024, 12:08 PM
      0 responses
      24 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 10:19 PM
      0 responses
      25 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 09:21 AM
      0 responses
      22 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-04-2024, 09:00 AM
      0 responses
      52 views
      0 likes
      Last Post seqadmin  
      Working...
      X