Skip to content
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

comprehensive list of contigs per barcode in 10X mode? #165

Open
ktpolanski opened this issue Nov 11, 2022 · 6 comments
Open

comprehensive list of contigs per barcode in 10X mode? #165

ktpolanski opened this issue Nov 11, 2022 · 6 comments

Comments

@ktpolanski
Copy link

Hello,

I came across this protocol, which describes how to get VDJ from Visium. TRUST4 seems pretty well equipped to process this data due to similar R1 structure to regular 10X. However, one thing I'd imagine being an issue is that Visium spots are small bulks rather than single cells, and as such it seems likely that there'd be a mix of various contigs at the spots. Meanwhile the documentation specifies that TRUST4 reports the top two contigs per barcode.

How hard would it be to potentially report all the contigs per barcode instead? Thanks and sorry for the trouble.

@mourisl
Copy link
Collaborator

mourisl commented Nov 11, 2022

The extra chains in a barcode will be in the last two columns of the TRUST4_barcoderep.tsv file. If you want to "promote" the other chains information in the primary field, you can also run the "barcoderep-expand.py" script in the "script" folder. This script only focuses on one of the chain.

This thread #141 might also be helpful.

@ktpolanski
Copy link
Author

Thank you for the insight. Sorry for the sluggish response, as it turned out the data hadn't yet arrived at the time. The data is imminent now, so I took the FASTQs of a TRAB sample for a spin with TRUST4 to get familiar with the tool and its various postprocessing. I was able to arrive at a 10X-like syntax that will easily go into downstream tools, so thanks a lot for that.

However, I have a couple of follow-up questions:

  1. barcoderep-expand.py has a --chain argument. Why is that? Wouldn't we want to just include all the extra chains if doing this? This doesn't seem like an option right now.
  2. I got a very high number of contigs when compared to cellranger output. There are over 10 times as many productive contigs, interestingly a third of them are BCRs. Is this normal? Is there some way to turn up stringency?

Thank you very much, and sorry for the trouble.

@mourisl
Copy link
Collaborator

mourisl commented Jan 3, 2023

  1. Because we can't be sure about the pairing (e.g. TRA+TRB) information, so the expansion will only "promote" one of the chains.
  2. TRUST4 assembles a lot of contigs from the ambient cells which are the cells failed to pass the quality control stage. I would recommend to only retain the barcodes that can pass the QC. Hope this will significantly reduce the noises you see.

@ktpolanski
Copy link
Author

Thanks for your lightning-fast reply, like always!

  1. Would it be possible to add an option (not default) to just export all of the chains like that? The barcodes get the suffixes anyway.
  2. Noted, but I tend to work with the all_contigs files from cellranger to sidestep the VDJ pipeline's attempt at cell calling. So there's no stringency knob?

@ktpolanski
Copy link
Author

Alright, I modified barcoderep-expand.py to taste, creating one "cell" per encountered chain. barcoderep-allchains.py can be found here.

The workflow I'm performing to get 10X-like output with one "cell" per chain:

/mnt/TRUST4/run-trust4 -t 25 -f /mnt/TRUST4/hg38_bcrtcr.fa --ref /mnt/TRUST4/human_IMGT+C.fa -u R2.fastq.gz --barcode R1.fastq.gz --barcodeRange 0 15 + --UMI R1.fastq.gz --umiRange 16 27 + --barcodeWhitelist ~/cellranger/spaceranger-1.1.0/lib/python/cellranger/barcodes/visium-v1.txt
python3 barcoderep-allchains.py -b TRUST_R2_barcode_report.tsv > TRUST_R2_barcode_report_allchains.tsv
/mnt/TRUST4/scripts/trust-barcoderep-to-10X.pl TRUST_R2_barcode_report_allchains.tsv 10x-allchains

@mourisl
Copy link
Collaborator

mourisl commented Jan 13, 2023

Sorry I missed your message last week. Glad you found a way to make it work and share your workflow. I'll make this an option in the trust-expand script later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants