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 Advances in Sequencing Analysis Tools
          by seqadmin


          The sequencing world is rapidly changing due to declining costs, enhanced accuracies, and the advent of newer, cutting-edge instruments. Equally important to these developments are improvements in sequencing analysis, a process that converts vast amounts of raw data into a comprehensible and meaningful form. This complex task requires expertise and the right analysis tools. In this article, we highlight the progress and innovation in sequencing analysis by reviewing several of the...
          05-06-2024, 07:48 AM
        • 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...
          04-22-2024, 07:01 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by seqadmin, 05-14-2024, 07:03 AM
        0 responses
        19 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 05-10-2024, 06:35 AM
        0 responses
        44 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 05-09-2024, 02:46 PM
        0 responses
        54 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 05-07-2024, 06:57 AM
        0 responses
        42 views
        0 likes
        Last Post seqadmin  
        Working...
        X