Coder Social home page Coder Social logo

Comments (12)

vadimnazarov avatar vadimnazarov commented on July 21, 2024

Hello @majorkazer ,

can you email us a sample of your data so we can reproduce the bug please? [email protected]

Can you try running the code

j_usage = geneUsage(BCRdata.coding$data, "hs.ighj", .ambig = "inc")

and see what changed?

from immunarch.

majorkazer avatar majorkazer commented on July 21, 2024

Hi @vadimnazarov,

Thanks for your help. My dataset is huge, so I have attached a downsampled dataset here.

I tried running the code you suggested, but still get the same result as described above.

BCRdata_downsampled.RData.zip

from immunarch.

vadimnazarov avatar vadimnazarov commented on July 21, 2024

Hi @majorkazer ,

it seems that everything works OK on that version of immunarch:

screenshot

Do you have the tcR package installed? Can you remove both tcR and immunarch packages and install immunarch (only!) again, and try that again?

from immunarch.

vadimnazarov avatar vadimnazarov commented on July 21, 2024

ping @majorkazer

from immunarch.

majorkazer avatar majorkazer commented on July 21, 2024

Apologies for the delay.

I am running this analysis in a jupyter notebook runtime environment; I'm not sure if this may be part of the problem. I created a new notebook runtime environment and re-installed immunarch from github using:

devtools::install_url("https://github.com/immunomind/immunarch/raw/master/immunarch.tar.gz")

I still get the same result as I reported before (see attached image from notebook).

Screen Shot 2019-12-16 at 1 38 24 PM

from immunarch.

vadimnazarov avatar vadimnazarov commented on July 21, 2024

Hi @majorkazer

We run the exact code you just wrote us on your data, and got correct results for all three gene segments. Can you please run the following code and check the output:

table(BCRdata.coding$data$J.name)
table(BCRdata.coding$data$D.name)

from immunarch.

majorkazer avatar majorkazer commented on July 21, 2024

Hi,

Running either table function returns this: < table of extent 0 >.

However, if I run table(BCRdata.coding$data$clones$D.name), I get what we would expect:
Screen Shot 2019-12-16 at 2 46 13 PM

I don't have a way to test this locally as of right now, everything is being run on the runtime environment... I think there may be something weird going on with the environment and/or jupyter notebooks. Nevertheless, for the time being I can just use the outputs from table to generate my own frequency plots.

Thanks for your help with this! Happy to close this issue for the time being unless you want to explore further.

from immunarch.

vadimnazarov avatar vadimnazarov commented on July 21, 2024

@majorkazer

after brainstorming with almost the whole team we managed to reproduce this tricky bug. Can you please try

j_usage = geneUsage(BCRdata.coding$data[[1]], "hs.ighj", .norm=T, .ambig="inc")
vis(j_usage, .plot = "hist")

Note the [[1]] for the data.

Alternatively, you can try

j_usage = geneUsage(BCRdata.coding$data[["clones"]], "hs.ighj", .norm=T, .ambig="inc")
vis(j_usage, .plot = "hist")

from immunarch.

majorkazer avatar majorkazer commented on July 21, 2024

Success! I am able to generate the J and D frequency plots using your code.

So, out of curiosity, is this something weird with how MIXCR objects are brought in? Or a difference in the version of immunarch that I'm using?

Thanks for your help!

from immunarch.

vadimnazarov avatar vadimnazarov commented on July 21, 2024

Perfect!

No, this is an issue in our code. geneUsage incorrectly processes the case when there is only one repertoire in the input list of repertoires. When you pass BCRdata.coding$data you pass a list with only one repertoire (i.e., the problematic case). When you pass BCRdata.coding$data[["clones"]] you pass this exact repertoire, and this is the case where everything works OK. Interestingly enough, when you pass a list with two or more repertoires, everything works OK, because we have a separate branch of code that processes the case with only one repertoire, and we definitely need to improve it.

@majorkazer , thank you for bringing this very tricky and non-obvious issue to us! We will fix it in our next release, and I will close the issue then.

We are conducting short interviews with specialists about pain points in AIRR analysis. We would like to learn more about the full pipeline from laboratory work to clinical insights. The interview is also a wonderful opportunity to discuss anything related to immune repertoire analysis and how to make it in immunarch and R. Should you find it appealing, here is a link to schedule our appointment: https://calendly.com/immunomind/interview

from immunarch.

EugeneRumynskiy avatar EugeneRumynskiy commented on July 21, 2024

The issue was solved.

from immunarch.

talban14 avatar talban14 commented on July 21, 2024

Sorry to open this back up but i'm having the same problem and the [[1]] does not fix it. I don't have tcR installed and am using immunarch directly in R. My data was loaded in from mixcr and it seems that everything else works great except this function.

specifying hs.trab. or hstrbj ect all returns the same object with all clones including IGH, IGK.

using the [[1]] selects clones but it seems to be doing it in a strange way. for example hs.trav will return any clone that has a V in the name IGHV3, TRAV11, IGKV2D. Same thing with hs.trab and hs.traj

from immunarch.

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.