Skip to content

Commit

Permalink
Merge pull request #208 from pepkit/dev
Browse files Browse the repository at this point in the history
v0.11.0 release
  • Loading branch information
donaldcampbelljr authored Oct 2, 2024
2 parents a84968b + 1e554e9 commit c47035d
Show file tree
Hide file tree
Showing 18 changed files with 356 additions and 327 deletions.
8 changes: 6 additions & 2 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format.

## [0.11.0] - 2024-10-02
### Fixed
- for output schema, make samples an array type and nest under items [#204](https://github.com/pepkit/pipestat/issues/204)
- pipeline_name not setting correctly [#207](https://github.com/pepkit/pipestat/issues/207)
- bug with objects populating html report

## [0.10.2] - 2024-08-26
### Fixed
- add obtaining pephub_path from config file, [#202](https://github.com/pepkit/pipestat/issues/202)
Expand All @@ -10,7 +16,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
### Fixed
- add pipestat summarize and link for pephub backend


## [0.10.0] - 2024-07-18
### Fixed
- allow for bool or boolean in schema [#189](https://github.com/pepkit/pipestat/issues/189)
Expand All @@ -20,7 +25,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## Added
- pephub backend [#125](https://github.com/pepkit/pipestat/issues/125)


## [0.9.3] - 2024-06-06
### Fixed
- fixed regression with summarizing or creating a table via aggregate_results.yaml and "{record_identifier}" in the results file path
Expand Down
2 changes: 1 addition & 1 deletion pipestat/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.10.2"
__version__ = "0.11.0"
6 changes: 6 additions & 0 deletions pipestat/parsed_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,16 @@ def __init__(self, data: Union[Dict[str, Any], Path, str]) -> None:

self._pipeline_name = data["properties"].pop(SCHEMA_PIPELINE_NAME_KEY, None)

# Two passes for sample-data as it is now nested under items per #204
sample_data = _safe_pop_one_mapping(
subkeys=["samples"],
data=data["properties"],
info_name="sample-level",
mappingkey="items",
)
sample_data = _safe_pop_one_mapping(
data=sample_data,
info_name="sample-level",
mappingkey="properties",
)

Expand Down
17 changes: 9 additions & 8 deletions pipestat/pipestat.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,15 @@ def __init__(
)

# TODO this is a work around for Looper ~ https://github.com/pepkit/looper/issues/492, sharing pipeline names
# In the future, we should get piepline name only from output schema.
self.cfg[PIPELINE_NAME] = (
pipeline_name
or self.cfg[CONFIG_KEY].get(PIPELINE_NAME)
or self.cfg[SCHEMA_KEY].pipeline_name
if self.cfg[SCHEMA_KEY] is not None
else DEFAULT_PIPELINE_NAME
)
# In the future, we should get pipeline name only from output schema.
if pipeline_name:
self.cfg[PIPELINE_NAME] = pipeline_name
elif self.cfg[CONFIG_KEY].get(PIPELINE_NAME):
self.cfg[PIPELINE_NAME] = self.cfg[CONFIG_KEY].get(PIPELINE_NAME)
elif self.cfg[SCHEMA_KEY] and self.cfg[SCHEMA_KEY].pipeline_name:
self.cfg[PIPELINE_NAME] = self.cfg[SCHEMA_KEY].pipeline_name
else:
self.cfg[PIPELINE_NAME] = DEFAULT_PIPELINE_NAME

self.cfg[PROJECT_NAME] = self.cfg[CONFIG_KEY].priority_get(
"project_name", env_var=ENV_VARS["project_name"], override=project_name
Expand Down
10 changes: 2 additions & 8 deletions pipestat/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,7 @@ def create_object_htmls(self, navbar, footer):
links = []
html_page_path = os.path.join(self.pipeline_reports, f"{file_result}.html".lower())

if self.prj.cfg["multi_result_files"] is True:
pipeline_types = ["sample", "project"]
else:
pipeline_types = [self.prj.backend.pipeline_type]
pipeline_types = ["sample", "project"]

for pipeline_type in pipeline_types:
self.prj.backend.pipeline_type = pipeline_type
Expand Down Expand Up @@ -425,10 +422,7 @@ def create_object_htmls(self, navbar, footer):
html_page_path = os.path.join(self.pipeline_reports, f"{image_result}.html".lower())
figures = []

if self.prj.cfg["multi_result_files"] is True:
pipeline_types = ["sample", "project"]
else:
pipeline_types = [self.prj.backend.pipeline_type]
pipeline_types = ["sample", "project"]

for pipeline_type in pipeline_types:
self.prj.backend.pipeline_type = pipeline_type
Expand Down
12 changes: 7 additions & 5 deletions tests/data/output_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ type: object
properties:
pipeline_name: "default_pipeline_name"
samples:
type: object
properties:
result_name:
type: string
description: "ResultName"
type: array
items:
type: object
properties:
result_name:
type: string
description: "ResultName"

90 changes: 46 additions & 44 deletions tests/data/output_schema_as_JSON_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,56 @@ type: object
properties:
pipeline_name: "default_pipeline_name"
samples:
type: object
properties:
number_of_things:
type: integer
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
output_image:
$ref: "#/$defs/image"
description: "This an output image"
output_file:
$ref: "#/$defs/file"
description: "This a path to the output image"
collection_of_images:
type: array
description: A collection of images.
items:
type: array
items:
type: object
properties:
number_of_things:
type: integer
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
output_image:
$ref: "#/$defs/image"
description: "This an output image"
output_file:
$ref: "#/$defs/file"
description: "This a path to the output image"
collection_of_images:
type: array
description: A collection of images.
items:
type: object
properties:
prop1:
$ref: "#/$defs/file"
description: An example file.
nested_object:
type: object
description: An object containing output file and image.
properties:
prop1:
example_property_1:
$ref: "#/$defs/file"
description: An example file.
nested_object:
type: object
description: An object containing output file and image.
properties:
example_property_1:
$ref: "#/$defs/file"
description: An example file.
example_property_2:
$ref: "#/$defs/image"
description: An example image.
output_file_nested_object:
type: object
description: First Level
properties:
example_property_1:
type: object
description: Second Level
properties:
third_level_property_1:
$ref: "#/$defs/file"
description: Third Level
example_property_2:
type: object
description: Second Level
properties:
third_level_property_1:
$ref: "#/$defs/file"
description: Third Level
example_property_2:
$ref: "#/$defs/image"
description: An example image.
output_file_nested_object:
type: object
description: First Level
properties:
example_property_1:
type: object
description: Second Level
properties:
third_level_property_1:
$ref: "#/$defs/file"
description: Third Level
example_property_2:
type: object
description: Second Level
properties:
third_level_property_1:
$ref: "#/$defs/file"
description: Third Level
$defs:
image:
type: object
Expand Down
42 changes: 22 additions & 20 deletions tests/data/output_schema_html_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,28 @@ properties:
type: boolean
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras pharetra."
samples:
type: object
properties:
smooth_bw:
path: "aligned_{genome}/{sample_name}_smooth.bw"
type: string
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce nec cursus nulla."
aligned_bam:
path: "aligned_{genome}/{sample_name}_sort.bam"
type: string
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus ipsum erat, porta in condimentum viverra, pellentesque in nisl. Nulla rhoncus nibh est, quis malesuada diam suscipit at. In ut diam."
peaks_bed:
path: "peak_calling_{genome}/{sample_name}_peaks.bed"
type: string
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce nec cursus nulla."
output_file:
$ref: "#/$defs/file"
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce nec cursus nulla."
output_image:
$ref: "#/$defs/image"
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras pharetra."
type: array
items:
type: object
properties:
smooth_bw:
path: "aligned_{genome}/{sample_name}_smooth.bw"
type: string
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce nec cursus nulla."
aligned_bam:
path: "aligned_{genome}/{sample_name}_sort.bam"
type: string
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus ipsum erat, porta in condimentum viverra, pellentesque in nisl. Nulla rhoncus nibh est, quis malesuada diam suscipit at. In ut diam."
peaks_bed:
path: "peak_calling_{genome}/{sample_name}_peaks.bed"
type: string
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce nec cursus nulla."
output_file:
$ref: "#/$defs/file"
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce nec cursus nulla."
output_image:
$ref: "#/$defs/image"
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras pharetra."
$defs:
image:
type: object
Expand Down
50 changes: 26 additions & 24 deletions tests/data/sample_output_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,32 @@ type: object
properties:
pipeline_name: "default_pipeline_name"
samples:
type: object
properties:
number_of_things:
type: integer
description: "Number of things"
percentage_of_things:
type: number
description: "Percentage of things"
name_of_something:
type: string
description: "Name of something"
switch_value:
type: boolean
description: "Is the switch on or off"
output_file:
$ref: "#/$defs/file"
description: "This a path to the output file"
output_image:
$ref: "#/$defs/image"
description: "This a path to the output image"
md5sum:
type: string
description: "MD5SUM of an object"
highlight: true
type: array
items:
type: object
properties:
number_of_things:
type: integer
description: "Number of things"
percentage_of_things:
type: number
description: "Percentage of things"
name_of_something:
type: string
description: "Name of something"
switch_value:
type: boolean
description: "Is the switch on or off"
output_file:
$ref: "#/$defs/file"
description: "This a path to the output file"
output_image:
$ref: "#/$defs/image"
description: "This a path to the output image"
md5sum:
type: string
description: "MD5SUM of an object"
highlight: true
$defs:
image:
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,22 @@ properties:
type: boolean
description: "Is the switch on or off"
samples:
type: object
properties:
smooth_bw:
path: "aligned_{genome}/{sample_name}_smooth.bw"
type: string
description: "A smooth bigwig file"
aligned_bam:
path: "aligned_{genome}/{sample_name}_sort.bam"
type: string
description: "A sorted, aligned BAM file"
peaks_bed:
path: "peak_calling_{genome}/{sample_name}_peaks.bed"
type: string
description: "Peaks in BED format"
type: array
items:
type: object
properties:
smooth_bw:
path: "aligned_{genome}/{sample_name}_smooth.bw"
type: string
description: "A smooth bigwig file"
aligned_bam:
path: "aligned_{genome}/{sample_name}_sort.bam"
type: string
description: "A sorted, aligned BAM file"
peaks_bed:
path: "peak_calling_{genome}/{sample_name}_peaks.bed"
type: string
description: "Peaks in BED format"
status:
type: object
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,19 @@ properties:
type: boolean
description: "Is the switch on or off"
samples:
type: object
properties:
smooth_bw:
path: "aligned_{genome}/{sample_name}_smooth.bw"
type: string
description: "A smooth bigwig file"
aligned_bam:
path: "aligned_{genome}/{sample_name}_sort.bam"
type: string
description: "A sorted, aligned BAM file"
peaks_bed:
path: "peak_calling_{genome}/{sample_name}_peaks.bed"
type: string
description: "Peaks in BED format"
type: array
items:
type: object
properties:
smooth_bw:
path: "aligned_{genome}/{sample_name}_smooth.bw"
type: string
description: "A smooth bigwig file"
aligned_bam:
path: "aligned_{genome}/{sample_name}_sort.bam"
type: string
description: "A sorted, aligned BAM file"
peaks_bed:
path: "peak_calling_{genome}/{sample_name}_peaks.bed"
type: string
description: "Peaks in BED format"
Loading

0 comments on commit c47035d

Please sign in to comment.