Unconfigured Ad

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

    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

      • mylaser
        Reply to Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
        by mylaser
        Kheloyar – Everything You Need to Know About Kheloyaar Login and Kheoyar Id
        If you are looking for an online gaming platform that offers a user-friendly experience, Kheloyar has become a name that many users search for. Whether you're interested in creating a new account, accessing your dashboard through Kheloyaar Login, or learning how to obtain a Kheoyar Id, understanding the platform's features and account process is essential.
        This guide explains everything you need to know about...
        Today, 01:13 AM
      • SEQadmin2
        Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
        by SEQadmin2



        Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
        ...
        07-09-2026, 11:10 AM
      • SEQadmin2
        Cancer Drug Resistance: The Lingering Barrier to Rising Survival
        by SEQadmin2



        Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

        There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
        07-08-2026, 05:17 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by SEQadmin2, 07-09-2026, 10:04 AM
      0 responses
      16 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-08-2026, 10:08 AM
      0 responses
      10 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-07-2026, 11:05 AM
      0 responses
      22 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-02-2026, 11:08 AM
      0 responses
      31 views
      0 reactions
      Last Post SEQadmin2  
      Working...