Skip to content
Permalink
62add26c47
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
26 lines (23 sloc) 784 Bytes
# parses arguments using argparse
# @return args list of all parameters
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument("meme", help="Path to meme file")
parser.add_argument("output", help="Output file")
parser.add_argument("num", help="Number of motifs parsed from file")
args = parser.parse_args()
return args
# write lines of file till certain line (MOTIF + [num])
def main():
args = parse_arguments()
out = open(args.output, "w+")
number = int(args.num) + 1
motif = "MOTIF " + str(number)
with open(args.meme) as f:
for line in f:
if motif in line:
break
out.write(line)
if __name__ == "__main__":
import argparse
main()