Skip to content

Commit 12af5ee

Browse files
append mode as samplename suffix by traversing filepath
1 parent 660a581 commit 12af5ee

1 file changed

Lines changed: 27 additions & 4 deletions

File tree

multiqc/modules/proteinfold/proteinfold.py

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class MultiqcModule(BaseMultiqcModule):
1414
The module parses results generated by a variety of protein structure prediction programs in the [ProteinFold](https://nf-co.re/proteinfold/) pipeline.
1515
This includes (as of release v2.0):
1616
- [AlphaFold2](https://github.com/google-deepmind/alphafold)
17+
- [AlphaFold3](https://github.com/google-deepmind/alphafold3)
1718
- [ColabFold](https://github.com/sokrypton/ColabFold)
1819
- [ESMFold](https://github.com/facebookresearch/esm)
1920
- [RoseTTaFold-All-Atom](https://github.com/baker-laboratory/RoseTTAFold-All-Atom)
@@ -32,6 +33,7 @@ def __init__(self):
3233
href=[
3334
"https://nf-co.re/proteinfold",
3435
"https://github.com/google-deepmind/alphafold",
36+
"https://github.com/google-deepmind/alphafold3",
3537
"https://github.com/sokrypton/ColabFold",
3638
"https://github.com/facebookresearch/esm",
3739
"https://github.com/baker-laboratory/RoseTTAFold-All-Atom",
@@ -79,21 +81,42 @@ def __init__(self):
7981
"rank_19": ["_rank_19"],
8082
"rank_20": ["_rank_20"],
8183
"rank_21": ["_rank_21"],
82-
"rank_22": ["_rank_22"],
84+
"ranmodek_22": ["_rank_22"],
8385
"rank_23": ["_rank_23"],
8486
"rank_24": ["_rank_24"],
8587
}
8688

89+
mode_dict = {
90+
"alphafold2": "AlphaFold2",
91+
"alphafold3": "AlphaFold3",
92+
"colabfold": "ColabFold",
93+
"esmfold": "ESMFold",
94+
"rosettafold2na": "RoseTTAFold2-Nucleic-Acids",
95+
"rosettafold_all_atom": "RoseTTAFold-All-Atom",
96+
"helixfold3": "HelixFold3",
97+
"boltz": "Boltz",
98+
}
99+
87100
self.proteinfold_data: Dict[str, Any] = {}
88101
# I want to enable sample grouping: https://docs.seqera.io/multiqc/reports/customisation#sample-grouping
89102

90103
for f in self.find_log_files("proteinfold"):
91104
self.add_data_source(f)
92105

93-
samplename = f["s_name"].split("_")[0]
94-
clean_samplename = self.clean_s_name(samplename, f)
95-
self.proteinfold_data.setdefault(clean_samplename, {}) # Set default creates if doesn't already exist
106+
raw_samplename = f["s_name"].split("_")[0]
96107
filepath = Path(f["root"]) / f["fn"]
108+
mode = "UNKNOWN"
109+
for parent in filepath.parents:
110+
if parent.name in mode_dict: # traverse up the filepath until you hit a mode labelled dir
111+
mode = mode_dict[parent.name]
112+
break
113+
114+
mode_samplename = f"{raw_samplename}_{mode}"
115+
samplename = self.clean_s_name(mode_samplename, f)
116+
print(filepath)
117+
print(samplename)
118+
119+
self.proteinfold_data.setdefault(samplename, {}) # Set default creates if doesn't already exist
97120

98121
if f["fn"].endswith("_msa.tsv"):
99122
self.proteinfold_data[samplename]["msa_depth"] = f["f"].count("\n")

0 commit comments

Comments
 (0)