Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • refael.kohen
    Junior Member
    • Sep 2012
    • 4

    #1

    bedtools, vcf file with structural variants

    Hi,

    There is bug in bedtools when use with it on vcf files with structural variation:
    Here the report on the bug and how you can to fix it:


    I use with bedtools version v2.23.0-29-gab600e6-dirty.

    I try to use with "bedtools subtract" command on vcf file with structural variation (long deletions) - My vcf version is: ##fileformat=VCFv4.1

    Bedtools calculate the end position of the deletion according to the POS filed (start position) and the SVLEN key in INFO field in the vcf file records.

    In previous bedtools versions (I tried the version: v2.17.0), bedtools not support in structural variation, and not search the SVLEN key, and consider the length of the deletion as one base.

    Anyway, I find bug also in the bedtools version v2.23.0-29-gab600e6-dirty:
    when the SVLEN key was written in last position of INFO field (and the next character is tab), bedtools not succeed to find it, because bedtools seek the ";" character after the value of the SVLEN.

    Unfortunately, some software for finding structural variants (like Delly) not write the SVLEN key in their vcf output files. So I use with vcf package of python in order add the SVLEN key to INFO field (with the Record.add_info() function). But, the vcf package write the SVLEN key in the last position of the INFO field.

    For fixing this bug, you can add command to source code of bedtools:

    1) open the file: your_source_code_bedtools_path/bedtools2/src/utils/FileRecordTools/FileReaders/SingleLineDelimTextFileReader.cpp

    2) add the following row to function int SingleLineDelimTextFileReader::getVcfSVlen():
    if(endPtr == NULL) {endPtr = strchr(startPtr, '\t');}
    after the row:
    const char *endPtr = strchr(sta rtPtr, ';');

    3) Compile the source code:
    make install -C your_source_code_bedtools_path/bedtoolsSV/bedtools2/
    or if you no permission to write to /usr/local/bin:
    make -C your_source_code_bedtools_path/bedtoolsSV/bedtools2/ and use with the bedtools file in your_source_code_bedtools_path/bedtoolsSV/bedtools2/bin folder.

    Now, bedtools will succeed to identify the SVLEN key, also if it is written in last position of the INFO field.

    Refael.
    Last edited by refael.kohen; 04-06-2016, 04:53 AM.
  • refael.kohen
    Junior Member
    • Sep 2012
    • 4

    #2
    Another bug:

    Now I see that other sub-programs of bedtools like "bedtools cluster" not use with SVLEN key, but expected to get the length of the deletion from other field (column number 4 in vcf).

    But vcf version 4.2, use with 'SVLEN' or 'END' keys in INFO field for end point of the deletion.

    You can fix the bedtools cluster (and other sub-programs of bedtools that not uses with SVLEN key), so bedtools will take the 'END' key in 'INFO' field:

    1) open the file: your_source_code_bedtools_path/bedtools2/src/utils/bedFile/bedFile.h

    2) add the following rows to function parseVcfLine:
    unsigned int end_index_s = fields[7].find(";END")+5;
    unsigned int end_index_e = fields[7].find(";", end_index_s);
    bed.end = atoi(fields[7].substr(end_index_s, end_index_e-end_index_s).c_str())-1;

    after the row:
    bed.end = bed.start + fields[3].size();

    3) Compile the source code:
    make install -C your_source_code_bedtools_path/bedtoolsSV/bedtools2/
    or if you no permission to write to /usr/local/bin:
    make -C your_source_code_bedtools_path/bedtoolsSV/bedtools2/ and use with the bedtools file in your_source_code_bedtools_path/bedtoolsSV/bedtools2/bin folder.

    Refael.

    Comment

    • GenoMax
      Senior Member
      • Feb 2008
      • 7142

      #3
      Please report these via BEDTools discussion list: https://groups.google.com/forum/#!fo...dtools-discuss Dr. Quinlan probably monitors that regularly.

      Comment

      Latest Articles

      Collapse

      • SEQadmin2
        Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
        by SEQadmin2



        Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

        Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
        ...
        10-14-2026, 09:55 AM
      • SEQadmin2
        New Genomics Technologies Take Aim at Long-Standing Limits
        by SEQadmin2


        Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

        We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
        ...
        09-28-2026, 10:25 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by SEQadmin2, 10-22-2026, 11:13 AM
      0 responses
      29 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-22-2026, 10:48 AM
      0 responses
      22 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-15-2026, 10:52 AM
      0 responses
      39 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-14-2026, 05:39 AM
      0 responses
      45 views
      0 reactions
      Last Post SEQadmin2  
      Working...