Entering edit mode
3.7 years ago
mhasa006
▴
70
I'm trying to add a free text while writing the reads in a BAM file. As the Java hstjdk samtool doc mentions, I can add a free text with @CO
SAMTag. For example,
I'm adding the NM
tag and MD
tag using this code
record.setAttribute(htsjdk.samtools.SAMTag.MD.name(), "Value");
record.setAttribute(htsjdk.samtools.SAMTag.NM.name(), "Value");
But when I try to do the same for @CO
tag
record.setAttribute(htsjdk.samtools.SAMTag.CO.name(), "Value");
I get the following error
cannot find symbol
symbol: variable CO
location: class htsjdk.samtools.SAMTag
Can someone help me figure out how to add free text while writing a BAM file? Thanks in advance.
what is your version of htsjdk ?
samtools 1.2 Using htslib 1.2.1
Samtools is up to
v.1.12
so consider updating.Can this be an issue because of the earlier version of samtools? I tried the
It runs through without error, but nothing was written in the BAM file
we cannot help without seeing the code.
GenoMax htsjdk version is ~ not related to samtools or htslib.
no, what is the version of htsjdk ? not samtools, not htslib. https://github.com/samtools/htsjdk/releases
htsjdk version 1.133
Can the version cause this issue?
yes. 1.333 is 7 years old. And
CO
was not defined then.https://github.com/samtools/htsjdk/blob/3ed9b1d7681099ab77921916f7e6d0dd29f7d245/src/java/htsjdk/samtools/SAMTag.java
It's just too old. You shouldn't use this library. "951 commits to master since this release "
Got it, Thanks for the help.