Error in `calculateInterVsIntra()`

Issue #5 resolved
Julian Zhou created an issue

Minimal reproducible example (data attached):

db_mre_scoper = defineClonesScoper(db=db_mre, junction="h_cdr3", v_call="h_v", j_call="h_j", first=F, cdr3=F, mod3=F, nproc=1, progress=T)
CLONING>  
     PROGRESS> [=================] 100%  3s
CLONES=  1167
RECORDS=  1202
PASS=  1202
FAIL=  0
db_mre_analyze = analyzeClones(db=db_mre_scoper, junction="h_cdr3", v_call="h_v", j_call="h_j", clone="CLONE", first=F, cdr3=F, nproc=1, progress=T)
INTER AND INTRA DISTANCES ANALYSIS>  
  PROGRESS> [=================] 100%  3s
Error in if (is.na(f.lower)) stop("f.lower = f(lower) is NA") : 
  argument is of length zero

I was able to trace the error back to calculateInterVsIntra(), called by analyzeClones.

Somehow, vec_ff has no entry with inter in the names.

As a result, db_dff$LABEL is all intra.

Then, func1.1 and func1.2 are both numeric(0), instead of a single numeric value. This throws the

Error in if (is.na(f.lower)) stop("f.lower = f(lower) is NA") : argument is of length zero

message when running

intxn <- uniroot(scoper:::intersectPoint, interval = c(minInt, maxInt), tol=1e-8, extendInt="yes",
                     func1.0=1, func1.1=func1.1, func1.2=func1.2,
                     func2.0=1, func2.1=func2.1, func2.2=func2.2)

Comments (6)

  1. nima nouri

    hmm... I will look at it tmw or Monday for sure... please send me the cloned data if the attached one is not cloned.

  2. Julian Zhou reporter

    Thanks. The first line of code from above will assign clones. It takes only 3 seconds to run.

  3. nima nouri

    Ok. From the cloning output it seems it infered a lot of singltons and may be the rest are clones with only two seqs. I will look at it, but if this is the case, maybe we are facing a very specific case.

  4. nima nouri

    -- OK. Your data was a particular case which I updated the code to resolve the issue.

    -- The inferred clones are mostly singletons and other clones have only one unique sequences. Therefore, there was no maximum distances in in any clone (i.e. all zeros), and the function did not report them. So, there was no entry with inter in the names.

    -- I have fixed the issue by keeping the zeros, and reporting them in the plot. I also have changed the plot preview from a density curve to a histogram.

    -- I checked your data. It should be good to go.

  5. Log in to comment