Skip to content

Commit

Permalink
Merge pull request #10 from Australian-Structural-Biology-Computing/p…
Browse files Browse the repository at this point in the history
…atch-yaml

Patch YAML
  • Loading branch information
nbtm-sh authored Dec 3, 2024
2 parents 1a58825 + 09fd530 commit 9787c1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions create_samplesheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ def create_yaml(data, fp):
"sequences": []
}
for row in data:
output_data["sequences"].append({
output_data["sequences"].append({"protein": {
"id": row.name,
"sequence": row.data
})
}})

yaml.dump(output_data, fp, default_flow_style=False)

Expand Down
4 changes: 2 additions & 2 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def test_create_yaml_single_sample(self):
fp_data = fp.read()
fp.close()

self.assertEqual(fp_data, 'sequences:\n- id: TEST\n sequence: AAAAAA\nversion: 1\n')
self.assertEqual(fp_data, 'sequences:\n- protein:\n id: TEST\n sequence: AAAAAA\nversion: 1\n')

def test_create_yaml_multiple_sample(self):
sample_input = []
Expand All @@ -280,7 +280,7 @@ def test_create_yaml_multiple_sample(self):
fp_data = fp.read()
fp.close()

self.assertEqual(fp_data, "sequences:\n- id: TEST1\n sequence: AAAAAA\n- id: TEST2\n sequence: AAAAAA\n- id: TEST3\n sequence: AAAAAA\nversion: 1\n")
self.assertEqual(fp_data, "sequences:\n- protein:\n id: TEST1\n sequence: AAAAAA\n- protein:\n id: TEST2\n sequence: AAAAAA\n- protein:\n id: TEST3\n sequence: AAAAAA\nversion: 1\n")

if __name__ == "__main__":
unittest.main()

0 comments on commit 9787c1b

Please sign in to comment.