Comments (4)
Hi Brenna, the latest commit 6f57bbc
fixes the issue (it was working properly with multi allelic datasets, but the all the colours of genind were not accounted for when using biallelic datasets..)
Thanks for reporting !
Thierry
from radiator.
Hi Brenna,
I was not able to run your code, I get this error:
Error in is.factor(x) : object 'sets.length' not found
Where is sets.length
from ?
If you show me the fix, I'll try to read genind object differently (re-open the issue by replying):
Otherwise, you can do this:
Import data and load radiator
library(radiator)
data <- suppressWarnings(readr::read_csv(
file = "foo2.csv",
col_names = TRUE, col_types = readr::cols(.default = readr::col_character()))) %>%
dplyr::mutate(POP_ID = rep("POP1", n())) %>%
dplyr::select(POP_ID, INDIVIDUALS = X1, dplyr::everything(.)) %>%
dplyr::mutate_all(.tbl = ., .funs = tidyr::replace_na, replace = "000000")
Generate the tidy data
tidy.data <- radiator::tidy_genomic_data(data)
test genind
genind.data <- radiator::write_genind(tidy.data)
genind.data
Or, do all this at the same time as testing the imputations
2 ways: through radiator::genomic converter or grur::grur_imputations
imp.rf <- radiator::genomic_converter(
data = data,
output = "genind",
imputation.method = "rf",
hierarchical.levels = "global",
verbose = TRUE)
names(imp.rf)
[1] "genind.no.imputation" "genind.imputed"
[3] "tidy.data" "tidy.data.imp"
So here you have both imputed and non imputed: tidy data and genind objects.
Recover them separately:
tidy.data <- imp.rf$tidy.data
tidy.data.imp <- imp.rf$tidy.data.imp
genind.no.imputation <- imp.rf$genind.no.imputation
genind.imputed <- imp.rf$genind.imputed
You have simulated data with NA's ? Simulated on what?
Early next week I have a grur update to evaluate imputation accuracy and other tools...
Cheers
Thierry
from radiator.
I'm actually reopening it ;)
- To make the code fully reproducible, show how you import
foo2
in R ?
I used :
foo2 <- suppressWarnings(readr::read_csv(
file = "foo2.csv",
col_names = TRUE, col_types = readr::cols(.default = readr::col_character())))
foo.genind@pop <- as.factor(rep("PO1", 100))
in your code fix the problem on my end.
But... when I run some checks, I get weird results:
foo.genind@tab # gives weird weird results
- You should have the marker/locus name then a
.
with the alleles you report using:110
and100
- not the case on my end Which is not the case, the first columns of the matrix are
X1.1
,X1.2
,...
- the columns at the end are fine
[email protected]
andadegenet::nLoc(foo.genind)
Shows that the individual column is considered as locus, which explains why the weird results above.
do your get the same results?
Best
Thierry
from radiator.
I'm sorry about that Thierry - I didn't check the data file after I wrote it out.
Read it in this way and it should recreate the problem:
foo2 <- read.csv("foo2.csv", check.names=F)
foo2 <- foo2 [,-1]
foo2 [, ] <- lapply(foo2 [, ], as.character)
foo.genind <- df2genind(foo2, ncode = 3, NA.char = NA, ploidy = 2)
foo.genind@pop <- as.factor(rep("PO1", length(sets.length[x])))
Let me know if it is still not working!
from radiator.
Related Issues (20)
- SeqArray newest version: unused argument (.progress = TRUE) HOT 6
- error in genomic_converter() HOT 2
- Stacks vcf to rubias HOT 4
- genomic_converter Error HOT 4
- filter_rad error: Column `READ_DEPTH` is a `SeqVarDataList` object. HOT 1
- filter_rad issue error/dplyr:::mutate_error ! & DynamicClusterCall()
- error in reading VCF file HOT 1
- The GDS node "$ref" does not exist. HOT 5
- Genomic converter error 'no more individuals in your data' HOT 9
- Error in file(con, "r") : cannot open the connection HOT 1
- Error when using genomic_converter genlight --> pcadapt HOT 3
- Potential help error with DArT HOT 3
- The GDS node "$ref" does not exist. HOT 4
- genomic_converter errors HOT 5
- Error in `dplyr::mutate()` - No Variants Selected HOT 5
- genomic converter() Error:>! `everything()` must be used within a *selecting* function. HOT 1
- Error Converting VCF to Genepop HOT 12
- read_vcf file access error with parallel.core = 1L argument HOT 3
- ERROR with detect_duplicate_genome + tidy format obtained from genomic_converter HOT 3
- Error with genomic_converter HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from radiator.