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

Using IGoR for species not supplied #31

Open
zacmon opened this issue Sep 17, 2018 · 1 comment
Open

Using IGoR for species not supplied #31

zacmon opened this issue Sep 17, 2018 · 1 comment
Labels

Comments

@zacmon
Copy link

zacmon commented Sep 17, 2018

Hi Quentin,

In your docs, you stated in the third paragraph of Advanced Usage:

Note that changing the GeneChoice realizations can be done automatically (without manually editing the recombination parameter file) by supplying the desired set of genomic templates to IGoR using the -set_genomic command. This could be used e.g to define a model for a chain in a species for which IGoR does not supply a model starting from of model for this chain from another species.

What exactly do you mean in the last sentence? It's unclear. Do you mean, perhaps, that the commands I've written below would allow for model_parms.txt and the like to be produced for a new species?

Example bash script template and IGoR commands

We first set up a convenient variable for setting all the genomic options.

genomeDirectory=/path/to/genomeInformationForNewSpecies
setCustomGenome="-set_genomic --V ${genomeDirectory}genomicVs.fasta\
                -set_genomic --D ${genomeDirectory}genomicDs.fasta\
                -set_genomic --J ${genomeDirectory}genomicJs.fasta\
                -set_CDR3_anchors --V ${genomeDirectory}V_gene_CDR3_anchors.csv\
                -set_CDR3_anchors --J ${genomeDirectory}J_gene_CDR3_anchors.csv"

We then run IGoR employing these options.

igor -set_wd workingDirectory -batch batchName -read_seqs inputFile
igor -set_wd workingDirectory $setCustomGenome -batch batchName -align --all
igor -set_wd workingDirectory $setCustomGenome -species human\
 -chain heavy_naive -batch batchName -infer -output --scenarios 10 --Pgen

We initialize a model for the new species from another (predefined) species, here the human model in IGoR.

Recommendations for inference options

For a new species, what do you recommend be the options for N_iter and L_thresh in the inference stage? Currently, N_iter defaults to five and my Pgen values are mostly NaNs. Would increase N_iter improve this as well as manipulating L_thresh?

@qmarcou
Copy link
Owner

qmarcou commented Sep 26, 2018

Hi @zacmontague ,

What exactly do you mean in the last sentence? It's unclear. Do you mean, perhaps, that the commands I've written below would allow for model_parms.txt and the like to be produced for a new species?

This is indeed what I mean: provided you want to create for new species (e.g a platypus) a recombination model with the same topology than an existing model (say e.g human heavy chain), the commands you have used will create the correct model_parms and marginals files with the custom (platypus) genomic templates you have provided

As for your second question about inference parameters:

  • N_iter controls the number of iterations in the Expectation Maximization algorithm, each new iteration will increase the final likelihood of the model. From my experience this likelihood quickly plateaus after a few iterations. Again from my personal experience (which you should take with agrain of salt and check by yourself the evolution of the likelihood and model parameters) 10 iterations is more than enough to obtain robust results. This is most likely not the parameter you should tune to solve your situation with many NaN in your Pgen (or sequence likelihood?)

  • L_thresh is indeed a better candidate for your problem, especially if your are dealing with highly mutated sequences (e.g ones that underwent somatic hypermutations). This parameter exists because you might want to rule out some bad quality sequences (e.g ones with many errors introduced during PCR). You should set it such that most of your sequences are assigned a likelihood starting from the first iteration (which you can monitor looking at the inference_logs.txt file)

However in as explained in #28 the most likely reason for your NaNs come from alignment quality and I strongly encourage you to read my answer for that issue.

Repository owner deleted a comment from decenwang Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants