I am very new to micro RNA analysis. I have been using H. sapiens, GRCh38 + major index as given in the Bowtie Website to align with my trimmed FASTQ file . The command I am using to make very sensitive alignments with Bowtie2 is given below.

module load  Bowtie2; 
bowtie2 --local -p 8 -q --phred33 -D 20 -R 3 -N 0 -L 8 \
    -i S,1,0.50 -x grch38_1kgmaj \
    -U /gpfs/ycga/scratch60/nicoli/ag2646/HumanmicroRNAbowtie_verysensitive_1.06.2021./3kPa_HDF_miRNA_1bbduk.fastq \
    -S /gpfs/ycga/scratch60/nicoli/ag2646/HumanmicroRNAbowtie_verysensitive_1.06.2021./3kPa_HDF_miRNA_1bbduk.sam

Then I am using:

samtools sort -bS 3kPa_HDF_miRNA_1bbduk.sam > 3kPa_HDF_miRNA_1bbduk.bam

to convert sam files into bam files.

However, I am hitting the error described below:

[W::sam_read1_sam] Parse error at line 46371

When I grepped the specific line it shows:


Any specific help troubleshooting this error will be very useful.

  • 1
    $\begingroup$ The [W: is just a warning. If the process errored out, there should be another actual error message that follows that warning. $\endgroup$
    – Ram RS
    Jun 3 at 18:51
  • $\begingroup$ Is it the last line of the samfile? I wonder if the sam file could be truncated (like a missing newline or something). $\endgroup$
    – Kamil S Jaron
    Jun 3 at 22:03
  • 2
    $\begingroup$ How did you "grep the line"? Is that actually line number 46371 of the file, or is that a random line that happens to contain the string 46371? $\endgroup$
    – terdon
    Jun 4 at 17:03
  • 1
    $\begingroup$ Is your samtools sort command actually a samtools view command? The -bS flag would not work with samtools sort: htslib.org/doc/samtools-sort.html. I tried it out of curiosity and got samtools: invalid option -- b. $\endgroup$ Jun 5 at 18:16
  • $\begingroup$ See similar situation here: biostars.org/p/169277. Have you confirmed that bowtie2 finished without errors? Does your sam file look ok? how many lines does it have? $\endgroup$ Jun 5 at 18:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.