rwdavies / STITCH

STITCH - Sequencing To Imputation Through Constructing Haplotypes
http://www.nature.com/ng/journal/v48/n8/abs/ng.3594.html
GNU General Public License v3.0
73 stars 19 forks source link

A question about copying files onto tempdir #78

Closed Dengzhaoo closed 1 year ago

Dengzhaoo commented 1 year ago

Hi

Now I'm using basevar+stitch to impute 1x WGS data.I used basevar to get chromosome 1 posfile and impute with stitch.when I run it I have this message:

[2023-01-19 17:12:54] Done generating inputs [2023-01-19 17:12:54] Copying files onto tempdir sh: 1: cannot create /tmp/RtmpEkb7pB/SUHDAFSUGU/files_to_transfer.txt: Directory nonexistent rsync: failed to open files-from file /tmp/RtmpEkb7pB/SUHDAFSUGU/files_to_transfer.txt: No such file or directory rsync error: syntax or usage error (code 1) at main.c(1746) [client=3.2.3] [2023-01-19 17:12:55] Done copying files onto tempdir [2023-01-19 17:12:55] Generate allele count [2023-01-19 17:12:57] Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection

Error in check_mclapply_OK(out2) : An error occured during STITCH. The first such error is above Calls: STITCH -> buildAlleleCount -> check_mclapply_OK In addition: Warning messages: 1: In mclapply(1:length(sampleRanges), mc.cores = nCores, FUN = loadBamAndConvert_across_a_range, : scheduled core 4 did not deliver a result, all values of the job will be affected 2: In mclapply(sampleRanges, mc.cores = nCores, FUN = buildAlleleCount_subfunction, : all scheduled cores encountered errors in user code Execution halted

At first I thought it was out of memory, but I checked and found there was enough memory。 This is my script

/home/dengzhao/9z/git/stitchdata/STITCH.R \ --chr=1 \ --bamlist=bam.txt \ --posfile=chr1_pos.txt \ --outputdir=./ \ --K=2 \ --nGen=1000 \ --nCores=16 I would like to ask how to solve this error problem? I am looking forward to your reply. Thank you

rwdavies commented 1 year ago

It's complaining because it can't seem to use the R requested tempdir on your machine What happens when you start R and do something like

cat("test", file = file.path(tempdir(), "test.txt"))
scan(file.path(tempdir(), "test.txt"), "character")
Dengzhaoo commented 1 year ago

I input in R and happen like this

cat("test", file = file.path(tempdir(), "test.txt")) scan(file.path(tempdir(), "test.txt"), "character") Read 1 item [1] "test"

Dengzhaoo commented 1 year ago

On other chromosomes with the same code can run, only in the first chromosome errors, may I know what is the cause thank you

rwdavies commented 1 year ago

Does it reproducibly crash? i.e. if you run chr1 several times and chr2 several times do you always get the same error?

The error suggests a problem in R making the temporary directories.

Dengzhaoo commented 1 year ago

Yes, this error will be repeated when other chromosomes are running. I just tried to change the default address of R tempdir, but the same error still occurs.

Dengzhaoo commented 1 year ago

should I updata R or Uninstall and reload R

rwdavies commented 1 year ago

how did you try to change the tempdir? setting it for STITCH using --tempdir ?

Dengzhaoo commented 1 year ago

I changed R defult tempdir,not set STITCH using --tempdir,it not work

Dengzhaoo commented 1 year ago

I sloved this error when I set STITCH using --tempdir. thank you