MPUSP / nf-core-crispriscreen

Process next generation sequencing data obtained from CRISPRi repression library screenings
MIT License
4 stars 2 forks source link

If replicates were taken on different dates, calculation of correlation in calculate_fitness.R fails #21

Closed ute-hoffmann closed 1 year ago

ute-hoffmann commented 1 year ago

Description of the bug

If replicates were taken on different dates, several rows with the exact same sgRNA_index, log2FC, condition and time are fed into the function determine_corr in calculate_fitness.R (line 311). Hence, the correlation matrix cannot be computed correctly and the function fails.

Quick-and-dirty fix: add lines DESeq_result_table$date <- NULL DESeq_result_table <- unique(DESeq_result_table) in calculate_fitness.R, line 300ff

Command used and terminal output

Calculating sgRNA efficiency and correlation.
  Error in `dplyr::mutate()`:
  ℹ In argument: `sgRNA_correlation = determine_corr(sgRNA_index,
    log2FoldChange, condition, time)`.
  ℹ In group 1: `sgRNA_target = "AT103"`.
  Caused by error in `stats::cor()`:
  ! 'x' must be numeric
  Backtrace:

       ▆

    1. ├─... %>% ...

    2. ├─dplyr::mutate(...)

    3. ├─dplyr:::mutate.data.frame(...)

    4. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by)

Relevant files

No response

System information

No response