Skip to content

Commit

Permalink
Merge branch 'dev' into hit_selection
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenceKuhl authored Aug 27, 2024
2 parents 88118c9 + bdb7682 commit 47476a7
Show file tree
Hide file tree
Showing 15 changed files with 67 additions and 24 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Fix cutadapt 3' and 5' no such variable found bug ([#187](https://github.com/nf-core/crisprseq/pull/187))
- Fix design matrix bug that introduced dots instead of a hyphen ([#190](https://github.com/nf-core/crisprseq/pull/190))
- Make output of FluteMLE optional as when some pathways produce bugs some channels are then empty ([#190](https://github.com/nf-core/crisprseq/pull/190))
- Fix a typo in crisprcleanr/normalize, when a user inputs a file ([#192](https://github.com/nf-core/crisprseq/pull/192))

### Deprecated

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,15 @@ Main developers:
We thank the following people for their extensive assistance in the development of this pipeline:

- [@alan-tracey](https://github.com/alan-tracey)
- [@bolenala](https://github.com/bolenala)
- [@ggabernet](https://github.com/ggabernet)
- [@jianhong](https://github.com/jianhong)
- [@joannakraw](https://github.com/joannakraw)
- [@mashehu](https://github.com/mashehu)
- [@metinyazar](https://github.com/metinyazar)
- [@msanvicente](https://github.com/msanvicente)
- [@mschaffer-incyte](https://github.com/mschaffer-incyte)
- [@SusiJo](https://github.com/SusiJo)
- [@joannakraw](https://github.com/joannakraw)
- [@metinyazar](https://github.com/metinyazar)

## Contributions and Support

Expand Down
2 changes: 0 additions & 2 deletions bin/BAGEL.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,6 @@ def calculate_bayes_factors(
print("Iter TrainEss TrainNon TestSet")
sys.stdout.flush()
for loop in range(LOOPCOUNT):
# currentbf = {}
printstr = ""
printstr += str(loop)

Expand Down Expand Up @@ -984,7 +983,6 @@ def calculate_bayes_factors(
#

for loop in range(LOOPCOUNT):
# currentnbf = {}
printstr = ""
printstr += str(loop)

Expand Down
1 change: 0 additions & 1 deletion bin/drugz.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ def calculate_fold_change(
fc_replicate_id = "fc_{replicate}".format(replicate=replicate)
fc_zscore_id = "zscore_" + fc_replicate_id
empirical_bayes_id = "eb_std_{replicate}".format(replicate=replicate)
# one_based_idx = replicate + 1

# Get the control and treatment sample ids for each replicate
control_sample = control_samples[replicate]
Expand Down
7 changes: 6 additions & 1 deletion docs/usage/screening.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ Running MAGeCK MLE and BAGEL2 with a contrast file will also output a Venn diagr

### Running MAGeCK RRA only

MAGeCK RRA performs robust ranking aggregation to identify genes that are consistently ranked highly across multiple replicate screens. To run MAGeCK RRA, you can define the contrasts as previously stated in the last section (with a `.txt` extension) and also specify `--rra`.
MAGeCK RRA performs robust ranking aggregation to identify genes that are consistently ranked highly across multiple replicate screens. To run MAGeCK RRA, you can define the contrasts as previously stated in the last section with --contrasts your_file.txt(with a `.txt` extension) and also specify `--rra`.
MAGeCK RRA performs robust ranking aggregation to identify genes that are consistently ranked highly across multiple replicate screens. To run MAGeCK RRA, you can define the contrasts as previously stated in the last section with `--contrasts your_file.txt` (with a `.txt` extension) and also specify `--rra`.

### Running MAGeCK MLE only

Expand All @@ -109,6 +110,10 @@ This label is not mandatory as in case you are running time series. If you wish

The downstream analysis involves distinguishing essential, non-essential, and target-associated genes. Additionally, it encompasses conducting biological functional category analysis and pathway enrichment analysis for these genes. Furthermore, it provides visualization of genes within pathways, enhancing user exploration of screening data. MAGECKFlute is run automatically after MAGeCK MLE and for each MLE design matrice. If you have used the `--day0_label`, MAGeCKFlute will be ran on all the other conditions. Please note that the DepMap data is used for these plots.

#### Using negative control sgRNAs for MAGeCK MLE

You can add the parameter `--mle_control_sgrna` followed by your file (one non targeting control sgRNA per line) to integrate the control sgRNA in MAGeCK MLE.

### Running BAGEL2

BAGEL2 (Bayesian Analysis of Gene Essentiality with Location) is a computational tool developed by the Hart Lab at Harvard University. It is designed for analyzing large-scale genetic screens, particularly CRISPR-Cas9 screens, to identify genes that are essential for the survival or growth of cells under different conditions. BAGEL2 integrates information about the location of guide RNAs within a gene and leverages this information to improve the accuracy of gene essentiality predictions.
Expand Down
10 changes: 5 additions & 5 deletions modules/local/mageck/flutemle.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ process MAGECK_FLUTEMLE {
tuple val(meta), path(gene_summary)

output:
tuple val(meta), path("MAGeCKFlute_*/Enrichment/*") , emit: enrich
tuple val(meta), path("MAGeCKFlute_*/QC/*") , emit: qc
tuple val(meta), path("MAGeCKFlute_*/Selection/*") , emit: select
tuple val(meta), path("MAGeCKFlute_*/PathwayView/*"), emit: pathwayview
path "versions.yml" , emit: versions
tuple val(meta), path("MAGeCKFlute_*/Enrichment/*") , emit: enrich , optional: true
tuple val(meta), path("MAGeCKFlute_*/QC/*") , emit: qc , optional: true
tuple val(meta), path("MAGeCKFlute_*/Selection/*") , emit: select , optional: true
tuple val(meta), path("MAGeCKFlute_*/PathwayView/*"), emit: pathwayview, optional: true
path "versions.yml" , emit: versions , optional: true

when:
task.ext.when == null || task.ext.when
Expand Down
4 changes: 4 additions & 0 deletions modules/local/matricescreation.nf
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@ process MATRICESCREATION {
dimnames = list(all_samples,
c("Samples", "baseline",
name))))
# R automatically converts "-" to "." in the column names
# so here we re-assign the column names to keep the dashes defined by the user
colnames(design_matrix) <- c("Samples", "baseline", name)
# Set baseline and treatment values in the design matrix
design_matrix[, "Samples"] <- rownames(design_matrix)
design_matrix\$baseline <- 1
design_matrix[treatment_samples, name] <- 1
design_matrix[treatment_samples, paste0(gsub(',', '_', '$meta.treatment'),"_vs_",gsub(",","_",'$meta.reference'))] <- 1
# Print the design matrix to a file
output_file <- paste0(gsub(',', '_', '$meta.treatment' ),"_vs_",gsub(",","_",'$meta.reference'),".txt")
write.table(design_matrix, output_file, sep = "\t", quote = FALSE, row.names=FALSE)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion modules/nf-core/crisprcleanr/normalize/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 15 additions & 4 deletions modules/nf-core/mageck/mle/mageck-mle.diff

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions modules/nf-core/mageck/mle/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ params {
library = null
crisprcleanr = null
contrasts = null
mle_control_sgrna = null
mle_design_matrix = null
count_table = null
fasta = null
Expand Down
4 changes: 4 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@
"exists": true,
"description": "Design matrix used for MAGeCK MLE to call essential genes under multiple conditions while considering sgRNA knockout efficiency"
},
"mle_control_sgrna": {
"type": "string",
"description": "control-sgrna file for MAGeCK MLE"
},
"contrasts": {
"type": "string",
"format": "file-path",
Expand Down
14 changes: 11 additions & 3 deletions subworkflows/local/utils_nfcore_crisprseq_pipeline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,24 @@ workflow INITIALISATION_CHANNEL_CREATION_SCREENING {
ch_design = Channel.fromPath(params.mle_design_matrix)
}


ch_biogrid = Channel.fromPath("$projectDir/assets/biogrid_hgncid_noduplicate_dropna.csv", checkIfExists: true)
ch_hgnc = Channel.fromPath("$projectDir/assets/hgnc_complete_set.txt", checkIfExists: true)

if(params.mle_control_sgrna) {
ch_mle_control_sgrna = Channel.fromPath(params.mle_control_sgrna)
} else {
ch_mle_control_sgrna = []
}

emit:
library = ch_library // channel: library file
crisprcleanr = ch_crisprcleanr // channel: crisprcleanr file or value
design = ch_design // channel: design matrix file
library = ch_library // channel: library file
crisprcleanr = ch_crisprcleanr // channel: crisprcleanr file or value
design = ch_design // channel: design matrix file
mle_control_sgrna = ch_mle_control_sgrna // channel: negative control sgRNA for MAGeCK MLE
biogrid = ch_biogrid // channel: biogrid
hgnc = ch_hgnc // channel: hgnc

}

/*
Expand Down
6 changes: 3 additions & 3 deletions workflows/crisprseq_screening.nf
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ workflow CRISPRSEQ_SCREENING {
}.set { ch_designed_mle }

ch_mle = ch_designed_mle.combine(ch_counts)
MAGECK_MLE_MATRIX (ch_mle)
MAGECK_MLE_MATRIX (ch_mle, INITIALISATION_CHANNEL_CREATION_SCREENING.out.mle_control_sgrna)
ch_versions = ch_versions.mix(MAGECK_MLE_MATRIX.out.versions)
MAGECK_FLUTEMLE(MAGECK_MLE_MATRIX.out.gene_summary)
ch_versions = ch_versions.mix(MAGECK_FLUTEMLE.out.versions)
Expand All @@ -280,7 +280,7 @@ workflow CRISPRSEQ_SCREENING {
if(params.contrasts) {
MATRICESCREATION(ch_contrasts)
ch_mle = MATRICESCREATION.out.design_matrix.combine(ch_counts)
MAGECK_MLE (ch_mle)
MAGECK_MLE (ch_mle, INITIALISATION_CHANNEL_CREATION_SCREENING.out.mle_control_sgrna)
ch_versions = ch_versions.mix(MAGECK_MLE.out.versions)
MAGECK_FLUTEMLE_CONTRASTS(MAGECK_MLE.out.gene_summary)
ch_versions = ch_versions.mix(MAGECK_FLUTEMLE_CONTRASTS.out.versions)
Expand All @@ -290,7 +290,7 @@ workflow CRISPRSEQ_SCREENING {
}
if(params.day0_label) {
ch_mle = Channel.of([id: "day0"]).merge(Channel.of([[]])).merge(ch_counts)
MAGECK_MLE_DAY0 (ch_mle)
MAGECK_MLE_DAY0 (ch_mle, INITIALISATION_CHANNEL_CREATION_SCREENING.out.mle_control_sgrna)
ch_versions = ch_versions.mix(MAGECK_MLE_DAY0.out.versions)
MAGECK_FLUTEMLE_DAY0(MAGECK_MLE_DAY0.out.gene_summary)
ch_versions = ch_versions.mix(MAGECK_FLUTEMLE_DAY0.out.versions)
Expand Down

0 comments on commit 47476a7

Please sign in to comment.