Skip to content
Permalink
53b0857b4a
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
1 contributor

Users who have contributed to this file

29 lines (21 sloc) 929 Bytes
import os
class ResultSaver:
"""
class to save the results. Path is dependent on the data_dir, tissuetype and mapped = True or False.
The output is saved to the temp directory in the data folder if crossmapping is necessary.
"""
def __init__(self, results, organism, wd, mapped, is_data_dir, tissue, out):
print("Save results to File !")
self.path = ""
if mapped:
if is_data_dir:
self.path = os.path.join(wd + "/temp/" + organism + ".gtf")
else:
self.path = os.path.join( wd + "/data/temp/" + organism + ".gtf" )
elif tissue:
self.path = os.path.join(out+"/"+organism+"_filtered.gtf")
else:
self.path = os.path.join(out+"/"+organism+".gtf")
with open(self.path, "w") as output_file:
for line in results:
output_file.write("\t".join(line)+"\n")