-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvolcano-plot-in-python.py
35 lines (23 loc) · 1.12 KB
/
volcano-plot-in-python.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#import libraries
import pandas as pd
from bioinfokit import analys,visuz
#set data_path
data_path="testvolcano.csv"
df=pd.read_csv(data_path)
#show first five data points
print(df.head())
#plot and save. Plot will be saved in the current working directory
visuz.gene_exp.volcano(df=df,lfc='log2FC',pv='p-value')
#plot and open . This will not save the image
visuz.gene_exp.volcano(df=df,lfc='log2FC',pv='p-value',show=True)
#plot and rotate x-axis labels
visuz.gene_exp.volcano(df=df,lfc='log2FC',pv='p-value',ar=0,show=True)
#show statistically significant differentially expressed genes based on thresholds
visuz.gene_exp.volcano(df=df,lfc='log2FC',pv='p-value',ar=0,show=True,plotlegend=True,
legendpos='upper right',lfc_thr=(1,2),pv_thr=(0.05,0.01))
#change plot color
visuz.gene_exp.volcano(df=df,lfc='log2FC',pv='p-value',ar=0,color=('blue','grey','green'),show=True)
#Add gene labels
visuz.gene_exp.volcano(df=df,lfc="log2FC",pv="p-value",geneid="GeneNames"
,genenames=("LOC_Os09g01000.1", "LOC_Os01g50030.1",
"LOC_Os06g40940.3"),ar=0,show=True)