-1

I want to understand how this code can be implemented using holoviews 1.12.7 version. I am using a depreciated version. Here is the sample code that I have run

Chromosome = hv.Dimension('chromosome', unit='-', range=(AxesDF.loc['Min','Chr'],AxesDF.loc['Max','Chr']))
TraitIndex = hv.Dimension('trait index', unit='-', range=(AxesDF.loc['Min','Trait'],AxesDF.loc['Max','Trait']))
pP = hv.Dimension(r'$\mathsf{-log(p-value)}$', unit='-', range=(AxesDF.loc['Min','pP'],AxesDF.loc['Max','pP']))

SPlot_pP_Ch = holoviews.DFrame(GWASummaryStatisticsDF[['MHPos','pP-value']], dimensions={'MHPos':Chromosome,'pP-value':pP})

SPlot_Trait_Chr = holoviews.DFrame(GWASummaryStatisticsDF[['MHPos','TraitIndex','pP-value']],dimensions={'MHPos':Chromosome,'TraitIndex':TraitIndex,'pP-value':pP})

SPlot_Trait_Chr_pP = holoviews.DFrame(GWASummaryStatisticsDF[['MHPos','TraitIndex','pP-value']],dimensions={'MHPos':Chromosome,'TraitIndex':TraitIndex,'pP-value':pP})  

### Plots to Visualise: holoviews Scatter plots ##
### Example of Dataset in ***GWASummaryStatisticsDF dataframe*** ###
        MHPos   pP-value    TraitIndex
0   1.012324e+09    8.664141    1
1   1.738541e+09    7.485851    1
2   1.738436e+09    27.525929   1
3   1.738463e+09    56.837436   1
4   1.011689e+09    7.582362    1

Error Message

Sander van den Oord
  • 10,986
  • 5
  • 51
  • 96

1 Answers1

0

Okay, below is a small example of how to create a scatter plot with holoviews. If this is different from what you have or need, try to explain as clear as possible in your question what your data looks like and what you are looking for.

The .DFrame() method doesn't exist, so that's why you are getting your error message.

# import libraries
import numpy as np
import pandas as pd

import holoviews as hv
hv.extension('bokeh')

# create example data
df = pd.DataFrame({
    'chromosome': np.random.rand(10),
    'trait_index': np.random.rand(10),
})

# create scatter plot
scatter_plot = hv.Scatter(
    data=df,
    kdims=['chromosome'],
    vdims=['trait_index'],
)

scatter_plot
Sander van den Oord
  • 10,986
  • 5
  • 51
  • 96