Skip to content

Commit

Permalink
moved imports for bio
Browse files Browse the repository at this point in the history
  • Loading branch information
raphenya committed Sep 7, 2023
1 parent 734d5b5 commit 1fa17c5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/Analyser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from app.settings import *
from Bio import SeqIO

class Analyser(object):
"""Class to find analyse fasta files."""
Expand All @@ -24,4 +25,3 @@ def run(self):
continue
d[checksum] = record.description
checksums.add(checksum)

9 changes: 5 additions & 4 deletions app/Filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from app.Database import Database
from app.ConvertRGIJsonToTSV import ConvertJsonToTSV
from app.settings import *
from Bio import SeqIO

import hashlib
import multiprocessing
Expand Down Expand Up @@ -88,8 +89,8 @@ def prepare_output(self):
os.path.join(self.working_directory,"{}.temp.{}.json".format(file_name, "overexpression")), \
os.path.join(self.working_directory,"{}.temp.{}.json".format(file_name, "rrna"))
)
# combine 3 json files
obj.combine_jsons()
# combine 3 json files
obj.combine_jsons()
# write tsv
obj.run()

Expand All @@ -104,7 +105,7 @@ def process_xml_file(self):
prepare_output_thread = multiprocessing.Process(target=self.prepare_output, args=())
prepare_output_thread.start()
prepare_output_thread.join()
if prepare_output_thread.exitcode:
if prepare_output_thread.exitcode:
raise Exception()
cleanup_thread = multiprocessing.Process(target=self.cleanup, args=())
cleanup_thread.start()
Expand All @@ -125,7 +126,7 @@ def process_rrna(self, model_type="rrna"):

file_name = os.path.basename(self.input_sequence)
with open(os.path.join(self.working_directory,"{}.{}.json".format(file_name, model_type)), 'w') as fout:
fout.write(json.dumps(res))
fout.write(json.dumps(res))

# with open(os.path.splitext(self.output_file)[0]+".{}.json".format(model_type), 'w') as fout:
# fout.write(json.dumps(res))
Expand Down
2 changes: 1 addition & 1 deletion app/ORF.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from app.settings import os, SeqIO, logger
from app.settings import os, logger
import contextlib, tempfile, time, fileinput, math, multiprocessing, shutil
from multiprocessing.pool import ThreadPool
import pyrodigal
Expand Down
1 change: 1 addition & 0 deletions app/OverexpressionModel.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from app.Base import BaseModel
from app.settings import *
from Bio.Blast import NCBIXML
from Bio.Seq import Seq

class Overexpression(BaseModel):
"""Class for overexpression searches."""
Expand Down
4 changes: 2 additions & 2 deletions app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import json

# from Bio.Blast import NCBIXML
from Bio.Seq import Seq
from Bio import SeqIO
#from Bio.Seq import Seq
# from Bio import SeqIO

# ====================================================================================
# FUNTIONS
Expand Down

0 comments on commit 1fa17c5

Please sign in to comment.