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
        Exploring the Dynamics of the Tumor Microenvironment
        by seqadmin




        The complexity of cancer is clearly demonstrated in the diverse ecosystem of the tumor microenvironment (TME). The TME is made up of numerous cell types and its development begins with the changes that happen during oncogenesis. “Genomic mutations, copy number changes, epigenetic alterations, and alternative gene expression occur to varying degrees within the affected tumor cells,” explained Andrea O’Hara, Ph.D., Strategic Technical Specialist at Azenta. “As...
        07-08-2024, 03:19 PM
      • seqadmin
        Exploring Human Diversity Through Large-Scale Omics
        by seqadmin


        In 2003, researchers from the Human Genome Project (HGP) announced the most comprehensive genome to date1. Although the genome wasn’t fully completed until nearly 20 years later2, numerous large-scale projects, such as the International HapMap Project and 1000 Genomes Project, continued the HGP's work, capturing extensive variation and genomic diversity within humans. Recently, newer initiatives have significantly increased in scale and expanded beyond genomics, offering a more detailed...
        06-25-2024, 06:43 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, Yesterday, 07:20 AM
      0 responses
      24 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 07-16-2024, 05:49 AM
      0 responses
      38 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 07-15-2024, 06:53 AM
      0 responses
      44 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 07-10-2024, 07:30 AM
      0 responses
      41 views
      0 likes
      Last Post seqadmin  
      Working...
      X