3DVA Plot components raw values (update?)

Hi @team ,

following this thread on making plots from 3DVA outputs (3DVA plot raw values - #2 by vperetroukhin), has there been changes on how to access these data or should I use the strategy described?

I want to plot in 2D component x vs component y (0vs1, 1 vs 2, etc…) and change the color of the dots, axis, etc…

Thank you.
Vincent

Hi @vincent! Since that post we’ve released CryoSPARC Tools, which makes accessing information like this much easier. For instance, this code will get you a dataframe with variability components 0, 1, and 2 each in their own column:

from cryosparc.tools import CryoSPARC
import json
import pandas as pd

# you'd need to change this part to use your login info
with open('/u/rposert/instance-info.json', 'r') as f:
    instance_info = json.load(f)
cs = CryoSPARC(**instance_info)
assert cs.test_connection()

project_number = "P312"
job_number = "J54"

project = cs.find_project(project_number)
job = project.find_job(job_number)
particles = job.load_output("particles")

df = pd.DataFrame({
    'c0': particles['components_mode_0/value'],
    'c1': particles['components_mode_1/value'],
    'c2': particles['components_mode_2/value']
})

From there you could use whichever plotting library you like, or export the data to a .csv or other formats:

import plotnine
(
    plotnine.ggplot(df, plotnine.aes('c0'))
    + plotnine.geom_histogram()
)

Thanks @rposert , I’ll give it a go.