Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • 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

  • #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


    • #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


      • #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

        • seqadmin
          Recent Developments in Metagenomics
          by seqadmin





          Metagenomics has improved the way researchers study microorganisms across diverse environments. Historically, studying microorganisms relied on culturing them in the lab, a method that limits the investigation of many species since most are unculturable1. Metagenomics overcomes these issues by allowing the study of microorganisms regardless of their ability to be cultured or the environments they inhabit. Over time, the field has evolved, especially with the advent...
          09-23-2024, 06:35 AM
        • seqadmin
          Understanding Genetic Influence on Infectious Disease
          by seqadmin




          During the COVID-19 pandemic, scientists observed that while some individuals experienced severe illness when infected with SARS-CoV-2, others were barely affected. These disparities left researchers and clinicians wondering what causes the wide variations in response to viral infections and what role genetics plays.

          Jean-Laurent Casanova, M.D., Ph.D., Professor at Rockefeller University, is a leading expert in this crossover between genetics and infectious...
          09-09-2024, 10:59 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by seqadmin, 10-02-2024, 04:51 AM
        0 responses
        13 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 10-01-2024, 07:10 AM
        0 responses
        21 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 09-30-2024, 08:33 AM
        0 responses
        25 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 09-26-2024, 12:57 PM
        0 responses
        18 views
        0 likes
        Last Post seqadmin  
        Working...
        X