This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Error information when running Hisat2 error correction for multiple mapping reads

Hi,

I did a Hisat2 error correction for multiple mapping reads after mapping. I have 9 libraries in total and the mapping rate is good (above 98 %). However, when I did the error correction, one library gave the following error:

Traceback (most recent call last):
  File "./toprintend1.py", line 16, in <module>
    start = int(splits[3].strip())
ValueError: invalid literal for int() with base 10: '149M'
[E::sam_parse1] SEQ and QUAL are of different length
[W::sam_read1] Parse error at line 114
[main_samview] truncated file.
errorCorrection.e8576242.9 (END)

All the other libraries ran well. Does anyone has any idea what happened here and how could I solve the problem? Thank you in advance!

rna-seq

Without details on what this script is doing it is impossible to help.

Thank you for your reply. Attached is the script of toprintend1.py. Please let me know if you need more information.

#This program genrates the length of a Cigar string in the last coloum of the ".sam" file.
import sys

file_o1 = open(sys.argv[2], 'w')  ## output file, expmple : accepted_hits_end.sam

file1 = open(sys.argv[1])  ## input file, exmpale : accepted_hits.sam
length = 0
dic = {}
for line in file1:
    if line != "\n":
        start = 0
        end = 0
        splits = line.split('\t')
        if splits[0].strip() not in ["@HD", "@PG", "@SQ"]:  ## to remove the header
            length = len(splits)
            start = int(splits[3].strip())
            sums = 0
            s = ''
            # to convert the cigar string into length (integer)
            for i in splits[5].strip():  # check for cigar string
                if i.isdigit():
                    s = s + i
                else:

Please use the formatting bar (especially the code option) to present your post better. I've done it for you this time.
code_formatting

Thank you!

That one library has the value "149M" somewhere which is a string. It is a string type because of the character "M". In that column or index only integers are allowed. You need to find the line containing "149M" and find out why this value is there. Instead of the start(?) postion.

Can't give more details

Hello hongliang.zhang!

We believe that this post does not fit the main topic of this site.

OP did not follow up on this. Please comment if you need further help.

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

0 answers

No answers yet.

Log in to answer this question.