Coder Social home page Coder Social logo

Unrecognized sequencing technology about lrez HOT 5 OPEN

pdimens avatar pdimens commented on July 3, 2024
Unrecognized sequencing technology

from lrez.

Comments (5)

pdimens avatar pdimens commented on July 3, 2024

@clemaitre is it because of this line?

const char* HaplotaggingPattern = "^A[0-9][0-9]C[0-9][0-9]B[0-9][0-9]D[0-9][0-9]$";

That it expects the BX:Z:AXXCXXBXXDXX to be the end of the line with nothing following it?

from lrez.

clemaitre avatar clemaitre commented on July 3, 2024

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.

pdimens avatar pdimens commented on July 3, 2024

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.

clemaitre avatar clemaitre commented on July 3, 2024

Thank you for this insightful suggestion, we will keep this in mind for future developments.

from lrez.

pdimens avatar pdimens commented on July 3, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.