cibiobcg / EthSEQ

Ethnicity Annotation from Whole-Exome and Targeted Sequencing Data
14 stars 10 forks source link

Performing ethnicity analysis from BAM files list throws errors #3

Open MarWoes opened 5 years ago

MarWoes commented 5 years ago

Hi,

Running the example from the README's Perform ethnicity analysis from BAM files list throws the errors:

Error in dimnames(x) <- dn: length of 'dimnames' [2] not equal to array extent

and

Error in fread(paste(genotype.dir, files[1], sep = ""), sep = "\t", header = T,  : 
  File '/tmp/Rtmptz8tn5/EthSEQ_Analysis/ASEQGenotypes/NA' does not exist or is non-readable. getwd()=='...'

This seems to be caused by the code snippet in aseq.Run:

model = snpgdsOpen(model.path,readonly = F)
snp.list = snpgdsSNPList(model)
vcf = cbind(snp.list$chromosome,pos=snp.list$position,snp.list$rs.id,
           as.character(read.gdsn(index.gdsn(model,"snp.ref"))),
                  as.character(read.gdsn(index.gdsn(model,"snp.alt"))),".",".",".")
colnames(vcf)= c("CHR","POS","ID","REF","ALT","QUAL","FILTER","INFO")

When debugging this part, snp.list does not have an entry snp.list$rs.id. Changing it to snp.list$snp.id seems to resolve the issue.

Could you have a look into this?

Thanks in advance!