Skip to content

Commit

Permalink
Fixing EditorConfig linting failures
Browse files Browse the repository at this point in the history
  • Loading branch information
atrull314 committed Oct 4, 2023
1 parent 3e4a923 commit caea67c
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 255 deletions.
5 changes: 3 additions & 2 deletions bin/merge_counts.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ message("--- Remove the columns ---")
shared_column_table <- merged_table %>% select(ends_with(".x") | ends_with(".y"))
unshared_column_table <- merged_table %>% select(!(ends_with(".x") | ends_with(".y")))

# We only want to look at merged
# We only want to look at merged
bc_prefixes <- unique(sub("\\..*", "", colnames(shared_column_table)))

# Do rowsums for columns that are the same barcode
Expand All @@ -87,4 +87,5 @@ sessioninfo <- "R_sessionInfo.log"

sink(sessioninfo)
sessionInfo()
sink()
sink()

52 changes: 26 additions & 26 deletions bin/seurat_qc.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,33 @@ library(ggplot2)
#' @return A density plot

plotSingleCellDensity <- function(input_obj,
metadata_variable,
group.by = "orig.ident",
scale_x_axis = FALSE,
geom_density_level = 0.2) {

metadata <- dplyr::select(
input_obj@meta.data,
{{ metadata_variable }},
{{ group.by }}
)

meta_density <- ggplot2::ggplot(
metadata,
aes(
x = .data[[metadata_variable]],
color = .data[[group.by]],
fill = .data[[group.by]]
metadata_variable,
group.by = "orig.ident",
scale_x_axis = FALSE,
geom_density_level = 0.2) {

metadata <- dplyr::select(
input_obj@meta.data,
{{ metadata_variable }},
{{ group.by }}
)
) +

meta_density <- ggplot2::ggplot(
metadata,
aes(
x = .data[[metadata_variable]],
color = .data[[group.by]],
fill = .data[[group.by]]
)
) +
geom_density(alpha = geom_density_level) +
theme_classic()

if (scale_x_axis == TRUE) {
return(meta_density + scale_x_log10())
} else {
return(meta_density)
}
if (scale_x_axis == TRUE) {
return(meta_density + scale_x_log10())
} else {
return(meta_density)
}
}

###############################
Expand Down Expand Up @@ -102,9 +102,9 @@ total_reads <- as.numeric(gsub("([0-9]+).*$", "\\1", flagstat_lines[index_nums])
# Create the Seurat object
#NOTE: we do not perform any pre-filtering at this point
seurat_obj <- CreateSeuratObject(counts = cell_bc_matrix,
min.cells = 0,
min.features = 0,
project = opt$id)
min.cells = 0,
min.features = 0,
project = opt$id)

######################
### GENERATE PLOTS ###
Expand Down
7 changes: 3 additions & 4 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ if (!params.skip_qc){
]
}
}

process {
withName:'.*:BAM_SORT_STATS_SAMTOOLS_FILTERED:BAM_STATS_SAMTOOLS:.*' {
ext.prefix = { "${meta.id}.mapped_only" }
Expand All @@ -155,7 +155,7 @@ if (!params.skip_qc){
]
}
}

process {
withName:'.*:BAM_SORT_STATS_SAMTOOLS_CORRECTED:BAM_STATS_SAMTOOLS:.*' {
ext.prefix = { "${meta.id}.corrected" }
Expand All @@ -166,7 +166,7 @@ if (!params.skip_qc){
]
}
}

process {
withName:'.*:BAM_SORT_STATS_SAMTOOLS_DEDUP:BAM_STATS_SAMTOOLS:.*' {
ext.prefix = { "${meta.id}.dedup" }
Expand Down Expand Up @@ -209,7 +209,6 @@ process {
path: { "${params.outdir}/references/paftools" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }

]
}
}
Expand Down
215 changes: 0 additions & 215 deletions module_diffs.txt

This file was deleted.

8 changes: 4 additions & 4 deletions modules/local/create_regex.nf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ process CREATE_REGEX {
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/python:3.8.3':
'biocontainers/python:3.8.3' }"

input:
val cell_barcode_pattern
val identifier_pattern
Expand All @@ -22,13 +22,13 @@ process CREATE_REGEX {

script:
def args = task.ext.args ?: ''

"""
OUT_FILE="regex_patterns.txt"
if [[ "${cell_barcode_pattern}" ]]; then
echo -e "REGEX: ${cell_barcode_pattern}" > \${OUT_FILE}
echo -e "UMI_TOOLS: N/A" >> \${OUT_FILE}
echo -e "REGEX: ${cell_barcode_pattern}" > \${OUT_FILE}
echo -e "UMI_TOOLS: N/A" >> \${OUT_FILE}
else
create_regex.py -i "${identifier_pattern}" \\
Expand Down
2 changes: 1 addition & 1 deletion modules/local/isoquant.nf
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ process ISOQUANT {
isoquant: \$(isoquant.py -v 2>&1)
END_VERSIONS
"""

}
}
2 changes: 1 addition & 1 deletion modules/local/nanofilt.nf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ process NANOFILT {
IDX=\$(basename ${reads} | cut -f2 -d'.')
FILE_PREFIX=\${FILE_PREFIX}.\${IDX}
fi
cat $reads | NanoFilt $args > \${FILE_PREFIX}.filtered.fastq
cat $reads | NanoFilt $args > \${FILE_PREFIX}.filtered.fastq
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
2 changes: 1 addition & 1 deletion modules/local/prowlertrimmer.nf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ process PROWLERTRIMMER {
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

"""
FILE_PREFIX=${prefix}
if [ ${params.split_amount} -gt 0 ]; then
Expand Down
2 changes: 1 addition & 1 deletion modules/local/reformat_whitelist.nf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ process REFORMAT_WHITELIST {
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

"""
reformat_whitelist.py \\
-i ${whitelist} \\
Expand Down

0 comments on commit caea67c

Please sign in to comment.