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
          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
        • 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, Yesterday, 08:47 AM
        0 responses
        16 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-11-2024, 12:08 PM
        0 responses
        60 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-10-2024, 10:19 PM
        0 responses
        60 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-10-2024, 09:21 AM
        0 responses
        54 views
        0 likes
        Last Post seqadmin  
        Working...
        X