R in python for dummies: Error in file(file, "rt") : cannot open the connection
1
0
Entering edit mode
9.2 years ago
lien ▴ 90

Dear all,

Another newbie question about running R from within a python script. I googled and found the error message multiple times, and I think I have to change something with the path, but I can't figure out how.

Here is the script:

#! /usr/bin/python
from subprocess import call
import sys
import argparse
import os
import time
import shutil
# Check command line arguments ###################################################################################
def checkArgs(args):
if not os.path.isfile(args.fastq_file):
errorExit("FastQ file not found")
if args.custom_norm and not os.path.isfile(args.custom_norm):
errorExit("Custom normalization file not found")
# Error and Exit ###################################################################################
def errorExit(message):
print "Error"
print message
print "Exit"
sys.exit(1)
script_dir = os.path.dirname(os.path.realpath(__file__))
# Parse command line arguments ###################################################################################
parser = argparse.ArgumentParser(description='Analyze read depth in comparison to transcription end')
parser.add_argument('-fq','--fastq', dest='fastq_file',
help='Fastq file (for NextSeq: Specify Lane 1 Fastq File)',required=True)
parser.add_argument('-s','--sample-name', dest='name',
help='Sample name to be used subsequently',required=True)
parser.add_argument('-g','--gender', dest='gender',
help='Gender of the sample [either m or f]',required=True, choices=["m","f"])
parser.add_argument('-o','--out-dir', dest='outdir',
help='Output Directory [default .]',default=".")
parser.add_argument('-k','--keep-temp', dest='keep',
help='Keep temporary files',action="store_true")
parser.add_argument('-m','--machine', dest='machine',
help='Sequencing machine [miseq|nextseq]',required=True, choices=["miseq","nextseq"])
parser.add_argument('-skipmerge','--skip-merge', dest='skip_merge',
help='Skip merging of FastQ files for NextSeq data',action="store_true")
parser.add_argument('-t','--threads', dest='threads',
help='No. threads for alignment [default: 1]',type=int,default=1)
parser.add_argument('-custnorm','--custom-normalization-file', dest='custom_norm',
help='Choose custom file to normalize against')
args = parser.parse_args()
print time.strftime("%d/%m/%Y: %H:%M:%S : Starting Analysis")
print " Fastq file: ",args.fastq_file
print " Sample name file: ",args.name
print " Output Directory: ",args.outdir
print " Machine: ",args.machine
print " Gender: ",args.gender
if args.keep:
print " Keeping temporary files"
if args.custom_norm:
print " Custom normalization: ",args.custom_norm
checkArgs(args)
proj_dir = args.outdir+"/"+args.name
########################################################################################################
# Step1 create directory and create MD5 file of input
return_val=call(["mkdir",proj_dir])
if return_val != 0:
print "Cannot create directory "+proj_dir
sys.exit(1)
ERR_LOG = open(proj_dir+"/"+args.name+".err.log","w")
OUT_LOG = open(proj_dir+"/"+args.name+".out.log","w")
OUT_LOG.write("Analysis Pipeline version: "+version)
OUT_LOG.write(time.strftime("%d/%m/%Y: %H:%M:%S : Starting Analysis"))
OUT_LOG.write("Fastq file: "+args.fastq_file+"\n")
OUT_LOG.write("Sample name file: "+args.name+"\n")
OUT_LOG.write("Output Directory: "+args.outdir+"\n")
OUT_LOG.write("Machine: "+args.machine+"\n")
OUT_LOG.write("Gender: "+args.gender+"\n")
if args.keep:
OUT_LOG.write("Keeping temporary files"+"\n")
if args.custom_norm:
OUT_LOG.write("Custom normalization: "+args.custom_norm+"\n")
OUT_LOG.write(time.strftime("\n%d/%m/%Y: %H:%M:%S : Step1 create directory and create MD5 file of input\n"))
OUT_LOG.flush()
print time.strftime("%d/%m/%Y: %H:%M:%S : Step1 create directory and create MD5 file of input")
MD5_OUTPUT = open(proj_dir +"/"+args.name+".md5","w")
call(["md5sum",args.fastq_file],stdout=MD5_OUTPUT,stderr=ERR_LOG)
MD5_OUTPUT.close()
########################################################################################################
# Step2 alignment
OUT_LOG.write(time.strftime("\n%d/%m/%Y: %H:%M:%S : Step2 alignment\n"))
print time.strftime("%d/%m/%Y: %H:%M:%S : Step2 alignment")
aln_value=call([script_dir+"/software/bwa","aln","-f",proj_dir+"/"+args.name+".aln","-t",str(args.threads),script_dir+"/ref/hg19.navin",args.fastq_file],stderr=ERR_LOG,stdout=OUT_LOG)
if aln_value != 0:
print "Error in alignment"
sys.exit()
aln_value=call([script_dir+"/software/bwa","samse","-f",proj_dir+"/"+args.name+".sam",script_dir+"/ref/hg19.navin",proj_dir+"/"+args.name+".aln",args.fastq_file],stderr=ERR_LOG,stdout=OUT_LOG)
if aln_value != 0:
print "Error in alignment"
sys.exit()
########################################################################################################
# Step3 create bam file, sort and remove duplicates
OUT_LOG.write(time.strftime("\n%d/%m/%Y: %H:%M:%S : Step3 create bam file, sort and remove duplicates\n"))
print time.strftime("%d/%m/%Y: %H:%M:%S : Step3 create bam file, sort and remove duplicates")
call([script_dir+"/software/samtools","view","-S","-b","-o",proj_dir+"/"+args.name+".bam",proj_dir+"/"+args.name+".sam"],stderr=ERR_LOG,stdout=OUT_LOG)
if not args.keep:
call(["rm",proj_dir+"/"+args.name+".sam"])
call(["rm",proj_dir+"/"+args.name+".aln"])
call([script_dir+"/software/samtools","rmdup","-s",proj_dir+"/"+args.name+".bam",proj_dir+"/"+args.name+".rmdup.bam"],stderr=ERR_LOG,stdout=OUT_LOG)
call([script_dir+"/software/samtools","sort",proj_dir+"/"+args.name+".rmdup.bam",proj_dir+"/"+args.name+".rmdup.sorted"],stderr=ERR_LOG,stdout=OUT_LOG)
call([script_dir+"/software/samtools","view","-o",proj_dir+"/"+args.name+".rmdup.sorted.sam",proj_dir+"/"+args.name+".rmdup.sorted.bam"],stderr=ERR_LOG,stdout=OUT_LOG)
if not args.keep:
call(["rm",proj_dir+"/"+args.name+".bam"],stderr=ERR_LOG,stdout=OUT_LOG)
call(["rm",proj_dir+"/"+args.name+".rmdup.bam"],stderr=ERR_LOG,stdout=OUT_LOG)
call(["rm",proj_dir+"/"+args.name+".rmdup.sorted.bam"],stderr=ERR_LOG,stdout=OUT_LOG)
########################################################################################################
# Step4 count reads in predefined genomic bins
OUT_LOG.write(time.strftime("\n%d/%m/%Y: %H:%M:%S : Step4 count reads in predefined genomic bins\n"))
print time.strftime("%d/%m/%Y: %H:%M:%S : Step4 count reads in predefined genomic bins")
call([script_dir+"/scripts/count_reads_in_bins_cnv.py",proj_dir+"/"+args.name+".rmdup.sorted.sam",proj_dir+"/"+args.name+".bincounts",proj_dir+"/"+args.name+".stats",script_dir+"/ref"],stderr=ERR_LOG,stdout=OUT_LOG)
if not args.keep:
call(["rm",proj_dir+"/"+args.name+".rmdup.sorted.sam"],stderr=ERR_LOG,stdout=OUT_LOG)
########################################################################################################
# Step5 Normalization in R (GC-correction, normalization with means of controls, etc...) and segmentation
OUT_LOG.write(time.strftime("\n%d/%m/%Y: %H:%M:%S : Step5 Normalization in R (GC-correction, normalization with means of controls, etc...) and segmentation\n"))
print time.strftime("%d/%m/%Y: %H:%M:%S : Step5 Normalization in R (GC-correction, normalization with means of controls, etc...) and segmentation")
TMP_R = open(proj_dir+"/"+args.name+".tmp.R","w")
if args.custom_norm:
TMP_R.write("cbs.segment01(indir=\".\", outdir=\""+proj_dir+"/CGHResults\", bad.bins=\""+script_dir+"/ref/hg19.50k.k50.bad.bins.txt\","+
"varbin.gc=\""+script_dir+"/ref/hg19.new_sorted.gc_count.txt\", varbin.data=\""+proj_dir+"/"+args.name+".bincounts"+"\", sample.name=\""+args.name+"\", "+
"alt.sample.name=\"\", alpha=0.05, nperm=1000, undo.SD=1.0, min.width=5,controls_file=\""+args.custom_norm+"\",sample.dir=\""+proj_dir+"\")\n")
elif args.machine == "miseq":
if args.gender == "m":
TMP_R.write("cbs.segment01(indir=\".\", outdir=\""+proj_dir+"/CGHResults\", bad.bins=\""+script_dir+"/ref/hg19.50k.k50.bad.bins.txt\","+
"varbin.gc=\""+script_dir+"/ref/hg19.new_sorted.gc_count.txt\", varbin.data=\""+proj_dir+"/"+args.name+".bincounts"+"\", sample.name=\""+args.name+"\", "+
"alt.sample.name=\"\", alpha=0.05, nperm=1000, undo.SD=1.0, min.width=5,controls_file=\""+script_dir+"/ref/Kontrollen_male.bincount.txt\",sample.dir=\""+proj_dir+"\")\n")
else:
TMP_R.write("cbs.segment01(indir=\".\", outdir=\""+proj_dir+"/CGHResults\", bad.bins=\""+script_dir+"/ref/hg19.50k.k50.bad.bins.txt\","+
"varbin.gc=\""+script_dir+"/ref/hg19.new_sorted.gc_count.txt\", varbin.data=\""+proj_dir+"/"+args.name+".bincounts"+"\", sample.name=\""+args.name+"\", "+
"alt.sample.name=\"\", alpha=0.05, nperm=1000, undo.SD=1.0, min.width=5,controls_file=\""+script_dir+"/ref/Kontrollen_female.bincount.txt\",sample.dir=\""+proj_dir+"\")\n")
elif args.machine == "nextseq":
if args.gender == "m":
TMP_R.write("cbs.segment01(indir=\".\", outdir=\""+proj_dir+"/CGHResults\", bad.bins=\""+script_dir+"/ref/hg19.50k.k50.bad.bins.txt\","+
"varbin.gc=\""+script_dir+"/ref/hg19.new_sorted.gc_count.txt\", varbin.data=\""+proj_dir+"/"+args.name+".bincounts"+"\", sample.name=\""+args.name+"\", "+
"alt.sample.name=\"\", alpha=0.05, nperm=1000, undo.SD=1.0, min.width=5,controls_file=\""+script_dir+"/ref/Kontrollen_male.bincount_nextseq.txt\",sample.dir=\""+proj_dir+"\")\n")
else:
TMP_R.write("cbs.segment01(indir=\".\", outdir=\""+proj_dir+"/CGHResults\", bad.bins=\""+script_dir+"/ref/hg19.50k.k50.bad.bins.txt\","+
"varbin.gc=\""+script_dir+"/ref/hg19.new_sorted.gc_count.txt\", varbin.data=\""+proj_dir+"/"+args.name+".bincounts"+"\", sample.name=\""+args.name+"\", "+
"alt.sample.name=\"\", alpha=0.05, nperm=1000, undo.SD=1.0, min.width=5,controls_file=\""+script_dir+"/ref/Kontrollen_female.bincount_nextseq.txt\",sample.dir=\""+proj_dir+"\")\n")
TMP_R.close()
R_SCRIPT = open(proj_dir+"/"+args.name+".script.R","w")
COMMON_R = open(script_dir+"/scripts/CNV_postprocessing.cghweb.r","r")
for line in COMMON_R.readlines():
R_SCRIPT.write(line)
COMMON_R.close()
TMP_R = open(proj_dir+"/"+args.name+".tmp.R","r")
for line in TMP_R.readlines():
R_SCRIPT.write(line)
TMP_R.close()
R_SCRIPT.close()
os.environ["R_LIBS_USER"]=script_dir+"/R/x86_64-pc-linux-gnu-library/2.14"
r_loc=script_dir+"/R/R"
call([r_loc,"CMD","BATCH",proj_dir+"/"+args.name+".script.R",proj_dir+"/"+args.name+".script.R.out"],stderr=ERR_LOG,stdout=OUT_LOG)
call(["gunzip",proj_dir+"/CGHResults/Table_of_aCGH_smoothed_profiles.txt.gz"],stderr=ERR_LOG,stdout=OUT_LOG)
call(["mv",proj_dir+"/CGHResults/Table_of_aCGH_smoothed_profiles.txt",proj_dir+"/"+args.name+".segmented"],stderr=ERR_LOG,stdout=OUT_LOG)
call([script_dir+"/scripts/get_segments.pl",proj_dir+"/"+args.name+".segmented",proj_dir+"/"+args.name+".segments"],stderr=ERR_LOG,stdout=OUT_LOG)
########################################################################################################
# Step6 Create Plots in R
OUT_LOG.write(time.strftime("\n%d/%m/%Y: %H:%M:%S : Step6 Create Plots in R\n"))
print time.strftime("%d/%m/%Y: %H:%M:%S : Step6 Create Plots in R")
INFILE1 = open(script_dir+"/scripts/makeGraph.R","r")
call(["R","--slave","--args",proj_dir+"/"+args.name+".segmented"],stdin=INFILE1,stderr=ERR_LOG,stdout=OUT_LOG)
INFILE1.close()
INFILE2 = open(script_dir+"/scripts/makeGraph_each_chr.R","r")
call(["R","--slave","--args",proj_dir+"/"+args.name+".segmented"],stdin=INFILE2,stderr=ERR_LOG,stdout=OUT_LOG)
INFILE2.close()
INFILE3 = open(script_dir+"/scripts/makeGraph_segments.R","r")
call(["R","--slave","--args",proj_dir+"/"+args.name+".segmented"],stdin=INFILE3,stderr=ERR_LOG,stdout=OUT_LOG)
INFILE3.close()
INFILE4 = open(script_dir+"/scripts/makeGraph_segments_each_chr.R","r")
call([r_loc,"--slave","--args",proj_dir+"/"+args.name+".segmented"],stdin=INFILE4,stderr=ERR_LOG,stdout=OUT_LOG)
INFILE4.close()
INFILE5 = open(script_dir+"/scripts/makeGraph_linear_chrlen_log2.R","r")
call(["R","--slave","--args",proj_dir+"/"+args.name+".segmented"],stdin=INFILE5,stderr=ERR_LOG,stdout=OUT_LOG)
INFILE5.close()
INFILE6 = open(script_dir+"/scripts/makeGraph_linear_chrlen_segments.R","r")
call(["R","--slave","--args",proj_dir+"/"+args.name+".segmented"],stdin=INFILE6,stderr=ERR_LOG,stdout=OUT_LOG)
INFILE6.close()
INFILE7 = open(script_dir+"/scripts/makeGraph_linear_chrlen_blue.R","r")
call(["R","--slave","--args",proj_dir+"/"+args.name+".segments"],stdin=INFILE7,stderr=ERR_LOG,stdout=OUT_LOG)
INFILE7.close()
########################################################################################################
# Step7 Calculate Z-scores
OUT_LOG.write(time.strftime("\n%d/%m/%Y: %H:%M:%S : Step7 Calculate Z-scores\n"))
print time.strftime("%d/%m/%Y: %H:%M:%S : Step7 Calculate Z-scores")
if args.custom_norm:
OUT_LOG.write(time.strftime("\n%d/%m/%Y: %H:%M:%S : Skip Z-score calculation for custom normalization file\n"))
print time.strftime("%d/%m/%Y: %H:%M:%S : Skip Z-score calculation for custom normalization file")
elif args.machine == "miseq":
if args.gender=="m":
call([script_dir+"/scripts/segmental_GC_z-scores.pl",proj_dir+"/"+args.name+".segments",proj_dir+"/"+args.name+".corrected.bincounts",proj_dir+"/"+args.name+".segmented.zscores.txt",script_dir+"/ref/GC_corrected_bincounts_male"],stderr=ERR_LOG,stdout=OUT_LOG)
else:
call([script_dir+"/scripts/segmental_GC_z-scores.pl",proj_dir+"/"+args.name+".segments",proj_dir+"/"+args.name+".corrected.bincounts",proj_dir+"/"+args.name+".segmented.zscores.txt",script_dir+"/ref/GC_corrected_bincounts_female"],stderr=ERR_LOG,stdout=OUT_LOG)
elif args.machine == "nextseq":
if args.gender=="m":
call([script_dir+"/scripts/segmental_GC_z-scores.pl",proj_dir+"/"+args.name+".segments",proj_dir+"/"+args.name+".corrected.bincounts",proj_dir+"/"+args.name+".segmented.zscores.txt",script_dir+"/ref/GC_corrected_bincounts_male_nextseq"],stderr=ERR_LOG,stdout=OUT_LOG)
else:
call([script_dir+"/scripts/segmental_GC_z-scores.pl",proj_dir+"/"+args.name+".segments",proj_dir+"/"+args.name+".corrected.bincounts",proj_dir+"/"+args.name+".segmented.zscores.txt",script_dir+"/ref/GC_corrected_bincounts_female_nextseq"],stderr=ERR_LOG,stdout=OUT_LOG)
########################################################################################################
# Step8 Call Focal Amplifications
OUT_LOG.write(time.strftime("\n%d/%m/%Y: %H:%M:%S : Step8 Call Focal Amplifications\n"))
print time.strftime("%d/%m/%Y: %H:%M:%S : Step8 Call Focal Amplifications")
call(["mkdir",proj_dir+"/FocalAmps"],stderr=ERR_LOG,stdout=OUT_LOG)
FOCAL_SCRIPT=open(script_dir+"/scripts/FocalAmplifications_fromPlasmaSeq.R","r")
if args.gender == "m":
call(["R","--slave","--args",proj_dir+"/"+args.name+".segmented",proj_dir+"/"+args.name+".segments",proj_dir+"/FocalAmps/"+args.name,"Prostate","100",script_dir+"/scripts/Ref"],stdin=FOCAL_SCRIPT,stderr=ERR_LOG,stdout=OUT_LOG)
else:
call(["R","--slave","--args",proj_dir+"/"+args.name+".segmented",proj_dir+"/"+args.name+".segments",proj_dir+"/FocalAmps/"+args.name,"Breast","100",script_dir+"/scripts/Ref"],stdin=FOCAL_SCRIPT,stderr=ERR_LOG,stdout=OUT_LOG)
FOCAL_SCRIPT.close()
########################################################################################################
OUT_LOG.write(time.strftime("\n%d/%m/%Y: %H:%M:%S : Finished Analysis\n"))
print time.strftime("%d/%m/%Y: %H:%M:%S : Finished Analysis")
ERR_LOG.close()
OUT_LOG.close()
view raw cnv_pipeline.py hosted with ❤ by GitHub
The first steps are going fine, but the problem occurs during step 5.

Below the command line used to invoke the script

  lien@lien:~/Documents/Plasma_Seq_Heitzer_Ulz$ pwd
        /home/lien/Documents/Plasma_Seq_Heitzer_Ulz
  lien@lien:~/Documents/Plasma_Seq_Heitzer_Ulz$ ./cnv_pipeline_totest.py 
-fq /media/lien/Seagate\ Backup\ Plus\ Drive/Lien-NIPT-Original-Fastq/GC029428-AR007.HiSeq2000.FCA.R1.fastq.gz 
-s GC029428-AR007 
-g f 
-o /home/lien/Documents/Plasma_Seq_output 
-m miseq 
-k

A temporary R file (GC029428-AR007.tmp.r) is created and shown below, and the directories all seem right.

 cbs.segment01(indir=".", 
 outdir="/home/lien/Documents/Plasma_Seq_output/GC029428-AR007/CGHResults", 
 bad.bins="/home/lien/Documents/Plasma_Seq_Heitzer_Ulz/ref/hg19.50k.k50.bad.bins.txt",
 varbin.gc="/home/lien/Documents/Plasma_Seq_Heitzer_Ulz/ref/hg19.new_sorted.gc_count.txt", 
 varbin.data="/home/lien/Documents/Plasma_Seq_output/GC029428-AR007/GC029428-AR007.bincounts", 
 sample.name="GC029428-AR007", alt.sample.name="", 
 alpha=0.05, nperm=1000, undo.SD=1.0, min.width=5,
 controls_file="/home/lien/Documents/Plasma_Seq_Heitzer_Ulz/ref/Kontrollen_female.bincount.txt",
 sample.dir="/home/lien/Documents/Plasma_Seq_output/GC029428-AR007")

However, the log file shows that files are not found. All libraries in R are loaded correctly, but this is the error I'm getting:

cbs.segment01(indir=".", 
outdir="/home/lien/Documents/Plasma_Seq_output/GC029428-AR007/CGHResults", 
bad.bins="/home/lien/Documents/Plasma_Seq_Heitzer_Ulz/ref/hg19.50k.k50.bad.bins.txt",
varbin.gc="/home/lien/Documents/Plasma_Seq_Heitzer_Ulz/ref/hg19.new_sorted.gc_count.txt", 
varbin.data="/home/lien/Documents/Plasma_Seq_output/GC029428-AR007/GC029428-AR007.bincounts", 
sample.name="GC029428-AR007", alt.sample.name="", 
alpha=0.05, nperm=1000, undo.SD=1.0, min.width=5,
controls_file="/home/lien/Documents/Plasma_Seq_Heitzer_Ulz/ref/Kontrollen_female.bincount.txt",
sample.dir="/home/lien/Documents/Plasma_Seq_output/GC029428-AR007")
Error in file(file, "rt") : cannot open the connection
Calls: cbs.segment01 -> read.table -> file
In addition: Warning message:
In file(file, "rt") :
  cannot open file './/home/lien/Documents/Plasma_Seq_output/GC029428-AR007/GC029428-AR007.bincounts': No such file or directory
Execution halted

I think the error is caused by the .//Plasma_Seq_output folder that is not found due to the '//'. However, when I try to change something in the python script to remove one '/', this doesn't work. Also, when I try to change the command line arguments, this results in error.

Am I missing something really obvious here?

Thanks!

R python • 5.8k views
ADD COMMENT
0
Entering edit mode
9.2 years ago

In which directory do you execute the script? My understanding is that the script expects to be in "Documents".

ADD COMMENT
0
Entering edit mode

The script is located in /Documents/Plasma_Seq_Heitzer_Ulz/ and is executed in this directory. The input files in the reference-subfolder are in /Documents/Plasma_Seq_Heitzer_Ulz/ref/. The output files generated are in /Documents/Plasma_Seq_output/. Are this too many subfolders?

ADD REPLY
0
Entering edit mode

To solve your problem, try to type the full path of all your documents. Your error message is just saying it cannot detect the file. I think it is searching for /Documents/Plasma_Seq_Heitzer_Ulz///Plasma_Seq_output/GC029428-AR007/GC029428-AR007.bincounts

ADD REPLY
0
Entering edit mode

I've copied all the outputs without changing the paths. And I included the entire script, where the first steps are ok, but problems arise in step 5.

ADD REPLY
0
Entering edit mode

How about changing indir=\".\" to indir=\"\", hopefully it will change the file to //home/lien/Documents/Plasma_Seq_output/GC029428-AR007/GC029428-AR007.bincounts instead of .//home/lien/Documents/Plasma_Seq_output/GC029428-AR007/GC029428-AR007.bincounts. If that doesn't work, maybe even remove the indir parameter

ADD REPLY
0
Entering edit mode

I tried your suggestions:

*. When I change indir from indir=\".\" to indir=\"\" this is the error message:

Error in runCGHAnalysis(CGHweb_ratios, BioHMM = FALSE, UseCloneDists = FALSE, :
Unable to create the output directory /home/lien/Documents/Plasma_Seq_Heitzer_Ulz//home/lien/Documents/Plasma_Seq_output/GC029428-AR007/CGHResults Calls: cbs.segment01 -> runCGHAnalysis In addition: Warning message: In dir.create(tDir) : cannot create dir '/home/lien/Documents/Plasma_Seq_Heitzer_Ulz//home/lien/Documents/Plasma_Seq_output/GC029428-AR007/CGHResults', reason 'No such file or directory' Execution halted

*. When I completely remove indir this is the error message:

Error in runCGHAnalysis(CGHweb_ratios, BioHMM = FALSE, UseCloneDists = FALSE, : Unable to create the output directory /home/lien/Documents/Plasma_Seq_Heitzer_Ulz//home/lien/Documents/Plasma_Seq_output/GC029428-AR007/CGHResults Calls: cbs.segment01 -> runCGHAnalysis In addition: Warning message: In dir.create(tDir) : cannot create dir '/home/lien/Documents/Plasma_Seq_Heitzer_Ulz//home/lien/Documents/Plasma_Seq_output/GC029428-AR007/CGHResults', reason 'No such file or directory' Execution halted

*. When I change the output folder from /home/lien/Documents/Plasma_Seq_output to /home/lien/Documents/Plasma_Seq_Heitzer_Ulz, this is the error message (which is the same as the original one):

Error in file(file, "rt") : cannot open the connection Calls: cbs.segment01 -> read.table -> file In addition: Warning message: In file(file, "rt") : cannot open file './/home/lien/Documents/Plasma_Seq_Heitzer_Ulz/GC029428-AR007/GC029428-AR007.bincounts': No such file or directory Execution halted

ADD REPLY
0
Entering edit mode

From these error message, we can be certain that the problem is due to the directory location. Therefore, to point to the correct location, you can try indir to point to proj_dir whereas remove proj_dir from the outdir hopefully, it will now point to /home/lien/Documents/Plasma_Seq_output/GC029428-AR007/CGHResults where I think proj_dir is /home/lien/Documents/Plasma_Seq_output/GC029428-AR007/

ADD REPLY
0
Entering edit mode

Thanks for your help Sam. It was indeed a problem with the directory locations. When I don't specify the output directory on the command line, he finds all the locations he needs and the script runs completely.

ADD REPLY

Login before adding your answer.

Traffic: 2059 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6