1
0
Fork 0
mirror of https://github.com/MillironX/taxprofiler.git synced 2024-11-24 02:59:55 +00:00

Fix final linting problems for template merge

This commit is contained in:
James A. Fellows Yates 2022-09-02 06:07:33 +00:00
parent 8fff741f85
commit e64b3f85a4
2 changed files with 142 additions and 110 deletions

View file

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

View file

@ -3,104 +3,140 @@
"homePage": "https://github.com/nf-core/taxprofiler", "homePage": "https://github.com/nf-core/taxprofiler",
"repos": { "repos": {
"nf-core/modules": { "nf-core/modules": {
"adapterremoval": { "git_url": "https://github.com/nf-core/modules.git",
"git_sha": "879d42c5e28661fe0a5e744c9e2c515868f9e08a" "modules": {
}, "adapterremoval": {
"bbmap/bbduk": { "branch": "master",
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" "git_sha": "879d42c5e28661fe0a5e744c9e2c515868f9e08a"
}, },
"bowtie2/align": { "bbmap/bbduk": {
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" "branch": "master",
}, "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
"bowtie2/build": { },
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" "bowtie2/align": {
}, "branch": "master",
"cat/fastq": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" },
}, "bowtie2/build": {
"centrifuge/centrifuge": { "branch": "master",
"git_sha": "d2726fcf75063960f06b36d2229a4c0966614108" "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
}, },
"centrifuge/kreport": { "cat/fastq": {
"git_sha": "734d0db6079a4aa43b6509b207e5d6feb35d4838" "branch": "master",
}, "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
"custom/dumpsoftwareversions": { },
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" "centrifuge/centrifuge": {
}, "branch": "master",
"diamond/blastx": { "git_sha": "d2726fcf75063960f06b36d2229a4c0966614108"
"git_sha": "3531824af826c16cd252bc5aa82ae169b244ebaa" },
}, "centrifuge/kreport": {
"fastp": { "branch": "master",
"git_sha": "d0a1cbb703a130c19f6796c3fce24fbe7dfce789" "git_sha": "734d0db6079a4aa43b6509b207e5d6feb35d4838"
}, },
"fastqc": { "custom/dumpsoftwareversions": {
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" "branch": "master",
}, "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
"filtlong": { },
"git_sha": "957cb9b83668075f4af101fc99502908cca487e3" "diamond/blastx": {
}, "branch": "master",
"gunzip": { "git_sha": "3531824af826c16cd252bc5aa82ae169b244ebaa"
"git_sha": "9aadd9a6d3f5964476582319b3a1c54a3e3fe7c9" },
}, "fastp": {
"kaiju/kaiju": { "branch": "master",
"git_sha": "8856f127c58f6af479128be8b8df4d42e442ddbe" "git_sha": "d0a1cbb703a130c19f6796c3fce24fbe7dfce789"
}, },
"kaiju/kaiju2krona": { "fastqc": {
"git_sha": "2f0b19240430de6807b1232e6d9d0e8084e8a28f" "branch": "master",
}, "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
"kaiju/kaiju2table": { },
"git_sha": "538dbac98ba9c8f799536cd5a617195501439457" "filtlong": {
}, "branch": "master",
"kraken2/kraken2": { "git_sha": "957cb9b83668075f4af101fc99502908cca487e3"
"git_sha": "abe025677cdd805cc93032341ab19885473c1a07" },
}, "gunzip": {
"krakentools/kreport2krona": { "branch": "master",
"git_sha": "8b2a473f586bed003e72d2b183acc43fc0ddc422" "git_sha": "9aadd9a6d3f5964476582319b3a1c54a3e3fe7c9"
}, },
"krona/ktimporttaxonomy": { "kaiju/kaiju": {
"git_sha": "0e9fd9370ad1845870b8a9c63fcc47d999a1739e" "branch": "master",
}, "git_sha": "8856f127c58f6af479128be8b8df4d42e442ddbe"
"krona/ktimporttext": { },
"git_sha": "cdefbec66999c0b49d8bfeea9d6f9d19056635a2" "kaiju/kaiju2krona": {
}, "branch": "master",
"malt/run": { "git_sha": "2f0b19240430de6807b1232e6d9d0e8084e8a28f"
"git_sha": "be8d7b3293cac26cc63e4dbfb364deb8ed6ec7e5" },
}, "kaiju/kaiju2table": {
"megan/rma2info": { "branch": "master",
"git_sha": "2d38566eca4cc15142b2ffa7c11837569b39aece" "git_sha": "538dbac98ba9c8f799536cd5a617195501439457"
}, },
"metaphlan3": { "kraken2/kraken2": {
"git_sha": "ed4dd1a928ebf4308efb720de878045f7773f8e2" "branch": "master",
}, "git_sha": "abe025677cdd805cc93032341ab19885473c1a07"
"minimap2/align": { },
"git_sha": "1a5a9e7b4009dcf34e6867dd1a5a1d9a718b027b" "krakentools/kreport2krona": {
}, "branch": "master",
"minimap2/index": { "git_sha": "8b2a473f586bed003e72d2b183acc43fc0ddc422"
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" },
}, "krona/ktimporttaxonomy": {
"motus/merge": { "branch": "master",
"git_sha": "b02e648c221e1da17cb589eefe297e61ec9e9c49" "git_sha": "0e9fd9370ad1845870b8a9c63fcc47d999a1739e"
}, },
"motus/profile": { "krona/ktimporttext": {
"git_sha": "b6ed584443ad68ac41e6975994139454a4f23c18" "branch": "master",
}, "git_sha": "cdefbec66999c0b49d8bfeea9d6f9d19056635a2"
"multiqc": { },
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" "malt/run": {
}, "branch": "master",
"porechop": { "git_sha": "be8d7b3293cac26cc63e4dbfb364deb8ed6ec7e5"
"git_sha": "b78e19b9dae3671db2c7d4346fe04452c1debfab" },
}, "megan/rma2info": {
"prinseqplusplus": { "branch": "master",
"git_sha": "f1c5384c31e985591716afdd732cf8c2ae29d05b" "git_sha": "2d38566eca4cc15142b2ffa7c11837569b39aece"
}, },
"samtools/bam2fq": { "metaphlan3": {
"git_sha": "5510ea39fe638594bc26ac34cadf4a84bf27d159" "branch": "master",
}, "git_sha": "ed4dd1a928ebf4308efb720de878045f7773f8e2"
"samtools/view": { },
"git_sha": "6b64f9cb6c3dd3577931cc3cd032d6fb730000ce" "minimap2/align": {
}, "branch": "master",
"untar": { "git_sha": "1a5a9e7b4009dcf34e6867dd1a5a1d9a718b027b"
"git_sha": "e080f4c8acf5760039ed12ec1f206170f3f9a918" },
"minimap2/index": {
"branch": "master",
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
},
"motus/merge": {
"branch": "master",
"git_sha": "b02e648c221e1da17cb589eefe297e61ec9e9c49"
},
"motus/profile": {
"branch": "master",
"git_sha": "b6ed584443ad68ac41e6975994139454a4f23c18"
},
"multiqc": {
"branch": "master",
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
},
"porechop": {
"branch": "master",
"git_sha": "b78e19b9dae3671db2c7d4346fe04452c1debfab"
},
"prinseqplusplus": {
"branch": "master",
"git_sha": "f1c5384c31e985591716afdd732cf8c2ae29d05b"
},
"samtools/bam2fq": {
"branch": "master",
"git_sha": "5510ea39fe638594bc26ac34cadf4a84bf27d159"
},
"samtools/view": {
"branch": "master",
"git_sha": "6b64f9cb6c3dd3577931cc3cd032d6fb730000ce"
},
"untar": {
"branch": "master",
"git_sha": "e080f4c8acf5760039ed12ec1f206170f3f9a918"
}
} }
} }
} }