immunarch icon indicating copy to clipboard operation
immunarch copied to clipboard

support for TRUST4 output

Open natallah opened this issue 3 years ago • 12 comments

Hello,

Is there a way that I can load data output from TRUST4 into Immunarch?

Thanks, Nadia

natallah avatar Sep 04 '20 22:09 natallah

There is a bug on detecting vdjtools format.

I believe that the problem is on the file io.R, line 546: } else if (str_detect(tolower(l), "cdr3nt") && str_detect(tolower(l), "vend") && str_detect(tolower(l), "v")) {

According to the VDJTools documentation, only the columns 1 to 7 are required, which means that the column Vend shouldn't be used to recognize the vdjtools file.

@natallah, on your file created by TRUST4 sample_report.tsv, remove the character # from the beginning and add a new column: Vend with NA values, if you don't already have it. It worked for me.

adefelicibus avatar Oct 17 '20 14:10 adefelicibus

Fabulous @adefelicibus - thank you SO much!

natallah avatar Oct 19 '20 20:10 natallah

There is a bug on detecting vdjtools format.

I believe that the problem is on the file io.R, line 546: } else if (str_detect(tolower(l), "cdr3nt") && str_detect(tolower(l), "vend") && str_detect(tolower(l), "v")) {

According to the VDJTools documentation, only the columns 1 to 7 are required, which means that the column Vend shouldn't be used to recognize the vdjtools file.

@natallah, on your file created by TRUST4 sample_report.tsv, remove the character # from the beginning and add a new column: Vend with NA values, if you don't already have it. It worked for me.

Which version do you use? Version 0.6.5 doesn't work for me even I follow your suggestions. The vdjtools parser seems to assume an 11-columns vdjtools format.

ddzhang3 avatar Oct 23 '20 11:10 ddzhang3

There is a bug on detecting vdjtools format.

I believe that the problem is on the file io.R, line 546: } else if (str_detect(tolower(l), "cdr3nt") && str_detect(tolower(l), "vend") && str_detect(tolower(l), "v")) {

According to the VDJTools documentation, only the columns 1 to 7 are required, which means that the column Vend shouldn't be used to recognize the vdjtools file.

@natallah, on your file created by TRUST4 sample_report.tsv, remove the character # from the beginning and add a new column: Vend with NA values, if you don't already have it. It worked for me.

Hi, I've installed the lastest version on the master branch. But the trick did not work for me, too. the error message is

  Error: Assigned data `df[[.dstart]] - df[[.vend]] - 1` must be compatible with existing data.

It looks like some extra effort are needed.

zqfang avatar May 11 '21 10:05 zqfang

Hi, @ddzhang3 and @zqfang! My name is Aleksandr Popov, I am a developer of the Immunarch package. Thank you for using our software!

Could you, please, provide examples of files that cannot be loaded to Immunarch? It will help to update the parser.

Best regards, Aleksandr

Alexander230 avatar Aug 10 '21 09:08 Alexander230

@Alexander230 , sounds great ! I've attached 2 output of TRUST4. TRUST4.zip

zqfang avatar Aug 11 '21 00:08 zqfang

Thank you very much for providing the data! I've made a fix; you can try it by installing Immunarch from Github branch with the fix:

devtools::install_github("immunomind/immunarch", ref="trust4-fix")

Soon I plan to merge it into development branch of Immunarch.

Best regards, Aleksandr

Alexander230 avatar Aug 11 '21 11:08 Alexander230

@Alexander230 , That's fantastic ! It works perfect now.

There's still one issue:

When only header line presents (without any clonetypes data), it throws error

Error in if (any(str_detect(.name[i], c("TCRA", "TRAV", "TCRG", "TRGV",  : 
  missing value where TRUE/FALSE needed

When I parse a directory of many results, the parse stop because of the empty file.

Would you mind skipping the file without any clonetypes and warning for the user ?

zqfang avatar Aug 12 '21 01:08 zqfang

@zqfang , please try to reinstall Immunarch again from trust4-fix branch; I've made an update to handle empty files better. It will display warnings that type of recombination (VJ/VDJ) cannot be detected, but will not stop with error.

Best regards, Aleksandr

Alexander230 avatar Aug 12 '21 13:08 Alexander230

@Alexander230 , it works perfect now. Thank you very much for quick response

zqfang avatar Aug 13 '21 14:08 zqfang

@Alexander230 I install the trust-fix version of immunarch. But I found that when i plot the geneusage, it will plot all the genes. For example, imm_gu <- geneUsage(immdata$data[c(1, 2)], "hs.ighj", .norm = F, .ambig = 'inc')
vis(imm_gu) image geneUsage(immdata$data[c(1, 2)], "hs.trbv", .norm = F, .ambig = 'inc')
image

Thanks for your reply~

weizhiting avatar Sep 02 '21 08:09 weizhiting

Hello I just recently starrted ImmuneArch on TRUST4 results from Bulk RNA-seq and I get the same problem, when using geneUsage, despite selecting specific genes it plots all of them? Is there a way to fix it? Thank you.

Cinade avatar Aug 30 '22 07:08 Cinade

Hello, @weizhiting and @Cinade!

Immunarch's geneUsage() function now selects all V or D or J genes depending on .gene argument value, not a specific gene. We plan to improve the functionality of geneUsage() in future versions of Immunarch.

For now, you can select only the genes that you need from geneUsage() output before visualization, for example,

imm_gu <- geneUsage(immdata$data[c(1, 2)], .gene="hs.trbj", .norm = F, .ambig = 'inc')
vis(imm_gu[imm_gu[["Names"]] %in% c("TRBJ1-2", "TRBJ1-3"), ])

If you have more questions, feel free to ask them!

Best regards, Aleksandr

Alexander230 avatar Sep 29 '22 12:09 Alexander230

Thank you very much. it work for me.

Cinade avatar Nov 17 '22 13:11 Cinade

Closing this issue for now. The next version of Immunarch will mostly support the AIRR Standard data format.

More details on the next version of Immunarch are here: https://b-t.cr/t/immunarch-will-significantly-evolve-but-it-will-break-things-and-we-need-your-help/1123

vadimnazarov avatar Oct 24 '23 00:10 vadimnazarov