Either I'm missing something or there is a little bug in the tutorial's R code. In the step "Below limit of detection", I think the aim is to count the number of transcripts with counts below the LOD, per sample. You do this e.g., with
However, I think doing it this way results in R cycling over the lod vector in a way that LODs from multiple samples are used for measurements within a single sample. This will result in counting errors if LODs vary substantially.
You can easily recreate what I mean in R with the following example:
Dear Mr. Bhattacharya,
Either I'm missing something or there is a little bug in the tutorial's R code. In the step "Below limit of detection", I think the aim is to count the number of transcripts with counts below the LOD, per sample. You do this e.g., with
num_hk_blod = colSums(raw[raw$Code.Class == 'Housekeeping',-c(1:2)] < lod)
However, I think doing it this way results in R cycling over the
lod
vector in a way that LODs from multiple samples are used for measurements within a single sample. This will result in counting errors if LODs vary substantially.You can easily recreate what I mean in R with the following example:
If the misunderstanding is on my side, I'm sorry.
Best wishes, Andi