Skip to content

Commit

Permalink
Fix more whitespace issues from linting
Browse files Browse the repository at this point in the history
  • Loading branch information
samuell committed Nov 28, 2024
1 parent 2b18c82 commit e92ae56
Show file tree
Hide file tree
Showing 12 changed files with 105 additions and 118 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ testing/
testing*
*.pyc
bin/
LICENSE
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@
#
# This also goes for command substitution, so rather than:
#
# echo "Lines in file:" $(wc -l somefile.txt)
# echo "Lines in file:" $(wc -l somefile.txt)
#
# ... you would write:
#
# echo "Lines in file:" $$(wc -l somefile.txt)
# echo "Lines in file:" $$(wc -l somefile.txt)
#
# 2. Makefiles also use some special variables with special meaning, to access
# things like the output and input files:
Expand Down Expand Up @@ -119,9 +119,9 @@
# like so:
#
# name_of_rule: dependency1 \
# dependency2 \
# dependency3 \
# dependency4 \
# dependency2 \
# dependency3 \
# dependency4 \
# ==============================================================================
# Various definitions
Expand All @@ -140,9 +140,9 @@ MNT_ROOT := /$(shell readlink -f . | cut -d"/" -f2)
INSTALL_LOG := "$(SCRIPT_DIR)/.install.log"

define log_message
@echo "--------------------------------------------------------------------------------" | tee -a $(INSTALL_LOG);
@echo "$$(date "+%Y-%m-%d %H:%M:%S"): $1" | tee -a $(INSTALL_LOG);
@echo "--------------------------------------------------------------------------------" | tee -a $(INSTALL_LOG);
@echo "--------------------------------------------------------------------------------" | tee -a $(INSTALL_LOG);
@echo "$$(date "+%Y-%m-%d %H:%M:%S"): $1" | tee -a $(INSTALL_LOG);
@echo "--------------------------------------------------------------------------------" | tee -a $(INSTALL_LOG);
endef

# ==============================================================================
Expand All @@ -152,10 +152,10 @@ endef
install: assets/databases/emu_database/species_taxid.fasta assets/databases/emu_database/taxonomy.tsv assets/databases/krona/taxonomy/taxonomy.tab

assets/databases/emu_database/species_taxid.fasta: assets/databases/emu_database/species_taxid.fasta.gz
zcat $< > $@
zcat $< > $@

assets/databases/emu_database/taxonomy.tsv: assets/databases/emu_database/taxonomy.tsv.gz
zcat $< > $@
zcat $< > $@

assets/databases/krona/taxonomy/taxonomy.tab: assets/databases/krona/taxonomy/taxonomy.tab.gz
zcat $< > $@
zcat $< > $@
23 changes: 11 additions & 12 deletions bin/generate_input.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ trap 'exit_status="$?" && echo "Error occurred on line $LINENO: $BASH_COMMAND" &

# Usage message
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <directory>"
exit 1
echo "Usage: $0 <directory>"
exit 1
fi


Expand All @@ -20,15 +20,15 @@ directory=$(realpath "$directory")
ls -1 "$directory"/*fastq.gz > "reads.txt"
echo "sample,fastq_1,fastq_2" > "samplesheet_merged.csv"
while IFS= read -r line; do
# Get the filename
read1_n=$(basename "$line")
# Full path to forward read
read1_n_path="${directory}/${read1_n}"
# Entry name (everything in the filename before ".fastq.gz")
sample_n=$(echo "$read1_n" | sed 's/\.fastq\.gz//')
# Append to the sample_sheet.csv file
echo "${sample_n},${read1_n_path}," >> "samplesheet_merged.csv"
echo
# Get the filename
read1_n=$(basename "$line")
# Full path to forward read
read1_n_path="${directory}/${read1_n}"
# Entry name (everything in the filename before ".fastq.gz")
sample_n=$(echo "$read1_n" | sed 's/\.fastq\.gz//')
# Append to the sample_sheet.csv file
echo "${sample_n},${read1_n_path}," >> "samplesheet_merged.csv"
echo
done < "reads.txt"

cat "./samplesheet_merged.csv"
Expand All @@ -37,4 +37,3 @@ echo "file saved as samplesheet_merged.csv"
echo
rm -f ./reads.txt
echo "Script finished"

25 changes: 12 additions & 13 deletions bin/merge_barcodes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ trap 'exit_status="$?" && echo Failed on line: $LINENO at command: $BASH_COMMAND
# if not 2 arguments passed, quit
if [ $# -ne 2 ]
then
echo "arguments are missing to start script. 2 argumens are expected"
exit 1
echo "arguments are missing to start script. 2 argumens are expected"
exit 1
fi

# arguments
Expand All @@ -15,22 +15,21 @@ fastq_pass_dir_out="$2"
parent_directory=$(dirname "$fastq_pass_dir_out")

if [ ! -d "$parent_directory" ]; then
echo "Parent directory for $fastq_pass_dir_out does not exist: $parent_directory"
exit 1
echo "Parent directory for $fastq_pass_dir_out does not exist: $parent_directory"
exit 1
fi

if [ ! -d "$fastq_pass_dir_out" ]; then
mkdir "$fastq_pass_dir_out"
echo "Directory created: $fastq_pass_dir_out"
mkdir "$fastq_pass_dir_out"
echo "Directory created: $fastq_pass_dir_out"
else
echo "Directory already exists: $fastq_pass_dir_out"
echo "Directory already exists: $fastq_pass_dir_out"
fi

for i in "$fastq_pass_dir_in"/barcode* ; do
barcode_path=$(realpath "$i")
echo "barcode path $barcode_path"
barcode_name=$(basename "$barcode_path")
echo "barcode_name $barcode_name"
cat "$barcode_path/"*".fastq.gz" > "$fastq_pass_dir_out/${barcode_name}.fastq.gz"
barcode_path=$(realpath "$i")
echo "barcode path $barcode_path"
barcode_name=$(basename "$barcode_path")
echo "barcode_name $barcode_name"
cat "$barcode_path/"*".fastq.gz" > "$fastq_pass_dir_out/${barcode_name}.fastq.gz"
done

27 changes: 12 additions & 15 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -102,23 +102,23 @@ process {
]
}
withName: EMU_ABUNDANCE {
publishDir = [
publishDir = [
[
path: { "${params.outdir}/results" },
mode: params.publish_dir_mode,
pattern: '*{.tsv,txt}'
path: { "${params.outdir}/results" },
mode: params.publish_dir_mode,
pattern: '*{.tsv,txt}'
],
[
path: { "${params.outdir}/results" },
mode: params.publish_dir_mode,
pattern: '*{.sam}',
enabled: params.keep_files,
path: { "${params.outdir}/results" },
mode: params.publish_dir_mode,
pattern: '*{.sam}',
enabled: params.keep_files,
],
[
path: { "${params.outdir}/results" },
mode: params.publish_dir_mode,
pattern: '*{.fa}',
enabled: params.output_unclassified
path: { "${params.outdir}/results" },
mode: params.publish_dir_mode,
pattern: '*{.fa}',
enabled: params.output_unclassified
],

]
Expand Down Expand Up @@ -176,7 +176,4 @@ process {
]
]
}



}
14 changes: 7 additions & 7 deletions lib/NfcoreTemplate.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,14 @@ class NfcoreTemplate {
Map colors = logColours(monochrome_logs)
String workflow_version = NfcoreTemplate.version(workflow)
String.format(
"""\n
"""\n
${dashedLine(monochrome_logs)}
${colors.blue} _____ __ __ _____ __ __ _____
${colors.blue} / ____| \\/ |/ ____| /_ | / / / ____|
${colors.blue} | | __| \\ / | (___ ______| |/ /_| (___
${colors.blue} | | |_ | |\\/| |\\___ \\______| | '_ \\\\___ \\
${colors.blue} | |__| | | | |____) | | | (_) |___) |
${colors.blue} \\_____|_| |_|_____/ |_|\\___/_____/
${colors.blue} _____ __ __ _____ __ __ _____
${colors.blue} / ____| \\/ |/ ____| /_ | / / / ____|
${colors.blue} | | __| \\ / | (___ ______| |/ /_| (___
${colors.blue} | | |_ | |\\/| |\\___ \\______| | '_ \\\\___ \\
${colors.blue} | |__| | | | |____) | | | (_) |___) |
${colors.blue} \\_____|_| |_|_____/ |_|\\___/_____/
${colors.purple} ${workflow.manifest.name} ${workflow_version}${colors.reset}
Expand Down
8 changes: 4 additions & 4 deletions lib/WorkflowGmsemu.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ class WorkflowGmsemu {
genomeExistsError(params, log)


// if (!params.fasta) {
// log.error "Genome fasta file not specified with e.g. '--fasta genome.fa' or via a detectable config file."
// System.exit(1)
// }
// if (!params.fasta) {
// log.error "Genome fasta file not specified with e.g. '--fasta genome.fa' or via a detectable config file."
// System.exit(1)
// }
}

//
Expand Down
10 changes: 5 additions & 5 deletions modules/local/generate_input/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ process GENERATE_INPUT {

debug true //print to stdout. debugging

// Software MUST be pinned to channel (i.e. "bioconda"), version (i.e. "1.10").
// For Conda, the build (i.e. "h9402c20_2") must be EXCLUDED to support installation on different operating systems.
// Software MUST be pinned to channel (i.e. "bioconda"), version (i.e. "1.10").
// For Conda, the build (i.e. "h9402c20_2") must be EXCLUDED to support installation on different operating systems.
conda "conda-forge::python=3.9"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/python:3.9':
'quay.io/biocontainers/python:3.9' }"

input:
path(merged_files)
path(merged_files)

output:
// publishDir 'fastq_pass_merged', mode: 'move'
path '*amplesheet_merged.csv' , emit : sample_sheet_merged
// publishDir 'fastq_pass_merged', mode: 'move'
path '*amplesheet_merged.csv' , emit : sample_sheet_merged
script:
"""
generate_input.sh $merged_files
Expand Down
17 changes: 7 additions & 10 deletions modules/local/merge_barcodes/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,25 @@
process MERGE_BARCODES {
debug true //print to stdout



// Software MUST be pinned to channel (i.e. "bioconda"), version (i.e. "1.10").
// For Conda, the build (i.e. "h9402c20_2") must be EXCLUDED to support installation on different operating systems.
// Software MUST be pinned to channel (i.e. "bioconda"), version (i.e. "1.10").
// For Conda, the build (i.e. "h9402c20_2") must be EXCLUDED to support installation on different operating systems.
conda "conda-forge::python=3.9"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/python:3.9':
'quay.io/biocontainers/python:3.9' }"


input:
path('fastq_pass')
path('fastq_pass')

output:
// publishDir 'fastq_pass_merged', mode: 'move'
// publishDir 'fastq_pass_merged', mode: 'move'
// path('*fastq.gz') , emit : fastq_files_merged
path('fastq_pass_merged/*fastq.gz') , emit : fastq_files_merged
path('fastq_pass_merged') , emit : fastq_dir_merged
path('fastq_pass_merged/*fastq.gz') , emit : fastq_files_merged
path('fastq_pass_merged') , emit : fastq_dir_merged

script:
"""
merge_barcodes.sh $fastq_pass fastq_pass_merged
"""
}

17 changes: 6 additions & 11 deletions modules/local/merge_barcodes_samplesheet/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,25 @@
process MERGE_BARCODES_SAMPLESHEET {
debug true //print to stdout. debugging



// Software MUST be pinned to channel (i.e. "bioconda"), version (i.e. "1.10").
// For Conda, the build (i.e. "h9402c20_2") must be EXCLUDED to support installation on different operating systems.
// Software MUST be pinned to channel (i.e. "bioconda"), version (i.e. "1.10").
// For Conda, the build (i.e. "h9402c20_2") must be EXCLUDED to support installation on different operating systems.
conda "conda-forge::python=3.9"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/python:3.9':
'quay.io/biocontainers/python:3.9' }"



input:
path('barcodes_samplesheet')
path('fastq_pass')
path('barcodes_samplesheet')
path('fastq_pass')


output:
// publishDir 'fastq_pass_merged', mode: 'move'
path('fastq_pass_merged/*fastq.gz') , emit : fastq_files_merged
path('fastq_pass_merged') , emit : fastq_dir_merged

script:
"""
merge_barcodes_samplesheet.py $barcodes_samplesheet fastq_pass_merged $fastq_pass
"""
}

16 changes: 8 additions & 8 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ params {
input = null
db = null

// reads = null
//reads = null
seqtype = "map-ont"
min_abundance = 0.0001
minimap_max_alignments = 50
Expand All @@ -23,27 +23,27 @@ params {
output_unclassified = true


//
// porechop_abi
//
// porechop_abi
adapter_trimming = false

//
// filtlong filtering
//
// filtlong filtering
quality_filtering = true
longread_qc_qualityfilter_minlength = 1200
longread_qc_qualityfilter_maxlength = 1800
longread_qc_qualityfilter_min_mean_q = 94

//Save the trimmed reads
// Save the trimmed reads
save_preprocessed_reads = false

// krona
// Krona
run_krona = true
krona_taxonomy_tab = "$projectDir/assets/databases/krona/taxonomy/taxonomy.tab"

// For barcode folders
merge_fastq_pass = null
barcodes_samplesheet = null
barcodes_samplesheet = null

// References
// MultiQC options
Expand Down
Loading

0 comments on commit e92ae56

Please sign in to comment.