Mercurial > repos > cpt_testbed > functionalworkflow
diff gff3_reformat.py @ 0:f678e282b320 draft default tip
"planemo upload"
author | cpt_testbed |
---|---|
date | Fri, 06 May 2022 07:07:23 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gff3_reformat.py Fri May 06 07:07:23 2022 +0000 @@ -0,0 +1,20 @@ +#!/usr/bin/env python +import sys +import argparse +from CPT_GFFParser import gffParse, gffWrite +import logging + +logging.basicConfig(level=logging.INFO) + + +def reformat(data): + for record in gffParse(data): + record.annotations = {} + gffWrite([record], sys.stdout) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="Reformat GFF files") + parser.add_argument("data", type=argparse.FileType("r"), help="Input annotations") + args = parser.parse_args() + reformat(**vars(args))