Skip to content

Commit c24333e

Browse files
committed
Fix BED example. Revert last change
1 parent 7ddc3fa commit c24333e

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

src/omnipy_examples/bed.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from omnipy import (Chain2, Chain3, convert_dataset, Dataset, HttpUrlDataset, LinearFlowTemplate,
44
MatchItemsModel, Model, PandasDataset, SplitToItemsModel, SplitToLinesModel,
5-
TableOfPydanticRecordsModel, TaskTemplate)
5+
TableOfPydanticRecordsModel, TaskTemplate, StrDataset)
66
from omnipy_examples.util import get_github_repo_urls
77
from pydantic import BaseModel, conint, constr
88

@@ -36,7 +36,7 @@ class BedRecordModel(BaseModel):
3636
strand: constr(regex='[-+\.]') | None
3737
thickStart: GenomeCoord | None
3838
thickEnd: GenomeCoord | None
39-
itemRgb: SplitOnComma2RgbColorModel | Literal[0] | None
39+
itemRgb: SplitOnComma2RgbColorModel | Literal['0'] | None
4040
blockCount: conint(ge=0) | None
4141
blockSizes: SplitOnComma2ListOfIntsModel | None
4242
blockStarts: SplitOnComma2ListOfIntsModel | None
@@ -56,8 +56,8 @@ class BedDataset(Dataset[BedModel]):
5656

5757
# Omnipy tasks
5858
@TaskTemplate()
59-
def fetch_bed_dataset(url_list: HttpUrlDataset) -> BedDataset:
60-
bed_raw_dataset = BedDataset()
59+
def fetch_bed_dataset(url_list: HttpUrlDataset) -> StrDataset:
60+
bed_raw_dataset = StrDataset()
6161
bed_raw_dataset.load(url_list)
6262
return bed_raw_dataset
6363

@@ -66,15 +66,11 @@ def fetch_bed_dataset(url_list: HttpUrlDataset) -> BedDataset:
6666
@LinearFlowTemplate(
6767
get_github_repo_urls,
6868
fetch_bed_dataset,
69+
convert_dataset.refine(name='parse_bed', fixed_params={'dataset_cls': BedDataset}),
6970
convert_dataset.refine(
7071
name='convert_to_dataframe', fixed_params={'dataset_cls': PandasDataset}),
7172
)
7273
def import_bed_files_to_pandas(owner: str, repo: str, branch: str, path: str,
7374
file_suffix: str) -> PandasDataset:
7475
...
7576

76-
77-
# Running the flow
78-
if __name__ == '__main__':
79-
import_bed_files_to_pandas.run(
80-
owner='arq5x', repo='bedtools2', branch='master', path='data', file_suffix='bed')

src/omnipy_examples/main.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ def get_path_to_example_data() -> Path:
2323

2424
@app.command()
2525
def bed(
26-
owner: str = 'sunyumail93',
27-
repo: str = 'Bed12Processing',
26+
owner: str = 'arq5x',
27+
repo: str = 'bedtools2',
2828
branch: str = 'master',
2929
path: str = 'data',
30-
file_suffix: str = 'bed12',
30+
file_suffix: str = 'bed',
3131
) -> PandasDataset:
3232
from omnipy_examples.bed import import_bed_files_to_pandas
3333
return import_bed_files_to_pandas.run(
@@ -71,6 +71,12 @@ def chatgpt() -> object:
7171
return get_chatgpt_interpretation_of_biorxiv_entries_and_commit_loop.run()
7272

7373

74+
@app.command()
75+
def seqcol() -> object:
76+
from omnipy_examples.seqcol import seqcol_tests
77+
return seqcol_tests.run()
78+
79+
7480
@app.callback()
7581
def main(output_dir: str = runtime.config.job.output_storage.local.persist_data_dir_path,
7682
engine: EngineChoice = 'local',

0 commit comments

Comments
 (0)