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

Enable generic & cancer dataset #49

Merged
merged 1 commit into from
Jun 30, 2021
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
25 changes: 18 additions & 7 deletions cubi_tk/snappy/pull_sheets.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,20 @@ def on_visit_material(self, material, node_path, study=None, assay=None):
sample = material
characteristics = {c.name: c for c in source.characteristics}
comments = {c.name: c for c in source.comments}
batch = characteristics.get("Batch", comments.get("Batch"))
family = characteristics.get("Family", comments.get("Family"))
father = characteristics.get("Father", comments.get("Father"))
mother = characteristics.get("Mother", comments.get("Mother"))
sex = characteristics.get("Sex", comments.get("Sex"))
affected = characteristics.get("Disease status", comments.get("Disease status"))
self.sources[material.name] = Source(
family=characteristics["Family"].value[0],
family=family.value[0] if family else None,
source_name=source.name,
batch_no=characteristics.get("Batch", comments.get("Batch")).value[0],
father=characteristics["Father"].value[0],
mother=characteristics["Mother"].value[0],
sex=characteristics["Sex"].value[0],
affected=characteristics["Disease status"].value[0],
batch_no=batch.value[0] if batch else None,
father=father.value[0] if father else None,
mother=mother.value[0] if mother else None,
sex=sex.value[0] if sex else None,
affected=affected.value[0] if affected else None,
sample_name=sample.name,
)
elif material.type == "Library Name":
Expand All @@ -199,14 +205,19 @@ def on_visit_material(self, material, node_path, study=None, assay=None):
library_type = "WES"
elif library.name.split("-")[-1].startswith("Panel_seq"):
library_type = "Panel_seq"
elif library.name.split("-")[-1].startswith("mRNA_seq"):
library_type = "mRNA_seq"
else:
raise Exception("Cannot infer library type from %s" % library.name)

folder_name = first_value("Folder name", node_path)
if not folder_name:
folder_name = library.name
self.samples[sample.name] = Sample(
source=self.sources[sample.name],
library_name=library.name,
library_type=library_type,
folder_name=first_value("Folder name", node_path),
folder_name=folder_name,
seq_platform=first_value("Platform", node_path),
library_kit=first_value("Library Kit", node_path),
)
Expand Down
2 changes: 1 addition & 1 deletion cubi_tk/sodar/pull_raw_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def execute(self) -> typing.Optional[int]:
if not out_path.exists():
out_path.mkdir(parents=True)

investigation = api.investigations.get(
investigation = api.samplesheet.retrieve(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did this affect the other sample sheet type?

@holtgrewe, care to comment? I'm not familiar with SODAR API syntax...

sodar_url=self.config.sodar_url,
sodar_api_token=self.config.sodar_api_token,
project_uuid=self.config.project_uuid,
Expand Down