library(NIPTeR)
#Gather all bam filepaths in a vector. Corresponds to 1a in figure
bam_filepaths <- list.files(path = "/Path/to/bamfiles/", pattern = ".bam", full.names = T)
#Load all bam files using lapply and feed the results to function as_control_group,
#converting the NIPTSamples to a NIPTControlGroup object. Corresponds to 1b in figure
control_group <- as_control_group(nipt_samples = lapply(X = bam_filepaths, bin_bam_sample,
do_sort = F, separate_strands = F))
根据官方文档运行以上代码时,总是提示报错:
NIPTeR Error: BAM file appears to be unsorted
谷歌了半天,发现不止一个人遇到这个问题:
有人建议:分开来写
s1<-bin_bam_sample("./sample1.bam", do_sort = F, separate_strands = F, custom_name = NULL)
s2<-bin_bam_sample("./sample2.bam", do_sort = F, separate_strands = F, custom_nam