Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • methylnick
    Member
    • May 2009
    • 10

    #1

    Recreating TCGA FASTQ file from BAM and unaligned files - How to randomize reads?

    Hi fellow colleagues, I have been looking around the forum and google searching and it would seem my issue is a little obscure.

    I am performing in-silico analysis of raw level 1 TCGA sequence reads and was hoping to generate "pseudo"-simulated FASTQ files. In the sense, that from the BAM file and unaligned FASTQ file from the same individual, I would like to recreate the full FASTQ file to replicate the TCGA pipeline and then test on some bespoke pipelines I am trying to get a handle on.

    What I have done so far is:

    1. use samtools bamshuf to randomise the BAM file.
    2. convert the randomised BAM file to FASTQ.

    This is where I am stuck because if I catenate this FASTQ file to the unaligned FASTQ files all I would get is the unaligned reads stacked right after all those within the BAM file.

    Is there a tool out there that can randomize the order of sequence reads in a FASTQ file? And it would be for paired end data as well, hoping to preserve the paired ends at the same time?

    Apologies if I had not refined my searches and there is something obvious available. I am hoping there is something short of learning a programming language and writing the script from scratch!!!

    Cheers

    Nick
  • Michael.Ante
    Senior Member
    • Oct 2011
    • 127

    #2
    BBmap can do that :
    I haven't used it but it includes a tool to reorder reads while keeping pairs together
    Code:
    shuffle.sh in=R1.fastq in2=R2.fastq out=R1_rand.fastq out2=R2_rand.fastq
    Last edited by Michael.Ante; 09-22-2015, 12:04 AM. Reason: Typo

    Comment

    • fanli
      Senior Member
      • Jul 2014
      • 197

      #3
      Out of curiosity, in what context(s) does the order of reads in a FASTQ file matter? I could imagine in clustering or something like that...but most mappers treat reads independently right?

      Comment

      • maubp
        Peter (Biopython etc)
        • Jul 2009
        • 1544

        #4
        Read order does matter for many de novo assemblers, and also for things like k-mer based normalisation.

        Comment

        • methylnick
          Member
          • May 2009
          • 10

          #5
          Originally posted by fanli View Post
          Out of curiosity, in what context(s) does the order of reads in a FASTQ file matter? I could imagine in clustering or something like that...but most mappers treat reads independently right?
          Also I was hoping to peform some saturation analysis so downsampling the FASTQ files and see what happens to the gene transcripts but also the unmapped stuff.

          Good to know it does have an affect on de-novo assembly, which is also something I would like to try out.

          cheers

          Nick

          Comment

          • methylnick
            Member
            • May 2009
            • 10

            #6
            Originally posted by Michael.Ante View Post
            BBmap can do that :
            I haven't used it but it includes a tool to reorder reads while keeping pairs together
            Code:
            shuffle.sh in=R1.fastq in2=R2.fastq out=R1_rand.fastq out2=R2_rand.fastq
            Thanks for that Micheal.Ante, this looks to be what I am looking for, fun times playing with it! cheers.

            Nick

            Comment

            Latest Articles

            Collapse

            • SEQadmin2
              Beyond CRISPR/Cas9: Understand, Choose, and Use the Right Genome Editing Tool
              by SEQadmin2



              CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).

              Despite this, “CRISPR helped turn genome editing from a specialized technique into
              ...
              07-31-2026, 11:01 AM
            • SEQadmin2
              Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
              by SEQadmin2


              Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

              The systematic characterization of the human proteome has
              ...
              07-20-2026, 11:48 AM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by SEQadmin2, 08-13-2026, 12:22 PM
            0 responses
            20 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 08-11-2026, 10:35 AM
            0 responses
            16 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 08-06-2026, 07:41 AM
            0 responses
            32 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 08-03-2026, 10:13 AM
            0 responses
            50 views
            0 reactions
            Last Post SEQadmin2  
            Working...