SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
How would I go about calling BWA from a python script? prs321 Bioinformatics 7 07-07-2019 06:20 AM
python error in cuffdiff script bvk Bioinformatics 4 07-07-2019 06:14 AM
Oases python script can't find Velvet JakeBuehler De novo discovery 3 11-18-2014 06:41 AM
python script modification of LSC0.2.4 ? arthur.yxt Bioinformatics 0 06-11-2013 02:32 PM
gatk python script m_elena_bioinfo Bioinformatics 7 11-20-2011 07:40 AM

Reply
 
Thread Tools
Old 05-16-2015, 03:23 PM   #1
bvk
Member
 
Location: czech

Join Date: May 2015
Posts: 65
Default R script to Python conversion

setwd("/pipeline/deff")
source('http://www.bioconductor.org/biocLite.R')
biocLite('cummeRbund')
library(cummeRbund)
cuff_data <- readCufflinks('deff')
pdf("allplots.pdf")
#"distbtn of expression levels for each dataset"
plot(csDensity(genes(cuff_data)))
#"compare the exp of each gene in all the conditions with scatter plot"
plot(csScatterMatrix(genes(cuff_data)))
#"distances between condition with dendrogram"
plot(csDendro(genes(cuff_data)))
#"to inspect differentially expressed genes"
plot(csVolcanoMatrix(genes(cuff_data)))
dev.off()

Can anyone help how to write a python script for plotting cuffdiff output.
bvk is offline   Reply With Quote
Old 05-17-2015, 01:36 AM   #2
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

Why reinvent the wheel? R is a perfectly adequate language for tasks like this. Just call an Rscript from python if you need to.
dpryan is offline   Reply With Quote
Old 05-17-2015, 01:49 AM   #3
bvk
Member
 
Location: czech

Join Date: May 2015
Posts: 65
Default

Quote:
Originally Posted by dpryan View Post
Why reinvent the wheel? R is a perfectly adequate language for tasks like this. Just call an Rscript from python if you need to.
Yes, but I just want to give a try with python. Anyways I'l use R only. Thank you !!
bvk is offline   Reply With Quote
Old 05-18-2015, 01:10 AM   #4
bvk
Member
 
Location: czech

Join Date: May 2015
Posts: 65
Default

Quote:
Originally Posted by dpryan View Post
Why reinvent the wheel? R is a perfectly adequate language for tasks like this. Just call an Rscript from python if you need to.
How to call an R script from python ?
bvk is offline   Reply With Quote
Old 05-18-2015, 01:16 AM   #5
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

The subprocess module would be a common method to call any other functions from within python.
dpryan is offline   Reply With Quote
Old 05-18-2015, 01:32 AM   #6
bvk
Member
 
Location: czech

Join Date: May 2015
Posts: 65
Default

Quote:
Originally Posted by dpryan View Post
The subprocess module would be a common method to call any other functions from within python.
import subprocess
retcode = subprocess.call(['/usr/bin/R','/path/to/analysis.R'])

Is this enough to call my analysis.R script
bvk is offline   Reply With Quote
Old 05-18-2015, 01:42 AM   #7
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

You'll want to use Rscript rather than R.
dpryan is offline   Reply With Quote
Old 05-18-2015, 01:51 AM   #8
bvk
Member
 
Location: czech

Join Date: May 2015
Posts: 65
Default

Quote:
Originally Posted by dpryan View Post
You'll want to use Rscript rather than R.
Ok. So

import subprocess
retcode = subprocess.call(['/usr/bin/Rscript','/san/gh/ngs/con/analysis.R'])
bvk is offline   Reply With Quote
Old 05-18-2015, 01:55 AM   #9
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

Yup, something like that should work for you
dpryan is offline   Reply With Quote
Old 05-18-2015, 02:35 AM   #10
bvk
Member
 
Location: czech

Join Date: May 2015
Posts: 65
Default

Quote:
Originally Posted by dpryan View Post
Yup, something like that should work for you
Thankyou
bvk is offline   Reply With Quote
Reply

Tags
python, rnaseq analysis

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 09:44 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO