diff --git a/src/read_sequencing.py b/src/read_sequencing.py index e229af2d183bfdf923ea612954414c66821c4b39..2382f5166cc9b0512e77d2084ff1dbd59189634e 100644 --- a/src/read_sequencing.py +++ b/src/read_sequencing.py @@ -1,4 +1,4 @@ -"""Read Sequencing! +"""Read Sequencing. Simulate the sequencing of reads on the template of terminal fragments and simulates reads of these fragments. Author: Kathleen Moriarty @@ -33,14 +33,15 @@ def read_sequencing( num_reads: number of total reads to simulate read_len: integer of identical read length """ - # Read data from terminal fragment file # Store fragment descriptions in a list frag_desc = [] # type: List[str] with open(frag_file_name, 'r') as f: frag_line = f.readline() + # Store all fragments as a list to parse later frag_list = [] # type: List[str] + # Store combined fragment lines frag_str = "" while frag_line != "": # To stop when the end of file is reached diff --git a/tests/test_read_sequence.py b/tests/test_read_sequence.py index bae061e8ba57519f3f8e2b560e2c373e32f60839..3b1021bb3052b644905777b45858724554ea5d88 100644 --- a/tests/test_read_sequence.py +++ b/tests/test_read_sequence.py @@ -1,4 +1,4 @@ -"""Test Read Sequencing Functionality.""" +"""Test Functionality of Read Sequencing""" # imports from built-in modules from pathlib import Path @@ -13,10 +13,10 @@ from src.read_sequencing import read_sequencing def test_read_sequencing(tmpdir): """Tests the correct number of reads were generated.""" read_sequencing( - frag_file_name=Path('./tests/resources/test_terminal_fragments.txt'), + frag_file_name=Path.cwd() / 'tests/resources/test_terminal_fragments.txt', num_reads=80, read_len=10, output_file_name=tmpdir / 'reads.txt' ) df_out = pd.read_table(tmpdir / 'reads.txt', header=None) - assert df_out.shape[0] == 80 * 3 + assert df_out.shape[0] == 80 * 2