Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • Bam2FastQ help

    Hi guys,

    I am new here. I am trying to use Bam2Fastq convert a very large (~7 GB) bam file to a fastq file, but whenever I try to do this, I get this weird message.

    Basically I am trying to extract only aligned reads from a bam file, using this site as my guide: http://davetang.org/wiki/tiki-index....ls#Basic_usage

    If that is not possible. If it is possible to convert the whole file to fastq will be good as well.

    What I enter in Command Prompt
    Code:
    bam2fastq -o blah_aligned.fastq --no-unaligned Bamfilename.bam
    The message I get:
    Code:
    The sequences in the BAM file are marked as Paired, but a single output
    file is specified.  Ensure that the output filename (--output) includes
    a # symbol to be replaced with the read number
    If you could kindly help. I will really appreciate it. Thank you.

    -Zapages

  • #2
    Run the command

    Code:
    bam2fastq -o blah_aligned_R#.fastq --no-unaligned Bamfilename.bam
    This will create two output files blah_aligned_R1.fastq and blah_aligned_R2.fastq containing read #1 and read #2 of the read pairs respectively.

    Comment


    • #3
      Yeah, the program is trying to do the right thing in giving you two separate fastq files, but you told it only one fastq, and it doesn't like that.

      If you want only aligned reads, use samtools view -bF 4 to filter your .bam first.

      Comment


      • #4
        Thank you guys^

        Originally posted by swbarnes2 View Post
        Yeah, the program is trying to do the right thing in giving you two separate fastq files, but you told it only one fastq, and it doesn't like that.

        If you want only aligned reads, use samtools view -bF 4 to filter your .bam first.
        I have used bamview and Bamseek to see the sequence that we are interested in are present. Everything lines up with the sequence that we are interested.

        Anyway should I sort with samtools. I think the bam file is already aligned, but I am not too sure.

        How do you sort in with sam tools?
        Last edited by Zapages; 10-28-2012, 07:45 AM.

        Comment


        • #5
          Originally posted by swbarnes2 View Post
          Yeah, the program is trying to do the right thing in giving you two separate fastq files, but you told it only one fastq, and it doesn't like that.
          That's rather frustrating - two paired FASTQ files is only the 'right thing' for some tools, others prefer a single interleaved FASTQ file (which makes piping streams much easier!).

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