Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chelie
    Junior Member
    • Sep 2015
    • 3

    #1

    how to mask low coverage positions

    Hello,

    I am looking for a way to mask positions below a certain coverage, i.e., convert all positions below x-fold coverage to N.

    The problem is not calculating the coverage for each position (I can do that with BEDtools genomecov or BBmap pileup.sh), but the actual conversion of the input file. I was looking into BEDtools maskfasta for example, but couldn't find a way to set a specific coverage-threshold.

    Thanks for any suggestion!
  • ashishbansal
    Member
    • Dec 2018
    • 17

    #2
    The reason why masking performs better than trimming and no quality control in reducing the false-positive rate is apparent because masking maximizes the information content of a raw read while removing the base calls with low qualities. However, masking did not improve for the false-negative calls due to a low coverage. Therefore, we recommend masking as a preprocessing method to remove low quality base calls in NGS since it reduces the false-positive rate without sacrificing the false-negative rate. Masking could be used effectively in reducing the false-positive rate also for the identification of somatic mutations in cancer screening by RNA-seq.
    Clinical Research

    Comment

    • ashishbansal
      Member
      • Dec 2018
      • 17

      #3
      Try this code to mask coverage positions

      layout(local_size_x = 1, local_size_y = 1) in;
      writeonly uniform uimage2D img_output;

      struct LineSegment
      {
      vec2 mP1;
      vec2 mP2;
      };

      layout(std140) uniform GlyphData
      {
      int mTextureOffsetX; // Target X location in atlas
      int mTextureOffsetY; // Target Y location in atlas
      int mWidth; // Width of glyph
      int mHeight; // Height of glyph
      vec2 mBorderUnits; // Amount of border to preserve
      int mScanlineStartIndices[100]; // Start into the sorted line segment array

      }glyphData;

      layout(std140) uniform OutlineData
      {
      vec2 mSize; // Size of glyph in units
      vec2 mMinimum; // Minimum of glyph in units
      int mNumSortedOutlines; // Amount of outlines
      vec2 mSortedOutlinesP1[1000]; // Top point of outlines
      vec2 mSortedOutlinesP2[1000]; // Bottom point of outlines

      }outlineData;

      void main()
      {
      uint result = 0;

      ivec2 pixelCoords = ivec2(gl_GlobalInvocationID.xy);
      int startIndex = glyphData.mScanlineStartIndices[pixelCoords.y];

      if (startIndex != -1)
      {
      float yUnits = float(pixelCoords.y) / float(glyphData.mHeight);
      float nextYUnits = float(pixelCoords.y + 1) / float(glyphData.mHeight);

      vec2 sizeWithBorder = outlineData.mSize + glyphData.mBorderUnits * 2.0f;
      vec2 minimum = outlineData.mMinimum - glyphData.mBorderUnits;

      for (int index = startIndex; index != outlineData.mNumSortedOutlines; ++index)
      {
      LineSegment line;
      line.mP1 = (outlineData.mSortedOutlinesP1[index] - minimum) / sizeWithBorder;
      line.mP2 = (outlineData.mSortedOutlinesP2[index] - minimum) / sizeWithBorder;

      if (line.mP1.y >= nextYUnits)
      break;

      float dy = line.mP2.y - line.mP1.y;
      if (dy == 0.0)
      continue;

      float dx = line.mP2.x - line.mP1.x;
      float dx_dy = dx / dy;

      for (int subY = 0; subY != 4; ++subY)
      {
      for (int subX = 0; subX != 4; ++subX)
      {
      float subPixelYOffset = float(3 - subX) * (1.0 / 16.0) + (1.0 / 32.0) + float(subY) * 0.25f;
      float subPixelXOffset = float(subY) * (1.0 / 16.0) + (1.0 / 32.0) + float(subX) * 0.25f;

      float sampleY = yUnits + subPixelYOffset / float(glyphData.mHeight);
      if (sampleY >= line.mP1.y && sampleY < line.mP2.y)
      {
      float lineXUnits = line.mP1.x + (sampleY - line.mP1.y) * dx_dy;
      float curX = float(pixelCoords.x + subPixelXOffset) / float(glyphData.mWidth);
      if (curX > lineXUnits)
      {
      uint mask = 1 << ((3 - subX) + subY * 4);
      result ^= mask;
      }
      }
      }
      }
      }
      }

      ivec2 textureOffset = ivec2(pixelCoords.x + glyphData.mTextureOffsetX, pixelCoords.y + glyphData.mTextureOffsetY);
      imageStore(img_output, textureOffset, uvec4(result, 0, 0, 0));
      }
      Clinical Research

      Comment

      • HESmith
        Senior Member
        • Oct 2009
        • 512

        #4
        You're on the right track with BEDtools. Use the 'genomecov' command with the '-bg' flag (BEDGRAPH format) to calculate coverage, filter using 'awk' (awk '$4 < THRESHOLD_VALUE') to retain the low-coverage intervals, then back to BEDtools 'maskfasta' to convert those intervals to Ns.
        Last edited by HESmith; 01-02-2019, 06:41 AM.

        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, Yesterday, 11:13 AM
        0 responses
        21 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, Yesterday, 10:48 AM
        0 responses
        18 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-15-2026, 10:52 AM
        0 responses
        36 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-14-2026, 05:39 AM
        0 responses
        42 views
        0 reactions
        Last Post SEQadmin2  
        Working...