(continuing the same chat, ChatGPT 5.4 Thinking)
(your question verbatim)
Tu peux me confirmer ou non que l'ordre des atomes dans les npy est toujours le meme?
Hello, can you explain to me how to get the coordinates corresponding to my conformer indices? I was given the indices before, and now I would like to know how to get the corresponding coordinates. I was given a link to the GitHub repo of the coordinates:
https://github.com/sjdv1982/nucleotide-library (it contains a README)
and the following explanation:
Your conformer indices should correspond to the conformer array that you get when you concatenate the primary .npy and the extension .npy
| import numpy as np | |
| import jax | |
| from jax import numpy as jnp | |
| def _run_argsort_numpy(args) -> jnp.ndarray: | |
| jax.debug.print("Run argsort using Numpy") | |
| arr, axis = args | |
| return np.argsort(arr, axis=axis).astype(np.int32) | |
| def run_argsort_numpy(arr:jnp.ndarray, axis=None) -> jnp.ndarray: |
| # Author: Sjoerd de Vries, CNRS | |
| # license: public domain | |
| import sys | |
| import os | |
| import h5py | |
| import numpy as np | |
| active_paper_file = sys.argv[1] | |
| target_directory = sys.argv[2] |
| """ | |
| 11 cards, 55 points in total | |
| S = current score | |
| K = cards remaining | |
| score increase = (chance to draw a non-joker * average value of non-joker) - (chance to draw a joker * S) | |
| = (K-1)/K * (55-S)/(K-1) - 1/K * S | |
| = (55-S)/K - S/K | |
| = (55 - 2S)/K |
| """ | |
| Parses the biological assemblies of a mmCIF file | |
| For each assembly. | |
| a list of 4x4 transformation matrices is computed, and returned together | |
| with a list of chains | |
| Each transformation matrix is to be applied to each chain in the list | |
| Biological assemblies may contain non-protein or fantasy chains; it is possible | |
| to pass in a list of interesting chains, and the returned chain lists will | |
| then be filtered accordingly |
| """fivethirtyeight.com Riddler Classic, Dec 11 | |
| https://fivethirtyeight.com/features/how-high-can-you-count-with-menorah-math/ | |
| ''' | |
| From Alex van den Brandhof comes a matter of life and death: | |
| The Potentate of Puzzles decides to give five unlucky citizens a test. The potentate has countless red hats, green hats and blue hats. She says to the citizens, “Tomorrow, you will all be blindfolded as I place one of these hats on each of your heads. Once all the hats are placed, your blindfolds will be removed. At this point, there will be no communication between any of you! As soon as I give a signal, everyone must guess — at the same time — the color of the hat atop their own head. If at least one of you guesses correctly, all of you will survive! Otherwise …” | |
| The potentate continues: “The good news is that there’s a little more information you’ll have. I will be arranging you into two rows facing each other, with two of you in one row and three of you in the other. Citizens in the same row cannot see each other, |
| import numpy as np | |
| fragments = np.load("fragments_clust.npy") | |
| redun = np.load("redundancy-masks/1.0-seqclust-50.npy").astype(bool) | |
| fragments = fragments[redun] | |
| fragments_aa = np.array([f for f in fragments if f["motif"] == b"AAA"]) | |
| clus = [f for f in fragments_aa if f["clust1.0"] == 700] | |
| print(clus) |
| """ | |
| Recursive Bayesian approach to create optimal tournament schedules | |
| Solution for The Riddler Classic, July 19: https://fivethirtyeight.com/features/can-you-construct-the-optimal-tournament/ | |
| Results: | |
| 4 players, 4 games: | |
| Game 1. Player A vs player B, winner becomes the favorite. | |
| Game 2. Favorite vs player C. |