Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OrthoXMLSplitter.py #33

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions utils/OrthoXMLSplitter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

#!/usr/bin/env python3
# from pyoma project

from __future__ import unicode_literals, division
Expand All @@ -8,9 +8,11 @@
import errno
import logging
import re

import argparse
import sys
logger = logging.getLogger(__name__)


## the only change compared to pyoma version is to remove int constratin on HOG id .


Expand Down Expand Up @@ -228,4 +230,18 @@ def create_new_orthoxml(self, fn, OGs):
tree = etree.ElementTree(etree_2_dump)
tree.write(
fn, xml_declaration=True, encoding="utf-8", method="xml", pretty_print=True
)
)

### main
def main(argv):
parser = argparse.ArgumentParser(description="Split OrthoXML file into HOGs")
parser.add_argument("-i", "--inFile", dest="inFile", required=True, help="OrthoXML file")
parser.add_argument("-o", "--outFile", dest="outFile", required=False, default='./splits/', help='split OrthoXML destination path')
args = parser.parse_args()

splitter = OrthoXMLSplitter(args.inFile, cache_dir=args.outFile)
splitter()

if __name__ == '__main__':
main(sys.argv)

Loading