Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work correctly with Dynamo table #8

Open
builab opened this issue Nov 10, 2023 · 2 comments
Open

Doesn't work correctly with Dynamo table #8

builab opened this issue Nov 10, 2023 · 2 comments

Comments

@builab
Copy link

builab commented Nov 10, 2023

When I tried to use ArtiaX with dynamo, it didn't display the particle orientation properly. With the same dataset, converting to Relion4 format, then ArtiaX displayed the star file correctly. Can you check this?

@jchutchings
Copy link

jchutchings commented Jul 12, 2024

Hi,

I have found the same issue: orientations in RELION look as expected, but the equivalent Dynamo table looks incorrect.

Attaching a small set of equivalent particles in RELION (v3.1) star and Dynamo tbl format, if that helps with troubleshooting:
data1_tbl.txt
data1_star.txt

This is with ChimeraX v1.8 and Artiax v0.4.7.

Let us know if you need more info and thanks in advance!

Best,
Josh

@builab
Copy link
Author

builab commented Feb 1, 2025

Hi ArtiaX developer & Josh,
I spent a bit of time to reverse what ArtiaX writes dynamo table to see the problem.
ArtiaX swaps column 7 and 9 of dynamo table. Also, the angle in column 9 should multiply by -1 and add 180 to be correct visualized. Column 7 multiply by -1 and minus 180.

So I wrote a quick script to fix DynamoTable for visualization in ArtiaX below. Though it would be nice to get it fixed inside ArtiaX. Sorry the code doesn't format properly.

import numpy as np
import sys

def modify_table(input_file, output_file):
# Load the file as a NumPy array (space-separated values)
data = np.loadtxt(input_file)

# Ensure column indices are within range
num_columns = data.shape[1]
if num_columns < 9:
    raise ValueError("Input file must have at least 9 columns.")

# Swap columns 7 and 9 (convert to 0-based index)
data[:, [6, 8]] = data[:, [8, 6]]

# Modify the new column 9 (which was swapped from column 7)
data[:, 8] = data[:, 8] * -1 + 180
data[:, 6] = data[:, 6] * -1 - 180


# Save the modified data back to the output file
np.savetxt(output_file, data, fmt='%.6f', delimiter=' ')

if name == "main":
if len(sys.argv) != 3:
print("Usage: python modify_table_values.py input_file output_file")
sys.exit(1)

input_file = sys.argv[1]
output_file = sys.argv[2]

modify_table(input_file, output_file)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants