papillon
index
/home/lab/Papillon/papillon/__init__.py

A python version of CummeRbund
to read and plot Galaxy RNA-seq data

 
Package Contents
       
papillon

 
Classes
       
builtins.object
papillon

 
class papillon(builtins.object)
     Methods defined here:
__init__(self, path, drop_comparison=[])
read cummeRbund files and return:
self.path - files path
self.samples - samples found
self.comparison - comparisons found
self.genes_detect - dataframe of genes detected
self.genes_significant - dataframe of genes significant
self.isoforms_detect - dataframe of isoforms detected 
self.isoforms_significant - dataframe of isoforms significant 
expressed
__str__(self)
Return str(self).
change_order(self, new_order)
Change the samples order
dropComparison(self, comparison)
Drop Comparison (str) or list of comparisons and re-calculate 
df_significant
get_gene(self, genelist=None, comparison=None, sign=None, export=False)
This function select genes. Create self.selected and 
self.type_selected="gene".
genelist - accept string (gene name), list of gene names or file
           with a list of gene name
comparison - accept only 1 comparison as str (already present in 
             the data)
sign - usable in combination with comparison, accept either ">" or 
       "<"
export - True/False whether want or not export the dataframe of 
         selected genes
get_isoform(self, genelist=None, comparison=None, sign=None, export=False, show_dup=False)
This function select isoforms. Create self.selected and 
self.type_selected="isoform" 
genelist - accept string (gene name), list of gene names or file
           with a list of gene name
comparison - accept only 1 comparison as str (already present in 
             the data)
sign - usable in combination with comparison, accept either ">" or 
       "<"
export - True/False whether want or not export the dataframe of 
         selected genes
show_dup - True/False whether want or not highlight duplicated
           isoforms for the same gene
heatmap(self, z_score=True, col_cluster=False, method='complete', cmap='seismic', export=False, **options)
Generate heatmap using selected genes/isoforms
z_score - True/False whether want or not apply z-score normalization
col_cluster - True/False whether want or not cluster the samples
method - clustering algorithm - default is complete-linkage
cmap - map color
export - True/False whether want or not export the dataframe of 
         selected genes
**options - all the options accepted by seaborn.clustermap
default metric is euclidean.
onlyFPKM(self, return_as, **option)
Return a DataFrame with only FPKM columns, 
return as: 
    "df" - pandas DataFrame
    "array" - numpy array
    "gene name" - pandas DataFrame containing gene names
It uses self.selected, or an extra_df.
plot(self, title='', legend=True, z_score=False, export=False, df=None, size=10, ci=None, **option)
LinePlot a selected dataframe of genes. Max number of genes 200
title - accept a string as title of the plot
legend - True/False show the legend
z_score - True/False calculate the z-score normalization
export - True/False whether want or not export image
df - accept a dataframe different from self.selected
**options - all the options accepted by seaborn.factorplot
search(self, word, where, how='table', export=False)
search among genes/isoforms names in detected and significant
word - accept a str to search among the gene names
where - accept:
    "genes_detected" 
    "genes_significant" 
    "isoforms_detected"
    "isoforms_significant"
 
how - accept:
    "table" return the dataframe with the genes found
    "list" return a list of names, no duplicates
    "selected" put the genes found among the differential expressed 
               genes in self.selected (to plot),
               working only with where="significant"
selected_exist(self, remove=False)
Check if self.selected exists

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Functions
       
read_db(path, drop_comparison=[])
Read the cummeRbund Database.
path - accept a str with the folder path, containing the cummeRbund files
drop_comparison - drop comparison (str) or list of comparisons and 
                  re-calculate significant genes/isoforms