Skip to content

Adding a new gene filter scheme

David DeTomaso edited this page Mar 1, 2016 · 2 revisions

To add a gene-filtering (feature selection) method, edit the Filters.py source file.

Step 1

Towards the bottom of the file, after the "Add additional filtering methods here" header, define a new method that applies the desired filter

The function header must have the format:

def mynewfilter(proj_data):

Input proj_data is a Num_Genes X Num_Samples numpy.ndarray

Your function should operate on the data and weights matrices to return an output that is a boolean list of length Num_Genes where a value of False instructs FastProject to discard the gene when calculating Projection coordinates

Step 2

Register your new method so FastProject knows to call it when it next runs.

At the bottom of the file, add the method to the _filter_methods dictionary

_filter_methods['MyMethodName'] = mynewmethodname;
Clone this wiki locally