<jupyter_start><jupyter_text>BioDataCatalyst and CRDC Search-Locate-ComputeThis script runs the same work as FASPScript2, adapted to use FASPRunner and a WES Client.<jupyter_code>from fasp.runner import FASPRunner

# The implementations we're using
from fasp.loc import DRSMetaResolver
from fasp.workflow import sbcgcWESClient
from fasp.search import DataConnectClient, BigQuerySearchClient

faspRunner = FASPRunner(program='FASPNotebook02')
runNote = 'CRDC and BioDataCatalyst via FASPRunner, GA4GH++'<jupyter_output><empty_output><jupyter_text>Step 1 - DiscoveryQuery for relevant sequence files and get theit DRD ids.This example simply explores that we can query from different sources of subject/sample data and get files from two different cloud platforms.<jupyter_code># TCGA Query - CRDC
crdcquery = """
    SELECT 'case_'||associated_entities__case_gdc_id , 'crdc:'||file_id
    FROM search_cloud.cshcodeathon.gdc_rel24_filedata_active 
    where data_format = 'BAM' 
    and project_disease_type = 'Breast Invasive Carcinoma'
    limit 3"""

#COPD query - BioDataCatalyst
bdcquery = """
    SELECT SUBJECT_ID, 'bdc:'||read_drs_id
    FROM `isbcgc-216220.COPDGene.phenotype_drs`
    where Weight_KG between 92.5 and 93.0
    LIMIT 3"""<jupyter_output><empty_output><jupyter_text>Run FASPRunner against NCI Cancer Research Data Commons	Configure FASPRunner with the three clients needed<jupyter_code>searchClient = DataConnectClient('https://ga4gh-search-adapter-presto-public.prod.dnastack.com/')

drsClient = DRSMetaResolver()

# Step 3 - set up a class that runs samtools for us
# providing the location for the results
settings = faspRunner.settings
wesClient = sbcgcWESClient(settings['SevenBridgesProject'])
faspRunner.configure(searchClient, drsClient, wesClient)
runList = faspRunner.runQuery(crdcquery, runNote)<jupyter_output>Invalid access token in /Users/forei/.keys/anvil_credentials.json
Searching the GA4GH registry for org.ga4gh:drs services
Running query

    SELECT 'case_'||associated_entities__case_gdc_id , 'crdc:'||file_id
    FROM search_cloud.cshcodeathon.gdc_rel24_filedata_active 
    where data_format = 'BAM' 
    and project_disease_type = 'Breast Invasive Carcinoma'
    limit 3
_Retrieving the query_
____Page1_______________
____Page2_______________
____Page3_______________
____Page4_______________
____Page5_______________
subject=case_1b703058-e596-45bc-80fe-8b98d545c2e2, drsID=crdc:030e5e74-6461-4f05-a399-de8e470bc056
workflow submitted, run:3b48bc69-ed82-4c4c-a555-4e0303512813
____________________________________________________________
subject=case_a947a945-4721-45cc-bc45-13b8ea41c10e, drsID=crdc:04c68898-ddac-4e15-9f9a-5bf278d55e4a
workflow submitted, run:cdd1a0d5-2ebc-439c-aded-e4845bbe61a1
____________________________________________________________
subject=case_c462e422-eb8d-4daf-9897-[...]<jupyter_text>Run FASPRunner against BioDataCatalyst	Reconfigure and run the FASPClient for the BioDataCatalyst data<jupyter_code>searchClient = BigQuerySearchClient()
faspRunner.configure(searchClient, drsClient, wesClient)
runList = faspRunner.runQuery(bdcquery, runNote)
faspRunner.getFASPicon()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07459867799811143, 'fraction_numerical': 0.05256531318854265, 'mean_word_length': 6.984924623115578, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '208339', 'license': 'Apache-2.0', 'n_tokens_mistral': 1181, 'n_tokens_neox': 1079, 'n_words': 227, 'path': 'sessions/2/notebooks/FASPNotebook02.ipynb', 'repo_name': 'ga4gh/ismb-2022-fasp-starter-kit', 'size': '3177'}