Giter VIP home page Giter VIP logo

af2rank's People

Contributors

jproney avatar sokrypton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

af2rank's Issues

XlaRuntimeError: FAILED_PRECONDITION: DNN library initialization failed.

Hi AF2Rank authors! I was trying to run the colab notebook but met the following DNN library initialization failed error.
When I run the first cell under "## rank structures"

NAME = "1mjc"
CHAIN = "A" # this can be multiple chains
NATIVE_PATH = f"{NAME}.pdb"
DECOY_DIR = f"{NAME}"

if save_output_pdbs:
  os.makedirs(f"{NAME}_output",ok_exists=True)


# get data
%shell wget -qnc https://files.ipd.uw.edu/pub/decoyset/natives/{NAME}.pdb
%shell wget -qnc https://files.ipd.uw.edu/pub/decoyset/decoys/{NAME}.zip
%shell unzip -qqo {NAME}.zip

# setup model
clear_mem()
af = af2rank(NATIVE_PATH, CHAIN, model_name=SETTINGS["model_name"])

I met the following error

---------------------------------------------------------------------------
XlaRuntimeError                           Traceback (most recent call last)
[<ipython-input-4-5740c8be5964>](https://localhost:8080/#) in <cell line: 17>()
     15 # setup model
     16 clear_mem()
---> 17 af = af2rank(NATIVE_PATH, CHAIN, model_name=SETTINGS["model_name"])

21 frames
[<ipython-input-2-b0744074ff0e>](https://localhost:8080/#) in __init__(self, pdb, chain, model_name, model_names)
     75                  "model_name":model_name,
     76                  "model_names":model_names}
---> 77     self.reset()
     78 
     79   def reset(self):

[<ipython-input-2-b0744074ff0e>](https://localhost:8080/#) in reset(self)
     78 
     79   def reset(self):
---> 80     self.model = mk_af_model(protocol="fixbb",
     81                              use_templates=True,
     82                              use_multimer=self.args["use_multimer"],

[/content/colabdesign/af/model.py](https://localhost:8080/#) in __init__(self, protocol, use_multimer, use_templates, debug, data_dir, **kwargs)
    118     self._model_params, self._model_names = [],[]
    119     for model_name in model_names:
--> 120       params = data.get_model_haiku_params(model_name=model_name, data_dir=data_dir, fuse=True)
    121       if params is not None:
    122         if not self._args["use_multimer"] and not self._args["use_templates"]:

[/content/colabdesign/af/alphafold/model/data.py](https://localhost:8080/#) in get_model_haiku_params(model_name, data_dir, fuse)
     39     with open(path, 'rb') as f:
     40       params = np.load(io.BytesIO(f.read()), allow_pickle=False)
---> 41     return utils.flat_params_to_haiku(params, fuse=fuse)

[/content/colabdesign/af/alphafold/model/utils.py](https://localhost:8080/#) in flat_params_to_haiku(params, fuse)
    108             P[f"{k}/{c}"] = {}
    109             for d in ["bias","weights"]:
--> 110               P[f"{k}/{c}"][d] = jnp.concatenate([L[d],R[d]],-1)
    111           P[f"{k}/center_norm"] = P.pop(f"{k}/center_layer_norm")
    112           P[f"{k}/left_norm_input"] = P.pop(f"{k}/layer_norm_input")

[/usr/local/lib/python3.10/dist-packages/jax/_src/numpy/lax_numpy.py](https://localhost:8080/#) in concatenate(arrays, axis, dtype)
   1852   k = 16
   1853   while len(arrays_out) > 1:
-> 1854     arrays_out = [lax.concatenate(arrays_out[i:i+k], axis)
   1855                   for i in range(0, len(arrays_out), k)]
   1856   return arrays_out[0]

[/usr/local/lib/python3.10/dist-packages/jax/_src/numpy/lax_numpy.py](https://localhost:8080/#) in <listcomp>(.0)
   1852   k = 16
   1853   while len(arrays_out) > 1:
-> 1854     arrays_out = [lax.concatenate(arrays_out[i:i+k], axis)
   1855                   for i in range(0, len(arrays_out), k)]
   1856   return arrays_out[0]

[/usr/local/lib/python3.10/dist-packages/jax/_src/lax/lax.py](https://localhost:8080/#) in concatenate(operands, dimension)
    615     if isinstance(op, Array):
    616       return type_cast(Array, op)
--> 617   return concatenate_p.bind(*operands, dimension=dimension)
    618 
    619 

[/usr/local/lib/python3.10/dist-packages/jax/_src/core.py](https://localhost:8080/#) in bind(self, *args, **params)
    384     assert (not config.jax_enable_checks or
    385             all(isinstance(arg, Tracer) or valid_jaxtype(arg) for arg in args)), args
--> 386     return self.bind_with_trace(find_top_trace(args), args, params)
    387 
    388   def bind_with_trace(self, trace, args, params):

[/usr/local/lib/python3.10/dist-packages/jax/_src/core.py](https://localhost:8080/#) in bind_with_trace(self, trace, args, params)
    387 
    388   def bind_with_trace(self, trace, args, params):
--> 389     out = trace.process_primitive(self, map(trace.full_raise, args), params)
    390     return map(full_lower, out) if self.multiple_results else full_lower(out)
    391 

[/usr/local/lib/python3.10/dist-packages/jax/_src/core.py](https://localhost:8080/#) in process_primitive(self, primitive, tracers, params)
    819 
    820   def process_primitive(self, primitive, tracers, params):
--> 821     return primitive.impl(*tracers, **params)
    822 
    823   def process_call(self, primitive, f, tracers, params):

[/usr/local/lib/python3.10/dist-packages/jax/_src/dispatch.py](https://localhost:8080/#) in apply_primitive(prim, *args, **params)
    129   try:
    130     in_avals, in_shardings = util.unzip2([arg_spec(a) for a in args])
--> 131     compiled_fun = xla_primitive_callable(
    132         prim, in_avals, OrigShardings(in_shardings), **params)
    133   except pxla.DeviceAssignmentMismatchError as e:

[/usr/local/lib/python3.10/dist-packages/jax/_src/util.py](https://localhost:8080/#) in wrapper(*args, **kwargs)
    261         return f(*args, **kwargs)
    262       else:
--> 263         return cached(config._trace_context(), *args, **kwargs)
    264 
    265     wrapper.cache_clear = cached.cache_clear

[/usr/local/lib/python3.10/dist-packages/jax/_src/util.py](https://localhost:8080/#) in cached(_, *args, **kwargs)
    254     @functools.lru_cache(max_size)
    255     def cached(_, *args, **kwargs):
--> 256       return f(*args, **kwargs)
    257 
    258     @functools.wraps(f)

[/usr/local/lib/python3.10/dist-packages/jax/_src/dispatch.py](https://localhost:8080/#) in xla_primitive_callable(prim, in_avals, orig_in_shardings, **params)
    220       return out,
    221   donated_invars = (False,) * len(in_avals)
--> 222   compiled = _xla_callable_uncached(
    223       lu.wrap_init(prim_fun), prim.name, donated_invars, False, in_avals,
    224       orig_in_shardings)

[/usr/local/lib/python3.10/dist-packages/jax/_src/dispatch.py](https://localhost:8080/#) in _xla_callable_uncached(fun, name, donated_invars, keep_unused, in_avals, orig_in_shardings)
    250       fun, name, donated_invars, keep_unused, True, in_avals, orig_in_shardings,
    251       lowering_platform=None)
--> 252   return computation.compile().unsafe_call
    253 
    254 

[/usr/local/lib/python3.10/dist-packages/jax/_src/interpreters/pxla.py](https://localhost:8080/#) in compile(self, compiler_options)
   2204             **self.compile_args)
   2205       else:
-> 2206         executable = UnloadedMeshExecutable.from_hlo(
   2207             self._name,
   2208             self._hlo,

[/usr/local/lib/python3.10/dist-packages/jax/_src/interpreters/pxla.py](https://localhost:8080/#) in from_hlo(***failed resolving arguments***)
   2542           break
   2543 
-> 2544     xla_executable, compile_options = _cached_compilation(
   2545         hlo, name, mesh, spmd_lowering,
   2546         tuple_args, auto_spmd_lowering, allow_prop_to_outputs,

[/usr/local/lib/python3.10/dist-packages/jax/_src/interpreters/pxla.py](https://localhost:8080/#) in _cached_compilation(computation, name, mesh, spmd_lowering, tuple_args, auto_spmd_lowering, _allow_propagation_to_outputs, host_callbacks, backend, da, pmap_nreps, compiler_options_keys, compiler_options_values)
   2452       "Finished XLA compilation of {fun_name} in {elapsed_time} sec",
   2453       fun_name=name, event=dispatch.BACKEND_COMPILE_EVENT):
-> 2454     xla_executable = dispatch.compile_or_get_cached(
   2455         backend, computation, dev, compile_options, host_callbacks)
   2456   return xla_executable, compile_options

[/usr/local/lib/python3.10/dist-packages/jax/_src/dispatch.py](https://localhost:8080/#) in compile_or_get_cached(backend, computation, devices, compile_options, host_callbacks)
    494 
    495   if not use_compilation_cache:
--> 496     return backend_compile(backend, computation, compile_options,
    497                            host_callbacks)
    498 

[/usr/local/lib/python3.10/dist-packages/jax/_src/profiler.py](https://localhost:8080/#) in wrapper(*args, **kwargs)
    312   def wrapper(*args, **kwargs):
    313     with TraceAnnotation(name, **decorator_kwargs):
--> 314       return func(*args, **kwargs)
    315     return wrapper
    316   return wrapper

[/usr/local/lib/python3.10/dist-packages/jax/_src/dispatch.py](https://localhost:8080/#) in backend_compile(backend, module, options, host_callbacks)
    462   # TODO(sharadmv): remove this fallback when all backends allow `compile`
    463   # to take in `host_callbacks`
--> 464   return backend.compile(built_c, compile_options=options)
    465 
    466 _ir_dump_counter = itertools.count()

XlaRuntimeError: FAILED_PRECONDITION: DNN library initialization failed. Look at the errors above for more details.

Do you know how to deal with this error?
Thanks!

Getting PAE matrix

Hi,

Nice work! Would it be possible to also return the PAE matrix for each decoy?

Thank you!

Multimer functions

Why, when using a "correct" template with two or more chains, does the relative orientation of the chains in the ranked or predicted structures (without recycling steps) remain the same? Since templates are encoded individually for each chain, I'm uncertain about how the AF2Rank multimer utility can mimic the correct orientation or binding interfaces of the structure. In other words how can I be sure that AF2Rank is actually ranking my input structure as a complex and not just ranks a reassembled structure?

Dealing with templates that have missing residues

What is the "proper" way to use a template that has missing residues? Let's say I have a template that has 20 missing residues due to an unresolved loop region, and I'm not interested in the region for the purpose of assessing pLDDT. I tried to give AF2Rank the template as is and a sequence with the gap token represented by "X", but it seems that AF2Rank processes the template as a contiguous chain and as such gives an error message due to sequence length mismatch. In this case, am I supposed to give AF2Rank a sequence with no gap tokens? Alternatively, I know that I can treat the template as a dimer and use a alphafold_multimer model, but I'm not sure if dealing with a monomeric protein with a multimer model is the best way to score the structure.

"decoy_set/***.txt" files

Dear James and Sergey,

Your work is really interesting and enables accurate structure prediction without MSAs. This will be very useful for my project.

From this line on in file test_templates.py l187 five txt files are read in. Similarly for the casp prediction a file called gdt_ref_all.txt is read in. Could you please share these files and potentially other necessary files to run the script that I've missed?

Thank you in advance!

Args to reproduce main functionality?

Hi, just wanted to double check if I'm using the right args to use the test_templates.py script to reproduce the ranking method that's described in the paper -- should I be using

--seq_replacement - --add_sidechains_mask_cb ?

Might be helpful to give an example call in the README, since if I understand right these aren't the default? Thanks!

Colab notebook: Template used in ranking structures and Runs on multimers

Hi there,

Thanks a lot for making this repo available.

I just wanted to ask two questions I have when I tested the colab notebook.

  1. Could you tell me is there a template taken when ranking decoy structures (e.g. the native structure)? I was a little bit confused when reading the set up code. Did the NATIVE PATH in the following cell indicate the template to be used?
    image

  2. When running multimers, even if I have changed model_mode into alphafold-multimer in the settings cell, I still got the following error: "ValueError: Only single model PDBs are supported. Found 0 models.". I also attached a screenshot below. Could you tell me if it's because the chain name only allows a string of length = 1?
    image

Runs on Multimeric Structures

First of all thank you for making this repo available.

I was wondering if you tested the algorithm on multimeric structures (having more than chain in the PDB file/Structure) or if you have any intuition regarding this possibility.

Best.
Liv

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.