Skip to content

Commit

Permalink
Merge pull request #89 from opain/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
opain authored Apr 18, 2024
2 parents 6b67944 + c001b29 commit 539b22e
Show file tree
Hide file tree
Showing 3 changed files with 1,006 additions and 964 deletions.
8 changes: 4 additions & 4 deletions Scripts/format_target/format_target.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,16 @@ write.table(ref_target$SNP.y, paste0(tmp_dir,'/extract_list_2.txt'), col.names =

# First extract variants based on original ID
if(opt$format == 'plink1'){
system(paste0(opt$plink2,' --bfile ',opt$target, ' --extract ', tmp_dir,'/extract_list_1.txt --make-pgen --memory 5000 --threads 1 --out ', tmp_dir,'/subset'))
system(paste0(opt$plink2," --bfile ",opt$target, " --extract ", tmp_dir,"/extract_list_1.txt --make-pgen 'pvar-cols=' --memory 5000 --threads 1 --out ", tmp_dir,"/subset"))
}
if(opt$format == 'plink2'){
system(paste0(opt$plink2,' --pfile ',opt$target, ' --extract ', tmp_dir,'/extract_list_1.txt --make-pgen --memory 5000 --threads 1 --out ', tmp_dir,'/subset'))
system(paste0(opt$plink2," --pfile ",opt$target, " --extract ", tmp_dir,"/extract_list_1.txt --make-pgen 'pvar-cols=' --memory 5000 --threads 1 --out ", tmp_dir,"/subset"))
}
if(opt$format == 'bgen'){
system(paste0(opt$plink2,' --bgen ',opt$target,'.bgen ref-last --sample ',gsub('.chr.*','',opt$target),'.sample --extract ', tmp_dir,'/extract_list_1.txt --make-pgen --memory 5000 --threads 1 --out ', tmp_dir,'/subset'))
system(paste0(opt$plink2," --bgen ",opt$target,".bgen ref-last --sample ",gsub(".chr.*","",opt$target),".sample --extract ", tmp_dir,"/extract_list_1.txt --make-pgen 'pvar-cols=' --memory 5000 --threads 1 --out ", tmp_dir,"/subset"))
}
if(opt$format == 'vcf'){
system(paste0(opt$plink2,' --vcf ',opt$target,'.vcf.gz --extract ', tmp_dir,'/extract_list_1.txt --make-pgen --memory 5000 --threads 1 --out ', tmp_dir,'/subset'))
system(paste0(opt$plink2," --vcf ",opt$target,".vcf.gz --extract ", tmp_dir,"/extract_list_1.txt --make-pgen 'pvar-cols=' --memory 5000 --threads 1 --out ", tmp_dir,"/subset"))
}

# Ensure both FID and IID are present in the .psam file
Expand Down
Loading

0 comments on commit 539b22e

Please sign in to comment.