Skip to content

Commit

Permalink
use file basename, correct upload_type
Browse files Browse the repository at this point in the history
  • Loading branch information
FriederikeHanssen committed Jan 15, 2024
1 parent e7bda22 commit 41bf5de
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Create empty upload
r = requests.post(url, params=params, json={}, headers=headers)

print("Create empty upload:\n")
print("Create empty upload:\n" )
print(r.json())
print(r.status_code)

Expand All @@ -28,22 +28,21 @@
bucket_url = r.json()["links"]["bucket"]

filenames = [
"NA12878_75M.deepvariant.vcf.gz",
#"freebayes/NA12878_75M/NA12878_75M.freebayes.vcf.gz",
#"haplotypecaller/NA12878_75M/NA12878_75M.haplotypecaller.filtered.vcf.gz",
#"strelka/NA12878_75M/NA12878_75M.strelka.variants.vcf.gz",
#"deepvariant/NA12878_200M/NA12878_200M.deepvariant.vcf.gz",
#"freebayes/NA12878_200M/NA12878_200M.freebayes.vcf.gz",
#"haplotypecaller/NA12878_200M/NA12878_200M.haplotypecaller.filtered.vcf.gz",
#"strelka/NA12878_200M/NA12878_200M.strelka.variants.vcf.gz",
"deepvariant/NA12878_75M/NA12878_75M.deepvariant.vcf.gz",
"freebayes/NA12878_75M/NA12878_75M.freebayes.vcf.gz",
"haplotypecaller/NA12878_75M/NA12878_75M.haplotypecaller.filtered.vcf.gz",
"strelka/NA12878_75M/NA12878_75M.strelka.variants.vcf.gz",
"deepvariant/NA12878_200M/NA12878_200M.deepvariant.vcf.gz",
"freebayes/NA12878_200M/NA12878_200M.freebayes.vcf.gz",
"haplotypecaller/NA12878_200M/NA12878_200M.haplotypecaller.filtered.vcf.gz",
"strelka/NA12878_200M/NA12878_200M.strelka.variants.vcf.gz",
]

for file in filenames:
path = "./variant_calling/deepvariant/NA12878_75M/%s" % file
path = "./variant_calling/%s" % file
with open(path, "rb") as fp:
print("%s/%s" % (bucket_url, file))
r = requests.put(
"%s/%s" % (bucket_url, file),
"%s/%s" % (bucket_url, os.path.basename(file)),
data=fp,
params=params,
)
Expand All @@ -54,7 +53,7 @@
data = {
"metadata": {
"title": title,
"upload_type": "data",
"upload_type": "dataset",
"description": "Variant calling results on benchmarking datasets produced with nf-core/sarek",
"creators": [
{"name": "Garcia, Maxime Ulysse", "affiliation": "Seqera, Barcelona"},
Expand Down

0 comments on commit 41bf5de

Please sign in to comment.