Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fongchun
    Member
    • May 2011
    • 55

    #1

    Picard SamtoFastq Extract Only Paired Reads

    Hi,

    I am using the Picard SamtoFastq function to extract paired fastq files from a bam file. My input is like this:

    [Thu Jul 19 00:13:45 PDT 2012] net.sf.picard.sam.SamToFastq INPUT=input.bam FASTQ=out.1.fastq SECOND_END_FASTQ=out.2.fastq VALIDATION_STRINGENCY=LENIENT OUTPUT_PER_RG=false RE_REVERSE=true INCLUDE_NON_PF_READS=false READ1_TRIM=0 READ2_TRIM=0 INCLUDE_NON_PRIMARY_ALIGNMENTS=false VERBOSITY=INFO QUIET=false COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false

    What I've noticed is that the fastq files that are getting extracted or not the same size and actually differ in the number of sequences in each file. I think this has to do with the complication that the input bam file has both single and paired-end reads.

    This is apparently when I try to run gsnap on the fastq files and it complains about how the read names do not match up.

    Is there a way to force the Picard samtofastq function to extract only paired-end reads?

    Thanks
  • loituna
    Junior Member
    • Aug 2011
    • 5

    #2
    Hi,

    a little up
    Was this problem solved? I am having the same issue :
    I am using picard tool as followed :
    java -jar SamToFastq.jar INPUT=<bamfile> FASTQ=outfile_1.fastq SECOND_END_FASTQ=outfile_2.fastq

    And I also got file with different size for _1 (30G) and _2 (18G) file. The number of line is also ~ double for _1.

    If I understood correctly, _2 file should be either same size as _1, if bam was constructed from paired end seq, or empty if not. I don't understand this in between output.

    any clue?

    thanks,

    (if it can help, I am working on cghub, tcga data)

    Comment

    • swbarnes2
      Senior Member
      • May 2008
      • 910

      #3
      I don't know about Picard tools, but you want to filter by the flags, and samtools view can do that.

      samtools view -bf 1 my.bam > my_paired.bam

      Comment

      • loituna
        Junior Member
        • Aug 2011
        • 5

        #4
        Hi,

        Thanks for the tip!
        And sorry, false alert, I resolved my problem. I think the picard tool was not the problem here but it was the original bam file.

        thanks anyway

        Comment

        Latest Articles

        Collapse

        • SEQadmin2
          Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
          by SEQadmin2



          Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

          Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
          ...
          10-14-2026, 09:55 AM
        • SEQadmin2
          New Genomics Technologies Take Aim at Long-Standing Limits
          by SEQadmin2


          Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

          We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
          ...
          09-28-2026, 10:25 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by SEQadmin2, 10-22-2026, 11:13 AM
        0 responses
        28 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-22-2026, 10:48 AM
        0 responses
        20 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-15-2026, 10:52 AM
        0 responses
        38 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-14-2026, 05:39 AM
        0 responses
        44 views
        0 reactions
        Last Post SEQadmin2  
        Working...