Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mondrian nextflow support #7

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions alhena_igo/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,33 @@ def clean(info: Info, analysis: str):
@cli.command()
@click.option('--analysis_id', help="MONDRIAN-HMMCOPY or SCDNA-ANNOTATION analysis primary key", required=True)
@click.option('--project', 'projects', multiple=True, default=["DLP"], help="Projects to load analysis into")
@click.option('--framework', type=click.Choice(['scp', 'mondrian']), help="Framework: scp or mondrian")
@click.option('--framework', type=click.Choice(['scp', 'mondrian', 'mondrian_nf']), help="Framework: scp, mondrian or mondrian_nf (nextflow)")
@click.option('--version', help="Isabl app version to load", required=True)
@pass_info
def load(info: Info, analysis_id: str, projects: List[str], framework: str, version: str):
click.echo(f'Loading as ID {analysis_id}')

if framework == 'scp':
[alignment, hmmcopy, annotation] = alhena_igo.isabl.get_directories(analysis_id, framework, version)
data = load_qc_results(alignment, hmmcopy, annotation)
data = load_qc_results(
'scp',
alignment_results_dir=alignment,
hmmcopy_results_dir=hmmcopy,
annotation_results_dir=annotation
)
elif framework == 'mondrian':
[alignment, hmmcopy] = alhena_igo.isabl.get_directories(analysis_id, framework, version)
data = load_qc_results(alignment, hmmcopy)
data = load_qc_results(
'mondrian',
alignment_results_dir=alignment,
hmmcopy_results_dir=hmmcopy
)
elif framework == 'mondrian_nf':
[qc] = alhena_igo.isabl.get_directories(analysis_id, framework, version)
data = load_qc_results(
'mondrian_nf',
qc_results_dir=qc
)
else:
raise Exception(f"Unknown framework option '{framework}'")

Expand Down
19 changes: 17 additions & 2 deletions alhena_igo/isabl.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ def get_analysis_filtered_by_assembly(experiment_sys_id, app_name, assembly):

def get_directories(analysis_pk: str, framework: str, version: str):
"""
Return QC results for Mondrian or SCP based off MONDRIAN-HMMCOPY or SCDNA-ANNOTATION
analysis primary key.
Return QC results for Mondrian (cromwell), Mondrain NF (nextflow) or SCP based off
MONDRIAN-HMMCOPY, MONDRIAN-NF-QC or SCDNA-ANNOTATION analysis primary key.
"""

if framework == 'mondrian':
Expand All @@ -79,6 +79,17 @@ def get_directories(analysis_pk: str, framework: str, version: str):

return [alignment.storage_url, hmmcopy[0].storage_url]

elif framework == 'mondrian_nf':
qc = ii.get_analyses(
pk=analysis_pk,
application__name='MONDRIAN-NF-QC',
status='SUCCEEDED',
)
assert len(qc) == 1

# quick way to add support mondrian-nf using exisiting mondrian logic
return [qc[0].storage_url]

elif framework == 'scp':
annotation = ii.get_analyses(pk=analysis_pk, application__name='SCDNA-ANNOTATION')
assert len(annotation) == 1
Expand Down Expand Up @@ -139,6 +150,8 @@ def get_id(aliquot_id, framework, version):

if framework == 'mondrian':
app = 'MONDRIAN-HMMCOPY'
elif framework == 'mondrian-nf':
app = 'MONDRIAN-NF-QC'
elif framework == 'scp':
app = 'SCDNA-ANNOTATION'
else:
Expand All @@ -163,6 +176,8 @@ def get_ids_from_isabl(project_pk, framework, version):
app = ''
if framework == 'mondrian':
app = 'MONDRIAN-HMMCOPY'
elif framework == 'mondrian-nf':
app = 'MONDRIAN-NF-QC'
elif framework == 'scp':
app = 'SCDNA-ANNOTATION'
else:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
version=version,
install_requires=[
# Include dependencies here
"alhenaloader @ git+https://github.com/shahcompbio/alhenaloader.git@v1.0.6#egg=alhenaloader",
"alhenaloader @ git+https://github.com/shahcompbio/alhenaloader.git@v1.1.0#egg=alhenaloader",
"isabl_cli @ git+https://github.com/papaemmelab/isabl_cli.git#egg=isabl_cli"
],
entry_points="""
Expand Down