Skip to content

Commit

Permalink
Merge branch 'main' into 256_check_local_and_pull_sheets_cancer
Browse files Browse the repository at this point in the history
  • Loading branch information
slaemmle authored Feb 20, 2025
2 parents 86d7ecf + 7253ad8 commit 85c545e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/cubi_tk/sodar/pull_raw_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def __init__(self):
#: Sample by sample name.
self.samples = {}

self.prev_process = None

def on_visit_material(self, material, node_path, study=None, assay=None):
super().on_visit_material(material, node_path, study, assay)
material_path = [x for x in node_path if hasattr(x, "type")]
Expand All @@ -67,7 +69,10 @@ def on_visit_material(self, material, node_path, study=None, assay=None):
self.sources[material.name]["batch_no"] = batch.value[0] if batch else None
family = characteristics.get("Family", comments.get("Family"))
self.sources[material.name]["family"] = family.value[0] if family else None
elif material.type == "Library Name":
elif material.type == "Library Name" or(
material.type == "Extract Name"
and self.prev_process.protocol_ref.startswith("Library construction")
):
library = material
sample = material_path[0]
folder = first_value("Folder name", node_path)
Expand All @@ -78,6 +83,9 @@ def on_visit_material(self, material, node_path, study=None, assay=None):
"library_name": library.name,
"folder_name": folder,
}
def on_visit_process(self, process, node_path, study=None, assay=None):
super().on_visit_process(process, study, assay)
self.prev_process = process


class PullRawDataCommand:
Expand Down

0 comments on commit 85c545e

Please sign in to comment.