Sign inSign up

baudisgroup/snp2pop

By baudisgroup

Updated almost 6 years ago

Population origin mapping

Image
0

695

baudisgroup/snp2pop repository overview

*** New Version 2.2*** Users can supply customised labeled reference data, so the classification is no longer limited to the groups defined in the 1000 Genomes project.

*** New Version 2.1 and 2.11*** Performance has been significantly improved (20-100x faster) by re-writing part of the tool set in C++. There is no change in the functionality; therefore, it is strongly recommended to use the versions v2.1x.

*** New Version 2.01 (batch processing)*** SNP2pop functionality stays the same, but v2.01 supports batch processing from command line, i.e. no typing in docker environment. Details see below.

This tool supports mapping from B-allele frequency data generated with 9 Affymetrix SNP array platforms as well as whole-genome sequencing data as input and a population assignment to one of the five continental groups (with 97.1% accuracy, benchmarked with paired TCGA data) or one of the 26 population groups (with 92.7% accuracy, benchmarked with paired TCGA data).

The currently supported genome version is GRCh37 (hg19). A mapping to other genome versions is planned.

Usage

First, you need to create a working directory $hostdir (use absolute path) to copy your input files and to receive the output from the pipeline. (file will be modified, so please only copy your original file into this folder.)

docker run -it --rm --mount type=bind,source=$hostdir,target=/data baudisgroup/snp2pop

After entering the interactive mode of the container, you can place your input files in $hostdir/input directory. Then:

Rscript --vanilla run_pop.r <parameters>

Then you will obtain your mapping results in the /results folder under $hostdir.

Demo Example with test data

You need to download the /test_SNP folder from here and copy the absolute path as $test_dir. These 2 files are processed BAF files from GEO repository with genotyping platform "Mapping250K_Sty".

*** v2.0*** Interactive mode is prompted, so the process is run in two steps. First step, set up the docker environment, and 2nd step, type in R command. Step1:

docker run -it --rm --mount type=bind,source=$test_dir,target=/data baudisgroup/snp2pop

Step2: If you use the /test_SNP, run the following command:

Rscript --vanilla run_pop.r -i BAF -o CONT -p Mapping250K_Sty

If you use sequencing data, run the following command:

Rscript --vanilla run_pop.r -i GZVCF -p Sequencing -o ALL

For testing sequencing data, you can download the 1000Genomes phase3 version 5 data from 1000Genomes project FTP site (ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/release/20130502).

*** v2.01 [For more advanced users and batch processing] ***

Docker container is run in background, and does not shut off unless explicitly killed.

In a for loop, run the following command:

docker run -d --name test --mount type=bind,source=$test_dir,target=/data baudisgroup/snp2pop:v2.01
docker exec -d test Rscript --vanilla run_pop.r -i BAF -o ALL -p Mapping250K_Sty

After checking the existence of result file, run

docker rm --force test

and go to the next loop.

Options

OptionsTypeDescription
-i --inputTEXTinput as B allele frequency file format (BAF), or genotype calling format (GC), Birdseed genotype format (BS) for SNP array data, or Variant Call Format (VCF) / gzipped VCF (GZVCF) for sequencing data.
-p --platformTEXTSNP array platform (see below), or Sequencing.
-o --outputTEXToutput as 9 theoretical fractions (FRAC), or output as ratio of 5 continental groups with a voting result (CONT) or ratio of 26 population groups with a voting result (POP), or both 26 populations and 5 continental groups summarized from the 26 population voting output (ALL). For customized references, the output will be by provided labels.
-r --reference *TEXTDefault reference of the software is 2492 samples from 1000 Genomes project. But optionally user can provide customized references composed of 2 files: vcf file, sample label file. Here the parameter format is two file names separated by comma.

* new in v2.2

Input file -i --input

The input file can be SNP array output or sequencing data.

In case of sequencing data, vcf or vcf.gz file formats are supported as input for sequencing data. Only one vcf file should be placed in the directory.

In case of SNP array output, file should be tab separated. There should be 4 columns: ID (SNP ID or simply indicating row number), chromosome (1-23), nucleotide base position, and a value column (a number within 0-1 if BAF format, or AA/AB/BB if GC format).

  • Example for BAF input format:
IDCHROBASEPOSVALUE
SNP_A-2131660112207510.3487
SNP_A-1967418123028120.9451
SNP_A-1969580123981251.0000
SNP_A-4263484126221850.4612
............
  • Example for GC input format:
IDCHROBASEPOSVALUE
SNP_111220751AB
SNP_212302812BB
SNP_312398125BB
SNP_412622185AB
............
  • Example for BS input format:
IDCHROBASEPOSVALUE
SNP_1112207511
SNP_2123028122
SNP_3123981252
SNP_4126221851
............
Files required for customized reference -r --reference *

Two files are needed:

  • variant file in .vcf or .vcf.gz format ( your own reference samples)
  • label file (tab separated, first column ID, second column label):
IDlabel
HG00096GBR
HG00101GBR
......

* new in v2.2

Platform specification -p --platform

For sequencing data, "Sequencing" should be used.

For SNP array, one of the following 9 array platforms should be named:

  • Mapping10K_Xba142
  • Mapping50K_Hind240
  • Mapping50K_Xba240
  • Mapping250K_Nsp
  • Mapping250K_Sty
  • GenomeWideSNP_5
  • GenomeWideSNP_6
  • CytoScan750K_Array
  • CytoScanHD_Array
Output file -o --output
OptionsDescription
FRACthe 9 fractional values representing estimated theoretical ancestors from admixture model.
CONTvoting percentage of 5 continental groups, the final result with highest vote and a confidence score* .
POPvoting percentage of 26 population groups, the final result with highest vote and a confidence score* .
ALLvoting percentage of 26 population groups, the final result with highest vote and a confidence score* . In addition, the voting summary of the population groups belonging to each continental group, then a final result of predicted continental group with a confidence score * .

* confidence score: the different between highest and second highest voting percentage.

Tag summary

Content type

Image

Digest

Size

358.7 MB

Last updated

almost 6 years ago

docker pull baudisgroup/snp2pop