Giter Club home page Giter Club logo

Comments (4)

qmarcou avatar qmarcou commented on August 29, 2024

Hi Jonas,
Thanks for posting your question here.

For your alpha chains: in general the most problematic step is to get correct gene alignments in the pre processing step, after that the inference/evaluation is pretty smooth. What I would encourage you to do is :

  • go in your evaluate or inference folder and look at the inference_logs.txt file. This file will tell you how many V or J gene goes into the inference : if any of these two values is 0 then it is impossible for the inference to attach a complete scenario to the sequence. In that case you should revise your alignments thresholds and/or offsets. Please note that there is now a dedicated command line to load template specific offsets in order to make best use of the sequencing information. Similarly there is a dedicated command if your input is made of nucleotide CDR3 sequences.

  • if the latter do not provide more information the alignments might still be the problem. One thing you can do is lower the probability threshold for the inference to allow for scenarios with very low probability. Maybe some of the sequences that were tagged as NaN before will get a probability assigned this time. If this is the acse look at the inference_logs.txt file and look at the average (over scenarios) number of errors for this sequence. If the number is much larger that what you would expect from your sequencing process you should adjust your alignment threshold.

As I mentioned the best results are obtained by constraining the offsets as much as you can provided the sequencing mechanism (having a primer in the V makes you sure of the V offset for instance, as for CDR3s the gene anchors position automatically gives you an offset) and incorrect parameters there may bias your results. I know setting them correctly may seem tedious, but I know by experience that making blind alignments does not work well especially on short sequences (such as CDR3s)

from igor.

JonasMir avatar JonasMir commented on August 29, 2024

Hi Quentin,

thanks for your detailed answer! Indeed the inference_logs.txt file showed the problem having zeroes. In my case already resetting the threshold for the alignment solved the problem.

Cheers,
Jonas

from igor.

spritelysauropods avatar spritelysauropods commented on August 29, 2024

Hello, I am adding to this question because I think the problems I am encountering are related, but I am not sure what additional steps to try to resolve nan generation probability for ~10% of mouse CDR3beta sequences (60 bp-long reads) using the built-in models.

For a handful of sequences in the Pgen_counts.csv that had nan for Pgen_estimate, I tried the following:

  • Looked at inference_logs.txt. The nan-Pgen_stimate sequences have 0 for seq_likelihood, seq_mean_n_errors, and seq_n_scenarios. But there is at least 1 n_V_aligns and n_J_aligns, so I am not sure if it was the alignment that is causing the problem. The IGoR alignments in the aligns folder also broadly match provided V and J identities.

  • set P_ratio_thresh to 0 to explore every recombination scenario by the following command: igor -set_wd $wdpath -batch mouse1 -species mouse -chain beta -evaluate --P_ratio_thresh 0.0 -output --Pgen. This lead to nan for every sequence, and I just saw this referenced in #4 (comment). (I will also try with very small but non-zero P_ratio_thresh.

I have not tried using the --ntCDR3 flag in the alignment step because it seems like the alignment step is successful. Should I try using the --ntCDR3 flag? We have indices of V and J positions in the read but it may just take me some thinking to match that to offsets.

Thank you!
I've attached a extract of the inference_logs.txt for 4 sequences that had nan Pgen_estimate with the default P_ratio_thresh and with P_ratio_thresh set to 0.0.
inference_logs_example.txt

from igor.

qmarcou avatar qmarcou commented on August 29, 2024

Dear @spritelysauropods ,
Apologies for the late reply. Did you have any luck setting the probability ratio to a low value? Setting to 0 must lead to a division by 0 somewhere in the code, hence the NaNs. I should probably introduce a small fix to replace 0 by the minimum double value.

As for your other questions:

I have not tried using the --ntCDR3 flag in the alignment step because it seems like the alignment step is successful. Should I try using the --ntCDR3 flag? We have indices of V and J positions in the read but it may just take me some thinking to match that to offsets.

In general I would advise you to use your V and J position knowledge, especially since you have such short reads (60bp). Disregarding this information is increasing uncertainty for the algorithm and can only produce worse results.
As for CDR3, this would require you to first preprocess your sequences in order to extract their CDR3 sequences. Many tools can perform this operation, although they all rely on some kind of alignment, and because you have very short reads you cannot be guaranteed they will spit out the correct CDR3.

from igor.

Related Issues (20)

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.