# HG changeset patch # User yating-l # Date 1496681414 14400 # Node ID b673449d111aaa423066662b0a557b7e2cfef030 # Parent 9573618e2afefdd1ee196dbc4068a972ed9ddc55 planemo upload commit f3fb68f4faf6766eef195b8b36157035ab95e7b1-dirty diff -r 9573618e2afe -r b673449d111a filter.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/filter.py Mon Jun 05 12:50:14 2017 -0400 @@ -0,0 +1,20 @@ +import sys +import argparse + +def filter(cds_file, valid_cds_file): + valid = open(valid_cds_file, 'w') + with open(cds_file, 'r') as f: + for line in f: + if len(line.rstrip().split('\t')) == 2: + valid.write(line) + valid.close() + +def main(argv): + parser = argparse.ArgumentParser(description='Filter out records without CDS coordinates') + parser.add_argument('-f', help='cds file') + parser.add_argument('-o', help='validated cds file') + args = parser.parse_args() + filter(args.f, args.o) + +if __name__ == '__main__': + main(sys.argv) diff -r 9573618e2afe -r b673449d111a gbToFasta.xml --- a/gbToFasta.xml Wed Apr 12 17:43:55 2017 -0400 +++ b/gbToFasta.xml Mon Jun 05 12:50:14 2017 -0400 @@ -15,7 +15,8 @@ && raToTab -cols=acc,cds outputra - '${outputcds}' + cds_file + && python $__tool_directory__/filter.py -f cds_file -o '${outputcds}' #end if ]]>