From 9b2d791569ecf05489edd3402f5d1b75cd9b949c Mon Sep 17 00:00:00 2001
From: Samuel Mondal <mondal0000@>
Date: Tue, 15 Nov 2022 10:25:46 +0100
Subject: [PATCH] restructuring the function

---
 sequence_extractor/exon_concatenation.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/sequence_extractor/exon_concatenation.py b/sequence_extractor/exon_concatenation.py
index c5348ac..ccc0103 100644
--- a/sequence_extractor/exon_concatenation.py
+++ b/sequence_extractor/exon_concatenation.py
@@ -1,6 +1,7 @@
-def exon_concatenation:
-	fa = open("fasta.fa",'r')
+def exon_concatenation(filename):
+	fa = open(filename,'r')
 	lines = fa.readlines()
+	to_write_to_file = []
 	for x in range(int(len(lines)/2)):
 		if x == 0:
 			annotation = lines[0]
@@ -9,5 +10,10 @@ def exon_concatenation:
 			if lines[2*x] == lines[2*(x-1)]:
 				read+= lines[(2*x)+1]
 			else:
+				to_write_to_file.append(annotation)
+				to_write_to_file.append(read)
 				annotation = lines[2*x]
 				read = lines[(2*x)+1]
+	to_write_to_file.append(annotation)
+	to_write_to_file.append(read)
+	return to_write_to_file
\ No newline at end of file
-- 
GitLab