R-使用column.splice定义多个范围

时间:2017-04-21 18:16:15

标签: r

我是R的新手。当我尝试使用冒号(:)范围语法选择特定数量的列时,我的程序出错了。写这个的正确方法是什么?

target <- read.table('/20130108.exome.targets.test.bed')
Bam <- c()

Bam[[1]] <- '/dataset/NA19761.mapped.ILLUMINA.bwa.MXL.exome.20120522.bam'
Bam[[2]] <- '/dataset/NA19774.mapped.ILLUMINA.bwa.MXL.exome.20120522.bam'
Bam[[3]] <- '/dataset/NA19770.mapped.ILLUMINA.bwa.MXL.exome.20120522.bam'
Bam[[4]] <- '/dataset/NA19651.mapped.ILLUMINA.bwa.MXL.exome.20120522.bam'

library(ExomeDepth)
ExomeCount <- getBamCounts(bed.frame = target, bam.files = Bam , include.chr=FALSE, referenceFasta ='./hs37d5.fa')
ExomeCount.dafr <- as(ExomeCount [,colnames(ExomeCount)],'data.frame')

    for(i in 1:4){
         if(i != 4 & i != 1){my.reference.set <- as.matrix(ExomeCount.dafr [,c(7:i+5,i+7:10)])}
    }

0 个答案:

没有答案