SysBioChalmers / Mouse-GEM

Genome-scale model for Mus musculus
Creative Commons Attribution 4.0 International
7 stars 5 forks source link

prepHumanModelForftINIT error #22

Closed byeongchangsim closed 1 year ago

byeongchangsim commented 1 year ago

Description of the issue:

I'm running the prepHumanModelForftINIT you uploaded. There is a problem here. It says to set a different path for metabolicTasks_Essential. Is there another file used for Mouse-gem?

An error appears if you use the .txt file in the existing Human-gem/data/MetabolicTasks.

The error message is An attempt was made to increment an array with an ambiguous dimension. to be.

haowang-bioinfo commented 1 year ago

@johan-gson can you help with this

johan-gson commented 1 year ago

For now, I think the metabolic tasks in Human-GEM should work fine, this is what I have previously used when running ftINIT. But the reactions.tsv should be from Mouse-GEM. Could you try if that helps? If not, I will help you investigate this more!

byeongchangsim commented 1 year ago

hello. johan-gson As you said, reactions.tsv used the mouse-GEM path. I also used Mouse-GEM.mat and for metabolicTasks I used Essential.txt located in Human-GEM\data\metabolicTasks. Finally, if you run it using setRavenSolver('gurobi'), you will get the error mentioned above. Please confirm.

thank you.

2023년 1월 20일 (금) 오전 9:36, johan-gson @.***>님이 작성:

For now, I think the metabolic tasks in Human-GEM should work fine, this is what I have previously used when running ftINIT. But the reactions.tsv should be from Mouse-GEM. Could you try if that helps? If not, I will help you investigate this more!

— Reply to this email directly, view it on GitHub https://github.com/SysBioChalmers/Mouse-GEM/issues/22#issuecomment-1397785792, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS6YL26YSUVQY4FTO4DDSKLWTHMYVANCNFSM6AAAAAAT73IS7M . You are receiving this because you authored the thread.Message ID: @.***>

byeongchangsim commented 1 year ago

Also with Human-GEM data it works fine.

Thank you

2023년 1월 20일 (금) 오전 9:42, 심병창 @.***>님이 작성:

hello. johan-gson As you said, reactions.tsv used the mouse-GEM path. I also used Mouse-GEM.mat and for metabolicTasks I used Essential.txt located in Human-GEM\data\metabolicTasks. Finally, if you run it using setRavenSolver('gurobi'), you will get the error mentioned above. Please confirm.

thank you.

2023년 1월 20일 (금) 오전 9:36, johan-gson @.***>님이 작성:

For now, I think the metabolic tasks in Human-GEM should work fine, this is what I have previously used when running ftINIT. But the reactions.tsv should be from Mouse-GEM. Could you try if that helps? If not, I will help you investigate this more!

— Reply to this email directly, view it on GitHub https://github.com/SysBioChalmers/Mouse-GEM/issues/22#issuecomment-1397785792, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS6YL26YSUVQY4FTO4DDSKLWTHMYVANCNFSM6AAAAAAT73IS7M . You are receiving this because you authored the thread.Message ID: @.***>

johan-gson commented 1 year ago

Ok, thanks for reporting this, I will investigate - I'll get back as soon as I know more!

johan-gson commented 1 year ago

The problem is that the b field in the Mouse model for some reason has two columns. This has happened before, and I think you fixed this @haowang-bioinfo? I suspect that you fixed this manually in the model, but that the problem is in the script that generates the model from Human-GEM, and therefore it came back now?

Anyway, @byeongchangsim, you can easily get around this with the following line:

mouseGEM.b = zeros(length(mouseGEM.mets),1);

just run it before you start the analysis - it will fix this issue. Let me know if you run into other problems, but I feel pretty convinced this is the problem.

byeongchangsim commented 1 year ago

hi johan-gson

I ran it the way you told me. It's running without errors.

Thank you very much.

2023년 1월 20일 (금) 오전 11:13, johan-gson @.***>님이 작성:

The problem is that the b field in the Mouse model for some reason has two columns. This has happened before, and I think you fixed this @haowang-bioinfo https://github.com/haowang-bioinfo? I suspect that you fixed this manually in the model, but that the problem is in the script that generates the model from Human-GEM, and therefore it came back now?

Anyway, @byeongchangsim https://github.com/byeongchangsim, you can easily get around this with the following line:

mouseGEM.b = zeros(length(mouseGEM.mets),1);

just run it before you start the analysis - it will fix this issue. Let me know if you run into other problems, but I feel pretty convinced this is the problem.

— Reply to this email directly, view it on GitHub https://github.com/SysBioChalmers/Mouse-GEM/issues/22#issuecomment-1397842716, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS6YL24B3FRBULNM43ESXEDWTHYEBANCNFSM6AAAAAAT73IS7M . You are receiving this because you were mentioned.Message ID: @.***>

johan-gson commented 1 year ago

Perfect, thanks! Good luck with your project!

haowang-bioinfo commented 1 year ago

@johan-gson good work!

The problem is that the b field in the Mouse model for some reason has two columns. This has happened before, and I think you fixed this @haowang-bioinfo? I suspect that you fixed this manually in the model, but that the problem is in the script that generates the model from Human-GEM, and therefore it came back now?

I can confirm this issue. The model has always been updated by script. I don't remember this occurred before, but this is a bug actually started v1.1. Working on to fix it now

byeongchangsim commented 1 year ago

hi

another problem is dispEM

2023년 1월 20일 (금) 11:22, johan-gson @.***>님이 작성:

Perfect, thanks! Good luck with your project!

— Reply to this email directly, view it on GitHub https://github.com/SysBioChalmers/Mouse-GEM/issues/22#issuecomment-1397847674, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS6YL2ZWK3PAZKQQJVFS3WTWTHZHDANCNFSM6AAAAAAT73IS7M . You are receiving this because you were mentioned.

byeongchangsim commented 1 year ago

hi johan-gson

Thank you so much for the answers so far. Finally, there was a problem in creating the model, so I sent an e-mail.

model1 = ftINIT(prepData, data_struct.tissues{1}, [], [], data_struct, {}, getHumanGEMINITSteps('1+0'), false, true); When I run this code, dispEM(['Failed to find good enough solution within the time frame. MIPGap: ' num2str(mipGap)]) error comes out. I'm asking for help.

Thank you very much.

2023년 1월 20일 (금) 오후 4:41, 심병창 @.***>님이 작성:

hi

another problem is dispEM

2023년 1월 20일 (금) 11:22, johan-gson @.***>님이 작성:

Perfect, thanks! Good luck with your project!

— Reply to this email directly, view it on GitHub https://github.com/SysBioChalmers/Mouse-GEM/issues/22#issuecomment-1397847674, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS6YL2ZWK3PAZKQQJVFS3WTWTHZHDANCNFSM6AAAAAAT73IS7M . You are receiving this because you were mentioned.

johan-gson commented 1 year ago

Hi again,

There are a few things we should check:

  1. Make sure that the model and the data you are using have the same type of gene identifiers. The mouse model uses gene symbols, make sure that the data uses the same, so it is not using for example ensembl identifiers.

  2. If that is ok, then I'm curious if you are using Gurobi version 10 (or higher). It may then be that you need to modify some parameters, let me know if that is the case.

  3. If this doesn't work, then if you could send me the gene expression profile that is failing, and I could debug it a bit here?

byeongchangsim commented 1 year ago

Dear johan-gosn

Thank you for your reply. The problem was resolved after setting setsolver to gurobi.

-

2023년 1월 20일 (금) 22:15, johan-gson @.***>님이 작성:

Hi again,

There are a few things we should check:

1.

Make sure that the model and the data you are using have the same type of gene identifiers. The mouse model uses gene symbols, make sure that the data uses the same, so it is not using for example ensembl identifiers. 2.

If that is ok, then I'm curious if you are using Gurobi version 10 (or higher). It may then be that you need to modify some parameters, let me know if that is the case. 3.

If this doesn't work, then if you could send me the gene expression profile that is failing, and I could debug it a bit here?

— Reply to this email directly, view it on GitHub https://github.com/SysBioChalmers/Mouse-GEM/issues/22#issuecomment-1398361743, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS6YL22U7TWC5U4QI6FO37TWTKFVNANCNFSM6AAAAAAT73IS7M . You are receiving this because you were mentioned.Message ID: @.***>

johan-gson commented 1 year ago

Ok, good, then again good luck with your project!

byeongchangsim commented 1 year ago

hello. TaskFileName is using metabolic_tasks_Full.xlsx from Human-GEM. However, when I run diffTasks = res_func.funcComp.tasks(isDiff) after running compareMultipleModels, the array is empty. I would like to know how to solve it. Thank you very much. As I said earlier, I put the gene name, not the ensemble ID. thank you.

2023년 1월 20일 (금) 오후 10:31, johan-gson @.***>님이 작성:

Ok, good, then again good luck with your project!

— Reply to this email directly, view it on GitHub https://github.com/SysBioChalmers/Mouse-GEM/issues/22#issuecomment-1398394967, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS6YL27BQ3Q5VSMPZSN6Y6TWTKHRXANCNFSM6AAAAAAT73IS7M . You are receiving this because you were mentioned.Message ID: @.***>

haowang-bioinfo commented 1 year ago

try to use metabolic_tasks_Full.txt

byeongchangsim commented 1 year ago

hi

I modified it to the part you told me, but the same error comes out.

2023년 1월 26일 (목) 17:15, Hao Wang @.***>님이 작성:

try to use metabolic_tasks_Full.txt

— Reply to this email directly, view it on GitHub https://github.com/SysBioChalmers/Mouse-GEM/issues/22#issuecomment-1404674434, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS6YL24HGMHNELUON66OXH3WUIXBJANCNFSM6AAAAAAT73IS7M . You are receiving this because you were mentioned.Message ID: @.***>

johan-gson commented 1 year ago

Could you try to debug the function compareMultiplemodels and see where it fails?

yanghong-bio commented 1 year ago

Hi again,

There are a few things we should check:

  1. Make sure that the model and the data you are using have the same type of gene identifiers. The mouse model uses gene symbols, make sure that the data uses the same, so it is not using for example ensembl identifiers.
  2. If that is ok, then I'm curious if you are using Gurobi version 10 (or higher). It may then be that you need to modify some parameters, let me know if that is the case.
  3. If this doesn't work, then if you could send me the gene expression profile that is failing, and I could debug it a bit here?

Hi johan,

Thanks for the tips for fixing the error. I am working on building sample-specific model using the rat-GEM as a temple. I had the same error and I first tried to debug by ratGEM.b = zeros(length(ratGEM.mets),1); but the error still appeared.

gurobi version: 10.0.1

Reproducing these results: prepDataexpression.mat.zip

johan-gson commented 1 year ago

Hi Hong,

I got lost in this long thread, sorry :). Could you explain what error you get exactly? You got exactly the same as when mouseGEM had a faulty .b field?

Best,

Johan

On Fri, Mar 3, 2023 at 9:13 AM Hong Yang @.***> wrote:

Hi again,

There are a few things we should check:

  1. Make sure that the model and the data you are using have the same type of gene identifiers. The mouse model uses gene symbols, make sure that the data uses the same, so it is not using for example ensembl identifiers.
  2. If that is ok, then I'm curious if you are using Gurobi version 10 (or higher). It may then be that you need to modify some parameters, let me know if that is the case.
  3. If this doesn't work, then if you could send me the gene expression profile that is failing, and I could debug it a bit here?

Hi johan,

Thanks for the tips for fixing the error. I am working on building sample-specific model using the rat-GEM as a temple. I had the same error and I first tried to debug by ratGEM.b = zeros(length(ratGEM.mets),1); but the error still appeared.

gurobi version: 10.0.1

Reproducing these results: prepDataexpression.mat.zip https://github.com/SysBioChalmers/Mouse-GEM/files/10882742/prepDataexpression.mat.zip

— Reply to this email directly, view it on GitHub https://github.com/SysBioChalmers/Mouse-GEM/issues/22#issuecomment-1453593817, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHX2AK23TZY3JSAJ4DS7UEDW2H4BPANCNFSM6AAAAAAT73IS7M . You are receiving this because you were mentioned.Message ID: @.***>

yanghong-bio commented 1 year ago

Hi johan,

sorry for the confusing. I run ftINIT using ratGEM and got the error below, error

load(fullfile(modelRoot,'models','Rat-GEM.mat'));
ratGEM.b = zeros(length(ratGEM.mets),1);
ratGEM = addBoundaryMets(ratGEM);

essentialTasks = parseTaskList('metabolicTasks_Essential.txt')
checkTasks(ratGEM, [], true, false, false, essentialTasks);

data_struct.genes = tpm_data{:, 1}; 
data_struct.tissues = tpm_data.Properties.VariableNames(2); 
data_struct.levels = tpm_data{:, 2}; 

data_struct.threshold = 1;

prepData = prepHumanModelForftINIT(ratGEM, false, 'metabolicTasks_Essential.txt', fullfile(modelRoot,'models','reactions.tsv'));
model1 = ftINIT(prepData, data_struct.tissues{1}, [], [], data_struct, {}, getHumanGEMINITSteps('1+0'), false, true);
johan-gson commented 1 year ago

Hi Hong,

I am not sure why this happens - it only happens with ratGEM right? Have you been able to run ftINIT with Human-GEM?. This will take some time to debug, which I unfortunately don't have right now. If you want to try something, you could try with version 9.5 of Gurobi and see if it works. If it doesn't work, I will have to look at this when I can find the time. Sorry for that answer, I am really downloaded with work right now.

Best

Johan

On Fri, Mar 3, 2023 at 10:46 AM Hong Yang @.***> wrote:

Hi johan,

sorry for the confusing. I run ftINIT using ratGEM and got the error below, [image: error] https://user-images.githubusercontent.com/30895199/222763953-63e442d4-22c5-4f46-af0d-d073ba2830b0.png

` load(fullfile(modelRoot,'models','Rat-GEM.mat')); ratGEM.b = zeros(length(ratGEM.mets),1); ratGEM = addBoundaryMets(ratGEM);

essentialTasks = parseTaskList('metabolicTasks_Essential.txt') checkTasks(ratGEM, [], true, false, false, essentialTasks);

data_struct.genes = tpm_data{:, 1}; data_struct.tissues = tpm_data.Properties.VariableNames(2); data_struct.levels = tpm_data{:, 2};

data_struct.threshold = 1;

prepData = prepHumanModelForftINIT(ratGEM, false, 'metabolicTasks_Essential.txt', fullfile(modelRoot,'models','reactions.tsv')); model1 = ftINIT(prepData, data_struct.tissues{1}, [], [], data_struct, {}, getHumanGEMINITSteps('1+0'), false, true); `

— Reply to this email directly, view it on GitHub https://github.com/SysBioChalmers/Mouse-GEM/issues/22#issuecomment-1453726760, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHX2AKZGINA5GQZQU723K4LW2IG4VANCNFSM6AAAAAAT73IS7M . You are receiving this because you were mentioned.Message ID: @.***>

yanghong-bio commented 1 year ago

Hi Johan,

Thank you so much for your help. The error also happened to the latest version of Human-GEM (1.14.0) with version 9.5.2 of Gurobi when i run ftINIT function.

mihai-sysbio commented 1 year ago

I'll try to chip in here with an idea. Just to confirm that everything is as it should, @yanghong-bio do you think you could try to follow the ftINIT guide and let us know if you could follow it without errors?

zrf492174 commented 1 year ago

Hi, Hong, I meet the same problem when I run ftINIT on another GEM, do you have any idea now?

johan-gson commented 1 year ago

Hi @zrf492174 and @yanghong-bio, if you have problems running ftINIT on other models, take a look at this issue: https://github.com/SysBioChalmers/RAVEN/issues/483 I introduced a possibility to run prepINITData without scaling, which may help for some models. I could however run ftINIT on Human-GEM 1.14 without any issues, so I'm not sure what happened there. Let me know if this is still an issue.

zrf492174 commented 1 year ago

Hi @zrf492174 and @yanghong-bio, if you have problems running ftINIT on other models, take a look at this issue: SysBioChalmers/RAVEN#483 I introduced a possibility to run prepINITData without scaling, which may help for some models. I could however run ftINIT on Human-GEM 1.14 without any issues, so I'm not sure what happened there. Let me know if this is still an issue.

Thank you so much for your help, I changed RNA-seq data and now can run it correctly, if there is any problem, I will let you know.

haowang-bioinfo commented 1 year ago

feel free to reopen