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
        Essential Discoveries and Tools in Epitranscriptomics
        by seqadmin


        The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist on Modified Bases...
        Yesterday, 07:01 AM
      • 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

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, 04-11-2024, 12:08 PM
      0 responses
      39 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 10:19 PM
      0 responses
      41 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 09:21 AM
      0 responses
      35 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-04-2024, 09:00 AM
      0 responses
      55 views
      0 likes
      Last Post seqadmin  
      Working...
      X