From d3ccefa86675430a3f6f9755bdec57cf4945707a Mon Sep 17 00:00:00 2001
From: "kathleen.moriarty" <kathleen.moriarty@unibas.ch>
Date: Wed, 8 Dec 2021 18:15:34 +0100
Subject: [PATCH] added: comments and new lines

---
 src/read_sequencing.py      | 5 +++--
 tests/test_read_sequence.py | 6 +++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/read_sequencing.py b/src/read_sequencing.py
index e229af2..2382f51 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 bae061e..3b1021b 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
-- 
GitLab