Skip to main content

sciviso: Wrapper for common visualisations for sci constellation.

Project description

sciviso

codecov.io PyPI

A wrapper to format all plots the same

Shared functions:

# Builds the plot
chart.plot()

# Saves to svg
chart.save_svg([directory, filename])

# Saves to png
chart.save_png([directory, filename], dpi=100)

# Returns svg string 
chart.get_svg()

Barchart

Standard seaborn wrapper. See documentation.

barchart = Barchart(df: pd.DataFrame, x: object, y: object, title='', xlabel='', ylabel='', hue=None, order=None,
                 hue_order=None)

Boxplot

Wrapper to create a box plot with option for annotating statistics.

boxplot = Boxplot(df: pd.DataFrame, x: object, y: object, title='', xlabel='', ylabel='', 
                    hue=None, order=None, hue_order=None)

# Also you can use the boxplot class to format data for the boxplot from a standard dataframe
boxplot.format_data_for_boxplot(df: pd.DataFrame, conditions: list, filter_column=None, filter_values=None):

# Here we create a new dataframe with the columns: Conditions, Samples, Values
"""
Conditions: for each of the conditions that the user specified we check if that is in a c
olumn of the dataframe, if it is then that column's values are added to values and labelled with that condition
Samples: original name of the column
Values: value from that column for each row

e.g. df.columns = 'gender,      control_s1,     control_s2,     drug_1,     drug_2'
     df.values = [['female',    12              11              9           8],
                  ['male',      10              19              5           4]]
I could format it to a boxplot with conditions=['control', 'drug'], filter_column='gender', ['female']

"""

Heatmap

Wrapper on seaborns clustermap. See that for details.

heatmap = Heatmap(df: pd.DataFrame, chart_columns: list, row_index: str, title='', xlabel='', ylabel='',
                 cluster_rows=True, cluster_cols=True, row_colours=None, vmin=None, vmax=None)


Scatterplot

Scatter with optional annotation & regression (toDo.)

scatter = Scatterplot(self, df: pd.DataFrame, x: object, y: object, title='', xlabel='', ylabel='', colour=None,
                 points_to_annotate=None, annotation_label=None, add_correlation=False, correlation='Spearman')

Violinplot

Very similar to the box plot just without the stats annotation. You can use the boxplot formatter to format the data for the violin plot.

violinplot = Violinplot(self, df: pd.DataFrame, x: object, y: object, title='', xlabel='', ylabel='', hue=None, order=None,
                 hue_order=None, showfliers=False, add_dots=False)

Volcanoplot

Volcano plot with annotation of selected values or all the top values.

volcano = Volcanoplot(self, df: pd.DataFrame, log_fc: str, p_val: str, label_column: str, title='',
                 xlabel='', ylabel='', invert=False, p_val_cutoff=0.05,
                 log_fc_cuttoff=2, label_big_sig=False, colours=None, offset=0, values_to_label=None)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sciviso-1.0.5.tar.gz (27.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sciviso-1.0.5-py3-none-any.whl (48.1 kB view details)

Uploaded Python 3

File details

Details for the file sciviso-1.0.5.tar.gz.

File metadata

  • Download URL: sciviso-1.0.5.tar.gz
  • Upload date:
  • Size: 27.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for sciviso-1.0.5.tar.gz
Algorithm Hash digest
SHA256 4e41d7d92b4dde41e220729338005069d78413e1370866f12ece4d8ec81013ec
MD5 7a100de45a82a67f9ec804094235979f
BLAKE2b-256 d33c304f1026d39959f86c4d79f6a24c3d7d4c1fcfd7d0cc1e4a329742022aab

See more details on using hashes here.

File details

Details for the file sciviso-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: sciviso-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 48.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for sciviso-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a48042d9f9e77e18e005e96e99cb2883bd9795553186e9845f765ea02be9061d
MD5 ad98f991dac58313192d64058b5d07f2
BLAKE2b-256 ec27537c8565b135eb35aad96fbb87b97674944dad8451a2356c01dd304cd4d1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page