Skip to content
Permalink
9b258c6d1f
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
42 lines (30 sloc) 1.5 KB
#!/usr/bin/env python3
import argparse
from Modules.Ensembl.Ensembl import Ensembl
from Modules.ucsc.ucsc import UcscGtf
from Modules.Uniquifier import UniqueFilter
from Modules.SaveResults import ResultSaver
import os
def check_for_local_folder(wd):
if not os.path.isdir(os.path.join(wd+"/EnsemblData")):
os.mkdir(os.path.join(wd+"/EnsemblData"))
if not os.path.isdir(os.path.join(wd+"/UCSCData" )):
os.mkdir(os.path.join(wd+"/UCSCData" ))
def main_script(org, wd, tissuetype=None):
check_for_local_folder(wd)
ucsc = UcscGtf(org, wd)
ense = Ensembl(org, wd)
print("Getting Unique Results")
unique_filter = UniqueFilter(ense.get_gtf(), ucsc.get_gtf(), tissuetype)
ResultSaver(unique_filter.get_results(), org, tissuetype, wd)
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='GTF-Generator from UCSC Table Browser and Ensembl Regulatory Build' )
parser.add_argument('organism', help='Source organism [ homo_sapiens or mus_musculus ]', action='store', nargs='?', type=str)
parser.add_argument('--tissue', help='Tissue- or Celltype(s)', action='store', nargs='*', type=str)
parser.add_argument('--wd', help='Working directory. default: "."', action='store', default='.', type=str)
args = vars(parser.parse_args())
if args["organism"]:
print("Working Dir: " + args["wd"])
main_script(args["organism"], args["wd"], args["tissue"])
else:
print("No Arguments found -> See ./RegGTFExtractor.py -h for help.")