This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
import sys | |
def convert_lines(lines): | |
new_lines = [] | |
for line in lines: | |
# check the modifications are necessary in the first place |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Requires JQ, on debian/ubuntu derivatives, this can be installed with "apt install jq" | |
# | |
# Either provide an antiSMASH JSON results file as the argument or pipe it in | |
jq -r '.records[].areas[] | [.start, .end, (.products | join(","))] | flatten | @tsv' "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import sys | |
from Bio.SeqFeature import FeatureLocation, CompoundLocation | |
from Bio.Seq import Seq | |
from helperlibs.bio import seqio | |
def split_location_on_cut(location, cut_point): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import json | |
import os | |
import sys | |
from mibig_html.common.secmet import Record | |
def check(json_file, gbk_dir): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for line in `git diff --cached --name-only --diff-filter=ACM | grep -v retired | grep -e json`; do | |
if [[ "$line" != *.json ]] ; then | |
continue | |
fi | |
test `tail -c 1 $line` | |
if [ "$?" == "1" ] ; then | |
truncate -s -1 $line | |
echo "Aborting commit due to trailing newline; add changes and recommit" | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Removes specific module(s) results from antiSMASH results JSON | |
Modules are expected to be named as per a python `__name__` result, | |
e.g. "antismash.modules.clusterblast" | |
""" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
class Item: | |
def __init__(self, name, depth): | |
self.name = name | |
self.depth = depth | |
self.children = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
import os | |
import sys | |
from typing import IO | |
def _main(accession: str, source: IO, destination: IO) -> int: | |
if not accession: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import json | |
import sys | |
def merge(inputs): | |
""" Merges the data in the given input handles and returns the result """ | |
assert len(inputs) > 1 | |
record_ids = set() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from __future__ import print_function, division | |
import sys | |
from helperlibs.bio import seqio | |
def strip_record(seq_record): | |
new_features = [] |
NewerOlder