R/OrganoidsToolBox.R
patientInfoMethoSet.Rd
Simple demo patient information dataset. The information is related to the organoids present in the 'drugScreening' dataset.
data(patientInfoMethoSet)
a data.frame
with the following columns:
organoid_id
a character
string representing the
organoid identifier.
patient_id
a character
string representing the patient
identifier.
ancestry
a character
string representing the patient
genetic ancestry.
BMI
a character
string representing the patient
BMI class.
getClassOneDrug
for selecting the samples
with sensitive and resistant behavior for a
specific drug screening dataset.
selectNoReplicateOrganoids
for selecting
the unrelated samples (only one sample per patient) from a drug screening
dataset.
fisherCategoricalVariable
for running Fisher tests
in the sensitive and resistant groups using a categorical value
from a drug screening dataset.
## Load drug screen dataset for methotrexate dataset
data(drugScreening)
## Load patient information dataset for methotrexate dataset
data(patientInfoMethoSet)
## Retain unreplicated samples
cleanData <- selectNoReplicateOrganoids(drugScreening=drugScreeningMethoSet,
patientInfo=patientInfoMethoSet)
## Calculate the extreme organoids for the methotrexate drug screening
## using a quantile of 1/3
results <- getClassOneDrug(drugScreening=cleanData,
drugName="Methotrexate", study="MEGA-TEST", screenType="TEST-01",
doseType="Averaged", quantile=1/4)
## The information of the extreme organoids is found it the 'extreme' entry
head(results$extreme)
#> organoid_id relative_auc group
#> 1 hT402 5.477998 SENSITIVE
#> 2 hT209 14.427644 SENSITIVE
#> 3 hT204 16.741371 SENSITIVE
#> 4 hT598 19.086306 SENSITIVE
#> 5 hT468 19.532156 SENSITIVE
#> 6 hT317 22.479160 SENSITIVE
## Fisher test on BMI
fisherT <- fisherCategoricalVariable(drugQuantile=results, category="BMI")
fisherT
#> $Fisher
#>
#> Fisher's Exact Test for Count Data
#>
#> data: allTable
#> p-value = 2.201e-05
#> alternative hypothesis: two.sided
#>
#>
#> $table
#> Normal Overweight Obese Underweight
#> SENSITIVE 25 2 3 3
#> RESISTANT 12 18 3 0
#>
#> $category
#> [1] "BMI"
#>