<jupyter_start><jupyter_text>Submit Plenary GWAS workflow using DRS ids from both Anvil and BioDataCatalyst DRSJob is submitted to DNAStack WES server. Submission is successful, but jobs fail.Current issue is with how the signed URLs are handled on the WES server.<jupyter_code>#  IMPORTS
#import sys
import datetime

from fasp.runner import FASPRunner

# The implementations we're using
from fasp.search import DiscoverySearchClient
from fasp.loc import DRSMetaResolver
from fasp.workflow import DNAStackWESClient


faspRunner = FASPRunner()

# Step 1 - Discovery
# query for relevant DRS objects
searchClient = DiscoverySearchClient('https://ga4gh-search-adapter-presto-public.prod.dnastack.com/', debug=False)

query = '''SELECT file_name, compact_drs_id, hostbased_drs_id, drs_id 
from thousand_genomes.onek_genomes.onek_recal_variants_drs 
where chromosome = 'chr21' and annotated = false'''

query_job = searchClient.runQuery(query)  # Send the query

drsResolver = DRSMetaResolver(getReg=False)	

wesClient = DNAStackWESClient('~/.keys/dnastack_wes_credentials.json')

# repeat steps 2 and 3 for each row of the query
# this example should find id's for the same file in both BioDataCatalyst and Anvil
for row in query_job:
    drs_id = row[1]
    print("vcffile={}, compact drsID={}".format(row[0], drs_id))

    # Step 2 - Use DRS to get the URL
    vcfurl = drsResolver.getAccessURL(drs_id, 'gs')
    drsClient, localid = drsResolver.getClient(drs_id) 
    fileSize = drsResolver.getObject(drs_id)['size']
    
    # Step 3 - Run a pipeline on the file at the drs url
    pipeline_id = wesClient.runGWASWorkflow(vcfurl, 'gs://dnastack-public-bucket/thousand_genomes_meta.csv')
    print('submitted:{}'.format(pipeline_id))

    outfile = ''
    via = 'WES'
    note = 'GWAS'

    time = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
    faspRunner.logRun(time, via, note,  pipeline_id, outfile, str(fileSize),
        searchClient, drsClient, wesClient)<jupyter_output>Running FASPNotebookGWAS.ipynb
_Retrieving the query_
____Page1_______________
____Page2_______________
____Page3_______________
____Page4_______________
____Page5_______________
vcffile=CCDG_13607_B01_GRM_WGS_2019-02-19_chr21.recalibrated_variants.vcf.gz, compact drsID=bdc:dg.4503/dbd55e76-1100-40b3-b420-0eaeee478fbc
submitted:387989d1-7cae-45a0-82ce-e15d53353ba3
vcffile=CCDG_13607_B01_GRM_WGS_2019-02-19_chr21.recalibrated_variants.vcf.gz, compact drsID=anv:dg.ANV0/737247da-f5da-49a7-86ec-737978eb8293
submitted:0c089b18-aa8c-4007-b131-485527a6a0eb
{'fraction_non_alphanumeric': 0.09208972845336481, 'fraction_numerical': 0.05391578118850846, 'mean_word_length': 5.451776649746193, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '100947', 'license': 'Apache-2.0', 'n_tokens_mistral': 1020, 'n_tokens_neox': 923, 'n_words': 200, 'path': 'notebooks/FASPNotebookGWAS.ipynb', 'repo_name': 'jb-adams/fasp-scripts', 'size': '2541'}