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
        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
      27 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 10:19 PM
      0 responses
      31 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 09:21 AM
      0 responses
      27 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