PageRenderTime 12ms CodeModel.GetById 9ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/tools/peakcalling/GetPath.py

https://bitbucket.org/cistrome/cistrome-harvard/
Python | 19 lines | 12 code | 2 blank | 5 comment | 6 complexity | 5c180d830ac23d400c99649e7c929a17 MD5 | raw file
 1import os, sys, tempfile
 2
 3#print os.getcwd()
 4fn = tempfile.mkstemp(prefix="paths")[1]
 5outf = open(fn, "w")
 6
 7for i in sys.argv[1:]:
 8    i = i.split(",")
 9    #if len(i)!=3:
10    #    print i
11    #    #print "Please input wigfile info correctly. and don't use comma and space."
12    #    sys.exit(1)
13    for j in range(len(i)):
14        if i[j][-3:] == "dat":
15            if os.path.isfile(i[j]):
16                i[j] = os.path.abspath(i[j])
17    outf.write(" ".join(i) + "\n")
18outf.close()
19print fn