Commit 22b46175 authored by Sam Nooij's avatar Sam Nooij
Browse files

Fix bug with reading reads files from sample sheet

parent ce51c184
......@@ -112,7 +112,7 @@ Output: a list of files to move or copy.
if sample_sheet.exists():
print("Sample sheet '%s' has been detected." % sample_sheet)
print("Reading sample sheet to infer required samples/data files.")
SAMPLES = {}
with open(sample_sheet) as sample_sheet_file:
......@@ -134,10 +134,10 @@ Output: a list of files to move or copy.
#report the number of missing files
missing_trimmed_files = 0
missing_scaffolds_files = 0
trimmed_reads_files = []
for sample in SAMPLES:
trimmed_reads_files = []
forward_filename = sample + "_pR1.fq"
forward_trimmed_reads = input_dir / "data" / "cleaned_fastq" / forward_filename
......@@ -146,7 +146,7 @@ Output: a list of files to move or copy.
else:
print("Forward trimmed reads for sample %s were not found." % sample)
missing_trimmed_files += 1
reverse_filename = sample + "_pR2.fq"
reverse_trimmed_reads = input_dir / "data" / "cleaned_fastq" / reverse_filename
......@@ -155,7 +155,7 @@ Output: a list of files to move or copy.
else:
print("Reverse trimmed reads for sample %s were not found." % sample)
missing_trimmed_files += 1
unpaired_filename = sample + "_unpaired.fq"
unpaired_trimmed_reads = input_dir / "data" / "cleaned_fastq" / unpaired_filename
......@@ -180,7 +180,7 @@ Output: a list of files to move or copy.
print("\nDone scanning for trimmed reads and scaffolds.")
print("%i and %i files are missing for each, respectively." % (missing_trimmed_files, missing_scaffolds_files))
else:
print("Sample sheet from Jovian not detected.")
print("Attempting to find Jovian output files without sample sheet.")
......@@ -205,7 +205,7 @@ Output: a list of files to move or copy.
print(" 4. results/multiqc_data/multiqc_trimmomatic.txt")
classifications_table = input_dir / "results" / "all_taxClassified.tsv"
if classifications_table.exists():
pass
else:
......@@ -360,7 +360,7 @@ def main():
for trimmed_file in input_dict["Trimmed_reads"]:
move_file(trimmed_file, Path(main_output / "data" / "raw" / "trimmed_reads" / trimmed_file.name))
for scaffold_file in input_dict["Filtered_scaffolds"]:
move_file(scaffold_file, Path(main_output / "data/" / "raw" / "scaffolds" / scaffold_file.name))
......@@ -371,14 +371,14 @@ def main():
move_file(input_dict["Read_counts_table"], Path(main_output / "data" / "raw" / "Mapped_read_counts.tsv"))
move_file(input_dict["Trimmomatic_table"], Path(main_output / "data" / "raw" / "multiqc_trimmomatic.txt"))
elif mode == "copy":
print("Copying files from %s to %s" % (arguments.input, arguments.output))
copy_file(input_dict["Sample_sheet"], Path(main_output / "data" / "raw"))
for trimmed_file in input_dict["Trimmed_reads"]:
copy_file(trimmed_file, Path(main_output / "data" / "raw" / "trimmed_reads" / trimmed_file.name))
for scaffold_file in input_dict["Filtered_scaffolds"]:
copy_file(scaffold_file, Path(main_output / "data/" / "raw" / "scaffolds" / scaffold_file.name))
......@@ -396,7 +396,7 @@ def main():
for trimmed_file in input_dict["Trimmed_reads"]:
link_file(trimmed_file, Path(main_output / "data" / "raw" / "trimmed_reads" / trimmed_file.name))
for scaffold_file in input_dict["Filtered_scaffolds"]:
link_file(scaffold_file, Path(main_output / "data/" / "raw" / "scaffolds" / scaffold_file.name))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment