Skip to content

Commit

Permalink
Feature rm expwarn (#93)
Browse files Browse the repository at this point in the history
* remove warnings caused by blastn asset file

* lower case all names

* rename job assets
  • Loading branch information
vestalisvirginis authored Jul 20, 2024
1 parent b61d4ce commit a110270
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 25 deletions.
10 changes: 5 additions & 5 deletions synphage/assets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

from . import ncbi_connect, user_data, status, blaster, viewer

NCBI_CONNECT = "NCBI_connect"
USERS_INPUT = "Users_input"
STATUS = "Status"
BLASTER = "Blaster"
VIEWER = "Viewer"
NCBI_CONNECT = "ncbi_connect"
USERS_INPUT = "users_input"
STATUS = "status"
BLASTER = "blaster"
VIEWER = "viewer"

ncbi_connect_assets = load_assets_from_package_module(
package_module=ncbi_connect,
Expand Down
5 changes: 4 additions & 1 deletion synphage/assets/blaster/n_blaster.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
from dagster import asset
from dagster import asset, ExperimentalWarning

import os
import pickle
import warnings
import polars as pl

from pathlib import Path
from typing import List
from collections import namedtuple

warnings.filterwarnings("ignore", category=ExperimentalWarning)


FastaNRecord = namedtuple("FastaNRecord", "new,history")
BlastNRecord = namedtuple("BlastNRecord", "new,history")
Expand Down
4 changes: 1 addition & 3 deletions synphage/assets/viewer/static_graph.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from dagster import asset, Config, MetadataValue, AssetObservation, AssetSpec, ExperimentalWarning
from dagster import asset, Config, MetadataValue, AssetObservation, AssetSpec

import enum
import os
import base64
import math
import tempfile
import warnings

import polars as pl

Expand All @@ -25,7 +24,6 @@
from string import Template
from PIL import ImageColor

warnings.filterwarnings("ignore", category=ExperimentalWarning)

TEMP_DIR = tempfile.gettempdir()

Expand Down
32 changes: 16 additions & 16 deletions synphage/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,61 +15,61 @@

# Job 1 : get data from the user
get_user_data = define_asset_job(
name="get_user_data",
name="step_1a_get_user_data",
selection=(
AssetSelection.groups("Users_input")
| AssetSelection.groups("Status")
AssetSelection.groups("users_input")
| AssetSelection.groups("status")
& AssetSelection.assets("genbank_history").downstream(depth=2)
),
)

# Job 2 : download gb files from the ncbi database
download = define_asset_job(
name="download",
name="step_1b_download",
selection=(
AssetSelection.groups("NCBI_connect")
| AssetSelection.groups("Status")
AssetSelection.groups("ncbi_connect")
| AssetSelection.groups("status")
& AssetSelection.assets("genbank_history").downstream(depth=2)
),
)

# Job 3 : validations with to reload + refresh UI
validations = define_asset_job(
name="make_validation",
selection=AssetSelection.groups("Status")
name="step_2_make_validation",
selection=AssetSelection.groups("status")
& AssetSelection.assets("reload_ui_asset").downstream(depth=3),
)

# Job 4 : blastn
blastn = define_asset_job(
name="make_blastn",
name="step_3a_make_blastn",
selection=(
AssetSelection.assets("append_processed_df")
| AssetSelection.groups("Blaster")
| AssetSelection.groups("blaster")
& AssetSelection.assets("create_fasta_n").downstream()
),
)

# Job 5 : blastp
blastp = define_asset_job(
name="make_blastp",
name="step_3b_make_blastp",
selection=(
AssetSelection.assets("append_processed_df")
| AssetSelection.groups("Blaster")
| AssetSelection.groups("blaster")
& AssetSelection.assets("create_fasta_p").downstream()
),
)

# Job 6 : blastn and blastp combined
all_blast = define_asset_job(
name="make_all_blast",
name="step_3c_make_all_blast",
selection=(
AssetSelection.assets("append_processed_df") | AssetSelection.groups("Blaster")
AssetSelection.assets("append_processed_df") | AssetSelection.groups("blaster")
),
)

# Job 7 : create the synteny diagram
plot = define_asset_job(
name="make_plot",
selection=AssetSelection.groups("Viewer"),
name="step_4_make_plot",
selection=AssetSelection.groups("viewer"),
)

0 comments on commit a110270

Please sign in to comment.