r - Rscript not producing jpg output in cluster computing -
i have rscript called ihs.two.hist.r
. have .sh script called ihs.2.hist.sh
when run rscript in directory, jpeg output. when call rscript in .sh script, not jpeg output. check error logs , it's empty. check .log , it's empty. should getting null device 1
in .log.
my rscript
###############cut columns don't need ### #cut -f1,2,3,4 /group/stranger-lab/ebeiter/test/snpsnap_mdd_5_100/matched_snps_annotated.txt > /group/stranger-lab/ebeiter/test/snpsnap_mdd_5_100/cut.matched_snps_annotated.txt #cut -f1,2 /group/stranger-lab/ebeiter/test/snpsnap_mdd_5_100/input_snps_insufficient_matches.txt > /group/stranger-lab/ebeiter/test/snpsnap_mdd_5_100/cut.input_snps_insufficient_matches.txt ### ###############only needed columns remain #read in data #module load r #r ###############read in data load("/group/stranger-lab/ebeiter/ihs_fst.rda") ### data <- read.table("/group/stranger-lab/ebeiter/snpsnap_top1_adhd_3_5k/matched_snps.txt", header=true, stringsasfactors=false) insufficient <- read.table("/group/stranger-lab/ebeiter/snpsnap_top1_adhd_3_5k/cut.input_snps_insufficient_matches.txt", header=true) ### data2 <- data[!(data$input_snp %in% insufficient$snpid),] ###############data2 100% matched ############### rsid first column ### map <- read.table("/group/stranger-lab/ebeiter/snpsnap_top1_adhd_3_5k/input_snps_identifer_mapping.txt", header=true) ### colnames(map)[1] <- "input_snp" data3 <- merge(map, data2, by="input_snp", all=false) data3$input_snp <- null colnames(data3)[1] <- "input_snp" ###############data3 100% match rsid first column ###############read in annotated , match rsid ### annotated <- read.table("/group/stranger-lab/ebeiter/snpsnap_top1_adhd_3_5k/cut.matched_snps_annotated.txt", header=true, stringsasfactors=false) ### library(reshape2) m1<-melt(data3,id.vars="input_snp") m2<-transform(annotated,variable=paste0("set_",set),value=snpid) m<-merge(m1,m2) out<-dcast(m,input_snp~variable,function(x) x[1],value.var="rsid") ###############out table of rsids ###############replace rsid ihs data4 <- apply(out, 2, function(x) ihs_ceu.whole_genome.pvalues$ihs[match(x, ihs_ceu.whole_genome.pvalues$snpid)]) data5 <- data4[rowsums(is.na(data4)) < 0.25*ncol(data4), ] ### write.table(data5, file="/group/stranger-lab/ebeiter/ihs.match.top1_adhd_3_5k", quote=false, row.names=false, sep="\t",) ### ###############percentage dec <- colsums(data5 > 2.0, na.rm=true)/colsums(!is.na(data5)) percent <- dec*100 ###############find z-score , p pop_sd <- sd(dec[-1]) pop_mean <- mean(dec[-1]) z <- (dec[1] - pop_mean)/pop_sd p <- pnorm(-abs(z)) ###############make histogram of ihs ### jpeg("/group/stranger-lab/ebeiter/ihs.two.top1_adhd_3_5k.hist.jpg") hist(percent[-1], breaks=seq(0,30,by=0.25), main="% matched snps w/ ihs > 2.0 adhd", xlab="%") ### abline(v=percent[1], col="red", lwd=2) text(x=25, y=11, labels=bquote(p == .(p))) dev.off() #done ihs plot
my .sh script is:
#pbs -n ihs_2_plot #pbs -s /bin/bash #pbs -l walltime=12:00:00 #pbs -l nodes=1:ppn=8 #pbs -l mem=4gb #pbs -o $home/${pbs_jobname}.o${pbs_jobid}.log #pbs -e $home/${pbs_jobname}.e${pbs_jobid}.err ###############related commands ###edit #code in qsub ###############cut columns don't need ### cut -f1,2,3,4 /group/stranger-lab/ebeiter/test/snpsnap_mdd_5_100/matched_snps_annotated.txt > /group/stranger-lab/ebeiter/test/snpsnap_mdd_5_100/cut.matched_snps_annotated.txt cut -f1,2 /group/stranger-lab/ebeiter/test/snpsnap_mdd_5_100/input_snps_insufficient_matches.txt > /group/stranger-lab/ebeiter/test/snpsnap_mdd_5_100/cut.input_snps_insufficient_matches.txt ### ###############only needed columns remain module load r ### rscript /group/stranger-lab/ebeiter/ihs.two.hist.r ###
i'm befuddled. have no idea how trouble shoot this, or if simple mistake or if have restructure everything. have tried running code before on smaller data file , worked. took 30 minutes 100 column, 1600 row data set. i'm working on 30 row, 5,000 column data set. job took 3:00:00 before "completed' , error , .log files empty. help?!?
Comments
Post a Comment