This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to resolve a ValueError: Multiple 'HD' Lines are not permitted when I run Circle-Map on a Linux system

enter image description here

circle-map valueerror

what is the output of

samtools view -H qname_unknown_circle.bam

? and please, don't post an image when you can copy+paste the text.

Thanks for the tip. I'll try your suggestion

I tried your suggestion samtools view -H qname_unknown_circle.bam and the output result is like this:
yu@root:~$ samtools view -H qname_unknown_circle.bam
@HD VN:1.5 SO:queryname
@SQ SN:chr1 LN:248956422
@SQ SN:chr10 LN:133797422
@SQ SN:chr11 LN:135086622
………(Many lines like this ‘@SQ SN:chrxx LN:xxxx' are omitted)
@SQ SN:chrY_KI270740v1_random LN:37240
@HD VN:1.5 SO:unsorted GO:query
@PG ID:bwa PN:bwa VN:0.7.17-r1198-dirty CL:bwa/bwa mem -q hg38.fa unknown_circle_reads_1.fastq unknown_circle_reads_2.fastq

Wow, I tried to delete the "HD" line from the original Sam file and continue with the circle-map pipeline, and the error disappeared

The code for deletion is samtools view -h unknown_circle.sam | sed -e '/HD/d' > test_circle.sam This command line error, the modified one is at the bottom.

what if the name of a read, the quality contains HD ?

I run the following command described in the tutorial and get a sam file that has an HD.

bwa mem -q hg38.fa unknown_circle_reads_1.fastq unknown_circle_reads_2.fastq > unknown_circle.sam

And then I used the the following command to get a bam file with two HD

samtools sort -n -o qname_unknown_circle.bam unknown_circle.sam

If a bam file has two HD lines and then runs the following command will produce the error above.

Circle-Map ReadExtractor -i qname_unknown_circle.bam -o circular_read_candidates.bam

So I deleted the HD line from the original sam file, and it worked.

Thanks again for your help !


Reference: iprada/Circle-Map

Sorry, I am a rookie, I just understand what you mean, the sed delete command mentioned above is fatal for quality containing HD, I will fix that sed command

samtools view -h unknown_circle.sam | sed -e '/@HD\tVN:1.5\tSO:unsorted\tGO:query/d' > test_circle.sam

0 answers

No answers yet.

Log in to answer this question.