SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Get unique reads when merging FastQ Files from BAM rkizen Bioinformatics 4 08-07-2013 07:23 AM
Extract fastq files of unaligned reads with Bowtie 2 Mad4Seq Bioinformatics 4 06-19-2013 10:53 PM
Split Large FASTQ file in small FASTQ files with user defined number of reads Windows deepbiomed Bioinformatics 3 04-04-2013 08:14 AM
Extract unaligned reads (Tophat) from FastQ Uwe Appelt Bioinformatics 5 08-07-2012 05:33 AM
Soft clip / trim within unaligned .bam file mehc Bioinformatics 2 05-29-2012 07:30 AM

Reply
 
Thread Tools
Old 09-21-2015, 09:21 PM   #1
methylnick
Member
 
Location: Melbourne, Australia

Join Date: May 2009
Posts: 10
Default 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
methylnick is offline   Reply With Quote
Old 09-22-2015, 01:03 AM   #2
Michael.Ante
Senior Member
 
Location: Vienna

Join Date: Oct 2011
Posts: 121
Default

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 at 01:04 AM. Reason: Typo
Michael.Ante is offline   Reply With Quote
Old 09-22-2015, 08:06 AM   #3
fanli
Senior Member
 
Location: California

Join Date: Jul 2014
Posts: 198
Default

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?
fanli is offline   Reply With Quote
Old 09-22-2015, 09:29 AM   #4
maubp
Peter (Biopython etc)
 
Location: Dundee, Scotland, UK

Join Date: Jul 2009
Posts: 1,541
Default

Read order does matter for many de novo assemblers, and also for things like k-mer based normalisation.
maubp is offline   Reply With Quote
Old 09-22-2015, 02:35 PM   #5
methylnick
Member
 
Location: Melbourne, Australia

Join Date: May 2009
Posts: 10
Default

Quote:
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
methylnick is offline   Reply With Quote
Old 09-22-2015, 02:43 PM   #6
methylnick
Member
 
Location: Melbourne, Australia

Join Date: May 2009
Posts: 10
Default

Quote:
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
methylnick is offline   Reply With Quote
Reply

Tags
bam, fastq, randomise, rna-seq, simulation

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 01:17 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO