Hi, I am working with a mixed RNASeq data of plant and fungus. I aligned my Illumina paired-end reads using bowtie2, to one of the reference. I got mapped and unmapped.bam files. Now, I want to map these unmapped reads back to the second organism reference. I used samtools to sort the files by name using
$ samtools sort -n my_file_unmapped.bam -o my_file_unmapped.qsort -O BAM
and got, unmapped.qsort files. Visualized the files using samtools view,
$ samtools view Rs_Os1_1d_unmapped.qsort
D6B775P1:106:C4NARACXX:7:1101:2383:96122 69 * 0 255 * * 0 0 CGGTGTTAGGCTTTCCATGACGATCGGTGTGGGAGGTGCCGTAGTTGTCAGTTGTGGACCCGGCACCGTAGCCGGCGGTAGTACTGCTGGTACCAGTAGT BBBFFFFFFFFFFIIIIIIIIIIIIIIFFFFIIIIIFFIIIBFFIIIIIIIIIIIFFFFFFFFBFFFFFFFFFFFBFFBBFFFFFFFFFFFFFFFFFFFB
D6B775P1:106:C4NARACXX:7:1101:2383:96122 133 * 0 255 * * 0 0 CAATCACAGGACGACAAATACCTACGGGTCGTCGAACACCAGTGACAACTACGGTTCAACTGACCGCACTCGCGGCACTGATCTGAACACCTGAACCGGA BBBFFFFFFFFFFIIIIIIIIIIIIIIIBFFIIIIIFIIIIIFFFFFFFFBFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
D6B775P1:106:C4NARACXX:7:1101:2384:9664 69 * 0 255 * * 0 0 AACACTGCTCGAGGTGCCATCGCGGATCGTCAGGCTATTGCCGAAGCTCTAAAGAGCGGGCAGATCAATGGATACGCCGGAGACGTGTGGGACGTTCAGC BBBFFFFFFFFFFIFIIIIIIIIIIIIIIFIIIIIIIIIIIIFIFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFBFFFFFFFFBBFBFFFFFF<BFFFF
D6B775P1:106:C4NARACXX:7:1101:2384:9664 133 * 0 255 * * 0 0 CCAGAGTAGTGGGGAACCATTCCGTTTCCTCCACCAAGAGGGTTCTTCATCGTGCGCCATGGATGGTCAGCAGGCGCTGGCTGAACGTCCCACACGTCTC BBBFFFFFFFFFFIIIIIIIIIIIIIIIIIIIIIIIIIIIIIFIIIIIIIFFIIIIIIFFFFFFFFBFFFFFFFFFFFFFFFFFFBFBFFFFFFFFFFFF
Then I tried converting the .bam files to .fastq using bedtools bedtofastq
$ bedtools bamtofastq -i my_file_unmapped.qsort -fq my_file_unmapped.end1.fq -fq2 my_file_unmapped.end2.fq
Got 2 output files, my_file_unmapped.end1.fq my_file_unmapped.end2.fq But when I tried to visualize the file using samtools view, using the command
$ samtools view my_files_unmapped.end1.fq
I am getting the following error, [W::sam_read1] parse error at line 2; [main_samview] truncated file.
What am I doing wrong??
Why are you using samtools to view a plain fastq file (if the files have indeed been generated correctly)?
samtool view is not meant for fastq files. it is used for alignment files
Oh, now this is indeed a silly mistake. I should simply use "more" to visualize a fastq file in terminal.
use
less filename
command@Prasad ok, thanks Prasad.