Skip to content

Commit

Permalink
add beacon import and search tools (galaxyproject#6028)
Browse files Browse the repository at this point in the history
* add new tools

* add beacon import and search

* add the beacon import and beacon search

* update tools help and tests

* update tool version

* fix .shed text

* fix .shed text

* fix help part in gene

* fix .shed text

* fix linting

* fix ip

* remove password from parmetars

* fix linting

* fix linting

* add more query options and update the script to the latest version

* change the output file format and onother linting errors

* fix spilling

* remove config_file

* add configFile
  • Loading branch information
khaled196 authored Jul 22, 2024
1 parent 92ffe42 commit f4151aa
Show file tree
Hide file tree
Showing 27 changed files with 10,774 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tools/beacon2-import/.shed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
categories:
- Variant Analysis
description: Beacon Import uploads local genetic data to the server, while Beacon Query searches for genetic information such as genes, sequences, and variants.
long_description: Beacon Import facilitates the seamless transfer of local genetic data to the server, enhancing collaboration and knowledge sharing. Meanwhile,
Beacon Query empowers users to efficiently explore the server for specific genetic information, including genes, sequences, variants, cnv, and genomic ranges. The search
tools also search the phenopacket and other metadata B2RI collections (individuals, runs, datasets, biosamples, cohorts and analyses),
catalyzing genomic research and clinical applications.
homepage_url: https://pypi.org/project/beacon2-import/
name: Beacon2_Import
owner: iuc
remote_repository_url: https://github.com/galaxyproject/tools-iuc/tree/master/tools/beacon2-import
auto_tool_repositories:
name_template: "{{ tool_id }}"
description_template: "Wrapper for {{ tool_name }}."
suite:
name: "suite_beacon2_import"
description: "A suite of Galaxy tools designed to work with the beacon2-import python library."
type: repository_suite_definition
83 changes: 83 additions & 0 deletions tools/beacon2-import/analyses.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<tool id="beacon2_analyses" name="Beacon2 Analyses" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.05">
<description>َQuery the analyses collection in the beacon database for bioinformatic procedures to identify variants</description>
<macros>
<import>macros.xml</import>
</macros>
<expand macro="creators"/>
<expand macro="requirements"/>
<command detect_errors="exit_code"><![CDATA[
beacon2-search analyses
--db-host '$db_host'
--db-port $db_port
--database '$database'
--collection '$collection'
--advance-connection
--db-auth-config '$credentials'
#if str($advanced_settings.aligner)
--aligner '$advanced_settings.aligner'
#end if
#if str($advanced_settings.analysisDate)
--analysisDate '$advanced_settings.analysisDate'
#end if
#if str($advanced_settings.biosampleId)
--biosampleId '$advanced_settings.biosampleId'
#end if
#if str($advanced_settings.identification)
--identification '$advanced_settings.identification'
#end if
#if str($advanced_settings.individualId)
--individualId '$advanced_settings.individualId'
#end if
#if str($advanced_settings.pipelineName)
--pipelineName '$advanced_settings.pipelineName'
#end if
#if str($advanced_settings.pipelineRef)
--pipelineRef '$advanced_settings.pipelineRef'
#end if
#if str($advanced_settings.runId)
--runId '$advanced_settings.runId'
#end if
#if str($advanced_settings.variantCaller)
--variantCaller '$advanced_settings.variantCaller'
#end if
> analyses_query_findings.json
]]></command>
<expand macro="configfile"/>
<inputs>
<expand macro="Connection_to_MongoDB" />
<expand macro="Database_Configuration" />
<section name="advanced_settings" title="Advanced settings" expanded="false">
<param argument="--aligner" optional="true" type="text" label="ALIGNER" value="" help="Reference to mapping/alignment software. Example bwa-0.7.8" />
<param argument="--analysisDate" optional="true" type="text" label="ANALYSIS DATE" value="" help="Date at which analysis was performed. Example 2021-10-17 " />
<param argument="--biosampleId" optional="true" type="text" label="BIOSAMPLE ID" value="" help="Reference to the id of the biosample this analysis is reporting on. Example S0001 " />
<param argument="--identification" optional="true" type="text" label="ID" value="" help="Analysis reference ID (external accession or internal ID). Example GA.01234abcde" />
<param argument="--individualId" optional="true" type="text" label="INDIVIDUALID" value="" help="Reference to the id of the individual this analysis is reporting on. Example P0001 " />
<param argument="--pipelineName" optional="true" type="text" label="PIPELINE NAME" value="" help="Analysis pipeline and version if a standardized pipeline was used. Example Pipeline-panel-0001-v1 " />
<param argument="--pipelineRef" optional="true" type="text" label="PIPELINE REF" value="" help="Link to Analysis pipeline resource" />
<param argument="--runId" optional="true" type="text" label="RUNID" value="" help=" Run identifier (external accession or internal ID). Example SRR10903401" />
<param argument="--variantCaller" optional="true" type="text" label="VARIANT CALLER" value="" help="Reference to variant calling software / pipeline. Example GATK4.0 " />
</section>
</inputs>
<outputs>
<data name="out_analyses_query" format="json" label="${tool.name} on ${on_string}: Analyses Query" from_work_dir="analyses_query_findings.json" />
</outputs>
<tests>
<test expect_num_outputs="1">
<param name="database" value="beacon" />
<param name="collection" value="analyses" />
<param name="db_host" value="20.108.51.167" />
<param name="individualId" value="NA24694" />
<param name="biosampleId" value="S0002" />
<param name="aligner" value="bwa-0.7.8" />
<param name="pipelineName" value="GATK Pipeline 4.2.3.0" />
<param name="identification" value="refvar-668fc705ef8bca245c3c2185" />
<output name="out_analyses_query">
<assert_contents><has_text_matching expression="_id"/></assert_contents>
</output>
</test>
</tests>
<help><![CDATA[
Beacon2 Analyses queries the analyses collection in the Beacon database to identify bioinformatic procedures and variants. This tool allows detailed queries using advanced settings such as aligner, analysis date, biosample ID, and more.
]]></help>
<expand macro="citations" />
</tool>
119 changes: 119 additions & 0 deletions tools/beacon2-import/biosamples.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<tool id="beacon2_biosamples" name="Beacon2 Biosamples" version="1.0.0" profile="21.05">
<description>Query the biosamples collection in the beacon database for samples taken from individuals</description>
<macros>
<import>macros.xml</import>
</macros>
<expand macro="creators"/>
<expand macro="requirements"/>
<command detect_errors="exit_code">
<![CDATA[
beacon2-search biosamples
--db-host '$db_host'
--db-port $db_port
--database '$database'
--collection '$collection'
--advance-connection
--db-auth-config '$credentials'
#if str($advanced_settings.biosampleStatus)
--biosampleStatus '$advanced_settings.biosampleStatus'
#end if
#if str($advanced_settings.collectionDate)
--collectionDate '$advanced_settings.collectionDate'
#end if
#if str($advanced_settings.collectionMoment)
--collectionMoment '$advanced_settings.collectionMoment'
#end if
#if str($advanced_settings.identification)
--identification '$advanced_settings.identification'
#end if
#if str($advanced_settings.diagnosticMarkers)
--diagnosticMarkers '$advanced_settings.diagnosticMarkers'
#end if
#if str($advanced_settings.histologicalDiagnosis)
--histologicalDiagnosis '$advanced_settings.histologicalDiagnosis'
#end if
#if str($advanced_settings.obtentionProcedure)
--obtentionProcedure '$advanced_settings.obtentionProcedure'
#end if
#if str($advanced_settings.pathologicalStage)
--pathologicalStage '$advanced_settings.pathologicalStage'
#end if
#if str($advanced_settings.pathologicalTnmFinding)
--pathologicalTnmFinding '$advanced_settings.pathologicalTnmFinding'
#end if
#if str($advanced_settings.featureType)
--featureType '$advanced_settings.featureType'
#end if
#if str($advanced_settings.severity)
--severity '$advanced_settings.severity'
#end if
#if str($advanced_settings.sampleOriginDetail)
--sampleOriginDetail '$advanced_settings.sampleOriginDetail'
#end if
#if str($advanced_settings.sampleOriginType)
--sampleOriginType '$advanced_settings.sampleOriginType'
#end if
#if str($advanced_settings.sampleProcessing)
--sampleProcessing '$advanced_settings.sampleProcessing'
#end if
#if str($advanced_settings.sampleStorage)
--sampleStorage '$advanced_settings.sampleStorage'
#end if
#if str($advanced_settings.tumorGrade)
--tumorGrade '$advanced_settings.tumorGrade'
#end if
#if str($advanced_settings.tumorProgression)
--tumorProgression '$advanced_settings.tumorProgression'
#end if
> biosamples_query_findings.json
]]>
</command>
<expand macro="configfile"/>
<inputs>
<expand macro="Connection_to_MongoDB"/>
<expand macro="Database_Configuration"/>
<section name="advanced_settings" title="Advanced settings" expanded="false">
<param argument="--biosampleStatus" optional="true" type="text" label="BIOSAMPLE STATUS" value="" help="Ontology value for the classification of the sample in abnormal sample (EFO:0009655) or reference sample (EFO:0009654)" />
<param argument="--collectionDate" optional="true" type="text" label="COLLECTION DATE" value="" help="Date of biosample collection in ISO8601 format" />
<param argument="--collectionMoment" optional="true" type="text" label="COLLECTION MOMENT" value="" help="Individual's or cell culture age at the time of sample collection in the ISO8601 duration format P[n]Y[n]M[n]DT[n]H[n]M[n]S, e.g. P32Y6M1D, P7D" />
<param argument="--identification" optional="true" type="text" label="ID" value="" help="Biosample identifier (external accession or internal ID)" />
<param argument="--diagnosticMarkers" optional="true" type="text" label="DIAGNOSTIC MARKERS" value="" help="Clinically relevant bio markers, e.g. T2b Stage Finding" />
<param argument="--histologicalDiagnosis" optional="true" type="text" label="HISTOLOGICAL DIAGNOSIS" value="" help="Disease diagnosis that was inferred from the histological examination, e.g. Serous Cystadenocarcinoma" />
<param argument="--obtentionProcedure" optional="true" type="text" label="OBTENTION PROCEDURE" value="" help="Ontology value describing the procedure for sample obtention, e.g. biopsy" />
<param argument="--pathologicalStage" optional="true" type="text" label="PATHOLOGICAL STAGE" value="" help="Pathological stage, if applicable, e.g. Stage IIIA" />
<param argument="--pathologicalTnmFinding" optional="true" type="text" label="PATHOLOGICAL TNM FINDING" value="" help="T2b Stage Finding" />
<param argument="--featureType" optional="true" type="text" label="FEATURE TYPE" value="" help="Definition of an ontology term which describes the phenotype, e.g. Infantile spasms" />
<param argument="--severity" optional="true" type="text" label="SEVERITY" value="" help="Ontology class that describes the severity of the condition, e.g. Moderate" />
<param argument="--sampleOriginDetail" optional="true" type="text" label="SAMPLE ORIGIN DETAIL" value="" help="Tissue from which the sample was taken or sample origin matching the category set in 'sampleOriginType', e.g. wall of urinary bladder" />
<param argument="--sampleOriginType" optional="true" type="text" label="SAMPLE ORIGIN TYPE" value="" help="Category of sample origin. Value from Ontology for Biomedical Investigations (OBI) material entity, e.g abnormal sample" />
<param argument="--sampleProcessing" optional="true" type="text" label="SAMPLE PROCESSING" value="" help="Status of how the specimen was processed, e.g. mechanical dissociation" />
<param argument="--sampleStorage" optional="true" type="text" label="SAMPLE STORAGE" value="" help="Status of how the specimen was stored" />
<param argument="--tumorGrade" optional="true" type="text" label="TUMOR GRADE" value="" help="Term representing the tumor grade, e.g. Grade 3a" />
<param argument="--tumorProgression" optional="true" type="text" label="TUMOR PROGRESSION" value="" help="Tumor progression category indicating primary, metastatic or recurrent progression, e.g. Primary Malignant Neoplasm" />
</section>
</inputs>
<outputs>
<data name="out_biosamples_query" format="json" label="${tool.name} on ${on_string}: Biosamples Query" from_work_dir="biosamples_query_findings.json" />
</outputs>
<tests>
<test expect_num_outputs="1">
<param name="database" value="beacon" />
<param name="collection" value="biosamples" />
<param name="db_host" value="20.108.51.167" />
<param name="tumorGrade" value="Grade 2 Lesion" />
<param name="biosampleStatus" value="abnormal sample" />
<param name="collectionDate" value="2021-04-23" />
<param name="sampleOriginDetail" value="wall of urinary bladde" />
<param name="tumorProgression" value="Primary Malignant Neoplasm" />
<output name="out_biosamples_query">
<assert_contents>
<has_text_matching expression="_id"/>
</assert_contents>
</output>
</test>
</tests>
<help><![CDATA[
Beacon2 Biosamples queries the biosamples collection in the Beacon database for samples taken from individuals. This tool allows detailed queries using advanced settings such as biosample status, collection date, diagnostic markers, and more.
]]></help>
<expand macro="citations" />
</tool>
63 changes: 63 additions & 0 deletions tools/beacon2-import/bracket.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<tool id="beacon2_bracket" name="Beacon2 Bracket" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.05">
<description>Specifies a sequence ranges for both the start and end positions of a genomic variation</description>
<macros>
<import>macros.xml</import>
</macros>
<expand macro="creators"/>
<expand macro="requirements"/>
<command detect_errors="exit_code"><![CDATA[
beacon2-search bracket
--db-host '$db_host'
--db-port $db_port
--database '$database'
--collection '$collection'
--advance-connection
--db-auth-config '$credentials'
--start-minimum $start_minimum
--start-maximum $start_maximum
--end-minimum $end_minimum
--end-maximum $end_maximum
#if str($advanced_settings.variantType)
--variantType '$advanced_settings.variantType'
#end if
#if str($advanced_settings.referenceName)
--referenceName '$advanced_settings.referenceName'
#end if
> bracket_query_findings.json
]]></command>
<expand macro="configfile"/>
<inputs>
<expand macro="Connection_to_MongoDB" />
<expand macro="Database_Configuration" />
<param argument="--start-minimum" type="integer" label="Start minimum position" value="" help="" />
<param argument="--start-maximum" type="integer" label="Start maximum position" value="" help="" />
<param argument="--end-minimum" type="integer" label="End minimum position" value="" help="" />
<param argument="--end-maximum" type="integer" label="End maximum position" value="" help="" />
<section name="advanced_settings" title="Advanced settings" expanded="false">
<param argument="--referenceName" optional="true" type="text" label="Reference Name" value="" help="Reference name in numbers chr1/1, chr2/2, chr3/3, etc." />
<param argument="--variantType" optional="true" type="text" label="VARIANT TYPE" value="" help="Targeted Variant type to search for" />
</section>
</inputs>
<outputs>
<data name="out_bracket_query" format="json" label="${tool.name} on ${on_string}: Bracket Query" from_work_dir="bracket_query_findings.json" />
</outputs>
<tests>
<test expect_num_outputs="1">
<param name="database" value="beacon" />
<param name="collection" value="genomicVariations" />
<param name="db_host" value="20.108.51.167" />
<param name="start_minimum" value="131836" />
<param name="start_maximum" value="161836" />
<param name="end_minimum" value="131837" />
<param name="end_maximum" value="151837" />
<param name="variantType" value="SNP" />
<output name="out_bracket_query">
<assert_contents><has_text_matching expression="_id"/></assert_contents>
</output>
</test>
</tests>
<help><![CDATA[
Bracket Queries allow the specification of sequence ranges for both start and end positions of a genomic variation. The typical example here is the query for similar structural variants - particularly CNVs - affecting a genomic region but potentially differing in their exact base extents.
]]></help>
<expand macro="citations" />
</tool>
Loading

0 comments on commit f4151aa

Please sign in to comment.