distToNearest amino acid model – "IUPAC base expected" error

Issue #159 resolved
Dasha Balashova created an issue

Hello,

Using distToNearest function (with immcantation/suite devel docker image) model=”aa” I have an error: task failed - "IUPAC base expected". Small data subsample (AA sequences correspond to IUPAC alphabet), code and error are attached.

Best regards,

Dasha

Comments (3)

  1. Jason Vander Heiden

    Greetings @Dasha Balashova ,

    Sorry for the slow reply and thank you for the reproducible example.

    distToNearest expects nucleotide sequence input even for the animo acid model. It does the translation automatically before calculating the distances. If you use the cdr3 column instead of the cdr3_aa column, then it should work. Meaning:

    dist_ham <- distToNearest(data, sequenceColumn="cdr3", 
                              vCallColumn="v_call", jCallColumn="j_call",
                              model="aa", normalize="len", nproc=8)
    

    That error is specifically coming from:

    x <- data$cdr3_aa[1]
    seqinr::translate(unlist(strsplit(x, "")), ambiguous=T)
    

  2. Log in to comment