Integration and reproducibility notes for using PA as a de-novo backend (e.g. the
denovo_benchmarks harness, or
the borgonovo reference-free assembler). See the top-level
README.md for the container and the high-level I/O contract; this
file collects the lower-level gotchas. Every claim is cited to file:line.
- Submodule URL is SSH.
.gitmodulespointsdepthchargeatgit@github.com:Alfred-N/depthcharge.git, so a recursive clone fails without an SSH key. The container works around this by rewriting the URL to HTTPS beforegit submodule update(misc/container.def:19-21); do the same (or clone the fork over HTTPS) outside the container. pkg_resources/ setuptools.environment.yml:11pinspytorch-lightning==2.1.1, which still imports the deprecatedpkg_resources. Recent setuptools (≥ 81) no longer ship it, andenvironment.ymldoes not pin setuptools — if you hitModuleNotFoundError: pkg_resources, addsetuptools<81to the env.- mzML support is untested in the bundled env. depthcharge parses mzML/mzXML
through
pyteomics.mzml/pyteomics.mzxml(depthchargedepthcharge/data/parsers.py:14-15), which typically also needspsimsfor PSI-MS CV terms.environment.ymlonly exercises the MGF path, so expect to install extra pyteomics dependencies before using--suffix .mzML.
- Run from the repo root. Config paths are relative —
configs/master_bm.yamlreferencesconfigs/downstream/casanovo_bm.yaml(configs/master_bm.yaml:38) — and the containercds into the repo before invoking it (misc/denovo_benchmarks_pairwise/make_predictions.sh:15-20). --predict_onlytakes a value. It istype=int, default=0(src/parse_args.py:221-226) cast to bool (parse_args.py:306), i.e.--predict_only=1, not a bare flag. (In the container it comes frompredict_only: 1inconfigs/master_bm.yaml:30.) Prediction then runs throughtrainer.predict(src/main.py:207-209).- Output-dir creation aborts if
outs/exists.create_output_dirscallsos.makedirs(..., exist_ok=False)for bothoutput_dirandlog_dir(src/parse_args.py:391-392). Withfixed_output_dir: 1(configs/master_bm.yaml:31) the paths are not uniquified, so a leftoverouts/from a previous run will crash the next one — delete it first.
setup()needs a Trainer.BenchmarkDataModule.setup(andLanceDataModule.setup) readself.trainer.global_rank/self.trainer.world_sizeto build theShardedBatchSampler(src/data/lance_data_module.py:119-125). To build a dataloader without a realpl.Trainer, attach a dummy, e.g.dm.trainer = SimpleNamespace(global_rank=0, world_size=1)before callingdm.setup("predict").
Neither the container nor make_predictions.sh emits per-step probability
distributions over the token vocabulary (the mzTab carries only scalar per-residue
confidences, and outputs.csv simulates even those —
output_mapper.py:191).
A borgonovo-style backend that needs the distributions must call the model
directly:
- The decoder behind
decoder_model: casanovo_decoderisPeptideDecoder.forward(tokens, precursors, memory, memory_key_padding_mask)(src/models/casanovo/decoder_interface.py:109,166). - It returns
(scores, tokens), withscoresof shape(B, L, V)(raw logits; softmax for probabilities) —return self.final(preds), tokens(decoder_interface.py:163). - The first step uses
decoder(None, precursors, memory, mem_masks);Nonetokens means only the precursor embedding is fed in (decoder_interface.py:137-141; called atsrc/wrappers/beam_search.py:84, then iteratively atbeam_search.py:121-126). precursorsis[mass, charge, mz], wheremass = mz·charge(protonated cluster mass — see the precursor-mass note in the README) (src/wrappers/casanovo_trainer_wrapper.py:150-154).decoder.reversecontrols decoding direction; the released checkpoint runs withreverse: True(configs/downstream/casanovo_bm.yaml), set onto the decoder atsrc/wrappers/casanovo_trainer_wrapper.py:99, which means C→N order (stop token$appears first;beam_search.py:232).- Greedy decoding is just beam search with
n_beams: 1(configs/downstream/casanovo_bm.yaml; wrapper default atsrc/wrappers/casanovo_trainer_wrapper.py:76). - Token labels are
C+57.021,M+15.995, … (src/utils.py:33,49), not Casanovo'sC[Carbamidomethyl]/ ProFormaC[UNIMOD:4].