Skip to content

Commit

Permalink
Merge pull request #322 from gbouras13/dev
Browse files Browse the repository at this point in the history
Update biopython <1.82 [skip ci]
  • Loading branch information
gbouras13 authored Jan 11, 2024
2 parents 2db12bf + 663c486 commit 4ad7b91
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 28 deletions.
52 changes: 39 additions & 13 deletions bin/pharokka.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,54 @@
import shutil
import sys
import time
import warnings
from pathlib import Path

from Bio import BiopythonDeprecationWarning
from custom_db import run_custom_pyhmmer
from databases import check_db_installation
from hmm import run_pyhmmer
from input_commands import (check_dependencies, get_input, instantiate_dirs,
instantiate_split_output,
validate_and_extract_genbank, validate_custom_hmm,
validate_fasta, validate_gene_predictor,
validate_meta, validate_terminase,
validate_threads)
from input_commands import (
check_dependencies,
get_input,
instantiate_dirs,
instantiate_split_output,
validate_and_extract_genbank,
validate_custom_hmm,
validate_fasta,
validate_gene_predictor,
validate_meta,
validate_terminase,
validate_threads,
)
from loguru import logger
from post_processing import Pharok, remove_post_processing_files
from processes import (concat_phanotate_meta, concat_trnascan_meta,
convert_gff_to_gbk, reorient_terminase, run_aragorn,
run_dnaapler, run_mash_dist, run_mash_sketch,
run_minced, run_mmseqs, run_phanotate,
run_phanotate_fasta_meta, run_phanotate_txt_meta,
run_pyrodigal, run_pyrodigal_gv, run_trna_scan,
run_trnascan_meta, split_input_fasta, translate_fastas)
from processes import (
concat_phanotate_meta,
concat_trnascan_meta,
convert_gff_to_gbk,
reorient_terminase,
run_aragorn,
run_dnaapler,
run_mash_dist,
run_mash_sketch,
run_minced,
run_mmseqs,
run_phanotate,
run_phanotate_fasta_meta,
run_phanotate_txt_meta,
run_pyrodigal,
run_pyrodigal_gv,
run_trna_scan,
run_trnascan_meta,
split_input_fasta,
translate_fastas,
)
from util import count_contigs, get_version

# add this to make sure of deprecation warning with biopython
warnings.simplefilter("default", BiopythonDeprecationWarning)


def main():
# get the args
Expand Down
16 changes: 12 additions & 4 deletions bin/pharokka_proteins.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,20 @@
from pathlib import Path

from databases import check_db_installation
from input_commands import (check_dependencies, instantiate_dirs,
validate_fasta, validate_threads)
from input_commands import (
check_dependencies,
instantiate_dirs,
validate_fasta,
validate_threads,
)
from loguru import logger
from post_processing import remove_directory, remove_file
from proteins import (Pharok_Prot, get_input_proteins, run_mmseqs_proteins,
run_pyhmmer_proteins)
from proteins import (
Pharok_Prot,
get_input_proteins,
run_mmseqs_proteins,
run_pyhmmer_proteins,
)
from util import get_version


Expand Down
10 changes: 6 additions & 4 deletions bin/proteins.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
from Bio import SeqIO
from external_tools import ExternalTool
from loguru import logger
from post_processing import (process_card_results, process_pyhmmer_results,
process_vfdb_results)
from post_processing import (
process_card_results,
process_pyhmmer_results,
process_vfdb_results,
)
from pyhmmer.easel import SequenceFile
from pyhmmer.plan7 import HMM, HMMFile
from util import (count_contigs, get_contig_headers, get_version,
remove_directory)
from util import count_contigs, get_contig_headers, get_version, remove_directory

Result = collections.namedtuple("Result", ["protein", "phrog", "bitscore", "evalue"])

Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ channels:
- defaults
dependencies:
- bcbio-gff >=0.7.0
- biopython >=1.78
- biopython >=1.78,<1.82
- phanotate >=1.5.0
- mmseqs2 ==13.45111
- trnascan-se >=2.0.9
Expand Down
11 changes: 9 additions & 2 deletions tests/test_external_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,15 @@
import pytest
from loguru import logger

from bin.processes import (run_aragorn, run_mash_sketch, run_minced,
run_phanotate, run_pyrodigal, run_pyrodigal_gv)
from bin.processes import (
run_aragorn,
run_mash_sketch,
run_minced,
run_phanotate,
run_pyrodigal,
run_pyrodigal_gv,
)

# import functions
from bin.util import remove_directory

Expand Down
15 changes: 11 additions & 4 deletions tests/test_input_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""

import sys

# import
import unittest
from pathlib import Path
Expand All @@ -14,10 +15,16 @@
import pytest
from loguru import logger

from bin.input_commands import (instantiate_dirs, validate_fasta,
validate_gene_predictor, validate_meta,
validate_strand, validate_terminase,
validate_terminase_start, validate_threads)
from bin.input_commands import (
instantiate_dirs,
validate_fasta,
validate_gene_predictor,
validate_meta,
validate_strand,
validate_terminase,
validate_terminase_start,
validate_threads,
)
from bin.util import remove_directory

# test data
Expand Down
1 change: 1 addition & 0 deletions tests/test_overall.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# import
import os
import shutil

# import functions
import subprocess
import sys
Expand Down
1 change: 1 addition & 0 deletions tests/test_proteins.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# import
import os
import shutil

# import functions
import subprocess
import sys
Expand Down

0 comments on commit 4ad7b91

Please sign in to comment.