How to resolve a ValueError: Multiple 'HD' Lines are not permitted when I run Circle-Map on a Linux system
0
0
Entering edit mode
19 months ago
liyuguo • 0

enter image description here

Circle-Map ValueError • 1.5k views
ADD COMMENT
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

Thanks for the tip. I'll try your suggestion

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

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

Login before adding your answer.

Traffic: 2399 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6