ALL Metrics
-
Views
-
Downloads
Get PDF
Get XML
Cite
Export
Track
Software Tool Article

segment_liftover : a Python tool to convert segments between genome assemblies

[version 1; peer review: 1 approved, 1 approved with reservations]
PUBLISHED 14 Mar 2018
Author details Author details
OPEN PEER REVIEW
REVIEWER STATUS

This article is included in the Python collection.

Abstract

The process of assembling a species’ reference genome may be performed in a number of iterations, with subsequent genome assemblies differing in the coordinates of mapped elements. The conversion of genome coordinates between different assemblies is required for many integrative and comparative studies. While currently a number of bioinformatics tools are available to accomplish this task, most of them are tailored towards the conversion of single genome coordinates. When converting the boundary positions of segments spanning larger genome regions, segments may be mapped into smaller sub-segments if the original segment’s continuity is disrupted in the target assembly. Such a conversion may lead to a relevant degree of data loss in some circumstances such as copy number variation (CNV) analysis, where the quantitative representation of a genomic region takes precedence over base-specific accuracy. segment_liftover aims at continuity-preserving remapping of genome segments between assemblies and provides features such as approximate locus conversion, automated batch processing and comprehensive logging to facilitate processing of datasets containing large numbers of structural genome variation data.

Keywords

Genome assembly, liftover, remap, copy number segment.

Introduction

The first draft version of human genome was published in 20011. In subsequent years, several new editions were released to perfect the quality of the genome assembly. The current version of human genome (GRCh38, UCSC hg38) was made available in 2013, with the latest revision (Grch38.p12) still containing more than 10 million unplaced bases (see NCBI website). Over the years, large numbers of genomic studies have been performed, generating data mapped to different versions of the reference genome. However, when performing genome analyses integrating data from multiple resources, it is imperative to convert all data to the same genomic coordinate system.

Two general methodologies are used for conversion between coordinates from different genome assemblies. The first approach is to re-align the original sequence data to the target assembly. This method could provide the best result but is very time consuming, and is not possible when the original sequence data is not available or does not consist of direct sequences (i.e. segmentation of array based data). Another approach is to convert the coordinates of genome data between assemblies by using a mapping file. This method, although bearing a side effect of minor information loss, for most applications provides a good balance between performance and accuracy.

Currently, three tools are in widespread use for the conversion between genome assemblies by coordinates: liftOver from University of California, Santa Cruz (referred as UCSC liftOver in the following article)2; CrossMap from Zhao3; and Remap from NCBI4. The UCSC liftOver tool exists in two flavours, both as web service and command line utility. It offers the most comprehensive selection of assemblies for different organisms with the capability to convert between many of them. CrossMap has the unique functionality to convert files in BAM/SAM or BigWig format. It generates almost identical results as UCSC liftOver, but is not optimised for converting genome coordinates between species. Remap provides for each organism a comprehensive list of major assemblies and the corresponding sub-versions. It can also perform cross species mapping, however, with only a limited number of organisms.

All those tools are efficient in coordinate conversion and provide almost identical results. However, as shown in Figure 1a, challenges arise when dealing with genome segments that are not continuous anymore in the target assembly; there, these three tools take on different strategies. CrossMap and UCSC liftOver break the segment into smaller segments and map them to different locations. Remap keeps the integrity of the segment and maps the span to the target assembly.

93823f9c-b906-4bcc-b689-d22596811225_figure1.gif

Figure 1. The challenge of segment liftover.

(a) When lifting a segment to another assembly, the landscape of the segment may be affected by indels and copy number variations, but the overall span of the segment does not change significantly. (b) When the end positions cannot be converted by the UCSC liftOver, the nearby regions will be searched for convertible positions as approximation. (c) Quality control checks for changes of chromosome or size to make sure the segment is converted properly.

In research such analysis of copy number variation (CNV) data, where the quantitative representation of a genomic range takes precedence over base-specific representation, the integrity of a continuous segment indicates the proper conversion between assemblies, but may not be a direct outcome of current re-mapping approaches. Although Remap can convert contiguous segments, it only provides web service with submission limits, which is difficult to use for large scale or pipelined applications. The limitation to single input files is a general limitation of those tools, which precludes their direct use in comparative studies which may require to work with tensor hundreds of thousands of files, as indicated through our own projects and requests from the research community.

In this article,we introduce segment_liftover, a tool to perform an integrity-preserving conversion of genomic segments data between genome assemblies. It features two major functional additions over existing tools: First, re-conversion by locus approximation, in instances where a precise conversion of genomic positions fails; and second, the capability to handle any number of files and optional integration into data processing pipelines with supporting features such as automatic file traversal, interruption resumption and detailed logging.

Methods

Implementation

segment_liftover can convert both probe files and segment files at the same time or in separate runs. It starts from a structured directory or a list of files, then traverses and converts all files meeting the specified name pattern, and finally outputs to a designated directory. To convert a probe file, segment_liftover will first use the UCSC liftOver to convert the file, then apply an approximate conversion on probes that the UCSC liftOver failed to convert. To convert a segment file, segment_liftover will use the UCSC liftOver to convert the start and end positions of segments. A successful segment conversion needs to satisfy the following four criteria:

                                                                             positionnew_start ≠ ∅                                                         (1)

                                                                             positionnew_end ≠ ∅                                                         (2)

                                                                             chromosomenew_start = chromosomenew_end                         (3)

1β<length(old_segment)length(new_segment)<β(4)

Where β controls the threshold of the length ratio and the default value is set to 2. If criteria (1) or (2) fails, segment_liftover will apply an approximate conversion; if the conversion still fails, it is reported as unconvertible. If criteria (3) or (4) fails, the conversion is reported as rejected (Figure 1c). The reason of failure is recorded in log files.

When a position cannot be converted by the UCSC liftOver, segment_liftover will attempt an approximate conversion and try to find a convertible position in the adjacency (Figure 1b). The range and the resolution of the search is defined by parameters –range and –step_size, respectively.

Operation

The segment_liftover tool is implemented in Python. The package is available for both Linux and OSX. It requires a minimum of 2G memory and the capacity of running Python 3. We recommend an installation using pip in a Python virtual environment. segment_liftover requires and depends on the UCSC liftOver program. A chain file, which provides alignments from source to target assembly, is also required. The chain files between common human assemblies (hg18, hg19 and hg38) are included in the program package. Chain files of other species and assemblies are available from the USCS Genome Browser. Figure 2 illustrates the work-flow of segment_liftover.

93823f9c-b906-4bcc-b689-d22596811225_figure2.gif

Figure 2. The workflow of segment_liftover:

(1) It can take either a folder or a file containing the list of files as the input. (2) It will try to convert by approximation when UCSC liftOver fails to convert a coordinate. (3) The directory structure will be kept in the output folder and detailed log files are also available.

Use cases

Converting arrayMap data from hg19 to hg38

In this section, we provide two examples of using segment_liftover to convert probes and segments, respectively. The two examples are part of the pipeline which updates the arrayMap database, a reference resource of somatic genome copy number variations in cancer5, from human genome assembly hg19 to hg38. In the first example, we converted 44,632 probe files and 44,471 segment files from hg19 to hg38. The probe data were generated from nine Affymetrix genotyping array platforms, which currently only support annotations for hg19. Circular binary segmentation (CBS) analysis (DNAcopy R-package) was used to infer copy number segments from log2 values of probes. The final segment files contain a list of genomic regions separated by their copy number values6. We ran the segment_liftover tool on a 12-core, 128GB RAM machine with 8 parallel processes. It took 42 hours to convert 44,632 probe files with 5.5 billion probe positions and 40 minutes to convert 44,471 segment files with 4.8 million segments.

Overall, more than 99.99% of probes and more than 99% of segments could be directly converted from hg19 to hg38 (Figure 3). As conversion of segments is more complicated and involves a quality control procedure to ensure the meaningfulness of the segment, it is expected to have a higher number of unconvertible segments than probes. As shown in Figure 4, the unconvertible regions are mainly around telomeres, centromeres, or other gene-sparse locations. In total, 38 genetic elements were found to be affected by the conversion (description in Supplementary Table 1).

93823f9c-b906-4bcc-b689-d22596811225_figure3.gif

Figure 3. Compasion of conversion results in log 10.

Directly converted is the sum of successful conversion from UCSC liftOver; approximately converted is the sum of successful re-conversion in locus adjacency; converted but rejected is the sum of all rejections from quality control; unconvertible is the sum of everything that is not converted.

93823f9c-b906-4bcc-b689-d22596811225_figure4.gif

Figure 4. Genomic regions of unconvertible probe positions from human genome hg19.

Unconvertible positions are marked red on the karyogram, annotated with HGNC symbol or ENSEMBL gene ID (if HGNC not available), retrieved from biomaRt_2.30.0.

Comparison of different conversion strategies

In the second example, we compared the performance of different conversion strategies using 1,000 samples randomly drawn from the first example (Table 1). Copy number segments were generated using four different strategies (Figure 5): (1) segments in hg19 were generated from probes in hg19 using the aforementioned standard pipeline; (2) segments in hg38 were generated with probes converted from hg19 to hg38 using the standard pipeline; (3) segments converted from hg19 to hg38 with approximate conversion; (4) segments converted from hg19 to hg38 without approximate conversion.

Table 1. Number of samples from nine platforms in use case examples.

all1000
samples
CytoScanHD_Array296373
CytoScan750K_Array1732
Mapping50K_Hind240269958
Mapping50K_Xba240330372
Mapping10K_Xba14291219
Mapping250K_Nsp9738223
Mapping250K_Sty7561184
GenomeWideSNP_616570359
GenomeWideSNP_555210

Table 2 shows the comparison of segments conversion in average between (3), (4) and (2) (complete table in Supplementary Table 2). Exact segment matches are categorized as "perfect"; "minor difference" is defined the same as condition (3) of quality control; the rest of the segments are categorized as "significant difference"; "sum" is the total number of segments of a sample in average. By comparing the sum of reference hg19, reference hg38 and approximation, it shows that the conversion result is very close to the result of the standard pipeline. The difference between converted and generated sums is much smaller than the difference between two generated sums of different genome versions. On average, the approximate conversion could rescue one additional segment per file. Finally, we zoom into a specific example on chromosome 9 in GSM276858 (illustrated in Figure 5). Because of the removal of probes from hg19 to hg38, the second segment will be lost without approximate conversion.

93823f9c-b906-4bcc-b689-d22596811225_figure5.gif

Figure 5. Chromosome 9 from GSM276858 with probe and segment data from hg19 coordinate(left) and hg38(right).

Segments directly processed from hg38 probes are used as reference (top right). hg19 segments converted with approximation (middle right) and without approximation (bottom right) are used for comparison.

Table 2. Number of segments with or without approximation on average.

perfectminor
difference
significant
difference
sum
reference hg19nanana218.42
reference hg38nanana215.04
approximation198.186.2410.25214.67
no approximation198.185.2310.01213.42

The two examples above demonstrated the efficiency and effectiveness of segment_liftover in processing large number of probe and segment files. It can provide conversion results that are similar to results generated from the standard pipeline. Moreover, with approximate conversion, the number of properly converted segments is slightly increased. In general, segment_liftover is able to provide reliable conversions and the ease of use.

Summary

Translation between genome versions of sequencing data is a tedious but crucial task in bioinformatics. With the functionalities of automated batching, approximate conversion and segment conversion, segment_liftover can dramatically reduce the complexity and workload of such data processing. Furthermore, segment_liftover’s detailed logs of execution result provide an easy and clear foundation for follow up analysis.

Software availability

Comments on this article Comments (0)

Version 2
VERSION 2 PUBLISHED 14 Mar 2018
Comment
Author details Author details
Competing interests
Grant information
Copyright
Download
 
Export To
metrics
Views Downloads
F1000Research - -
PubMed Central
Data from PMC are received and updated monthly.
- -
Citations
CITE
how to cite this article
Gao B, Huang Q and Baudis M. segment_liftover : a Python tool to convert segments between genome assemblies [version 1; peer review: 1 approved, 1 approved with reservations]. F1000Research 2018, 7:319 (https://doi.org/10.12688/f1000research.14148.1)
NOTE: If applicable, it is important to ensure the information in square brackets after the title is included in all citations of this article.
track
receive updates on this article
Track an article to receive email alerts on any updates to this article.

Open Peer Review

Current Reviewer Status: ?
Key to Reviewer Statuses VIEW
ApprovedThe paper is scientifically sound in its current form and only minor, if any, improvements are suggested
Approved with reservations A number of small changes, sometimes more significant revisions are required to address specific details and improve the papers academic merit.
Not approvedFundamental flaws in the paper seriously undermine the findings and conclusions
Version 1
VERSION 1
PUBLISHED 14 Mar 2018
Views
34
Cite
Reviewer Report 17 Apr 2018
Ryan K. Dale, Laboratory of Cellular and Developmental Biology, National Institute of Diabetes and Digestive and Kidney Diseases, National Institutes of Health, Bethesda, MD, USA 
Approved with Reservations
VIEWS 34
The authors describe how using existing genome coordinate conversion tools can be problematic on large domains in which continuity of the converted region is preferred over precision of the coordinate conversion. They describe a method that iteratively retries the conversion ... Continue reading
CITE
CITE
HOW TO CITE THIS REPORT
Dale RK. Reviewer Report For: segment_liftover : a Python tool to convert segments between genome assemblies [version 1; peer review: 1 approved, 1 approved with reservations]. F1000Research 2018, 7:319 (https://doi.org/10.5256/f1000research.15390.r32847)
NOTE: it is important to ensure the information in square brackets after the title is included in all citations of this article.
  • Reader Comment 08 Jun 2018
    Bo Gao, University of Zurich, Switzerland
    08 Jun 2018
    Reader Comment
    "- Figure 3 is difficult to interpret..."
    We also discussed the best way to show this. Now it's replaced with a table.

      "- I see in the code that there are ... Continue reading
  • Author Response 15 Jun 2018
    Michael Baudis, Institute of molecular Life Sciences, University of Zürich, Zürich, CH-8057, Switzerland
    15 Jun 2018
    Author Response
    Thank you for this very constructive referee report! We hope that the implemented changes satisfy the your wishes for improvements.
    Competing Interests: No competing interests were disclosed.
COMMENTS ON THIS REPORT
  • Reader Comment 08 Jun 2018
    Bo Gao, University of Zurich, Switzerland
    08 Jun 2018
    Reader Comment
    "- Figure 3 is difficult to interpret..."
    We also discussed the best way to show this. Now it's replaced with a table.

      "- I see in the code that there are ... Continue reading
  • Author Response 15 Jun 2018
    Michael Baudis, Institute of molecular Life Sciences, University of Zürich, Zürich, CH-8057, Switzerland
    15 Jun 2018
    Author Response
    Thank you for this very constructive referee report! We hope that the implemented changes satisfy the your wishes for improvements.
    Competing Interests: No competing interests were disclosed.
Views
23
Cite
Reviewer Report 26 Mar 2018
Oscar Krijgsman, Division of Molecular Oncology and Immunology, Netherlands Cancer Institute, Amsterdam, The Netherlands 
Approved
VIEWS 23
This manuscript discusses a new tool developed by the authors that improves the ‘liftover’ between genomic builds. “Segment_liftover” is built on the already available liftover tool from UCSC with the novelty that it the tool implements a better conversion between ... Continue reading
CITE
CITE
HOW TO CITE THIS REPORT
Krijgsman O. Reviewer Report For: segment_liftover : a Python tool to convert segments between genome assemblies [version 1; peer review: 1 approved, 1 approved with reservations]. F1000Research 2018, 7:319 (https://doi.org/10.5256/f1000research.15390.r31947)
NOTE: it is important to ensure the information in square brackets after the title is included in all citations of this article.
  • Reader Comment 08 Jun 2018
    Bo Gao, University of Zurich, Switzerland
    08 Jun 2018
    Reader Comment
    " The second use case is basically a direct comparison..."
    Our intention is to compare the performance of segment_liftover with the standard copy number segment calling procedure, which generates segments from ... Continue reading
COMMENTS ON THIS REPORT
  • Reader Comment 08 Jun 2018
    Bo Gao, University of Zurich, Switzerland
    08 Jun 2018
    Reader Comment
    " The second use case is basically a direct comparison..."
    Our intention is to compare the performance of segment_liftover with the standard copy number segment calling procedure, which generates segments from ... Continue reading

Comments on this article Comments (0)

Version 2
VERSION 2 PUBLISHED 14 Mar 2018
Comment
Alongside their report, reviewers assign a status to the article:
Approved - the paper is scientifically sound in its current form and only minor, if any, improvements are suggested
Approved with reservations - A number of small changes, sometimes more significant revisions are required to address specific details and improve the papers academic merit.
Not approved - fundamental flaws in the paper seriously undermine the findings and conclusions
Sign In
If you've forgotten your password, please enter your email address below and we'll send you instructions on how to reset your password.

The email address should be the one you originally registered with F1000.

Email address not valid, please try again

You registered with F1000 via Google, so we cannot reset your password.

To sign in, please click here.

If you still need help with your Google account password, please click here.

You registered with F1000 via Facebook, so we cannot reset your password.

To sign in, please click here.

If you still need help with your Facebook account password, please click here.

Code not correct, please try again
Email us for further assistance.
Server error, please try again.