From 10b8dc7af35f0d221daf121d0e3c0a52d9223368 Mon Sep 17 00:00:00 2001 From: Danny Arends Date: Wed, 29 Apr 2020 04:38:42 -0500 Subject: Fixing loading of the ITP data as a 4way cross, worked on http://gn2-test3.genenetwork.org/ --- wqflask/wqflask/marker_regression/rqtl_mapping.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/marker_regression/rqtl_mapping.py b/wqflask/wqflask/marker_regression/rqtl_mapping.py index e1aa290b..9909b6d4 100644 --- a/wqflask/wqflask/marker_regression/rqtl_mapping.py +++ b/wqflask/wqflask/marker_regression/rqtl_mapping.py @@ -128,7 +128,7 @@ def generate_cross_from_geno(dataset): # TODO: Need to figure out why som if(type == '4-way'){ genocodes <- c('1','2','3','4') } else { - genocodes <- c(getGenoCode(header, 'mat'), getGenoCode(header, 'het'), getGenoCode(header, 'pat')) # Get the genotype codes + genocodes <- c(getGenoCode(header, 'mat'), getGenoCode(header, 'het'), getGenoCode(header, 'pat')) # Get the genotype codes } genodata <- read.csv(genotypes, sep='\t', skip=toskip, header=TRUE, na.strings=getGenoCode(header,'unk'), colClasses='character', comment.char = '#') cat('Genodata:', toskip, " ", dim(genodata), genocodes, '\n') @@ -139,7 +139,11 @@ def generate_cross_from_geno(dataset): # TODO: Need to figure out why som cbind(genodata[,c('Locus','Chr', 'cM')], genodata[, 5:ncol(genodata)])) # Genotypes write.table(outCSVR, file = out, row.names=FALSE, col.names=FALSE,quote=FALSE, sep=',') # Save it to a file require(qtl) - cross = read.cross(file=out, 'csvr', genotypes=genocodes) # Load the created cross file using R/qtl read.cross + if(type == '4-way'){ + cross = read.cross(file=out, 'csvr', genotypes=genocodes, crosstype="4way", convertXdata=FALSE) # Load the created cross file using R/qtl read.cross + }else{ + cross = read.cross(file=out, 'csvr', genotypes=genocodes) # Load the created cross file using R/qtl read.cross + } if(type == 'riset') cross <- convert2riself(cross) # If its a RIL, convert to a RIL in R/qtl return(cross) } -- cgit v1.2.3