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
              Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
              by SEQadmin2



              Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

              Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
              ...
              10-14-2026, 09:55 AM
            • SEQadmin2
              New Genomics Technologies Take Aim at Long-Standing Limits
              by SEQadmin2


              Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

              We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
              ...
              09-28-2026, 10:25 AM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by SEQadmin2, 10-15-2026, 10:52 AM
            0 responses
            13 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 10-14-2026, 05:39 AM
            0 responses
            21 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 10-13-2026, 09:56 AM
            0 responses
            19 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 10-09-2026, 11:14 AM
            0 responses
            27 views
            0 reactions
            Last Post SEQadmin2  
            Working...