0.3.2 bug_fixes for automatic download in create_dataset

parent d51c12e8
...@@ -230,8 +230,6 @@ class STRINGDatasetCreation: ...@@ -230,8 +230,6 @@ class STRINGDatasetCreation:
os.remove(self.intermediate_file) os.remove(self.intermediate_file)
os.remove("clusters_preprocessed.tsv") os.remove("clusters_preprocessed.tsv")
os.remove("clusters.tsv") os.remove("clusters.tsv")
os.remove(self.interactions_file)
os.remove(self.sequences_file)
# A method to remove sequences of inappropriate length from a fasta file # A method to remove sequences of inappropriate length from a fasta file
def process_fasta_file(self): def process_fasta_file(self):
...@@ -282,7 +280,9 @@ def add_args(parser): ...@@ -282,7 +280,9 @@ def add_args(parser):
def main(params): def main(params):
downloaded_flag = False
if params.interactions is None or params.sequences is None: if params.interactions is None or params.sequences is None:
downloaded_flag = True
logging.info('One or both of the files are not specified (interactions or sequences). ' logging.info('One or both of the files are not specified (interactions or sequences). '
'Downloading from STRING...') 'Downloading from STRING...')
...@@ -320,6 +320,10 @@ def main(params): ...@@ -320,6 +320,10 @@ def main(params):
data.final_preprocessing_positives() data.final_preprocessing_positives()
data.create_negatives() data.create_negatives()
if downloaded_flag:
os.remove(params.interactions)
os.remove(params.sequences)
if __name__ == '__main__': if __name__ == '__main__':
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment