Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting my VCF data to use Outflank #16

Open
taniachavarria79 opened this issue Sep 18, 2018 · 1 comment
Open

Converting my VCF data to use Outflank #16

taniachavarria79 opened this issue Sep 18, 2018 · 1 comment

Comments

@taniachavarria79
Copy link

taniachavarria79 commented Sep 18, 2018

Hello,
I'm trying to convert my VCF data to an outflank format. I'm following your tutorial Kattie but it give me this message : "Warning message:
In convertVCFtoCount3(all.vcf.gen) : NAs introduced by coercion"
I do not know what I'm doing wrong. I do really appreciate your help!

I adjunct my VCF data here. I have to adjunct in a txt file because does not accept vcf files. In addition,
batch_1newdata.txt

this is the tutorial that I'm using:

vcf <- read.vcfR("../sim1a/vcf_sim1a_contest.vcf.gz", verbose=FALSE)
##############################

##############################

Convert VCF format to SNP data format required by OutFLANK (Note that this is slow)

##############################
convertVCFtoCount3 <- function(string){
# This function assumes 0 for reference
# and 1 for alternate allele
a <- as.numeric(unlist(strsplit(string, split = c("[|///]"))))
odd = seq(1, length(a), by=2)
a[odd] + a[odd+1]
}

all.vcf.gen <- vcf@gt[,-1]
system.time(gen_table <- matrix(convertVCFtoCount3(all.vcf.gen), ncol=ncol(all.vcf.gen)))

@DrK-Lo
Copy link
Collaborator

DrK-Lo commented Sep 24, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants