Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • Filter paired end BAM file based on iSize

    I have aligned Illumina Mate Pair data using bwa. I only care about large structural variation, and would like to discard paired ends with iSize less then 1000. This would get rid of a lot of small fragments that represent artifacts of the library construction. How can I do this?

    The steps I have followed to now are summarized below:

    # create bwa index for human genome
    bwa index -a bwtsw human_g1k_v37.fasta

    #Reverse complement fastq to convert from Mate Pair to Paired End
    fastx_reverse_complement -i R1_Ill.fastq -o R1.fastq
    fastx_reverse_complement -i R2_Ill.fastq -o R2.fastq

    #Align individual reads
    bwa aln -I human_g1k_v37.fasta R1.fastq>R1.sai
    bwa aln -I human_g1k_v37.fasta R2.fastq>R2.sai

    # Align paired ends
    bwa sampe human_g1k_v37.fasta R1.sai R2.sai R1.fastq R2.fastq>pe.sam

    # create BAM file
    samtools view -bT human_g1k_v37.fasta -o pe.bam pe.sam
    sort pe.bam pe_sort
    samtools index pe_sort.bam

    # discard concordant pairs or low quality or unmapped or unmapped mate
    samtools view -b -q 37 -F 1806 pe_sort.bam -o pe_discordant.bam

  • #2
    I have found a simple answer:

    cat XXX.sam | awk -F'\t' '{if ($9 > 1000 || $9 < -1000 || $9 == 0 ) print $0}' >output

    Comment


    • #3
      F 1806

      Hello,

      To remove properly paired reads or concordant reads why do you use F 1806 . I guess to remove or filter out properly paired reads shouldn't we use F 2 , Since properly paired read flag is 2 ?

      Thanks a lot
      Best,
      Rakesh

      Comment

      Latest Articles

      Collapse

      • 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
      • seqadmin
        Techniques and Challenges in Conservation Genomics
        by seqadmin



        The field of conservation genomics centers on applying genomics technologies in support of conservation efforts and the preservation of biodiversity. This article features interviews with two researchers who showcase their innovative work and highlight the current state and future of conservation genomics.

        Avian Conservation
        Matthew DeSaix, a recent doctoral graduate from Kristen Ruegg’s lab at The University of Colorado, shared that most of his research...
        03-08-2024, 10:41 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, Yesterday, 06:37 PM
      0 responses
      10 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, Yesterday, 06:07 PM
      0 responses
      9 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 03-22-2024, 10:03 AM
      0 responses
      51 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 03-21-2024, 07:32 AM
      0 responses
      67 views
      0 likes
      Last Post seqadmin  
      Working...
      X