QUILT icon indicating copy to clipboard operation
QUILT copied to clipboard

question about CRAM input format

Open 2584589300 opened this issue 2 years ago • 4 comments

Hi! When I try to use CRAM files as input, I got the following message:

Error in get_bam_name_and_maybe_convert_cram(iBam, bam_files, cram_files, : Both bam_files and cram_files are empty Calls: QUILT ... loadBamAndConvert -> get_bam_name_and_maybe_convert_cram Execution halted

And when I convert CRAM files to BAM files, it can work. I notice that in https://github.com/rwdavies/QUILT/blob/master/QUILT/R/functions.R

loadBamAndConvert( iBam = iSample, L = L, pos = pos, nSNPs = nSNPs, bam_files = bam_files, iSizeUpperLimit = iSizeUpperLimit, bqFilter = bqFilter, chr = chr, N = length(sampleNames), downsampleToCov = downsampleToCov, sampleNames = sampleNames, inputdir = tempdir, regionName = regionName, tempdir = tempdir, chrStart = chrStart, chrEnd = chrEnd, chrLength = NA, save_sampleReadsInfo = TRUE, use_bx_tag = use_bx_tag, bxTagUpperLimit = bxTagUpperLimit, default_sample_no_read_behaviour = "return_null" )

there is no "cram_files = cram_files", is that a mistake? Thanks!

2584589300 avatar Jan 06 '23 09:01 2584589300

Thanks looks like I forgot to pass through the arguments indeed.

rwdavies avatar Jan 09 '23 09:01 rwdavies

Hi @rwdavies! I would like to use QUILT in Nextflow. I have built a nf-core module that I would like to share with the community. However, I have noticed that it fails when I test it with cram inputs. As per Nextflow's guidelines, I am currently using the QUILT's version in Biocontainers. Is it possible that this version does not have the corrected code? I have also tested it outside Nextflow and I get the same error:

Code used to run docker interactively:

docker run -it -v /crams:/data quay.io/biocontainers/r-quilt:1.0.4--r43h06b5641_2 /bin/bash

Code used to run QUILT:

R -e 'library("QUILT"); 

QUILT(chr="chr20",cramlist="/data/cramlist.txt",
reference_haplotype_file="/data/ALL.chr20_GRCh38.genotypes.20170504.chr20.2000001.2100000.noNA12878.hap.gz", nGen=100,regionStart=2000001,regionEnd=2100000,buffer=1000,outputdir="quilt_output",reference_legend_file="/data/ALL.chr20_GRCh38.genotypes.20170504.chr20.2000001.2100000.noNA12878.legend.gz",reference="Homo_sapiens_assembly38.fasta")'

Error:

[2023-08-25 17:37:23] Get CRAM sample names
[2023-08-25 17:37:23] Done getting CRAM sample names
[2023-08-25 17:37:23] Warning, there are repeat sample names
[2023-08-25 17:37:23] There are 3227 SNPs in this region
[2023-08-25 17:37:24] Imputing sample: 1
Error in get_bam_name_and_maybe_convert_cram(iBam, bam_files, cram_files,  : 
  Both bam_files and cram_files are empty
Calls: QUILT ... loadBamAndConvert -> get_bam_name_and_maybe_convert_cram
Execution halted

Thank you!

atrigila avatar Aug 28 '23 12:08 atrigila

Hey, thanks, sorry for the slow reply, I'm just checking this now

Looks like it is passing, I just need to push a new version, and add to bioconductor. I'll work on that now / the next few days

rwdavies avatar Sep 11 '23 10:09 rwdavies

Thank you! :)

atrigila avatar Oct 06 '23 11:10 atrigila

This was fixed in QUILT2 with dependency STITCH 1.7.1, see https://github.com/rwdavies/STITCH/releases/tag/1.7.1

Zilong-Li avatar Aug 26 '24 13:08 Zilong-Li