summaryrefslogtreecommitdiff
path: root/Code/download_ena_records.py
diff options
context:
space:
mode:
Diffstat (limited to 'Code/download_ena_records.py')
-rw-r--r--Code/download_ena_records.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/Code/download_ena_records.py b/Code/download_ena_records.py
index 9ec7623..842fc52 100644
--- a/Code/download_ena_records.py
+++ b/Code/download_ena_records.py
@@ -5,8 +5,10 @@
import os
import sys
import time
+import shutil
from configure import TEMP_DIR, UPDATE_NETWORK_LOG_FILE
from log import write_log_file
+from configure import INFO_DIR
accession = 3702 # arabidopsis
types = ['read_run', 'read_experiment', 'sample', 'study']
@@ -19,7 +21,14 @@ for t in types:
os.system(cmd)
time.sleep(5)
-write_log_file('[download_ena_records.py] ENA records updated. Check folder %s' % (TEMP_DIR), UPDATE_NETWORK_LOG_FILE)
+for t in types:
+ fname = os.path.join(TEMP_DIR, 'ena_'+t+'.xml')
+ if os.path.exists(fname):
+ print(f'Move {fname} to {INFO_DIR}')
+ shutil.move(fname, INFO_DIR)
+ time.sleep(5)
+
+write_log_file('[download_ena_records.py] ENA records updated. Check folder %s' % (INFO_DIR), UPDATE_NETWORK_LOG_FILE)
#https://www.ebi.ac.uk/ena/browser/api/xml/links/taxon?accession=3702&result=read_run
#https://www.ebi.ac.uk/ena/browser/api/xml/links/taxon?accession=3702&result=read_experiment