/tools/peakcalling/GetPath.py

https://bitbucket.org/cistrome/cistrome-harvard/ · Python · 19 lines · 12 code · 2 blank · 5 comment · 4 complexity · 5c180d830ac23d400c99649e7c929a17 MD5 · raw file

  1. import os, sys, tempfile
  2. #print os.getcwd()
  3. fn = tempfile.mkstemp(prefix="paths")[1]
  4. outf = open(fn, "w")
  5. for i in sys.argv[1:]:
  6. i = i.split(",")
  7. #if len(i)!=3:
  8. # print i
  9. # #print "Please input wigfile info correctly. and don't use comma and space."
  10. # sys.exit(1)
  11. for j in range(len(i)):
  12. if i[j][-3:] == "dat":
  13. if os.path.isfile(i[j]):
  14. i[j] = os.path.abspath(i[j])
  15. outf.write(" ".join(i) + "\n")
  16. outf.close()
  17. print fn