This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data_sets <- c("mtcars", "morley", "rock") | |
shinyServer(function(input, output) { | |
# Drop-down selection box for which data set | |
output$choose_dataset <- renderUI({ | |
selectInput("dataset", "Data set", as.list(data_sets)) | |
}) | |
# Check boxes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
:Author: Jacob Forstater <[email protected]> or <[email protected]> | |
:Description: Various functions/workflow that help to process nanopore data | |
Log: | |
JF 20160809 initial public commit | |
''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Author: Jacob Forstater | |
Description: Workflow to clean up multistate events | |
- Filters out NStates <2 | |
- Filters out any event with StateResTime < minValue | |
- Supplys this back as a 2D flattened Array | |
Log: | |
JF 20160602 initial version | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Script to calculate optimal bin size (bandwidth). | |
:Created: 5/25/2016 | |
:Author: Jacob Forstater <jacob.forstater@nist.gov> | |
:Reference: Shimazaki and Shinomoto. Histogram Binwidth Optimization Method. Neural Comput. v19 pp1503-1527 (2007) | |
:Original Source: Modified from http://toyoizumilab.brain.riken.jp/hideaki/res/histogram.html | |
:ChangeLog: | |
.. line-block:: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List unique values in a DataFrame column | |
pd.unique(df.column_name.ravel()) | |
# Convert Series datatype to numeric, getting rid of any non-numeric values | |
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True) | |
# Grab DataFrame rows where column has certain values | |
valuelist = ['value1', 'value2', 'value3'] | |
df = df[df.column.isin(valuelist)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""quick way to create a data frame to try things out""" | |
df = pd.DataFrame(np.random.randn(5, 4), columns=['a', 'b', 'c', 'd']) | |
df['A'] """ will bring out a col """ df.ix[0] """will bring out a row, #0 in this case""" | |
"""to get an array from a data frame or a series use values, note it is not a function here, so no parans ()""" | |
point = df_allpoints[df_allpoints['names'] == given_point] # extract one point row. | |
point = point['desc'].values[0] # get its descriptor in array form. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Extend the MOSAIC ConvertToCSV class to export arbitrary binary files. | |
:Created: 02/25/2015 | |
:Author: Arvind Balijepalli <[email protected]> | |
:ChangeLog: | |
.. line-block:: | |
02/25/15 AB Initial version | |
""" | |
import mosaic.ConvertToCSV as conv |