seasoncloud / Alleloscope

Alleloscope is a method for allele-specific copy number estimation that can be applied to single cell DNA and ATAC sequencing data (separately or in combination). Allele-specific estimation allows for the more accurate delineation of copy number states and the detection of subclonal copy-neutral loss-of-heterozygosity and mirrored CNA events. On scATAC-seq data, Alleloscope allows integrative multi-omic analysis of allele-specific copy number and chromatin accessibility for the same cell.
28 stars 6 forks source link

Questions about Gen_bin_cell_atac.R script #1

Closed Ping-lin14 closed 3 years ago

Ping-lin14 commented 3 years ago

Hi

According to the Gen_bin_cell_atac.R script, when I execute if(grepl("chr",bin_bed[1,1])){ bin_bed[,1]=gsub("chr","",bin_bed[,1]) }else{ bin_bed=bin_bed } , I receive an errorError in if (grepl("chr", bin_bed[1, 1])) {: argument length is zero.

And when I execute query=GRanges(paste0('chr',chr200k[,1]), IRanges(chr200k[,2]+1,chr200k[,3])), I receive an errorError in stop_if_wrong_length(what, ans_len) : 'ranges' must have the length of the object to construct (1) or length 1. Is that right?

seasoncloud commented 3 years ago

Thanks for your interest in Alleloscope! The error seems to be due to the bin_bed variable. The input for the bin_bed parameter should be " A matrix of the BED format. The first three columns are 'chr', "start site", "end site". Each row is a bin region." Could you try "head(bin_bed)" to see if it the format looks like the following example? image

Ping-lin14 commented 3 years ago

I found that I entered the wrong .bed file, and now the problem is solved.

I have another question. After I filter out the quality drop cells and SNP, the warning message NA generated during the forced change will be generated. Do you want to ignore it?

Since I only have scATAC data, so I used Obj_filtered$seg_table <- Segmentation(Obj_filtered=Obj_filtered, raw_counts=raw_counts, plot_seg = TRUE) to generate the matrix for segmentation results from scDNA-seq. However, the error message is generated Error in strsplit(rownames(ref_counts), "-") : non-character argument. What is the treatment?

seasoncloud commented 3 years ago

To generate the bin by cell matrix using the Gen_bin_cell_atac.R file, I would like to note that the bed file is for the "fixed bins" not the peak regions with varying sizes. I added a helper function (https://github.com/seasoncloud/Basic_CNV_SNV/blob/main/scripts/Generate_bed.R) to help generate the bin_bed file based on your reference genome.

The "Error in strsplit(rownames(ref_counts), "-") : non-character argument" resulted from no input for the ref_counts argument (which is required).

The current Alleloscope version is developed for "scDNA-seq+ scATAC-seq" and "bulk DNA-seq + scATAC-seq". The current "Segmentation" function is developed for segmenting DNA sequencing data on the coverage (tumor+normal). We are planning to expand this to work on scATAC-seq data alone in the future.