Mercurial > repos > rmarenco > hub_archive_creator
view hub-archive-creator-1.6/twoBitCreator.py @ 1:bfa14bec861c draft default tip
Deleted selected files
author | rmarenco |
---|---|
date | Fri, 04 Mar 2016 11:20:43 -0500 |
parents | 163b2de763ea |
children |
line wrap: on
line source
#!/usr/bin/python import os import tempfile import subprocess def twoBitFileCreator(fastaFile, toolDirectory, mySpecieFolder): """ 2bit file creator from a fasta file. Need faTwoBit kentUtil. Output a .2bit file """ baseNameFasta = os.path.basename(fastaFile.name) suffixTwoBit, extensionTwoBit = os.path.splitext(baseNameFasta) nameTwoBit = suffixTwoBit + '.2bit' with open(os.path.join(mySpecieFolder, nameTwoBit), 'w') as twoBitFile: p = subprocess.Popen( [os.path.join(toolDirectory, 'tools/faToTwoBit'), fastaFile.name, twoBitFile.name]) p.wait() return twoBitFile