stuart-lab / signac

R toolkit for the analysis of single-cell chromatin data
https://stuartlab.org/signac/
Other
330 stars 88 forks source link

Error in CreateChromatinAssay #1796

Closed Geogres closed 1 month ago

Geogres commented 1 month ago

granges <- GRanges( seqnames = peak_features$chr, ranges = IRanges(start = peak_features$start, end = peak_features$end) )
atac_assay <- CreateChromatinAssay( counts = atac_matrix, genome = "hg38", fragments = granges ) While creating the atac_assay, I encountered the following issue. My GRanges object was successfully created, and I have ensured that my data types and numeric values are correctly formatted.

<simpleError in .get_data_frame_col_as_numeric(df, granges_cols[["end"]]): some values in the "end" column cannot be turned into numeric values> Warning message: Expected 3 pieces. Missing pieces filled with NA in 16742 rows [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, ...].

Here is the format of my data. 16,742 is the total number of my rows. chrX:155881104-155881482 chrX:155881104-155881482 Peaks chrX 155881104 155881482 chrY:2935693-2936164 chrY:2935693-2936164 Peaks chrY 2935693 2936164 chrY:7273640-7274096 chrY:7273640-7274096 Peaks chrY 7273640 7274096

timoast commented 1 month ago

Please check the documentation for the fragments parameter in CreateChromatinAssay, this should be your fragment file not the peak region GRanges. You also need to set sep = c(":", "-")