I have used Bowtie2 to get alignment output as .SAM
files. After getting sam files, I am getting the following errors:
[W::sam_read1] Parse error at line 459
[main_samview] truncated file.
I have used the following command to produce sam file:
./bowtie2 -p 5 -x /ref/grch38 --no-unal -U fastq/SRR7541164.fastq > /fastq/test.sam
And for samtools :
samtools view -S -b /fastq/test.sam > /fastq/test.bam
I have checked .SAM
file and fastq file to get the reason of error : few lines of both files are as follows:
Command:
head -n 10 /home/vivekr/Mirpipe/moRNA_data/trimmed_fastq/SRR7541168_trimmed.fq
Output:
@SRR7541168.1 1 length=51
NCAGTGCACTACAGAACTTTGT
+
#0<FFFFFFFFFFIIIIIIIFI
@SRR7541168.2 2 length=51
NCCCTGTGGTCTAGTGGTTAGGATT
+
#0<BFFFFBFFFFIFFBFFFF<BFF
@SRR7541168.3 3 length=51
NATTGCACTTGTCCCGGCCTGT
And for SAM files :
Command:
head -n 460 /home/vivekr/Mirpipe/moRNA_data/sorted_bam/SRR7541164_trimmed.sam | tail -n 20
Response:
@SQ SN:chrUn_KI270749v1 LN:158759
@SQ SN:chrUn_KI270750v1 LN:148850
@SQ SN:chrUn_KI270751v1 LN:150742
@SQ SN:chrUn_KI270752v1 LN:27745
@SQ SN:chrUn_KI270753v1 LN:62944
@SQ SN:chrUn_KI270754v1 LN:40191
@SQ SN:chrUn_KI270755v1 LN:36723
@SQ SN:chrUn_KI270756v1 LN:79590
@SQ SN:chrUn_KI270757v1 LN:71251
@SQ SN:chrUn_GL000214v1 LN:137718
@SQ SN:chrUn_KI270742v1 LN:186739
@SQ SN:chrUn_GL000216v2 LN:176608
@SQ SN:chrUn_GL000218v1 LN:161147
@SQ SN:chrX LN:156040895
@SQ SN:chrY LN:57227415
@SQ SN:chrY_KI270740v1_random LN:37240
@PG ID:bowtie2 PN:bowtie2 VN:2.3.5.1 CL:"/home/vivekr/Mirpipe/Packages1
/bowtie2-2.3.5.1-sra-linux-x86_64/bowtie2-align-s --wrapper basic-0 -p 8 -x /home/vivekr/Mirpipe
/ref/grch38/hg38 /home/vivekr/Mirpipe/moRNA_data/sorted_bam/SRR7541164_trimmed.sam --passthrough -U /home/vivekr/Mirpipe/moRNA_data/trimmed_fastq/SRR7541164_trimmed.fq"
SRR7541164.1 16 chr7 25949921 42 23M * 0 0 GACAAAGTTCTGTAGTGCACTGN IIIIIIIIIIFFFFFFFFFF<0# AS:i:-1 XN:i:0 XM:i:1
XO:i:0 XG:i:0 NM:i:1 MD:Z:22A0 YT:Z:UU
@SRR7541164.1 1 length=51%0ANCAGTGCACTACAGAACTTTGTC%0A+%0A#0<FFFFFFFFFFIIIIIIIIII%0A
SRR7541164.2 16 chr7 25949923 42 21M * 0 0 CAAAGTTCTGTAGTGCACTGN IIIIIIIFFFFFFFFFFF<0# AS:i:-1 XN:i:0 XM:i:1 XO:i:0 XG:i:0 NM:i:1 MD:Z:20A0 YT:Z:UU
Version details are as follows:
samtools 1.7
Using htslib 1.7-2
Copyright (C) 2018 Genome Research Ltd.
I am not able to check what is causing sam file curruption or error while conversion from sam to bam. Anu sugesstions please....
Thanks.
Hello ,
Just a typo here or do you realy redirecte bowtie output to
-S
?What's the output of
tail /fastq/test.sam
?fin swimmer
No. I use this
-S
to get output as sam file. The output oftail /fastq/test.sam
is as follows:@SRR7541164.20452273 20452273 length=51%0ACAAAGAATTCTCCTTTTGGGCTGGAATTCTCGGGTGCCAAGGAACTCCAGT%0A+SRR7541164.20452273 20452273 length=51%0ABBBFFFFFFFFFFFFIIIIIIIIIBFFIIIIIIIIIIIIIIIIIIIIIFII%0A SRR7541164.20452274 4 * 0 0 * * 0 0 TCAGTGCACTACAGAACTTTGTCTGGAATTCTCGGGTGCCAAGGAACTCCA BBBFFFFFFFFFFIIIIIIIIIIIIIIFIIIIIIIIIIIIIIIIIIIIFII YT:Z:UU
@SRR7541164.20452274 20452274 length=51%0ATCAGTGCACTACAGAACTTTGTCTGGAATTCTCGGGTGCCAAGGAACTCCA%0A+SRR7541164.20452274 20452274 length=51%0ABBBFFFFFFFFFFIIIIIIIIIIIIIIFIIIIIIIIIIIIIIIIIIIIFII%0A SRR7541164.20452275 4 * 0 0 * * 0 0 GTTTCCGTAGTGTAGTGGTTATCACGTTCGCCTTGGAATTCTCGGGTGCCA BBBFFFFFFFFFFFIFIIIIIIIIFIIIIIIIIIIIIIIIIIIIIIFFBFF YT:Z:UU
@SRR7541164.20452275 20452275 length=51%0AGTTTCCGTAGTGTAGTGGTTATCACGTTCGCCTTGGAATTCTCGGGTGCCA%0A+SRR7541164.20452275 20452275 length=51%0ABBBFFFFFFFFFFFIFIIIIIIIIFIIIIIIIIIIIIIIIIIIIIIFFBFF%0A SRR7541164.20452276 4 * 0 0 * * 0 0 CTGTCTGAGCGTCGCTTGGAATTCTCGGGTGCCAAGGAACTCCAGTCACAT BBBFFFFFFFFFFIIIIIIIIIIIIIIIIFFFIIFFFIIIIIIIIIIBFFI YT:Z:UU
@SRR7541164.20452276 20452276 length=51%0ACTGTCTGAGCGTCGCTTGGAATTCTCGGGTGCCAAGGAACTCCAGTCACAT%0A+SRR7541164.20452276 20452276 length=51%0ABBBFFFFFFFFFFIIIIIIIIIIIIIIIIFFFIIFFFIIIIIIIIIIBFFI%0A SRR7541164.20452277 4 * 0 0 * * 0 0 AGCTACATTGTCTGCTGGGTTTTGGAATTCTCGGGTGCCAAGGAACTCCAG BBBFFFFFFFFFFIIIIIIFFFIIIIIIIIIIIIIIIIIIIIIIIIIIIII YT:Z:UU
@SRR7541164.20452277 20452277 length=51%0AAGCTACATTGTCTGCTGGGTTTTGGAATTCTCGGGTGCCAAGGAACTCCAG%0A+SRR7541164.20452277 20452277 length=51%0ABBBFFFFFFFFFFIIIIIIFFFIIIIIIIIIIIIIIIIIIIIIIIIIIIII%0A
That last line is truncated, suggesting that your alignment got aborted prematurely.
Note that do sam-to-bam conversion on the fly without using a sam intermediate:
You cannot use
-S
and>
at the same time, so either you made a mistake or you gave us the wrong command.I made a mistake. Definitely
-S
and>
can't used together. Thanks for pointing it out. I have also checked and confirmed this with botiew2 manuals. I have edited the question also.Or sometimes check md5sum, if fastq files are downloaded correctly..