oicr-gsi / djerba

Create cancer bioinformatics reports from metadata and workflow output
GNU General Public License v3.0
9 stars 3 forks source link

Prevent failure of R script in case of single RNA sample in a 'cohort' #477

Open nodrogluap opened 1 day ago

nodrogluap commented 1 day ago

Would like to compare a single RNA sample against TCGA using Djerba, which means that the study cohort has a size of one. Normally this should not be an issue, but R has a very annoying 'feature' where data frames with a single column are automatically converted to vectors. This breaks the find_expression.R evaluation logic, but is easily mitigated in this pull request by adding the drop=FALSE argument in three places where the study cohort data frame is sliced up in the code.