diff options
author | AndreaGuarracino | 2020-09-26 12:12:17 +0200 |
---|---|---|
committer | AndreaGuarracino | 2020-09-26 12:12:17 +0200 |
commit | 7c12e4976337a063301be260cb3954bf4303f5e0 (patch) | |
tree | a25effc5a4afca5aee235e2b9e986abfab10ea12 /workflows/pangenome-generate | |
parent | 8e9247ab29db30e9bb7c87bef5f127b3b5cec699 (diff) | |
download | bh20-seq-resource-7c12e4976337a063301be260cb3954bf4303f5e0.tar.gz bh20-seq-resource-7c12e4976337a063301be260cb3954bf4303f5e0.tar.lz bh20-seq-resource-7c12e4976337a063301be260cb3954bf4303f5e0.zip |
script for processing the metadata of the ESR samples; moved delete_entries_on_arvados script in scripts directory
Diffstat (limited to 'workflows/pangenome-generate')
-rw-r--r-- | workflows/pangenome-generate/delete_entries_on_arvados.py | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/workflows/pangenome-generate/delete_entries_on_arvados.py b/workflows/pangenome-generate/delete_entries_on_arvados.py deleted file mode 100644 index d281456..0000000 --- a/workflows/pangenome-generate/delete_entries_on_arvados.py +++ /dev/null @@ -1,34 +0,0 @@ -import sys -import arvados -import arvados.collection - -from datetime import datetime - -date_time_str = '2020-08-20' -date_time_obj = datetime.strptime(date_time_str, '%Y-%m-%d') - -api = arvados.api() -keepclient = arvados.keep.KeepClient(api_client=api) - -validated = arvados.util.list_all(api.collections().list, filters=[ - ["owner_uuid", "=", sys.argv[1]], -# ["properties.status", "=", "validated"] -]) - -# validated.sort(key=lambda v: v["portable_data_hash"]) - -num_sample_deleted = 0 -for item in validated: - sequence_label = item['properties']["sequence_label"] - - # The SRA samples start with SRR or ERR - if not sequence_label.startswith('SRR') and not sequence_label.startswith('ERR'): - created_at_obj = datetime.strptime(item["created_at"], '%Y-%m-%dT%H:%M:%S.%fZ') - # print(item, created_at_obj) - - if created_at_obj < date_time_obj: - api.collections().delete(uuid=item['current_version_uuid']).execute() - num_sample_deleted += 1 - print(sequence_label) - -print('num_sample_deleted: {}'.format(num_sample_deleted)) |