MCPcopy Create free account
hub / github.com/apple/ml-simplefold / process_input

Method process_input

src/simplefold/wrapper.py:293–319  ·  view source on GitHub ↗
(self, aa_seq)

Source from the content-addressed store, hash-verified

291 )
292
293 def process_input(self, aa_seq):
294 # process fasta files to input format
295 download_fasta_utilities(self.cache)
296 # save the input sequence to a fasta file
297 with open(self.cache / "input.fasta", "w") as f:
298 f.write(f">A|Protein\n{aa_seq}\n")
299 data = [self.cache / "input.fasta"]
300 process_fastas(
301 data=data,
302 out_dir=self.cache,
303 ccd_path=self.cache / "ccd.pkl",
304 )
305
306 # prepare the target protein data for inference
307 struct_file = self.cache / "structures" / "input.npz"
308 record_file = self.cache / "records" / "input.json"
309 batch, structure, record = process_one_inference_structure(
310 struct_file,
311 record_file,
312 self.tokenizer,
313 self.featurizer,
314 self.processor,
315 self.esm_model,
316 self.esm_dict,
317 self.af2_to_esm,
318 )
319 return batch, structure, record
320
321 def run_inference(self, batch, model, plddt_model, device):
322 # run inference for target protein

Callers

nothing calls this directly

Calls 4

download_fasta_utilitiesFunction · 0.90
process_fastasFunction · 0.90
writeMethod · 0.80

Tested by

no test coverage detected