Skip to content
AmpliCoNE: Ampliconic Copy Number Estimator
Python Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

AmpliCoNE: Ampliconic Copy Number Estimator

A tool to estimate the copy number of ampliconic gene families in human Y chromosome using Illumina whole genome sequencing data.



To run AmpliCoNE, you need the following list of tools and packages:

Python 2.7.x
Numpy	1.14.2
Pandas 0.23.4	
Biopython 1.71
Bowtie2 version 2.2.9 

Steps to install the dependencies using conda

Create an environment.yml file as described below.

vim amplicone-environment.yml

name: amplicone
  - bioconda
  - python=2.7
  - pandas=0.23.4
  - numpy=1.14.2
  - pysam=
  - biopython=1.71
  - bowtie2=2.*

Use the amplicone-environment.yml file to create an environment named "amplicone"

conda env create -f amplicone-environment.yml

Load the environment each time you run AmpliCoNE.

source activate amplicone

Install AmpliCoNE

Once you installed the things above, do the following:

Clone the repository by running:

git clone

AmpliCoNE usage for human chromosome Y ampliconic genes using hg38

Download the Y chromosome annotation file and the gene definition file here.

#download annotation and gene definition files for hg38

#uncompress the files
tar -zxvf hg38_amplicone_files.tar.gz

#list files downloaded (
ls hg38_amplicone_files/

Generate input BAM files

Generate BAM files by aligning your Illumina whole genome sequencing dataset to hg38 using BWA-mem. (hg38 version reference can be downloaded from UCSC genome browser or ENSEMBL). The BAM files must be sorted by position and indexed.

Download test dataset here.

#download test BAM file

#uncompress the files
tar -zxvf test_data.tar.gz

#list files downloaded (test.bam  test.bam.bai)
ls test_data/

AmpliCoNE-count usage takes the gene definition file, annotation file and BAM file as input to estimate the copy number of the nine ampliconic gene families. In addition, the name of the Y chromosome (chrY|Y) as defined in reference and its sequence length are required parameters.

python --GENE_DEF hg38_amplicone_files/ --ANNOTATION hg38_amplicone_files/ --BAM test_data/test.bam --CHR Y --LENGTH 57227415

Other parameters in

The length of the chromosome must be set while using AmpliCoNE for a reference other than hg38.

--LENGTH <int> (default:57227415; length of Y chromosome in hg38) 


Parameter to define if the BAM file contains single end reads.


Output description

AmpliCoNE-count will generate two output files:

  • <OUTPUT>Ampliconic_Summary.txt

    A tab separated file with the ampliconic gene family copy number. First column will have the family name. Second column will have the gene copy number estimated using all the sites on Y with mappability 1. Third column will have the gene copy number estimated using the X-degenerate genes (CONTROL) defined in gene definition file.

    For example:

    GeneFamily CopyNumber(MAP=1) CopyNumber(XDG)
    BPY2 3 3
    CDY 4 4
    DAZ 4 4
    HSFY 2 2
    PRY 2 2
    RBMY 7 7
    TSPY 22 22
    VCY 4 4
    XKRY 2 2
  • <OUTPUT>XDG_CopyNumber.txt

    A tab separated file with two columns. First column will have the X-degenerate gene (XDG) ids. Second column will have the gene copy number estimates.

    For example:

    Gene CopyNumber(MAP=1)
    GeneID1 1
    GeneID2 1
    GeneID3 1
    GeneID4 1

    XDG_CopyNumber.txt file can provide information about the quality of sample. We can check if the estimates of the CONTROL genes copy number is close to one.

AmpliCoNE usage with other reference genomes / species

Before running in a different species, you must first perform steps 1-3 below. This needs to be run only once, and then the resulting files can be reused when analyzing dataset from same species. After these steps, AmpliCoNE-count can be run for each sample to estimate copy number, as described above.

Step 1: Download pre-requisite files

The pre-requisite files for most genomes can be downloaded from UCSC genome browser. Make sure that the chromosome annotation (chrY, Y) is the same in all the files. If the files are not available for download, please generate them using GEM-library, RepeatMasker, and TandemRepeatFinder tools.

  • Reference genome (Example : hg38, FASTA format)

    Note: The Y chromosome should be present as one continuous scaffold in the reference file.

  • Reference specific mappability file (Generated using GEM library; BED format)

#Steps to generate mappability
gem-indexer -i <REF.fa> -o <REF.fa> --complement emulate --verbose
gem-mappability -I <REF.fa.gem> -l 101 -o <OUT_MAPPABILITY> -m 2 -e 2
gem-2-wig -I <REF.fa.gem> -i <OUT_MAPPABILITY.mappability> -o <WIG_OUT_MAPPABILITY>
  • Reference specific RepeatMasker output (BED format)

  • Reference specific Tandem Repeat Finder output (BED format)

Step2: Generate gene definition file

  • Format : TSV
  • Columns : Start Position, End Position and Gene Family Name
  • Rows : Gene copy

NOTE: For gene copies in control, the gene family name (3rd column) should be "CONTROL".(case sensitive)

How to generate the file:

  • Identify a representative gene for each gene family and extract its sequence from NCBI.
  • BLAT the representative gene sequence against reference genome to identify all locations with greater than 99% identity.
  • Represent each location identified with its start and end location followed by the gene family name.

NOTE: All the locations >99% identity representing a gene family should be present on Y chromosome only. Each gene copy within a family should be represented as a row in the gene definition file.

For human ampliconic genes the gene definition file is available here. Below is an example file:

100 300 GF1
750 1050 GF1
3000 3300 GF1
9900 10900 GF2
2220 2320 GF2
3500 3750 CONTROL
4190 4420 CONTROL
4770 5040 CONTROL

Step 3: Generate Ychr_annotation file using AmpliCoNE-build

sh -c chrY -i <REF.fasta> -m <REF_MAPPABILITY.bed> -r <REF_REPMASK.bed> -t <REF_TRF.bed> -g <> -o

Use the output file (annotation file) from and gene definition file to run and estimate the gene family copy numbers.

python --GENE_DEF <> --ANNOTATION <> --BAM <BAM> --CHR <chr> --LENGTH <int>
You can’t perform that action at this time.