Comments (5)
@clemaitre is it because of this line?
Line 10 in c9b378c
That it expects the BX:Z:AXXCXXBXXDXX to be the end of the line with nothing following it?
from lrez.
Hi @pdimens,
sorry for the delay of my answer.
The issue does not come from the line of code you are pointing at because the regular expression is applied only on the value of the SAM TAG. This string value is obtained with the function getTag()
from the htslib library that handles the parsing of SAM/BAM files. In the example below :
... BX:Z:A95C26B84D96 1:N:0:TATCAGTA+TTACTACT
getTag("BX:Z", value)
should return the string "A95C26B84D96".
However, the Tag/field that follows the BX tag in your example (eg : 1:N:0:TATCAGTA+TTACTACT
) seems not to have the correct format : "TAG:TYPE:VALUE
, whereby TAG
is a two-character string that matches /[A-Za-z][A-Za-z0-9]/
(cf. https://bioinformatics.stackexchange.com/questions/3979/how-does-htslib-samtools-access-optional-bam-fields). Therefore htslib may probably not recognize it as a proper TAG field and instead may concatenate it to the barcode value.
Have you an idea at which step of your pipeline such fields were introduced ?
Best,
Claire
from lrez.
Thank you for your reply. This additional tag was produced by UMItools and added to the FASTQ sequence headers. In the FASTQ spec, the comment line is valid, but it gets invalidated in the SAM spec when that information is carried over in alignment. These are things I've discerned since posting the original issue. I have since created a python script to clean the SAM file, and I agree that one should be more diligent about adding fastq headers with SAM-spec TAG:TYPE:VALUE
. However, the inclusion of un-tagged comments in FASTQ files is fairly commonplace, so I wonder if it would be worth adjusting the regular expression to recognize the AxxCxxBxxDxx tag up until a whitespace delimiter to cushion against these FASTQ comments carrying over into sam files?
from lrez.
Thank you for this insightful suggestion, we will keep this in mind for future developments.
from lrez.
@clemaitre in addition to the previous suggestion, there are circumstances where the BX:Z:
tag is followed by more legal SAM spec tags but LRez does not distinguish it because there isn't a newline character immediately following the BX:Z:
tag. For example, the source FASTQ file can have read headers like this:
@A00814:267:HTMH3DRXX:2:1101:4580:1000 BX:Z:A02C01B11D46 RX:Z:GAAACGACCAACA+CGAACACGTTAGC QX:Z:F,FFFFFFFFFFF+FF,FFF:FFFFFF
The comments of which are legally added to the SAM/BAM file via (e.g.) bwa mem -C
, but are considered illegal due to the rigidity of the capturing regex in LRez.
from lrez.
Related Issues (7)
- bam query slow HOT 5
- query bam with option `-H` generates malformatted SAM HOT 1
- "LRez index fastq": unable to index a FASTQ file not gzipped
- LRez does not handle Haplotagging and stLFR barcodes ending with "-1"
- "stoi" error when indexing bam positions HOT 1
- Include barcode integer suffix in index. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lrez.