Truncated bamtofastq output files.
2
0
Entering edit mode
6.0 years ago
mirza ▴ 170

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??

bamtofastq truncated output file • 1.4k views
0
Entering edit mode

Why are you using samtools to view a plain fastq file (if the files have indeed been generated correctly)?

0
Entering edit mode

samtool view is not meant for fastq files. it is used for alignment files

0
Entering edit mode

Oh, now this is indeed a silly mistake. I should simply use "more" to visualize a fastq file in terminal.

0
Entering edit mode

use less filename command

0
Entering edit mode

1
Entering edit mode
0
Entering edit mode

yes, but after I use BBsplit, I obtain the fastq file and then I can to remap this with STAR but the count? FeatureCount doesn't work well with bbsplit. So my question is: After BBsplit What can I use to map and to calculate the count? Thanks

0
Entering edit mode
6.0 years ago
agata88 ▴ 840

Why don't you just map again whole fastq files to other reference? First mapping to fungi and second to plant. Without parsing the unmapped bam files.

0
Entering edit mode

In such mixed data, sometimes reads are wrongly mapped to a reference and we get to know only when we go for annotation. I think i'll be better off using this approach.