I am performing microbiome analysis in waste water using Ion 16s Metagenomics kit. I have .ubam files which I have successfully converted to .fastq using the following option in samtools
samtools fastq -0 out.fastq input.ubam
Should I have used the -0 option from samtools?
The original ubam file contains paired-end reads (both forward and reverse reads, un-joined within the file). Also, they have barcodes and adaptors attached to the sequences within the .ubam file. How can I accomplish the following goals:
1) get both forward and reverse reads out
2) join them (i will use qiime 2.0 for it).
Also, I used IonXpress 1-16 barcodes but I cannot find the sequences of the barcodes which are required for demultiplexing. I spent an hour looking at their website but I cannot find the sequences. Can anyone help me please?
Here is the how the .fastq files look likes.
@GLPH7:00666:05788
GGACTACCAGGGTATCTAATCCTGTTTGCTCCCCACGCTTTCGCATCTCAGCGTCAATAATGTTCCAGTAGATCGCCTTCGCAATCGGTATTCCTTCTGATCTCTACGGATTTTACCCCTACACC
+
A<BCBBC?ABD=CC:;:B=AB@;;;B0000000+00000>8@>>>?@@A:9:99@@<>>:0005:5008;99;://)/6///;5://*/99;?<B9<839==55599<7::::+4///&/7///1
@GLPH7:00666:05802
GCTGTCGTCAGCTCGTGTCGTGAGATGTTGGGTTAAGTCCCGCAACGAGCGCAACCCTTGCCATTAGTTGCCATCATTAAGTTGGGCACTTTAATGGGACTGCCGGTGACAAACCGGAGGAAGGTGGGGATGACGTCAAGTCCTCATGGCCCTTATGACCAGGGCTTCACACGTCATACAATGGTCGGTACAGAGGGTTGCCAAGCCGCGAGGTGGAGCTAATCTCATAAAACCGATCGTAGTCCGGATCGCAGTCTGCAACTCGACTGCGTGAAGTCGAAATCG
+
;:>==999@9;:;<;<AABA@=>>>>@@@CC>CID@CBBC>CBA=@??>999A?BD=C>@A@BB>@@@899:@9:9@?C;BA>BB;B@@@C=C?CCG>AA9::?B=BA@>>>:?=A;??=A:@;?@@@09::>A@@AB@GDD?BBBBB@DD>C=BBBBD@CBB<AA@BBAAABA@?BB==;=A>A<=;<AA<>>BD>C?B>:A489>=@@@@<@A=@@@@@<@>>>?====2=9///;;:?===7<6::///9:;>>>===B<;;AA>>>A;;;5:=888B;?;<
Thank you for this! :)
Also, do you have any idea how can I extract forward and reverse reads in .fastq files from a single UBAM using samtools? The original UBAM contains both forward and reverse reads but unaligned.
There are several ways of extracting the reads from a bam file. I never tried with an uBAM file, but they should work.
With samtools, you can use
samtools fastq
(might be good to dosamtools collate | samtools fastq
). I believesamtools bam2fq
is synonymous tosamtools fastq
since SAMtools 1.3. You also can usehtscmd bam2fq
from HTSlib.You can also use
bam bam2FastQ
from bamUtil.Or
bedtools bamtofastq
from bedtools.Or
reformat.sh
from BBTools.