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
          Exploring the Dynamics of the Tumor Microenvironment
          by seqadmin




          The complexity of cancer is clearly demonstrated in the diverse ecosystem of the tumor microenvironment (TME). The TME is made up of numerous cell types and its development begins with the changes that happen during oncogenesis. “Genomic mutations, copy number changes, epigenetic alterations, and alternative gene expression occur to varying degrees within the affected tumor cells,” explained Andrea O’Hara, Ph.D., Strategic Technical Specialist at Azenta. “As...
          07-08-2024, 03:19 PM
        • seqadmin
          Exploring Human Diversity Through Large-Scale Omics
          by seqadmin


          In 2003, researchers from the Human Genome Project (HGP) announced the most comprehensive genome to date1. Although the genome wasn’t fully completed until nearly 20 years later2, numerous large-scale projects, such as the International HapMap Project and 1000 Genomes Project, continued the HGP's work, capturing extensive variation and genomic diversity within humans. Recently, newer initiatives have significantly increased in scale and expanded beyond genomics, offering a more detailed...
          06-25-2024, 06:43 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by seqadmin, 07-10-2024, 07:30 AM
        0 responses
        25 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 07-03-2024, 09:45 AM
        0 responses
        201 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 07-03-2024, 08:54 AM
        0 responses
        211 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 07-02-2024, 03:00 PM
        0 responses
        193 views
        0 likes
        Last Post seqadmin  
        Working...
        X