Skip to content

Commit

Permalink
migration bug update
Browse files Browse the repository at this point in the history
  • Loading branch information
DeshanPerera committed Sep 16, 2024
1 parent 78d6626 commit 48780df
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 28 deletions.
7 changes: 2 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [
"--tumor",
"/mnt/d/Deshan/Books/University of Calgary/Experiments/TCGA/metastatic_primary/tumor_vcf_head.vcf",
"/mnt/d/Deshan/Books/University of Calgary/Experiments/TCGA/metastatic_primary/pheno_MUSE.txt",
"/mnt/d/Deshan/Books/University of Calgary/Experiments/TCGA/metastatic_primary/rename.vcf"
// "/mnt/d/Deshan/Books/University of Calgary/Experiments/Simulator_Linux/parameters_Cancer/parameters_MASTER.json"
"--cancer",
"/mnt/d/Deshan/Books/University of Calgary/Experiments/Simulator_Linux/parameters_Cancer/parameters_MASTER.json"
],
"stopAtEntry": false,
"cwd": "${fileDirname}",
Expand Down
2 changes: 1 addition & 1 deletion cancer.cu
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ void cancer::ingress()
sequence_replication_prob_changes,
sequence_metastatic_prob_changes,
max_sequences_per_File,
viral_Migration_Values, migration_start_Generation,
viral_Migration, viral_Migration_Values, migration_start_Generation,
count_tajima_Regions, tajima_regions_Start_Stop,
reference_Genome_location,
tissue_selection_Position_Count,
Expand Down
45 changes: 25 additions & 20 deletions cancer_Host.cu
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void cancer_Host::simulate_Generations(functions_library &functions,
float **sequence_replication_prob_changes,
float **sequence_metastatic_prob_changes,
int &max_sequences_per_File,
float **viral_Migration_Values, int *migration_start_Generation,
string &viral_Migration, float **viral_Migration_Values, int *migration_start_Generation,
int &count_tajima_Regions, int **tajima_regions_Start_Stop,
string &reference_Genome_location,
int *tissue_selection_Position_Count,
Expand Down Expand Up @@ -123,27 +123,30 @@ void cancer_Host::simulate_Generations(functions_library &functions,
tissue_migration_Targets_amount.push_back(intialize_vec);
}

cout << "\nPutative migrating particles per tissue: \n";

for (int migration_Check = 0; migration_Check < (num_Tissues * (num_Tissues - 1)); migration_Check++)
if (viral_Migration == "YES")
{
if (viral_Migration_Values[migration_Check][0] != -1)
cout << "\nPutative migrating particles per tissue: \n";

for (int migration_Check = 0; migration_Check < (num_Tissues * (num_Tissues - 1)); migration_Check++)
{
if (overall_Generations >= migration_start_Generation[migration_Check])
if (viral_Migration_Values[migration_Check][0] != -1)
{
int source = migration_Check / (num_Tissues - 1);
int destination = migration_Check % (num_Tissues - 1);

if (destination >= source)
if (overall_Generations >= migration_start_Generation[migration_Check])
{
destination = destination + 1;
}
int source = migration_Check / (num_Tissues - 1);
int destination = migration_Check % (num_Tissues - 1);

binomial_distribution<int> num_Particles(viral_Migration_Values[migration_Check][0], viral_Migration_Values[migration_Check][1]);
int num_viruses_to_transfer = num_Particles(gen);
if (destination >= source)
{
destination = destination + 1;
}

tissue_Migration_Totals[source] = tissue_Migration_Totals[source] + num_viruses_to_transfer;
tissue_migration_Targets_amount[source].push_back(make_pair(destination, num_viruses_to_transfer));
binomial_distribution<int> num_Particles(viral_Migration_Values[migration_Check][0], viral_Migration_Values[migration_Check][1]);
int num_viruses_to_transfer = num_Particles(gen);

tissue_Migration_Totals[source] = tissue_Migration_Totals[source] + num_viruses_to_transfer;
tissue_migration_Targets_amount[source].push_back(make_pair(destination, num_viruses_to_transfer));
}
}
}
}
Expand Down Expand Up @@ -436,10 +439,12 @@ void cancer_Host::simulate_Generations(functions_library &functions,
cout << "\nBottleneck size for metastatsis: " << tissue_Migration_Totals[tissue] << endl;
cout << "Metastatic cells avaiable: " << migration_cell_List.size() << endl;

migration_of_Cells(source_sequence_Data_folder, tissue_Names,
tissue, tissue_migration_Targets_amount[tissue], migration_cell_List,
overall_Generations, functions);

if (viral_Migration == "YES")
{
migration_of_Cells(source_sequence_Data_folder, tissue_Names,
tissue, tissue_migration_Targets_amount[tissue], migration_cell_List,
overall_Generations, functions);
}
// // ! Calculate Tajima's. Define parameters with gene regions for Tajima's

if (count_tajima_Regions > 0)
Expand Down
2 changes: 1 addition & 1 deletion cancer_Host.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public:
float **sequence_replication_prob_changes,
float **sequence_metastatic_prob_changes,
int &max_sequences_per_File,
float **viral_Migration_Values, int *migration_start_Generation,
string &viral_Migration, float **viral_Migration_Values, int *migration_start_Generation,
int &count_tajima_Regions, int **tajima_regions_Start_Stop,
string &reference_Genome_location,
int *tissue_selection_Position_Count,
Expand Down
Binary file modified main
Binary file not shown.
2 changes: 1 addition & 1 deletion parameters_Cancer/individual_Profiles/node_Master.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

"Terminal load tissues":"1,2,3",

"Metastatic migration":"Yes",
"Metastatic migration":"No",

"Cell migration":{

Expand Down

0 comments on commit 48780df

Please sign in to comment.