Skip to content

Commit

Permalink
Updating Docs for commit 39471b1 made on 2024-08-15T19:45:31+00:00 fr…
Browse files Browse the repository at this point in the history
…om refs/heads/latest by meson800
  • Loading branch information
meson800 committed Aug 15, 2024
0 parents commit e137ba1
Show file tree
Hide file tree
Showing 2,221 changed files with 538,454 additions and 0 deletions.
Empty file added .nojekyll
Empty file.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# GitHub Pages Cache

Nothing to see here. The contents of this branch are essentially a cache that's not intended to be viewed on github.com.

The actual documentation lives on the latest branch (e.g. the default branch for the repository).

This build is based on Sphinx, and uses a custom Python build script plus includes some of
Michael Altfield's work on building multi-branch documentation:
* https://tech.michaelaltfield.net/2020/07/18/sphinx-rtd-github-pages-1
4 changes: 4 additions & 0 deletions en/Mary-test/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: cabd5fe9be86a8092a8632e59f67c08b
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added en/Mary-test/.doctrees/bootcamp/iap/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added en/Mary-test/.doctrees/bootcamp/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added en/Mary-test/.doctrees/contributor_guide.doctree
Binary file not shown.
Binary file added en/Mary-test/.doctrees/environment.pickle
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added en/Mary-test/.doctrees/general/clean_bsc.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added en/Mary-test/.doctrees/general/index.doctree
Binary file not shown.
Binary file added en/Mary-test/.doctrees/general/lab_safety.doctree
Binary file not shown.
Binary file not shown.
Binary file added en/Mary-test/.doctrees/general/ordering.doctree
Binary file not shown.
Binary file not shown.
Binary file added en/Mary-test/.doctrees/general/receiving.doctree
Binary file not shown.
Binary file added en/Mary-test/.doctrees/general/recycling.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added en/Mary-test/.doctrees/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added en/Mary-test/.doctrees/instruments/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added en/Mary-test/.doctrees/plot_gallery/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added en/Mary-test/.doctrees/plot_gallery/test.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added en/Mary-test/.doctrees/protocols/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added en/Mary-test/.doctrees/recipes/fish/index.doctree
Binary file not shown.
Binary file added en/Mary-test/.doctrees/recipes/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added en/Mary-test/.doctrees/recipes/tc/index.doctree
Binary file not shown.
Binary file added en/Mary-test/.doctrees/recipes/tc/media.doctree
Binary file not shown.
Binary file not shown.
Binary file added en/Mary-test/.doctrees/recipes/tc/pei.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added en/Mary-test/.doctrees/tech/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# ----- PLOTTING FUNCTION -------

def plot_hists(df, # DataFrame with data
x, # variable (str, column header of df) or list of variables to plot
sample_list, # list of samples (values of column 'ConditionLabel') to plot in order
name, # short name (str) for saving the figure
plot_title=None, # Super-title for plot (optional str)
xlim=(1e1,1e6), # tuple or list of tuples (optional) for x-axis range on subplot(s)
gates=None # list (optional) of x-values at which to draw vertical lines, i.e. gates
):

# Specify additional parameters
lin = set(['FSC-A','FSC-H','FSC-W','SSC-A','SSC-H','SSC-W']) # list of variables to plot on linear scale (size-related params)
condition_palette = pd.read_pickle('data/histogram/exp42_palette.pkl') # custom color palette (dict mapping Condition values to colors)
sns.set_context('talk',rc={'font.family': 'sans-serif', 'font.sans-serif':['Helvetica Neue']})

sz = len(x) # number of subplots
fig, axs = plt.subplots(1,sz,figsize=(sz*7,5))

# Create each subplot
for i in range(sz):
g = sns.kdeplot(data=df, x=x[i], ax=axs[i],
hue='ConditionLabel', hue_order=sample_list, # samples are specified by the 'ConditionLabel' column in df
palette=condition_palette,
fill=True, alpha = 0.1, # shade under the curve, but faintly
log_scale=(x[i] not in lin), # default to log scale unless variable is in the linear list
legend=(i==sz-1), # add a legend only to the last subplot
common_norm=True) # supposed to normalize area under the curve (?)

# Formatting
sns.despine(ax=g) # remove top and right plot border
g.minorticks_off()

# Set the x-axis range based on provided list or value
if isinstance(xlim,list): g.set_xlim(xlim[i])
else: g.set_xlim(xlim)

# Add a vertical line (gate) if specified
if gates is not None: g.axvline(gates[i], c='gray', ls='--', alpha=0.5)

# Adjust the legend to the right of the last subplot
sns.move_legend(axs[-1], title='Condition', loc='upper left', bbox_to_anchor=(1,1), frameon=False)

# Add a super-title to the plot, if specified
fig.suptitle(plot_title)
fig.tight_layout()

# [NOT APPLICABLE HERE] Save the figure as an image to the path specified by output_path (not defined here)
# uses rushd outfile function to save metadata associated with the figure
# fig.savefig(rd.outfile(output_path/('hist-'+name+'.svg')),bbox_inches='tight')

return fig
# ----- END PLOTTING FUNCTION -------

# ----- Load data -----
labeler = pd.read_pickle('data/histogram/exp42_labeler.pkl') # dict mapping short Condition name to long ConditionLabel
data = pd.read_csv('data/histogram/exp42_data-small.csv') # stored DataFrame of data with metadata

# ----- Call the plotting function in a loop to generate plots with subsets of samples -----

# Specify variables -> this will generate two subplots
x = ['mGL-A', 'mCherry-A']

# Filter data
df = data.loc[(data[x[0]]>0) & (data[x[1]]>0)] # remove cells with log-unfriendly values
# Normalize number of cells in each sample (Condition) by downsampling to smallest sample size
num_cells = df.groupby(['Condition','Replicate'])[x[0]].count().min()
df = df.groupby(['Condition']).sample(n=num_cells, random_state=1)

# Dictionary of plots (separate figures) to generate
# keys = short name that plots are saved under
# values = list of samples (values in 'Condition' column) to include in the plot
plot_list = {
'tandem': ['260_False','260_True','261_False','261_True','262_False','262_True'],
'divergent+dox': ['263_True','264_True','265_True'],
'hPGK': ['260_False','260_True','263_False','263_True'],
}

# Loop to create each plot/figure
for name, sample_list in plot_list.items():

# Convert short sample names above (Condition) to long names (ConditionLabel) -> this is particular to my df organization
sample_list = [labeler[s] for s in sample_list]
# Identify the subset of the data to plot
dd = df.loc[df['ConditionLabel'].isin(sample_list)]

plot_hists(dd, x, sample_list, name,
xlim=[(1e0,1e6),(2e0,1e7)], # specify a different x-axis range for each variable
gates=[3e2,0]) # draw a gate on the first subplot but not the second
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
mapping = {
**{f"A{x}": "sciAD1.3" for x in range(1,13)},
**{f"B{x}": "sciAD1.4" for x in range(1,13)},
**{f"C{x}": "sciAD1.5" for x in range(1,13)},
**{f"D{x}": "sciAD1.6" for x in range(1,13)},
**{f"E{x}": "sciAD1.7" for x in range(1,13)},
**{f"F{x}": "sciAD1.9" for x in range(1,13)},
**{f"G{x}": "sciAD1.10" for x in range(1,13)},
**{f"H{x}": "sciAD1.11" for x in range(1,13)},
}
mapping = {**mapping, **{(k[0] + '0' + k[1]): v for k,v in mapping.items() if len(k) == 2}}
fig = plt.figure()
rd.plot.plot_mapping(mapping, style='category', fig=fig)
plt.title("Transposition sciAD1 layout", fontsize=15)
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
mapping = {
"A3": "sciAD1.{3,4,5,6,7,9,10,11}",
"A4": "sciAD1.{3,4,5,6,7,9,10,11}",
"A5": "sciAD1.{3,4,5,6,7,9,10,11}",
"A6": "sciAD1.{3,4,5,6,7,9,10,11}",
"A7": "sciAD1.{3,4,5,6,7,9,10,11}",
"A8": "sciAD1.{3,4,5,6,7,9,10,11}",
"A9": "sciAD1.{3,4,5,6,7,9,10,11}",
"A10": "sciAD1.{3,4,5,6,7,9,10,11}",
"B1": "sciAD2.{1,3,4,6,7,8,11,12,13,14,15,17}",
"B2": "sciAD2.{1,3,4,6,7,8,11,12,13,14,15,17}",
"B3": "sciAD2.{1,3,4,6,7,8,11,12,13,14,15,17}",
"B4": "sciAD2.{1,3,4,6,7,8,11,12,13,14,15,17}",
"B5": "sciAD2.{1,3,4,6,7,8,11,12,13,14,15,17}",
"B6": "sciAD2.{1,3,4,6,7,8,11,12,13,14,15,17}",
"B7": "sciAD2.{1,3,4,6,7,8,11,12,13,14,15,17}",
"B8": "sciAD2.{1,3,4,6,7,8,11,12,13,14,15,17}",
"B9": "sciAD2.{1,3,4,6,7,8,11,12,13,14,15,17}",
"B10": "sciAD2.{1,3,4,6,7,8,11,12,13,14,15,17}",
"B11": "sciAD2.{1,3,4,6,7,8,11,12,13,14,15,17}",
"B12": "sciAD2.{1,3,4,6,7,8,11,12,13,14,15,17}",
}
mapping = {**mapping, **{(k[0] + '0' + k[1]): v for k,v in mapping.items() if len(k) == 2}}
fig = plt.figure()
rd.plot.plot_mapping(mapping, style='category', fig=fig)
sns.move_legend(fig.get_axes()[0], 'lower center', bbox_to_anchor=(0.5,-0.31))
fig.tight_layout()
plt.title("Transposition primer plate", fontsize=15)
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
mapping = {
**{f"{x}1": "sciAD2.1" for x in "ABCDEFGH"},
**{f"{x}2": "sciAD2.3" for x in "ABCDEFGH"},
**{f"{x}3": "sciAD2.4" for x in "ABCDEFGH"},
**{f"{x}4": "sciAD2.6" for x in "ABCDEFGH"},
**{f"{x}5": "sciAD2.7" for x in "ABCDEFGH"},
**{f"{x}6": "sciAD2.8" for x in "ABCDEFGH"},
**{f"{x}7": "sciAD2.11" for x in "ABCDEFGH"},
**{f"{x}8": "sciAD2.12" for x in "ABCDEFGH"},
**{f"{x}9": "sciAD2.13" for x in "ABCDEFGH"},
**{f"{x}10": "sciAD2.14" for x in "ABCDEFGH"},
**{f"{x}11": "sciAD2.15" for x in "ABCDEFGH"},
**{f"{x}12": "sciAD2.17" for x in "ABCDEFGH"},
}
mapping = {**mapping, **{(k[0] + '0' + k[1]): v for k,v in mapping.items() if len(k) == 2}}
fig = plt.figure()
rd.plot.plot_mapping(mapping, style='category', fig=fig)
plt.title("Transposition sciAD2 layout", fontsize=15)
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Read in data
data = pd.read_csv('data/data_mGL_WPRE/data_mGL_WPRE.csv')

# Plot mGL-H
x = 'mGL-H'
hue = 'cond'
cond_list = ['mGL', 'mGL-WPRE']
colormap = {'mGL': 'lightgrey',
'mGL-WPRE': 'limegreen'}

# Plot
fig, ax = plt.subplots(1, 1, figsize=(6, 4))
sns.kdeplot(ax=ax, data=data, x=x, hue=hue, hue_order=cond_list,
log_scale=(True, False), common_norm=False,
shade=True, palette=colormap)

# Plot neg ctrl
sns.kdeplot(ax=ax, data=data.loc[data['cond'] == 'Neg'], x=x,
log_scale=(True, False), common_norm=False,
shade=False, color='black', alpha=0.5, linestyle='--')
ax.annotate('Neg', (0.08, 0.25),
xycoords='axes fraction', alpha=0.5, ha='center')

# Add threshold for mGL+ gating
mGL_H_thresh = 2*10**2
ax.axvline(mGL_H_thresh, 0, 1, color='black')

# Title
plt.suptitle('4 dpi')
# Adjust limits
mGL_lim = (10, 10**6)
ax.set_xlim(mGL_lim)

# Misc plotting stuff
fig.tight_layout() # Helps improve white spacing
plt.show()
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
df = pd.read_csv('data/test_data.csv')
sns.scatterplot(data=df, x='x', y='y')
sns.despine()
plt.show()
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Read in data
data = pd.read_csv('data/data_flow_with_adjunct_hist/data_flow_with_adjunct_hist.csv')

# Randomly sample 10^4 samples from each condition to make representative flow diagram
numSamples = 10**4
small_data = data.groupby(['cond']).sample(n=numSamples, random_state=1)

# General plotting params
x = 'CFSE-A'
y = 'sulfo-Cyanine5-A'
hue = 'cond'
cond_list = ['Ctrl', 'NIL', 'NILDD', 'NILDDRR']
colormap = {'Ctrl': 'grey', 'NIL': 'crimson',
'NILDD': 'purple', 'NILDDRR': 'dodgerblue'}

# definitions for the axes
left, width = 0.1, 0.65
bottom, height = 0.1, 0.65
spacing = 0.005

rect_scatter = [left, bottom, width, height]
rect_histx = [left, bottom + height + spacing, width, 0.2]
rect_histy = [left + width + spacing, bottom, 0.2, height]

# Set up figure
fig = plt.figure(figsize=(6, 6))
ax_scatter = plt.axes(rect_scatter)
ax_scatter.tick_params(direction='in', top=True, right=True)
ax_histx = plt.axes(rect_histx)
ax_histx.set_axis_off()
ax_histy = plt.axes(rect_histy)
ax_histy.set_axis_off()

# Set limits
xlim = (10, 1*10**5)
ylim = (5*10**1, 1*10**5)
ax_scatter.set_xlim(xlim)
ax_scatter.set_ylim(ylim)
ax_histx.set_xlim(xlim)
ax_histy.set_ylim(ylim)

# Make density plots
sns.kdeplot(ax=ax_scatter, data=small_data, x=x, y=y, hue=hue, hue_order=cond_list,
log_scale=True, common_norm=False,
palette=colormap, alpha=0.7, fill=False, legend=True)

# Plot histograms
sns.kdeplot(ax=ax_histx, data=small_data, x=x, hue=hue, hue_order=cond_list,
log_scale=True, common_norm=False,
palette=colormap, alpha=0.1, fill=True, legend=False)
sns.kdeplot(ax=ax_histy, data=small_data, y=y, hue=hue, hue_order=cond_list,
log_scale=True, common_norm=False,
palette=colormap, alpha=0.1, fill=True, legend=False)

# Add in CFSE and EU lines
CFSE_low_thresh = np.percentile(data[(data['cond'] == 'Ctrl')]['CFSE-A'], 20)
EU_thresh = np.percentile(
data[(data['cond'] == 'NIL') & (data['CFSE_cat'] == 'CFSE-low')]['sulfo-Cyanine5-A'], 50)
ax_scatter.axvline(CFSE_low_thresh, 0, 1, color='black')
ax_scatter.axhline(EU_thresh, 0, 1, color='black')

# Title
fig.suptitle('14 dpi')
# Misc plotting stuff
fig.tight_layout() # Helps improve white spacing
plt.show()
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
mapping = {
**{f"C{i}": "sciP1.{1-12}" for i in range(1,13)},
**{f"D{i}": "sciP1.{13-24}" for i in range(1,13)},
**{f"E{i}": "sciP1.{25-36}" for i in range(1,13)},
}
mapping = {**mapping, **{(k[0] + '0' + k[1]): v for k,v in mapping.items() if len(k) == 2}}
fig = plt.figure()
rd.plot.plot_mapping(mapping, style='category', fig=fig)
ax = fig.get_axes()[0]
sns.move_legend(ax, 'lower center', bbox_to_anchor=(0.5,-0.42))
ax.set_title("sciP1 PCR primer plate", fontsize=15)
fig.clip_box = ax.get_tightbbox()
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
mapping = {
**{f"{x}5": "sciP2.{1-8}" for x in 'ABCDEFGH'},
**{f"{x}6": "sciP2.{9-16}" for x in 'ABCDEFGH'},
**{f"{x}7": "sciP2.{17-24}" for x in 'ABCDEFGH'},
}
mapping = {**mapping, **{(k[0] + '0' + k[1]): v for k,v in mapping.items() if len(k) == 2}}
fig = plt.figure()
rd.plot.plot_mapping(mapping, style='category', fig=fig)
ax = fig.get_axes()[0]
sns.move_legend(ax, 'lower center', bbox_to_anchor=(0.5,-0.42))
ax.set_title("sciP2 PCR primer plate", fontsize=15)
fig.clip_box = ax.get_tightbbox()
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Categorize if mGL+
mGL_cat = list()
for mGL_val in data['mGL-H']:
if mGL_val > mGL_H_thresh:
mGL_cat.append('mGL+')
else:
mGL_cat.append('mGL-')
data['mGL_cat'] = mGL_cat

# Get total counts and percent of mGL+ and mGL-
well_group = ['cond', 'replicate', 'sampleNum'] # specifies we're splitting by cond >> bio rep >> tech rep >> etc...
count_df = data.groupby([*well_group, 'mGL_cat'])['mGL-H' # Doesn't have to be mGL-H, any column would work
].count().unstack(fill_value=0).stack().rename('count') # unstack()/stack() puts 0 if no mGL-H+ rather than dropping row
percent_df = (count_df*100/count_df.groupby(well_group).transform('sum')
).reset_index(name='percent')

# Extract just the mGL+ cells
data_mGL = data.loc[data['mGL_cat'] == 'mGL+']
percent_df_mGL = percent_df.loc[(percent_df['mGL_cat'] == 'mGL+')]

# Calculate geom mean of mGL+ cells
well_mGL_gmean_df = data_mGL.groupby(well_group)[
'mGL-H'].apply(scipy.stats.gmean).reset_index(name='mGL-H (gmean)')

# Plotting parameters
x = 'cond'
y = 'mGL-H'
order = ['mGL', 'mGL-WPRE']
pairs = [('mGL', 'mGL-WPRE')]
colormap = {'mGL': 'lightgrey',
'mGL-WPRE': 'limegreen'}

# Plot
fig, ax = plt.subplots(1, 1, figsize=(3, 3))
sns.boxplot(
ax=ax, data=data_mGL,
x=x, y=y, order=order,
boxprops={'facecolor': 'None'}, showfliers=False) # Gets rid of boxplot colors and outliers
sns.stripplot(
ax=ax, data=well_mGL_gmean_df,
x=x, y=y+' (gmean)', order=order,
dodge=True, palette=colormap, size=5)

# Add in stats
annot = Annotator(ax=ax, data=well_mGL_gmean_df, x=x, y=y+' (gmean)', pairs=pairs, order=order)
annot.configure(test='t-test_ind', text_format='star', loc='inside', verbose=2)
annot.apply_and_annotate()

# Adjust labels
plt.ticklabel_format(axis='y',style='sci',scilimits=(0,0))
plt.ylabel(y)
plt.title('4 dpi, HG')
fig.tight_layout() # Helps improve white spacing
plt.show()
Loading

0 comments on commit e137ba1

Please sign in to comment.