Skip to content

Commit

Permalink
Cleaning up, process_output.py outputs the input for now.
Browse files Browse the repository at this point in the history
  • Loading branch information
emarinier committed Dec 11, 2024
1 parent d579c35 commit 6ee6358
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
11 changes: 4 additions & 7 deletions bin/process_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,11 @@ def main(argv=None):
input = Path(args.input)
output = Path(args.output)

headers = ["query", "reference", "distance"]
results = [["A", "B", "1"], ["C", "D", "2"], ["E", "F", "3"]]
with open(output, "w") as output_file, \
open(input, "r") as input_file:

with open(output, "w") as output_file:
output_file.write((",").join(headers) + "\n")

for line in results:
output_file.write((",").join(line) + "\n")
for line in input_file:
output_file.write(line)

print(f"Output written to [{output}]")

Expand Down
4 changes: 2 additions & 2 deletions modules/local/append_metadata/main.nf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
process APPEND_METADATA {
tag "append_metadata"
tag "Appends metadata to distances"
label 'process_single'

input:
val distances_path // cluster data as a TSV path
val distances_path // distance data as a TSV path
// this needs to be "val", because "path"
// won't stage the file correctly for exec
val metadata_rows // metadata rows (no headers) to be appened, list of lists
Expand Down
4 changes: 2 additions & 2 deletions modules/local/process_output/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ process PROCESS_OUTPUT {
path(distances)

output:
path("results.csv"), emit: results
path("results.tsv"), emit: results
path "versions.yml", emit: versions

when:
Expand All @@ -21,7 +21,7 @@ process PROCESS_OUTPUT {
process_output.py \\
$args \\
--input $distances \\
--output results.csv
--output results.tsv
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down

0 comments on commit 6ee6358

Please sign in to comment.