Skip to content

Commit

Permalink
add(bam delivery message) (#3876) (patch)
Browse files Browse the repository at this point in the history
# Description

add bam delivery message
  • Loading branch information
ChrOertlin authored Oct 22, 2024
1 parent b938852 commit 1e08f4a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
20 changes: 20 additions & 0 deletions cg/services/delivery_message/messages/bam_message.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from cg.services.delivery_message.messages.delivery_message import DeliveryMessage
from cg.services.delivery_message.messages.utils import get_caesar_delivery_path
from cg.store.models import Case


class BamMessage(DeliveryMessage):

def create_message(self, cases: list[Case]) -> str:
delivery_path: str = get_caesar_delivery_path(cases[0])
return (
f"Hello,\n\n"
f"The following samples in this order have been sequenced:\n\n"
f"{self.generate_sample_name_list(cases)}\n\n"
f"The bam files have been uploaded to your inbox on Caesar at:\n\n"
f"{delivery_path}"
)

@staticmethod
def generate_sample_name_list(cases: list[Case]) -> str:
return "\n".join([sample.name for case in cases for sample in case.samples])
2 changes: 2 additions & 0 deletions cg/services/delivery_message/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
StatinaMessage,
)
from cg.services.delivery_message.messages.analysis_message import AnalysisMessage
from cg.services.delivery_message.messages.bam_message import BamMessage
from cg.services.delivery_message.messages.delivery_message import DeliveryMessage
from cg.services.delivery_message.messages.fastq_analysis_message import (
FastqAnalysisMessage,
Expand Down Expand Up @@ -55,6 +56,7 @@ def get_message_strategy_from_data_delivery(case: Case) -> DeliveryMessage:
DataDelivery.ANALYSIS_SCOUT: AnalysisScoutMessage,
DataDelivery.FASTQ_ANALYSIS_SCOUT: FastqAnalysisScoutMessage,
DataDelivery.STATINA: StatinaMessage,
DataDelivery.BAM: BamMessage,
}


Expand Down

0 comments on commit 1e08f4a

Please sign in to comment.