1
0
Fork 0
mirror of https://github.com/MillironX/taxprofiler.git synced 2024-11-22 01:26:04 +00:00
This commit is contained in:
maxibor 2022-02-18 13:15:30 +01:00
parent 54a1a4fd45
commit a6cfa0a1ba

View file

@ -1,8 +1,5 @@
#!/usr/bin/env python #!/usr/bin/env python
# TODO nf-core: Update the script to check the samplesheet
# This script is based on the example at: https://raw.githubusercontent.com/nf-core/test-datasets/viralrecon/samplesheet/samplesheet_test_illumina_amplicon.csv
from distutils import extension from distutils import extension
import os import os
import sys import sys
@ -83,7 +80,6 @@ def check_samplesheet(file_in, file_out):
## Check header ## Check header
MIN_COLS = 4 MIN_COLS = 4
# TODO nf-core: Update the column names for the input samplesheet
HEADER = [ HEADER = [
"sample", "sample",
"run_accession", "run_accession",
@ -188,7 +184,7 @@ def check_samplesheet(file_in, file_out):
else: else:
print_error("Invalid combination of columns provided!", "Line", line) print_error("Invalid combination of columns provided!", "Line", line)
## Create sample mapping dictionary = { sample: [ single_end, fastq_1, fastq_2 , fasta, run_accession, instrument_platform] } ## Create sample mapping dictionary = { sample: [ run_accession, instrument_platform, single_end, fastq_1, fastq_2 , fasta ] }
if sample not in sample_mapping_dict: if sample not in sample_mapping_dict:
sample_mapping_dict[sample] = [sample_info] sample_mapping_dict[sample] = [sample_info]
else: else:
@ -215,7 +211,6 @@ def check_samplesheet(file_in, file_out):
for sample in sorted(sample_mapping_dict.keys()): for sample in sorted(sample_mapping_dict.keys()):
for idx, val in enumerate(sample_mapping_dict[sample]): for idx, val in enumerate(sample_mapping_dict[sample]):
fout.write(f"{sample},{','.join(val)}\n") fout.write(f"{sample},{','.join(val)}\n")
# fout.write(f",".join(["{}".format(sample)] + val) + "\n")
else: else:
print_error("No entries to process!", "Samplesheet: {}".format(file_in)) print_error("No entries to process!", "Samplesheet: {}".format(file_in))