Skip to content

Commit

Permalink
Dev (#22)
Browse files Browse the repository at this point in the history
* update large file hook to increase size from 500KB to 20MB

* add antismash_gff_builder unit test

* add script that prints out current version of the package

* add simple unit test that just checks success

* add regex check in unit test for get_mpt_version

* remove failing exit codes for sanity check scripts - they should exit peacefully

* make pytest and lint workflows trigger on dev as well as main

* update pyproject.toml for versoin 0.1.6

* no need to run pytest on push to dev

* add output file from antismash_gff_builder unit test to repo

* fix get_subunits bug, add end_region check to primver_val_classification

* bump version
  • Loading branch information
chrisAta authored Oct 8, 2024
1 parent a37f7cf commit 333f5f0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,20 @@ def parse_args():
return input, fasta, sample


def get_amp_region(beg, strand, model):
def get_amp_region(beg, end, strand, model):
prev_region = ""

for region, region_coords in model.items():

region_beg = region_coords[0]
beg_diff = region_beg - beg
end_diff = region_beg - end

if strand == STRAND_FWD:
if beg_diff > 0:
if beg_diff > 0 and end_diff > 0:
return region
else:
if beg_diff > 0:
if beg_diff > 0 and end_diff > 0:
return prev_region

prev_region = region
Expand All @@ -92,6 +93,7 @@ def main():
primer_name = line_lst[0]
rfam = line_lst[3]
beg = float(line_lst[5])
end = float(line_lst[6])

if rfam == "RF00177":
gene = "16S"
Expand All @@ -116,7 +118,7 @@ def main():
elif "R" in primer_name:
strand = STRAND_REV

amp_region = get_amp_region(beg, strand, model)
amp_region = get_amp_region(beg, end, strand, model)
primer_seq = str(fasta_dict[primer_name].seq)

res_dict["Gene"].append(gene)
Expand Down
2 changes: 1 addition & 1 deletion mgnify_pipelines_toolkit/analysis/shared/get_subunits.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def main():
]
open_files = {}
for record in SeqIO.parse(args.input, "fasta"):
model = "-".join(record.id.split("/")[0].split("-")[1:])
model = "-".join(record.id.split("/")[0].split("-")[-1:])
if model in coding_rna:
filename = pattern_dict[model]
else:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "mgnify_pipelines_toolkit"
version = "0.1.6"
version = "0.1.7"
readme = "README.md"
license = {text = "Apache Software License 2.0"}
authors = [
Expand Down

0 comments on commit 333f5f0

Please sign in to comment.