-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
output knitted and corrected barcodes to fastq #30
Comments
Hi @kh49 I am so glad you find Pheniqs useful with scifi-RNA-seq. At the moment Pheniqs only writes decoded (error corrected) barcodes to SAM AUX tags. That said, there have been plans to add the functionality you describe since it can potentially make for a more seamless integration with downstream tools. I am looking into enhancing the token and transform syntax to allow what you are asking for. I will update this ticket soon with additional details. Regards, |
Hi @kh49 I have a version for you test. Are you comfortable building from source? are you testing on MacOS or Linux? alternatively I can provide instructions to build a static version with the builder. I added the option to address the decoded (error corrected) barcode sequence as one long, concatenated, sequence. So even if you had 3 cellular barcodes and each had two segments the tokens will be addressing the result as one long set of coordinates. To use it simply substitute the For instance There is one lingering issue... Since we are now pretending the decoded, or error corrected, barcode is a real sequence and allow to embed it in the output read, the error corrected nucleotides need a quality score. This is not a trivial question. The current version (35966b8) does not modify the quality scores of the corrected nucleotides which is probably a wrong behavior. but I wanted to allow you to test this and give feedback. One option is to provide a config option and give those corrected nucleotides a fixed quality score, say 30. You basically say: "I trust the decoding and I don't want any downstream tool to filter the read because it thinks the barcode quality is too low". Another option is use the overall error probability of decoding the entire barcode as the new quality but that will be probably too high for one mismatch and way too low for 3 or 4 mismatches. We are still debating it, but what will be your preferred method? |
@moonwatcher Thank you! I will give this a try in the next few days and get back to you. I'm working on Linux and should be fine building from source, but I'll let you know if I have issues. As far as the quality scores go, I think there would be merit in keeping both options you mentioned if it is not too much work. I think the fixed score case would be good enough in most cases, especially with the ability to tweak and fine tune correction parameters and error sensitivity in pheniqs. The second option sounds more technically correct. Maybe you can add a parameter to the config that lets users set a phred quality cutoff they'd like to use for the corrected barcodes. Then during error correction, barcodes with error probability lower than the set acceptable threshold would get assigned some quality score scaled between the maximum and the cutoff. Barcodes with error probability that is too high would get assigned some quality score scaled between the minimum and the cutoff. |
Hi @moonwatcher I tested the new version on my test case and the cell barcode redirection seems to work as intended and I can manipulate it as needed for output. However, I get no output from the molecular barcode. For example, if I have the following:
I'm expecting the first output file/interleaved line to have the molecular barcode and cellular barcode concatenated. Since I'm using naive molecular barcode decoding, I can always designate the UMI location in the input tokens instead. However, I also noticed that when outputting to BAM, the new version does not output the RX and QX tags, but does still provide OX and BZ. I ran the same configuration (without the new token addressing) on the new version as well as the current conda release and the conda version outputs RX and QX tags as expected but the new version does not. |
Hi @kh49 Everything you said is correct :)
Thank you for all the feedback so far. Looking forward to hear your opinion. |
Hi @moonwatcher, this all sounds good to me!
|
Hi @kh49 Sorry for the long delay but I am still working though this. This raised another question: What should be written when the decoder fails to decode the barcode? One option is what is currently done on the aux tags, which is to write a sequence of Another option is to write the original sequence with the original qualities. The read will be marked as failing quality control, as was always the case. Still working on the other features you mentioned ;) |
Hi @moonwatcher,
This tool is super helpful as I am trying to implement a new single cell protocol called scifi-RNA-seq. I have been able to get the desired barcode manipulations and correction to output to an organized bam. Unfortunately, My immediate downstream step requires fastq input so I need to either have pheniqs output fastqs with the corrected barcodes and RNA insert in one run, or set up a second run after generating a corrected BAM that quickly takes the BAM and outputs fastqs.
I have been trying to get the first option to work, but I can only seem to address the input tokens and create fastqs with the raw barcodes. I'm not sure how I can refer to the corrected barcodes.
For the second option, I don't understand how to access sequences in specific tags from a BAM input file. I saw some tutorials addressing interleaved BAM/CRAM, but my data is not interleaved and is one main read with a bunch of barcode stuff in tags.
I am attaching a small test case below. I use
scifi_main.json
as the config file for generating the correcttest.bam file.scifi_main_fastq.json
was my attempt at outputting FASTQs with correction which resulted in uncorrected output (R1_correcttest.fastq and R2_correcttest.fastq).Thank you!
scifi_pheniqs.tar.gz
The text was updated successfully, but these errors were encountered: