Simple pre-processing script for soapsnp files
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4627 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
cb0b2f9811
commit
fc39377e6c
|
|
@ -0,0 +1,23 @@
|
|||
import os.path
|
||||
import sys
|
||||
from optparse import OptionParser
|
||||
|
||||
|
||||
def main():
|
||||
global OPTIONS
|
||||
usage = "usage: %prog [options] cmap input.soapsnp"
|
||||
parser = OptionParser(usage=usage)
|
||||
|
||||
(OPTIONS, args) = parser.parse_args()
|
||||
if len(args) != 2:
|
||||
parser.error("Requires exactly 2 arguments")
|
||||
|
||||
cmap = dict([reversed(line.split()) for line in open(args[0])])
|
||||
#print cmap
|
||||
for line in open(args[1]):
|
||||
parts = line.split()
|
||||
mapped = cmap[parts[0]]
|
||||
print "\t".join([mapped] + parts[1:])
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Reference in New Issue