Commit 2ffd299b authored by Marie Bourdon's avatar Marie Bourdon
Browse files

add manual

parent fc18feef
This diff is collapsed.
{
"activeTab" : 0
"activeTab" : 2
}
\ No newline at end of file
{
}
\ No newline at end of file
{
"cursorPosition" : "100,50",
"scrollLine" : "96"
"cursorPosition" : "48,32",
"scrollLine" : "33"
}
\ No newline at end of file
{
}
\ No newline at end of file
{
"cursorPosition" : "9,60",
"scrollLine" : "0"
}
\ No newline at end of file
{
"cursorPosition" : "128,16",
"last_setup_crc32" : "31136BFE5bfca283",
"scrollLine" : "123"
"cursorPosition" : "44,0",
"last_setup_crc32" : "39B546A65bfca283",
"scrollLine" : "44"
}
\ No newline at end of file
~%2Fstuart_package%2Fstuart%2FDESCRIPTION="BEB7232"
~%2Fstuart_package%2Fstuart%2FNAMESPACE="AE613167"
~%2Fstuart_package%2Fstuart%2FR%2Fmark_poly.R="3A328548"
~%2Fstuart_package%2Fstuart%2FR%2Fwrite_rqtl.R="5B8691C7"
~%2Fstuart_package%2Fstuart%2Fvignettes%2FstuaRt.R="EBD625D2"
~%2Fstuart_package%2Fstuart%2Fvignettes%2FstuaRt.Rmd="D602FFE4"
## ---- include = FALSE---------------------------------------------------------
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
## ----setup--------------------------------------------------------------------
library(dplyr)
library(stuart)
## ----annot--------------------------------------------------------------------
annot_mini <- read.csv(url("https://raw.githubusercontent.com/kbroman/MUGAarrays/master/UWisc/mini_uwisc_v2.csv"))
## ----load---------------------------------------------------------------------
data(genos)
summary(genos)
data(phenos)
summary(phenos)
## ----strains------------------------------------------------------------------
strains <- geno_strains(ref=annot_mini,geno=genos,par1=c("StrainsA_1","StrainsA_2"),par2=c("StrainsB_1","StrainsB_2"),name1="parent1",name2="parent2")
head(strains)
## ----no_parent----------------------------------------------------------------
genos <- genos %>% filter(!Sample.ID %in% c("StrainsA_1", "StrainsA_2", "StrainsB_1","StrainsB_2"))
## ----tab_mark-----------------------------------------------------------------
data(stuart_tab)
summary(stuart_tab)
## ----mark_match---------------------------------------------------------------
tab2 <- mark_match(stuart_tab,ref=strains)
tab2 %>% filter(exclude_match==1)
## ----mark_poly ex-------------------------------------------------------------
tab2 <- mark_poly(tab2)
head(tab2)
## ----mark_prop ex-------------------------------------------------------------
tab2 <- mark_prop(tab2,cross="F2",homo=0.1,hetero=0.1)
head(tab2)
## ----mark_allele--------------------------------------------------------------
tab2 <- mark_allele(tab=tab2,ref=strains,par1="parent1",par2="parent2")
tab2 %>% arrange(desc(exclude_allele)) %>% head()
## ----mark_allele-strains------------------------------------------------------
strains %>% filter(marker %in% c("gJAX00038569","gJAX00425031","gUNC12245354","gUNC15530876","gUNC21555204","gUNC21596600")) %>% arrange(marker) %>% select(marker,parent1,parent2)
......@@ -5,20 +5,20 @@
"dirty" : false,
"encoding" : "UTF-8",
"folds" : "",
"hash" : "0",
"hash" : "3120719904",
"id" : "45D91D58",
"lastKnownWriteTime" : 1622539449,
"last_content_update" : 1622539449402,
"lastKnownWriteTime" : 1622621980,
"last_content_update" : 1622621980790,
"path" : "~/stuart_package/stuart/R/write_rqtl.R",
"project_path" : "R/write_rqtl.R",
"properties" : {
"cursorPosition" : "100,50",
"scrollLine" : "96"
"cursorPosition" : "48,32",
"scrollLine" : "33"
},
"read_only" : false,
"read_only_alternatives" : [
],
"relative_order" : 1,
"relative_order" : 5,
"source_on_save" : false,
"source_window" : "",
"type" : "r_source"
......
......@@ -48,7 +48,7 @@ write_rqtl <- function(geno,pheno,tab,ref,par1,par2,prefix,pos,path=NA){
#keep parental lines genotypes
colnames(ref) <- make.names(colnames(ref))
ref <- ref %>% select(marker,chr,bp_mm10,!!sym(pos),!!sym(par1),!!sym(par2))
ref <- ref %>% select(marker,chr,!!sym(pos),!!sym(par1),!!sym(par2))
#merge genotypes with parents
geno <- left_join(geno,ref,by=c("SNP.Name"="marker"))
......@@ -92,12 +92,12 @@ write_rqtl <- function(geno,pheno,tab,ref,par1,par2,prefix,pos,path=NA){
#keep positions of markers
markers <- geno %>% select(SNP.Name,chr,bp_mm10,!!sym(pos)) %>% distinct()
markers <- markers %>% arrange(chr,bp_mm10)
markers <- geno %>% select(SNP.Name,chr,!!sym(pos)) %>% distinct()
markers <- markers %>% arrange(chr,!!sym(pos))
#keep only interesting columns in geno file
geno <- geno %>% arrange(chr,bp_mm10)
geno <- geno %>% arrange(chr,!!sym(pos))
geno <- geno %>% select(SNP.Name,Sample.ID,Geno)
#remove prefix
......
......@@ -26,7 +26,7 @@
"read_only" : false,
"read_only_alternatives" : [
],
"relative_order" : 5,
"relative_order" : 6,
"source_on_save" : false,
"source_window" : "",
"type" : "r_dataframe"
......
......@@ -12,21 +12,21 @@
"path" : null,
"project_path" : null,
"properties" : {
"cacheKey" : "2EEA0644",
"cacheKey" : "F7A5FD33",
"caption" : "strains",
"contentUrl" : "grid_resource/gridviewer.html?env=&obj=strains&cache_key=2EEA0644",
"displayedObservations" : 11125,
"contentUrl" : "grid_resource/gridviewer.html?env=&obj=strains&cache_key=F7A5FD33",
"displayedObservations" : "11125",
"environment" : "",
"expression" : "strains",
"object" : "strains",
"preview" : 0,
"totalObservations" : 11125,
"variables" : 14
"preview" : "0",
"totalObservations" : "11125",
"variables" : "14"
},
"read_only" : false,
"read_only_alternatives" : [
],
"relative_order" : 6,
"relative_order" : 3,
"source_on_save" : false,
"source_window" : "",
"type" : "r_dataframe"
......
......@@ -26,7 +26,7 @@
"read_only" : false,
"read_only_alternatives" : [
],
"relative_order" : 3,
"relative_order" : 4,
"source_on_save" : false,
"source_window" : "",
"type" : "r_dataframe"
......
......@@ -7,19 +7,19 @@
"folds" : "",
"hash" : "0",
"id" : "96AB3736",
"lastKnownWriteTime" : 1622538645,
"last_content_update" : 1622538645004,
"lastKnownWriteTime" : 1622624631,
"last_content_update" : 1622624631694,
"path" : "~/stuart_package/stuart/vignettes/stuaRt.Rmd",
"project_path" : "vignettes/stuaRt.Rmd",
"properties" : {
"cursorPosition" : "128,16",
"last_setup_crc32" : "31136BFE5bfca283",
"scrollLine" : "123"
"cursorPosition" : "44,0",
"last_setup_crc32" : "39B546A65bfca283",
"scrollLine" : "44"
},
"read_only" : false,
"read_only_alternatives" : [
],
"relative_order" : 2,
"relative_order" : 1,
"source_on_save" : false,
"source_window" : "",
"type" : "r_markdown"
......
{
"collab_server" : "",
"contents" : "",
"created" : 1622622953119.000,
"dirty" : false,
"encoding" : "UTF-8",
"folds" : "",
"hash" : "2767839831",
"id" : "9E3EC0FD",
"lastKnownWriteTime" : 1622539469,
"last_content_update" : 1622539469,
"path" : "~/stuart_package/stuart/NAMESPACE",
"project_path" : "NAMESPACE",
"properties" : {
},
"read_only" : true,
"read_only_alternatives" : [
],
"relative_order" : 8,
"source_on_save" : false,
"source_window" : "",
"type" : "r_namespace"
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment