1
0
Fork 0
mirror of https://github.com/MillironX/taxprofiler.git synced 2024-11-25 22:09:55 +00:00

Merge pull request #116 from nf-core/nf-core-template-merge-2.5.1

Important! Template update for nf-core/tools v2.5.1
This commit is contained in:
James A. Fellows Yates 2022-09-02 13:47:39 +02:00 committed by GitHub
commit c9a7797682
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 25 deletions

View file

@ -55,11 +55,10 @@ jobs:
sudo update-locale LANG=en_US.UTF-8
- name: Run pipeline with test data
# TODO nf-core: You can customise CI pipeline run tests as required
# For example: adding multiple test runs with different parameters
# Remember that you can parallelise this by using strategy.matrix
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results ${{ matrix.parameters }}
uses: Wandalen/wretry.action@v1.0.11
with:
command: nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results ${{ matrix.parameters }}
attempt_limit: 3
motus:
name: Test mOTUs with workflow parameters
@ -79,14 +78,9 @@ jobs:
uses: actions/checkout@v2
- name: Install Nextflow
env:
NXF_VER: ${{ matrix.NXF_VER }}
# Uncomment only if the edge release is more recent than the latest stable release
# See https://github.com/nextflow-io/nextflow/issues/2467
# NXF_EDGE: ${{ matrix.NXF_EDGE }}
run: |
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/
uses: nf-core/setup-nextflow@v1
with:
version: "${{ matrix.NXF_VER }}"
- name: Show current locale
run: locale

View file

@ -6,10 +6,10 @@ import sys
import errno
import argparse
def parse_args(args=None):
Description = (
"Reformat nf-core/taxprofiler samplesheet file and check its contents."
)
Description = "Reformat nf-core/taxprofiler samplesheet file and check its contents."
Epilog = "Example usage: python check_samplesheet.py <FILE_IN> <FILE_OUT>"
parser = argparse.ArgumentParser(description=Description, epilog=Epilog)
@ -17,6 +17,7 @@ def parse_args(args=None):
parser.add_argument("FILE_OUT", help="Output file.")
return parser.parse_args(args)
def make_dir(path):
if len(path) > 0:
try:
@ -25,6 +26,7 @@ def make_dir(path):
if exception.errno != errno.EEXIST:
raise exception
def print_error(error, context="Line", context_str=""):
error_str = "ERROR: Please check samplesheet -> {}".format(error)
if context != "" and context_str != "":
@ -34,6 +36,7 @@ def print_error(error, context="Line", context_str=""):
print(error_str)
sys.exit(1)
def check_samplesheet(file_in, file_out):
"""
This function checks that the samplesheet follows the following structure:
@ -117,9 +120,7 @@ def check_samplesheet(file_in, file_out):
num_cols = len([x for x in lspl if x])
if num_cols < MIN_COLS:
print_error(
"Invalid number of populated columns (minimum = {})!".format(
MIN_COLS
),
"Invalid number of populated columns (minimum = {})!".format(MIN_COLS),
"Line",
line,
)
@ -182,13 +183,9 @@ def check_samplesheet(file_in, file_out):
## Auto-detect paired-end/single-end
if sample and fastq_1 and fastq_2: ## Paired-end short reads
sample_info.extend(["0", fastq_1, fastq_2, fasta])
elif (
sample and fastq_1 and not fastq_2
): ## Single-end short/long fastq reads
elif sample and fastq_1 and not fastq_2: ## Single-end short/long fastq reads
sample_info.extend(["1", fastq_1, fastq_2, fasta])
elif (
sample and fasta and not fastq_1 and not fastq_2
): ## Single-end long reads
elif sample and fasta and not fastq_1 and not fastq_2: ## Single-end long reads
sample_info.extend(["1", fastq_1, fastq_2, fasta])
elif fasta and (fastq_1 or fastq_2):
print_error(

10
pyproject.toml Normal file
View file

@ -0,0 +1,10 @@
# Config file for Python. Mostly used to configure linting of bin/check_samplesheet.py with Black.
# Should be kept the same as nf-core/tools to avoid fighting with template synchronisation.
[tool.black]
line-length = 120
target_version = ["py37", "py38", "py39", "py310"]
[tool.isort]
profile = "black"
known_first_party = ["nf_core"]
multi_line_output = 3