Skip to content

Commit

Permalink
Re-implements regex use
Browse files Browse the repository at this point in the history
The cpt module depended on `regex` and some extra features from it
(opposed to vanilla re from python)

Next, some formatting was applied automatically by my linter.

[#15]
  • Loading branch information
curtisim0 committed Sep 18, 2024
1 parent 96d9c03 commit ad5355b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
2 changes: 1 addition & 1 deletion cpt_putative_isp/cpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from Bio import SeqIO
from Bio.Data import CodonTable
import logging
import re
import regex as re

logging.basicConfig()
log = logging.getLogger()
Expand Down
18 changes: 2 additions & 16 deletions cpt_putative_isp/generate-putative-isp.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,12 @@

import argparse
from cpt import OrfFinder
from Bio import SeqIO
from Bio import Seq
import re
import regex as re
from spaninFuncs import *
import os

# if __name__ == '__main__':
# pass
###############################################################################

if __name__ == "__main__":

# Common parameters for both ISP / OSP portion of script

parser = argparse.ArgumentParser(
description="Get putative protein candidates for spanins"
)
Expand Down Expand Up @@ -212,15 +204,9 @@

pairs = tuple_fasta(fasta_file=args.out_isp_prot)

# print(pairs)

have_tmd = [] # empty candidates list to be passed through the user input criteria

for (
each_pair
) in (
pairs
): # grab transmembrane domains from spaninFuncts (queries for lysin snorkels # and a range of hydrophobic regions that could be TMDs)
for each_pair in pairs:
if len(each_pair[1]) <= args.max_isp:
try:
have_tmd += find_tmd(
Expand Down
2 changes: 1 addition & 1 deletion cpt_putative_isp/generate-putative-isp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<description>constructs a putative list of potential i-spanin from an input genomic FASTA</description>
<macros>
<import>macros.xml</import>

</macros>
<expand macro="requirements">
<requirement type="package" version="2019.06.08">regex</requirement>
</expand>
<command detect_errors="aggressive"><![CDATA[
python '$__tool_directory__/generate-putative-isp.py'
Expand Down

0 comments on commit ad5355b

Please sign in to comment.