aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPjotr Prins2020-04-06 16:41:12 -0500
committerPjotr Prins2020-04-06 16:41:12 -0500
commitc138b367229b5c0323984668315f369151668e32 (patch)
treee421e19ba61f740bf195ac7f470b833d2d2f70a0
parent9d4c695cd7001a4e5d5dd7970694c7f9418d947d (diff)
downloadbh20-seq-resource-c138b367229b5c0323984668315f369151668e32.tar.gz
bh20-seq-resource-c138b367229b5c0323984668315f369151668e32.tar.lz
bh20-seq-resource-c138b367229b5c0323984668315f369151668e32.zip
- Added some output and run main() by default
- Disabled ssl checking which does not work if you lack a certificate
-rw-r--r--bh20sequploader/main.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/bh20sequploader/main.py b/bh20sequploader/main.py
index 9de51f4..17ad492 100644
--- a/bh20sequploader/main.py
+++ b/bh20sequploader/main.py
@@ -17,18 +17,22 @@ def main():
parser.add_argument('metadata', type=argparse.FileType('r'), help='sequence metadata json')
args = parser.parse_args()
- api = arvados.api(host=ARVADOS_API_HOST, token=ARVADOS_API_TOKEN)
+ api = arvados.api(host=ARVADOS_API_HOST, token=ARVADOS_API_TOKEN, insecure=True)
col = arvados.collection.Collection(api_client=api)
+ print("Reading FASTA")
with col.open("sequence.fasta", "w") as f:
r = args.sequence.read(65536)
+ print(r[0:20])
while r:
f.write(r)
r = args.sequence.read(65536)
+ print("Reading JSONLD")
with col.open("metadata.jsonld", "w") as f:
r = args.metadata.read(65536)
+ print(r[0:20])
while r:
f.write(r)
r = args.metadata.read(65536)
@@ -44,3 +48,5 @@ def main():
col.save_new(owner_uuid=UPLOAD_PROJECT, name="Uploaded by %s from %s" %
(properties['upload_user'], properties['upload_ip']),
properties=properties, ensure_unique_name=True)
+
+main()